blob: 01d65d8e842f8380edf0ec44c80f5ec15219cf2b [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
Reid Spencer2b6c0382004-10-10 19:09:33 +000010elif test -z "$1" ; then
Reid Spencer6843e382004-10-08 05:33:35 +000011 outfile=configure
12 configfile=configure.ac
13 with_automake=0
Reid Spencer2b6c0382004-10-10 19:09:33 +000014else
15 die "Invalid option: $1"
Reid Spencer6843e382004-10-08 05:33:35 +000016fi
17test -d autoconf && test -f autoconf/$configfile && cd autoconf
18test -f $configfile || die "Can't find 'autoconf' dir; please cd into it first"
Reid Spencerb03adb82004-09-19 22:14:24 +000019autoconf --version | egrep '2\.59' > /dev/null
20if test $? -ne 0 ; then
21 die "Your autoconf was not detected as being 2.59"
22fi
Reid Spencer6843e382004-10-08 05:33:35 +000023aclocal --version | egrep '1\.9\.2' > /dev/null
Reid Spencerb03adb82004-09-19 22:14:24 +000024if test $? -ne 0 ; then
Reid Spencer6bc488b2004-10-13 00:18:58 +000025 die "Your aclocal was not detected as being 1.9.2"
Reid Spencerb03adb82004-09-19 22:14:24 +000026fi
27autoheader --version | egrep '2\.59' > /dev/null
28if test $? -ne 0 ; then
29 die "Your autoheader was not detected as being 2.59"
30fi
Reid Spencer6bc488b2004-10-13 00:18:58 +000031libtool --version | grep '1\.5\.10' > /dev/null
Reid Spencerb03adb82004-09-19 22:14:24 +000032if test $? -ne 0 ; then
33 die "Your libtool was not detected as being 1.5.10"
Brian Gaeke4940c572004-02-08 07:44:48 +000034fi
Reid Spencer6843e382004-10-08 05:33:35 +000035if test $with_automake -eq 1 ; then
36 automake --version | grep 'automake.*1.9.2' > /dev/null
37 if test $? -ne 0 ; then
38 die "Your automake was not detected as being 1.9.2"
39 fi
40fi
Reid Spencer8eacb0c2004-09-19 22:30:53 +000041echo ""
42echo "### NOTE: ############################################################"
Reid Spencer5d6c4a52004-09-21 17:13:23 +000043echo "### If you get *any* warnings from autoconf below you MUST fix the"
44echo "### scripts in the m4 directory because there are future forward"
Reid Spencer8eacb0c2004-09-19 22:30:53 +000045echo "### compatibility or platform support issues at risk. Please do NOT"
Reid Spencer6843e382004-10-08 05:33:35 +000046echo "### commit any configure script that was generated with warnings"
47echo "### present. You should get just three 'Regenerating..' lines."
Reid Spencer8eacb0c2004-09-19 22:30:53 +000048echo "######################################################################"
49echo ""
Reid Spencer6bc488b2004-10-13 00:18:58 +000050echo "Regenerating aclocal.m4 with aclocal 1.9.2"
Reid Spencerdcd38752004-09-07 16:00:48 +000051cwd=`pwd`
Reid Spencer6843e382004-10-08 05:33:35 +000052if test $with_automake -eq 1 ; then
Reid Spencer2b6c0382004-10-10 19:09:33 +000053 mv configure.ac .configure.ac.save
Reid Spencer6843e382004-10-08 05:33:35 +000054 cp configure.am configure.ac
55 cp configure.am ../configure.ac
56fi
Reid Spencerb03adb82004-09-19 22:14:24 +000057aclocal --force -I $cwd/m4 || die "aclocal failed"
Reid Spencer6843e382004-10-08 05:33:35 +000058echo "Regenerating configure with autoconf 2.59"
59autoconf --force --warnings=all -o ../$outfile $configfile || die "autoconf failed"
Brian Gaeke4940c572004-02-08 07:44:48 +000060cd ..
Reid Spencer6843e382004-10-08 05:33:35 +000061echo "Regenerating config.h.in with autoheader 2.59"
62autoheader -I autoconf -I autoconf/m4 autoconf/$configfile || die "autoheader failed"
63if test $with_automake -eq 1 ; then
64 echo "Regenerating makefiles with automake 1.9.2"
65 cp autoconf/aclocal.m4 .
Reid Spencer2b6c0382004-10-10 19:09:33 +000066 automake --gnu --add-missing --copy --force-missing
Reid Spencer6843e382004-10-08 05:33:35 +000067 cd $cwd
Reid Spencer2b6c0382004-10-10 19:09:33 +000068 mv .configure.ac.save configure.ac
Reid Spencer6843e382004-10-08 05:33:35 +000069fi
Brian Gaeke4940c572004-02-08 07:44:48 +000070exit 0