reverting previous change, will add support for other compilers later
[oota-llvm.git] / autoconf / AutoRegen.sh
1 #!/bin/sh
2 die () {
3         echo "$@" 1>&2
4         exit 1
5 }
6 outfile=configure
7 configfile=configure.ac
8 test -d autoconf && test -f autoconf/$configfile && cd autoconf
9 test -f $configfile || die "Can't find 'autoconf' dir; please cd into it first"
10 autoconf --version | egrep '2\.59' > /dev/null
11 if test $? -ne 0 ; then
12   die "Your autoconf was not detected as being 2.59"
13 fi
14 aclocal --version | egrep '1\.9\.2' > /dev/null
15 if test $? -ne 0 ; then
16   die "Your aclocal was not detected as being 1.9.2"
17 fi
18 autoheader --version | egrep '2\.59' > /dev/null
19 if test $? -ne 0 ; then
20   die "Your autoheader was not detected as being 2.59"
21 fi
22 libtool --version | grep '1\.5\.10' > /dev/null
23 if test $? -ne 0 ; then
24   die "Your libtool was not detected as being 1.5.10"
25 fi
26 echo ""
27 echo "### NOTE: ############################################################"
28 echo "### If you get *any* warnings from autoconf below you MUST fix the"
29 echo "### scripts in the m4 directory because there are future forward"
30 echo "### compatibility or platform support issues at risk. Please do NOT"
31 echo "### commit any configure script that was generated with warnings"
32 echo "### present. You should get just three 'Regenerating..' lines."
33 echo "######################################################################"
34 echo ""
35 echo "Regenerating aclocal.m4 with aclocal 1.9.2"
36 cwd=`pwd`
37 aclocal --force -I $cwd/m4 || die "aclocal failed"
38 echo "Regenerating configure with autoconf 2.59"
39 autoconf --force --warnings=all -o ../$outfile $configfile || die "autoconf failed"
40 cd ..
41 echo "Regenerating config.h.in with autoheader 2.59"
42 autoheader --warnings=all -I autoconf -I autoconf/m4 autoconf/$configfile || die "autoheader failed"
43 exit 0