blob: 07866e6bf2977206277486fc544b1748261b6677 [file] [log] [blame]
Misha Brukmana24b4dd2009-08-13 20:29:30 +00001#!/bin/bash
2
3die() {
Misha Brukman7dc75a62009-08-13 20:12:48 +00004 echo "$@" 1>&2
5 exit 1
Dan Gohmanf17a25c2007-07-18 16:29:46 +00006}
7
Misha Brukmana24b4dd2009-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.
Scott Michelda14e002008-11-20 04:28:08 +000015want_autoconf_version='2\.60'
Dan Gohmanf17a25c2007-07-18 16:29:46 +000016want_autoheader_version=$want_autoconf_version
Misha Brukmana24b4dd2009-08-13 20:29:30 +000017want_aclocal_version='1\.9\.6'
18want_libtool_version='1\.5\.22'
19### END NOTE #########################################################
Dan Gohmanf17a25c2007-07-18 16:29:46 +000020
21outfile=configure
22configfile=configure.ac
23
Misha Brukmana24b4dd2009-08-13 20:29:30 +000024want_autoconf_version_clean=$(clean $want_autoconf_version)
25want_autoheader_version_clean=$(clean $want_autoheader_version)
26want_aclocal_version_clean=$(clean $want_aclocal_version)
27want_libtool_version_clean=$(clean $want_libtool_version)
Dan Gohmanf17a25c2007-07-18 16:29:46 +000028
29test -d autoconf && test -f autoconf/$configfile && cd autoconf
30test -f $configfile || die "Can't find 'autoconf' dir; please cd into it first"
31autoconf --version | grep $want_autoconf_version > /dev/null
32test $? -eq 0 || die "Your autoconf was not detected as being $want_autoconf_version_clean"
Misha Brukmana24b4dd2009-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"
Dan Gohmanf17a25c2007-07-18 16:29:46 +000035autoheader --version | grep '^autoheader.*'$want_autoheader_version > /dev/null
36test $? -eq 0 || die "Your autoheader was not detected as being $want_autoheader_version_clean"
Misha Brukmana24b4dd2009-08-13 20:29:30 +000037libtool --version | grep $want_libtool_version > /dev/null
38test $? -eq 0 || die "Your libtool was not detected as being $want_libtool_version_clean"
Dan Gohmanf17a25c2007-07-18 16:29:46 +000039echo ""
40echo "### NOTE: ############################################################"
41echo "### If you get *any* warnings from autoconf below you MUST fix the"
42echo "### scripts in the m4 directory because there are future forward"
43echo "### compatibility or platform support issues at risk. Please do NOT"
44echo "### commit any configure script that was generated with warnings"
45echo "### present. You should get just three 'Regenerating..' lines."
46echo "######################################################################"
47echo ""
Misha Brukmana24b4dd2009-08-13 20:29:30 +000048echo "Regenerating aclocal.m4 with aclocal $want_aclocal_version_clean"
Dan Gohmanf17a25c2007-07-18 16:29:46 +000049cwd=`pwd`
50aclocal --force -I $cwd/m4 || die "aclocal failed"
51echo "Regenerating configure with autoconf $want_autoconf_version_clean"
52autoconf --force --warnings=all -o ../$outfile $configfile || die "autoconf failed"
53cd ..
54echo "Regenerating config.h.in with autoheader $want_autoheader_version_clean"
55autoheader --warnings=all -I autoconf -I autoconf/m4 autoconf/$configfile || die "autoheader failed"
56exit 0