62dd6b28642a577fbab3d66dd77d4ca9785321ed
[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 | grep '2\.59' > /dev/null
11 test $? -eq 0 || die "Your autoconf was not detected as being 2.59"
12 aclocal --version | grep '^aclocal.*1\.9\.2' > /dev/null
13 test $? -eq 0 || die "Your aclocal was not detected as being 1.9.2"
14 autoheader --version | grep '^autoheader.*2\.59' > /dev/null
15 test $? -eq 0 || die "Your autoheader was not detected as being 2.59"
16 libtool --version | grep '1\.5\.10' > /dev/null
17 test $? -eq 0 || die "Your libtool was not detected as being 1.5.10"
18 echo ""
19 echo "### NOTE: ############################################################"
20 echo "### If you get *any* warnings from autoconf below you MUST fix the"
21 echo "### scripts in the m4 directory because there are future forward"
22 echo "### compatibility or platform support issues at risk. Please do NOT"
23 echo "### commit any configure script that was generated with warnings"
24 echo "### present. You should get just three 'Regenerating..' lines."
25 echo "######################################################################"
26 echo ""
27 echo "Regenerating aclocal.m4 with aclocal 1.9.2"
28 cwd=`pwd`
29 aclocal --force -I $cwd/m4 || die "aclocal failed"
30 echo "Regenerating configure with autoconf 2.59"
31 autoconf --force --warnings=all -o ../$outfile $configfile || die "autoconf failed"
32 cd ..
33 echo "Regenerating config.h.in with autoheader 2.59"
34 autoheader --warnings=all -I autoconf -I autoconf/m4 autoconf/$configfile || die "autoheader failed"
35 exit 0