Linus Walleij | eb8c6fe | 2006-02-03 09:46:22 +0000 | [diff] [blame] | 1 | #!/bin/sh |
Linus Walleij | a094e13 | 2006-02-15 14:22:08 +0000 | [diff] [blame] | 2 | #set -e |
Linus Walleij | eb8c6fe | 2006-02-03 09:46:22 +0000 | [diff] [blame] | 3 | |
Linus Walleij | a094e13 | 2006-02-15 14:22:08 +0000 | [diff] [blame] | 4 | srcdir=`dirname $0` |
| 5 | |
| 6 | ACLOCAL_FLAGS="-I ${srcdir}/m4 ${ACLOCAL_FLAGS}" |
| 7 | |
| 8 | fail() { |
| 9 | status=$? |
| 10 | echo "Last command failed with status $status in directory $(pwd)." |
| 11 | echo "Aborting" |
| 12 | exit $status |
| 13 | } |
| 14 | |
| 15 | # Refresh GNU autotools toolchain: libtool |
| 16 | echo "Removing libtool cruft" |
| 17 | rm -f ltmain.sh config.guess config.sub |
| 18 | echo "Running libtoolize" |
| 19 | libtoolize --copy --force || fail |
| 20 | |
| 21 | # Refresh GNU autotools toolchain: aclocal autoheader |
| 22 | echo "Removing aclocal cruft" |
| 23 | rm -f aclocal.m4 |
| 24 | echo "Running aclocal $ACLOCAL_FLAGS" |
| 25 | aclocal $ACLOCAL_FLAGS || fail |
| 26 | echo "Removing autoheader cruft" |
| 27 | rm -f config.h.in src/config.h.in |
| 28 | echo "Running autoheader" |
| 29 | autoheader || fail |
| 30 | |
| 31 | # Refresh GNU autotools toolchain: automake |
| 32 | echo "Removing automake cruft" |
| 33 | rm -f depcomp install-sh missing mkinstalldirs |
| 34 | rm -f stamp-h* |
| 35 | echo "Running automake" |
Linus Walleij | 6f05002 | 2009-05-06 21:14:41 +0000 | [diff] [blame] | 36 | touch config.rpath |
Linus Walleij | a094e13 | 2006-02-15 14:22:08 +0000 | [diff] [blame] | 37 | automake --add-missing --gnu || fail |
| 38 | |
| 39 | # Refresh GNU autotools toolchain: autoconf |
| 40 | echo "Removing autoconf cruft" |
| 41 | rm -f configure |
| 42 | rm -rf autom4te*.cache/ |
| 43 | echo "Running autoconf" |
Linus Walleij | eb8c6fe | 2006-02-03 09:46:22 +0000 | [diff] [blame] | 44 | autoconf |
| 45 | |
| 46 | # Autoupdate config.sub and config.guess |
| 47 | # from GNU CVS |
| 48 | WGET=`which wget` |
| 49 | if [ "x$WGET" != "x" ]; then |
| 50 | echo "Autoupdate config.sub and config.guess (y/n)?" |
| 51 | read IN |
| 52 | if [ "$IN" = "y" ] || [ "$IN" = "Y" ]; then |
| 53 | wget -O tmpfile http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess |
| 54 | mv tmpfile config.guess |
| 55 | wget -O tmpfile http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub |
| 56 | mv tmpfile config.sub |
| 57 | fi |
| 58 | else |
| 59 | echo "Could not autoupdate config.sub and config.guess" |
| 60 | fi |
Linus Walleij | a094e13 | 2006-02-15 14:22:08 +0000 | [diff] [blame] | 61 | |
Andrés G. Aragoneses | f6aa64b | 2015-06-20 13:16:28 +0200 | [diff] [blame] | 62 | if [ ! -z "$NOCONFIGURE" ]; then |
| 63 | echo "autogen.sh finished! ./configure skipped." |
| 64 | exit $? |
| 65 | fi |
Linus Walleij | a094e13 | 2006-02-15 14:22:08 +0000 | [diff] [blame] | 66 | |
Andrés G. Aragoneses | f6aa64b | 2015-06-20 13:16:28 +0200 | [diff] [blame] | 67 | echo "autogen.sh finished! Now going to run ./configure $@" |
| 68 | ./configure $@ || { |
| 69 | echo "./configure failed"; |
| 70 | exit 1; |
| 71 | } |