blob: ae7e6a1d8662f3746e9952b0ef87f1d6d22e1baa [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"
Linus Walleij6f050022009-05-06 21:14:41 +000036touch config.rpath
Linus Walleija094e132006-02-15 14:22:08 +000037automake --add-missing --gnu || fail
38
39# Refresh GNU autotools toolchain: autoconf
40echo "Removing autoconf cruft"
41rm -f configure
42rm -rf autom4te*.cache/
43echo "Running autoconf"
Linus Walleijeb8c6fe2006-02-03 09:46:22 +000044autoconf
45
46# Autoupdate config.sub and config.guess
47# from GNU CVS
48WGET=`which wget`
49if [ "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
58else
59 echo "Could not autoupdate config.sub and config.guess"
60fi
Linus Walleija094e132006-02-15 14:22:08 +000061
Andrés G. Aragonesesf6aa64b2015-06-20 13:16:28 +020062if [ ! -z "$NOCONFIGURE" ]; then
63 echo "autogen.sh finished! ./configure skipped."
64 exit $?
65fi
Linus Walleija094e132006-02-15 14:22:08 +000066
Andrés G. Aragonesesf6aa64b2015-06-20 13:16:28 +020067echo "autogen.sh finished! Now going to run ./configure $@"
68./configure $@ || {
69 echo "./configure failed";
70 exit 1;
71}