Emeric Vigier | 2f62582 | 2012-08-06 11:09:52 -0400 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | # Copyright (C) 2006-2010 David Sugar, Tycho Softworks. |
| 3 | # |
| 4 | # This file is free software; as a special exception the author gives |
| 5 | # unlimited permission to copy and/or distribute it, with or without |
| 6 | # modifications, as long as this notice is preserved. |
| 7 | # |
| 8 | # This program is distributed in the hope that it will be useful, but |
| 9 | # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the |
| 10 | # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
| 11 | |
| 12 | WANT_AUTOCONF_2_5=1 |
| 13 | export WANT_AUTOCONF_2_5 |
| 14 | |
| 15 | rm -rf autoconf auto*.cache libtool |
| 16 | if test ! -d autoconf ; then mkdir autoconf ; fi |
| 17 | |
| 18 | libtoolize="libtoolize" |
| 19 | for lt in glibtoolize libtoolize15 libtoolize14 libtoolize13 ; do |
| 20 | if test -x /usr/bin/$lt ; then |
| 21 | libtoolize=$lt ; break |
| 22 | fi |
| 23 | if test -x /usr/local/bin/$lt ; then |
| 24 | libtoolize=$lt ; break |
| 25 | fi |
| 26 | done |
| 27 | $libtoolize --copy --force |
| 28 | |
| 29 | AUTOMAKE_FLAGS="" |
| 30 | case $libtoolize in |
| 31 | *glibtoolize) |
| 32 | AUTOMAKE_FLAGS="-i" |
| 33 | ;; |
| 34 | esac |
| 35 | |
| 36 | ACLOCALDIRS="" |
| 37 | if test -d m4 ; then |
| 38 | ACLOCALDIRS="-I m4" ; fi |
| 39 | |
| 40 | if test ! -z "$ACLOCAL" ; then |
| 41 | ACLOCALDIRS="$ACLOCALDIRS -I"${ACLOCAL} |
| 42 | elif test ! -z "$ACLOCAL_FLAGS" ; then |
| 43 | ACLOCALDIRS="$ACLOCALDIRS $ACLOCAL_FLAGS" ; fi |
| 44 | |
| 45 | reconf="" |
| 46 | if test -f ~/.configure ; then |
| 47 | reconf=`grep ^reconfig: ~/.configure | sed -e s/^reconfig://` |
| 48 | elif test -f /etc/configure.conf ; then |
| 49 | reconf=`grep ^reconfig: /etc/configure.conf | sed -e s/^reconfig://` ; fi |
| 50 | if test ! -z "$reconf" ; then ACLOCALDIRS="$ACLOCALDIRS $reconf" ; fi |
| 51 | |
| 52 | if [ -d ~/share/aclocal ] ; then |
| 53 | ACLOCALDIRS="$ACLOCALDIRS -I ~/share/aclocal" |
| 54 | elif [ -d /usr/local/share/aclocal ] ; then |
| 55 | ACLOCALDIRS="$ACLOCALDIRS -I /usr/local/share/aclocal" |
| 56 | fi |
| 57 | |
| 58 | if test ! -z "$1" -o ! -z "${AUTOCONF_SUFFIX}" ; then |
| 59 | ver="$1" |
| 60 | else |
| 61 | for v in 2.53 2.57 ; do |
| 62 | if test -f /usr/bin/autoconf-$v ; then |
| 63 | ver=$v |
| 64 | fi |
| 65 | done |
| 66 | fi |
| 67 | |
| 68 | if test "$ver" = "2.53" -a -z "$AUTOMAKE_SUFFIX" ; then |
| 69 | if test -f /usr/bin/automake-1.5 ; then |
| 70 | AUTOMAKE_SUFFIX="-1.5" |
| 71 | fi |
| 72 | fi |
| 73 | |
| 74 | aclocal${AUTOMAKE_SUFFIX} $ACLOCALDIRS |
| 75 | |
| 76 | if test -f /usr/bin/autoheader-$ver ; then |
| 77 | /usr/bin/autoheader-$ver |
| 78 | else |
| 79 | autoheader${AUTOCONF_SUFFIX} |
| 80 | fi |
| 81 | |
| 82 | automake${AUTOMAKE_SUFFIX} --add-missing --copy ${AUTOMAKE_FLAGS} |
| 83 | |
| 84 | if test -f /usr/bin/autoconf-$ver ; then |
| 85 | /usr/bin/autoconf-$ver |
| 86 | else |
| 87 | autoconf${AUTOCONF_SUFFIX} |
| 88 | fi |
| 89 | rm -f config.cache |
| 90 | |
| 91 | # fix for some broken... |
| 92 | |
| 93 | if test -f /usr/bin/automake-1.4 ; then |
| 94 | if test -f ltmain.sh ; then |
| 95 | cp ltmain.sh autoconf/ltmain.sh |
| 96 | fi |
| 97 | fi |
| 98 | |