blob: fdf12b0a1101e98e68417e89c9e0af687cd0a39e [file] [log] [blame]
Dan Gohmanf17a25c2007-07-18 16:29:46 +00001#!/bin/sh
2die () {
3 echo "$@" 1>&2
4 exit 1
5}
6
7### NOTE: ############################################################"
8### The below two variables specify the auto* versions
9### periods should be escaped with backslash, for use by grep
Scott Michel55252632008-11-20 04:26:21 +000010want_autoconf_version='2\.6[01]'
Dan Gohmanf17a25c2007-07-18 16:29:46 +000011want_autoheader_version=$want_autoconf_version
12### END NOTE #########################################################"
13
14
15outfile=configure
16configfile=configure.ac
17
18want_autoconf_version_clean=`echo $want_autoconf_version | sed -e 's/\\\\//g'`
19want_autoheader_version_clean=`echo $want_autoheader_version | sed -e 's/\\\\//g'`
20
21test -d autoconf && test -f autoconf/$configfile && cd autoconf
22test -f $configfile || die "Can't find 'autoconf' dir; please cd into it first"
23autoconf --version | grep $want_autoconf_version > /dev/null
24test $? -eq 0 || die "Your autoconf was not detected as being $want_autoconf_version_clean"
Scott Michel55252632008-11-20 04:26:21 +000025aclocal --version | grep '^aclocal.*\(1\.9\.6\|1\.10\)' > /dev/null
Dan Gohmanf17a25c2007-07-18 16:29:46 +000026test $? -eq 0 || die "Your aclocal was not detected as being 1.9.6"
27autoheader --version | grep '^autoheader.*'$want_autoheader_version > /dev/null
28test $? -eq 0 || die "Your autoheader was not detected as being $want_autoheader_version_clean"
29libtool --version | grep '1\.5\.22' > /dev/null
30test $? -eq 0 || die "Your libtool was not detected as being 1.5.22"
31echo ""
32echo "### NOTE: ############################################################"
33echo "### If you get *any* warnings from autoconf below you MUST fix the"
34echo "### scripts in the m4 directory because there are future forward"
35echo "### compatibility or platform support issues at risk. Please do NOT"
36echo "### commit any configure script that was generated with warnings"
37echo "### present. You should get just three 'Regenerating..' lines."
38echo "######################################################################"
39echo ""
40echo "Regenerating aclocal.m4 with aclocal 1.9.6"
41cwd=`pwd`
42aclocal --force -I $cwd/m4 || die "aclocal failed"
43echo "Regenerating configure with autoconf $want_autoconf_version_clean"
44autoconf --force --warnings=all -o ../$outfile $configfile || die "autoconf failed"
45cd ..
46echo "Regenerating config.h.in with autoheader $want_autoheader_version_clean"
47autoheader --warnings=all -I autoconf -I autoconf/m4 autoconf/$configfile || die "autoheader failed"
48exit 0