| 1 |
#! /bin/sh |
| 2 |
|
| 3 |
# SPDX-License-Identifier: BSD-3-Clause |
| 4 |
# Copyright (c) Contributors to the OpenEXR Project. |
| 5 |
|
| 6 |
# If we're on OS X, use glibtoolize instead of toolize |
| 7 |
HOSTTYPE=`uname` |
| 8 |
if [ "$HOSTTYPE" == "Darwin" ]; then |
| 9 |
LIBTOOLIZE=glibtoolize |
| 10 |
else |
| 11 |
LIBTOOLIZE=libtoolize |
| 12 |
fi |
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
# Check Autoconf version |
| 17 |
if [ -x `which autoconf` ]; then |
| 18 |
AC_VER=`autoconf --version | head -n 1 | sed 's/^[^0-9]*//'` |
| 19 |
AC_VER_MAJOR=`echo $AC_VER | cut -f1 -d'.'` |
| 20 |
AC_VER_MINOR=`echo $AC_VER | cut -f2 -d'.' | sed 's/[^0-9]*$//'` |
| 21 |
|
| 22 |
if [ "$AC_VER_MAJOR" -lt "2" ]; then |
| 23 |
echo "Autoconf 2.13 or greater needed to build configure." |
| 24 |
exit 1 |
| 25 |
fi |
| 26 |
|
| 27 |
if [ "$AC_VER_MINOR" -lt "13" ]; then |
| 28 |
echo "Autoconf 2.13 or greater needed to build configure." |
| 29 |
exit 1 |
| 30 |
fi |
| 31 |
|
| 32 |
if [ "$AC_VER_MINOR" -lt "50" ]; then |
| 33 |
if [ ! -e configure.in ]; then |
| 34 |
ln -s configure.ac configure.in |
| 35 |
fi |
| 36 |
echo "If you see some warnings about cross-compiling, don't worry; this is normal." |
| 37 |
else |
| 38 |
rm -f configure.in |
| 39 |
fi |
| 40 |
else |
| 41 |
echo autoconf not found. DtexToExr requires autoconf to bootstrap itself. |
| 42 |
exit 1 |
| 43 |
fi |
| 44 |
|
| 45 |
run_cmd() { |
| 46 |
echo running $* ... |
| 47 |
if ! $*; then |
| 48 |
echo failed! |
| 49 |
exit 1 |
| 50 |
fi |
| 51 |
} |
| 52 |
|
| 53 |
# Check if /usr/local/share/aclocal exists |
| 54 |
if [ -d /usr/local/share/aclocal ]; then |
| 55 |
ACLOCAL_INCLUDE="$ACLOCAL_INCLUDE -I /usr/local/share/aclocal" |
| 56 |
fi |
| 57 |
|
| 58 |
run_cmd aclocal -I m4 $ACLOCAL_INCLUDE |
| 59 |
run_cmd $LIBTOOLIZE --automake --copy |
| 60 |
run_cmd automake --add-missing --copy --foreign |
| 61 |
run_cmd autoconf |
| 62 |
echo |
| 63 |
echo "Now type './configure' to configure DtexToExr." |
| 64 |
echo |