blob: 2b5b961bf30487563fe3ef9eaf0f73bc729fa42b [file] [log] [blame]
Linus Walleijeb8c6fe2006-02-03 09:46:22 +00001#!/bin/sh
Linus Walleija094e132006-02-15 14:22:08 +00002#set -e
Linus Walleijeb8c6fe2006-02-03 09:46:22 +00003
Linus Walleija094e132006-02-15 14:22:08 +00004srcdir=`dirname $0`
5
6ACLOCAL_FLAGS="-I ${srcdir}/m4 ${ACLOCAL_FLAGS}"
7
8fail() {
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
16echo "Removing libtool cruft"
17rm -f ltmain.sh config.guess config.sub
18echo "Running libtoolize"
19libtoolize --copy --force || fail
20
21# Refresh GNU autotools toolchain: aclocal autoheader
22echo "Removing aclocal cruft"
23rm -f aclocal.m4
24echo "Running aclocal $ACLOCAL_FLAGS"
25aclocal $ACLOCAL_FLAGS || fail
26echo "Removing autoheader cruft"
27rm -f config.h.in src/config.h.in
28echo "Running autoheader"
29autoheader || fail
30
31# Refresh GNU autotools toolchain: automake
32echo "Removing automake cruft"
33rm -f depcomp install-sh missing mkinstalldirs
34rm -f stamp-h*
35echo "Running automake"
36automake --add-missing --gnu || fail
37
38# Refresh GNU autotools toolchain: autoconf
39echo "Removing autoconf cruft"
40rm -f configure
41rm -rf autom4te*.cache/
42echo "Running autoconf"
Linus Walleijeb8c6fe2006-02-03 09:46:22 +000043autoconf
44
45# Autoupdate config.sub and config.guess
46# from GNU CVS
47WGET=`which wget`
48if [ "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
57else
58 echo "Could not autoupdate config.sub and config.guess"
59fi
Linus Walleija094e132006-02-15 14:22:08 +000060
61echo "Finished!"
62