blob: 86a26d925fc40495948a0ddb3219d8dcb4be2c3f [file] [log] [blame]
Misha Brukman2cf89b62009-08-13 20:29:30 +00001#!/bin/bash
2
3die() {
Misha Brukman9d635302009-08-13 20:12:48 +00004 echo "$@" 1>&2
5 exit 1
Brian Gaeke4940c572004-02-08 07:44:48 +00006}
Gabor Greiff70414f2007-07-13 09:48:29 +00007
Misha Brukman2cf89b62009-08-13 20:29:30 +00008clean() {
9 echo $1 | sed -e 's/\\//g'
10}
11
12### NOTE: ############################################################
13### These variables specify the tool versions we want to use.
14### Periods should be escaped with backslash for use by grep.
Nick Lewycky68cecbd2009-09-27 04:57:35 +000015###
Dmitri Gribenko0fa62a32012-12-24 15:01:59 +000016### If you update these, please also update docs/GettingStarted.rst
Scott Michelee85bbc2008-11-20 04:28:08 +000017want_autoconf_version='2\.60'
Gabor Greiff70414f2007-07-13 09:48:29 +000018want_autoheader_version=$want_autoconf_version
Misha Brukman2cf89b62009-08-13 20:29:30 +000019want_aclocal_version='1\.9\.6'
Misha Brukman2cf89b62009-08-13 20:29:30 +000020### END NOTE #########################################################
Gabor Greiff70414f2007-07-13 09:48:29 +000021
Reid Spencerd00b82e2004-12-22 05:56:41 +000022outfile=configure
23configfile=configure.ac
Gabor Greiff70414f2007-07-13 09:48:29 +000024
Misha Brukman2cf89b62009-08-13 20:29:30 +000025want_autoconf_version_clean=$(clean $want_autoconf_version)
26want_autoheader_version_clean=$(clean $want_autoheader_version)
27want_aclocal_version_clean=$(clean $want_aclocal_version)
Gabor Greiff70414f2007-07-13 09:48:29 +000028
Reid Spencer6843e382004-10-08 05:33:35 +000029test -d autoconf && test -f autoconf/$configfile && cd autoconf
30test -f $configfile || die "Can't find 'autoconf' dir; please cd into it first"
Gabor Greiff70414f2007-07-13 09:48:29 +000031autoconf --version | grep $want_autoconf_version > /dev/null
32test $? -eq 0 || die "Your autoconf was not detected as being $want_autoconf_version_clean"
Misha Brukman2cf89b62009-08-13 20:29:30 +000033aclocal --version | grep '^aclocal.*'$want_aclocal_version > /dev/null
34test $? -eq 0 || die "Your aclocal was not detected as being $want_aclocal_version_clean"
Gabor Greiff70414f2007-07-13 09:48:29 +000035autoheader --version | grep '^autoheader.*'$want_autoheader_version > /dev/null
36test $? -eq 0 || die "Your autoheader was not detected as being $want_autoheader_version_clean"
Reid Spencer8eacb0c2004-09-19 22:30:53 +000037echo ""
38echo "### NOTE: ############################################################"
Reid Spencer5d6c4a52004-09-21 17:13:23 +000039echo "### If you get *any* warnings from autoconf below you MUST fix the"
40echo "### scripts in the m4 directory because there are future forward"
Reid Spencer8eacb0c2004-09-19 22:30:53 +000041echo "### compatibility or platform support issues at risk. Please do NOT"
Reid Spencer6843e382004-10-08 05:33:35 +000042echo "### commit any configure script that was generated with warnings"
43echo "### present. You should get just three 'Regenerating..' lines."
Reid Spencer8eacb0c2004-09-19 22:30:53 +000044echo "######################################################################"
45echo ""
Misha Brukman2cf89b62009-08-13 20:29:30 +000046echo "Regenerating aclocal.m4 with aclocal $want_aclocal_version_clean"
Reid Spencerdcd38752004-09-07 16:00:48 +000047cwd=`pwd`
Reid Spencerb03adb82004-09-19 22:14:24 +000048aclocal --force -I $cwd/m4 || die "aclocal failed"
Gabor Greiff70414f2007-07-13 09:48:29 +000049echo "Regenerating configure with autoconf $want_autoconf_version_clean"
Reid Spencer6843e382004-10-08 05:33:35 +000050autoconf --force --warnings=all -o ../$outfile $configfile || die "autoconf failed"
Brian Gaeke4940c572004-02-08 07:44:48 +000051cd ..
Gabor Greiff70414f2007-07-13 09:48:29 +000052echo "Regenerating config.h.in with autoheader $want_autoheader_version_clean"
Reid Spencerabec8f92004-10-27 23:03:44 +000053autoheader --warnings=all -I autoconf -I autoconf/m4 autoconf/$configfile || die "autoheader failed"
Brian Gaeke4940c572004-02-08 07:44:48 +000054exit 0