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" |
| 36 | automake --add-missing --gnu || fail |
| 37 | |
| 38 | # Refresh GNU autotools toolchain: autoconf |
| 39 | echo "Removing autoconf cruft" |
| 40 | rm -f configure |
| 41 | rm -rf autom4te*.cache/ |
| 42 | echo "Running autoconf" |
Linus Walleij | eb8c6fe | 2006-02-03 09:46:22 +0000 | [diff] [blame] | 43 | autoconf |
| 44 | |
| 45 | # Autoupdate config.sub and config.guess |
| 46 | # from GNU CVS |
| 47 | WGET=`which wget` |
| 48 | if [ "x$WGET" != "x" ]; then |
| 49 | echo "Autoupdate config.sub and config.guess (y/n)?" |
| 50 | read IN |
| 51 | if [ "$IN" = "y" ] || [ "$IN" = "Y" ]; then |
| 52 | wget -O tmpfile http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess |
| 53 | mv tmpfile config.guess |
| 54 | wget -O tmpfile http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub |
| 55 | mv tmpfile config.sub |
| 56 | fi |
| 57 | else |
| 58 | echo "Could not autoupdate config.sub and config.guess" |
| 59 | fi |
Linus Walleij | a094e13 | 2006-02-15 14:22:08 +0000 | [diff] [blame] | 60 | |
| 61 | echo "Finished!" |
| 62 | |