Misha Brukman | 2cf89b6 | 2009-08-13 20:29:30 +0000 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | die() { |
Misha Brukman | 9d63530 | 2009-08-13 20:12:48 +0000 | [diff] [blame] | 4 | echo "$@" 1>&2 |
| 5 | exit 1 |
Brian Gaeke | 4940c57 | 2004-02-08 07:44:48 +0000 | [diff] [blame] | 6 | } |
Gabor Greif | f70414f | 2007-07-13 09:48:29 +0000 | [diff] [blame] | 7 | |
Misha Brukman | 2cf89b6 | 2009-08-13 20:29:30 +0000 | [diff] [blame] | 8 | clean() { |
| 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 Lewycky | 68cecbd | 2009-09-27 04:57:35 +0000 | [diff] [blame^] | 15 | ### |
| 16 | ### If you update these, please also update docs/GettingStarted.html |
Scott Michel | ee85bbc | 2008-11-20 04:28:08 +0000 | [diff] [blame] | 17 | want_autoconf_version='2\.60' |
Gabor Greif | f70414f | 2007-07-13 09:48:29 +0000 | [diff] [blame] | 18 | want_autoheader_version=$want_autoconf_version |
Misha Brukman | 2cf89b6 | 2009-08-13 20:29:30 +0000 | [diff] [blame] | 19 | want_aclocal_version='1\.9\.6' |
| 20 | want_libtool_version='1\.5\.22' |
| 21 | ### END NOTE ######################################################### |
Gabor Greif | f70414f | 2007-07-13 09:48:29 +0000 | [diff] [blame] | 22 | |
Reid Spencer | d00b82e | 2004-12-22 05:56:41 +0000 | [diff] [blame] | 23 | outfile=configure |
| 24 | configfile=configure.ac |
Gabor Greif | f70414f | 2007-07-13 09:48:29 +0000 | [diff] [blame] | 25 | |
Misha Brukman | 2cf89b6 | 2009-08-13 20:29:30 +0000 | [diff] [blame] | 26 | want_autoconf_version_clean=$(clean $want_autoconf_version) |
| 27 | want_autoheader_version_clean=$(clean $want_autoheader_version) |
| 28 | want_aclocal_version_clean=$(clean $want_aclocal_version) |
| 29 | want_libtool_version_clean=$(clean $want_libtool_version) |
Gabor Greif | f70414f | 2007-07-13 09:48:29 +0000 | [diff] [blame] | 30 | |
Reid Spencer | 6843e38 | 2004-10-08 05:33:35 +0000 | [diff] [blame] | 31 | test -d autoconf && test -f autoconf/$configfile && cd autoconf |
| 32 | test -f $configfile || die "Can't find 'autoconf' dir; please cd into it first" |
Gabor Greif | f70414f | 2007-07-13 09:48:29 +0000 | [diff] [blame] | 33 | autoconf --version | grep $want_autoconf_version > /dev/null |
| 34 | test $? -eq 0 || die "Your autoconf was not detected as being $want_autoconf_version_clean" |
Misha Brukman | 2cf89b6 | 2009-08-13 20:29:30 +0000 | [diff] [blame] | 35 | aclocal --version | grep '^aclocal.*'$want_aclocal_version > /dev/null |
| 36 | test $? -eq 0 || die "Your aclocal was not detected as being $want_aclocal_version_clean" |
Gabor Greif | f70414f | 2007-07-13 09:48:29 +0000 | [diff] [blame] | 37 | autoheader --version | grep '^autoheader.*'$want_autoheader_version > /dev/null |
| 38 | test $? -eq 0 || die "Your autoheader was not detected as being $want_autoheader_version_clean" |
Misha Brukman | 2cf89b6 | 2009-08-13 20:29:30 +0000 | [diff] [blame] | 39 | libtool --version | grep $want_libtool_version > /dev/null |
| 40 | test $? -eq 0 || die "Your libtool was not detected as being $want_libtool_version_clean" |
Reid Spencer | 8eacb0c | 2004-09-19 22:30:53 +0000 | [diff] [blame] | 41 | echo "" |
| 42 | echo "### NOTE: ############################################################" |
Reid Spencer | 5d6c4a5 | 2004-09-21 17:13:23 +0000 | [diff] [blame] | 43 | echo "### If you get *any* warnings from autoconf below you MUST fix the" |
| 44 | echo "### scripts in the m4 directory because there are future forward" |
Reid Spencer | 8eacb0c | 2004-09-19 22:30:53 +0000 | [diff] [blame] | 45 | echo "### compatibility or platform support issues at risk. Please do NOT" |
Reid Spencer | 6843e38 | 2004-10-08 05:33:35 +0000 | [diff] [blame] | 46 | echo "### commit any configure script that was generated with warnings" |
| 47 | echo "### present. You should get just three 'Regenerating..' lines." |
Reid Spencer | 8eacb0c | 2004-09-19 22:30:53 +0000 | [diff] [blame] | 48 | echo "######################################################################" |
| 49 | echo "" |
Misha Brukman | 2cf89b6 | 2009-08-13 20:29:30 +0000 | [diff] [blame] | 50 | echo "Regenerating aclocal.m4 with aclocal $want_aclocal_version_clean" |
Reid Spencer | dcd3875 | 2004-09-07 16:00:48 +0000 | [diff] [blame] | 51 | cwd=`pwd` |
Reid Spencer | b03adb8 | 2004-09-19 22:14:24 +0000 | [diff] [blame] | 52 | aclocal --force -I $cwd/m4 || die "aclocal failed" |
Gabor Greif | f70414f | 2007-07-13 09:48:29 +0000 | [diff] [blame] | 53 | echo "Regenerating configure with autoconf $want_autoconf_version_clean" |
Reid Spencer | 6843e38 | 2004-10-08 05:33:35 +0000 | [diff] [blame] | 54 | autoconf --force --warnings=all -o ../$outfile $configfile || die "autoconf failed" |
Brian Gaeke | 4940c57 | 2004-02-08 07:44:48 +0000 | [diff] [blame] | 55 | cd .. |
Gabor Greif | f70414f | 2007-07-13 09:48:29 +0000 | [diff] [blame] | 56 | echo "Regenerating config.h.in with autoheader $want_autoheader_version_clean" |
Reid Spencer | abec8f9 | 2004-10-27 23:03:44 +0000 | [diff] [blame] | 57 | autoheader --warnings=all -I autoconf -I autoconf/m4 autoconf/$configfile || die "autoheader failed" |
Brian Gaeke | 4940c57 | 2004-02-08 07:44:48 +0000 | [diff] [blame] | 58 | exit 0 |