Cleanup configuration for Cygwin
[oota-llvm.git] / projects / sample / 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\.5[0-9]' > /dev/null
9 if test $? -ne 0 ; then
10         die "Your autoconf was not detected as being 2.5x"
11 fi
12 cwd=`pwd`
13 if test -d ../../../autoconf/m4 ; then
14   cd ../../../autoconf/m4
15   llvm_m4=`pwd`
16   cd $cwd
17 elif test -d ../../llvm/autoconf/m4 ; then
18   cd ../../llvm/autoconf/m4
19   llvm_m4=`pwd`
20   cd $cwd
21 else
22   die "Can't find the LLVM autoconf/m4 directory. llvm-test should be checked out to projects directory"
23 fi
24 echo "Regenerating aclocal.m4 with aclocal"
25 rm -f aclocal.m4
26 aclocal -I $cwd/m4 -I $llvm_m4 || die "aclocal failed"
27 echo "Regenerating configure with autoconf 2.5x"
28 autoconf --force --warnings=all -o ../configure configure.ac || die "autoconf failed"
29 cd ..
30 exit 0