blob: f264054464eb9fbd7d63d5de59776863ce383780 [file] [log] [blame]
Brian Gaeke4940c572004-02-08 07:44:48 +00001#!/bin/sh
2die () {
3 echo "$@" 1>&2
4 exit 1
5}
Reid Spencer6843e382004-10-08 05:33:35 +00006if test "$1" = --with-automake ; then
7 outfile=configure_am
8 configfile=configure.am
9 with_automake=1
10else
11 outfile=configure
12 configfile=configure.ac
13 with_automake=0
14fi
15test -d autoconf && test -f autoconf/$configfile && cd autoconf
16test -f $configfile || die "Can't find 'autoconf' dir; please cd into it first"
Reid Spencerb03adb82004-09-19 22:14:24 +000017autoconf --version | egrep '2\.59' > /dev/null
18if test $? -ne 0 ; then
19 die "Your autoconf was not detected as being 2.59"
20fi
Reid Spencer6843e382004-10-08 05:33:35 +000021aclocal --version | egrep '1\.9\.2' > /dev/null
Reid Spencerb03adb82004-09-19 22:14:24 +000022if test $? -ne 0 ; then
23 die "Your aclocal was not detected as being 1.9.1"
24fi
25autoheader --version | egrep '2\.59' > /dev/null
26if test $? -ne 0 ; then
27 die "Your autoheader was not detected as being 2.59"
28fi
29libtool --version | grep '1.5.10' > /dev/null
30if test $? -ne 0 ; then
31 die "Your libtool was not detected as being 1.5.10"
Brian Gaeke4940c572004-02-08 07:44:48 +000032fi
Reid Spencer6843e382004-10-08 05:33:35 +000033if test $with_automake -eq 1 ; then
34 automake --version | grep 'automake.*1.9.2' > /dev/null
35 if test $? -ne 0 ; then
36 die "Your automake was not detected as being 1.9.2"
37 fi
38fi
Reid Spencer8eacb0c2004-09-19 22:30:53 +000039echo ""
40echo "### NOTE: ############################################################"
Reid Spencer5d6c4a52004-09-21 17:13:23 +000041echo "### If you get *any* warnings from autoconf below you MUST fix the"
42echo "### scripts in the m4 directory because there are future forward"
Reid Spencer8eacb0c2004-09-19 22:30:53 +000043echo "### compatibility or platform support issues at risk. Please do NOT"
Reid Spencer6843e382004-10-08 05:33:35 +000044echo "### commit any configure script that was generated with warnings"
45echo "### present. You should get just three 'Regenerating..' lines."
Reid Spencer8eacb0c2004-09-19 22:30:53 +000046echo "######################################################################"
47echo ""
Reid Spencerdcd38752004-09-07 16:00:48 +000048echo "Regenerating aclocal.m4 with aclocal"
49cwd=`pwd`
Reid Spencer6843e382004-10-08 05:33:35 +000050if test $with_automake -eq 1 ; then
51 cp configure.ac .configure.ac.save
52 cp configure.am configure.ac
53 cp configure.am ../configure.ac
54fi
Reid Spencerb03adb82004-09-19 22:14:24 +000055aclocal --force -I $cwd/m4 || die "aclocal failed"
Reid Spencer6843e382004-10-08 05:33:35 +000056echo "Regenerating configure with autoconf 2.59"
57autoconf --force --warnings=all -o ../$outfile $configfile || die "autoconf failed"
Brian Gaeke4940c572004-02-08 07:44:48 +000058cd ..
Reid Spencer6843e382004-10-08 05:33:35 +000059echo "Regenerating config.h.in with autoheader 2.59"
60autoheader -I autoconf -I autoconf/m4 autoconf/$configfile || die "autoheader failed"
61if test $with_automake -eq 1 ; then
62 echo "Regenerating makefiles with automake 1.9.2"
63 cp autoconf/aclocal.m4 .
64 automake --foreign --add-missing --copy
65 rm configure.ac
66 cd $cwd
67 cp .configure.ac.save configure.ac
68fi
Brian Gaeke4940c572004-02-08 07:44:48 +000069exit 0