| 1 |
#!/bin/sh |
| 2 |
|
| 3 |
# Check for proper versions of autotools |
| 4 |
# We require: |
| 5 |
# - autoconf 2.50+ |
| 6 |
# - automake 1.7+, 1.9+ for make dist |
| 7 |
# - libtool 1.4+ |
| 8 |
|
| 9 |
# Touch revision.m4 |
| 10 |
if [ -f ./update_revision.sh ]; then |
| 11 |
./update_revision.sh; |
| 12 |
elif [ ! -f ./revision.m4 ]; then |
| 13 |
echo "m4_define([SVN_REV], 0)" > ./revision.m4; |
| 14 |
echo "m4_define([SVN_REVISION], trunk-r0)" >> ./revision.m4; |
| 15 |
echo "m4_define([SVN_DATE], )" >> ./revision.m4; |
| 16 |
fi |
| 17 |
|
| 18 |
# create m4 directory or we break older systems like RedHat/CentOS 5 |
| 19 |
mkdir -p m4 |
| 20 |
|
| 21 |
# Deal with some gentoo-specific issues |
| 22 |
WANT_AUTOMAKE='1.11 1.9 1.8 1.7' #latest of these is chosen or default if none hits |
| 23 |
export WANT_AUTOMAKE |
| 24 |
WANT_AUTOCONF='2.5' |
| 25 |
export WANT_AUTOCONF |
| 26 |
|
| 27 |
# Default program names |
| 28 |
test -z "$AUTOCONF" && AUTOCONF=autoconf |
| 29 |
test -z "$AUTOHEADER" && AUTOHEADER=autoheader |
| 30 |
|
| 31 |
test -z "$AUTOMAKE" && AUTOMAKE=automake |
| 32 |
test -z "$ACLOCAL" && ACLOCAL=aclocal |
| 33 |
|
| 34 |
test -z "$LIBTOOL" && for LIBTOOL in glibtool libtool; do |
| 35 |
($LIBTOOL --version) < /dev/null > /dev/null 2>&1 && break |
| 36 |
done |
| 37 |
test -z "$LIBTOOLIZE" && for LIBTOOLIZE in glibtoolize libtoolize; do |
| 38 |
($LIBTOOLIZE --version) < /dev/null > /dev/null 2>&1 && break |
| 39 |
done |
| 40 |
|
| 41 |
## Using prereq in autoconf rather than here, mostly for the debian systems at |
| 42 |
## this point |
| 43 |
if test -n "`$AUTOCONF --version 2>&1|head -n 1|egrep '1\.[0-9]+|2\.[0-4]+'`"; then |
| 44 |
echo "Autoconf 2.50 or above is required. Aborting build..."; |
| 45 |
exit 1; |
| 46 |
fi |
| 47 |
|
| 48 |
if test -n "`$AUTOMAKE --version 2>&1|head -n 1|egrep '\<1\.[0-6](\.[0-9]+)?\>'`"; then |
| 49 |
echo "Automake 1.7 or above is required. Aborting build..."; |
| 50 |
exit 1; |
| 51 |
fi |
| 52 |
|
| 53 |
if test -n "`$AUTOMAKE --version 2>&1|head -n 1|egrep '\<1\.7(\.[0-9]+)?|\<1\.8(\.[0-9]+)?'`"; then |
| 54 |
echo "make dist only supported with automake 1.9 or above" >&2; |
| 55 |
fi |
| 56 |
|
| 57 |
if test -n "`$LIBTOOL --version 2>&1|head -n 1|cut -f 4 -d ' '|egrep '1\.[0-3](\.[0-9]+)?$'`"; then |
| 58 |
echo "Libtool 1.4 or above is required. Aborting build..."; |
| 59 |
exit 1; |
| 60 |
fi |
| 61 |
|
| 62 |
# clean up files which cause confusion when switch versions of auto* |
| 63 |
rm -rf autom4te.cache |
| 64 |
|
| 65 |
# Make the build more robust if a Makefile.am is removed from the file system, but it is not removed |
| 66 |
# from the configure.ac file. |
| 67 |
find . | grep -v wxSmithSTC/stc| grep Makefile.in$ | xargs rm -vf |
| 68 |
|
| 69 |
rm -vf debian/control |
| 70 |
echo "Note: If you want to build debian packages you have to first run the debian/setup_control.sh script. See the script for details how to use it." |
| 71 |
|
| 72 |
# Fire up autotools |
| 73 |
$LIBTOOLIZE --force --copy && \ |
| 74 |
$ACLOCAL $ACLOCAL_FLAGS && \ |
| 75 |
$AUTOHEADER && \ |
| 76 |
$AUTOMAKE --include-deps --add-missing --foreign --copy && \ |
| 77 |
$AUTOCONF |