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