Add in version dependency checks on all the tools we depend on. This is
[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 "Note: Warnings about 'AC_CONFIG_SUBDIRS: you should use literals' are ok"
25 echo "Regenerating aclocal.m4 with aclocal"
26 cwd=`pwd`
27 aclocal --force -I $cwd/m4 || die "aclocal failed"
28 echo "Regenerating configure with autoconf 2.5x"
29 autoconf --force --warnings=all -o ../configure configure.ac || die "autoconf failed"
30 cd ..
31 echo "Regenerating config.h.in with autoheader 2.5x"
32 autoheader -I autoconf -I autoconf/m4 autoconf/configure.ac || die "autoheader failed"
33 exit 0