summaryrefslogtreecommitdiff
path: root/projects/sample/autoconf/AutoRegen.sh
blob: 2655f21dc01348a253adc1c84d2e81609546b2c0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/sh
die () {
	echo "$@" 1>&2
	exit 1
}
test -d autoconf && test -f autoconf/configure.ac && cd autoconf
test -f configure.ac || die "Can't find 'autoconf' dir; please cd into it first"
autoconf --version | egrep '2\.5[0-9]' > /dev/null
if test $? -ne 0 ; then
	die "Your autoconf was not detected as being 2.5x"
fi
cwd=`pwd`
if test -d ../../../autoconf/m4 ; then
  cd ../../../autoconf/m4
  llvm_m4=`pwd`
  cd $cwd
elif test -d ../../llvm/autoconf/m4 ; then
  cd ../../llvm/autoconf/m4
  llvm_m4=`pwd`
  cd $cwd
else
  die "Can't find the LLVM autoconf/m4 directory. llvm-test should be checked out to projects directory"
fi
echo "Regenerating aclocal.m4 with aclocal"
rm -f aclocal.m4
aclocal -I $cwd/m4 -I $llvm_m4 || die "aclocal failed"
echo "Regenerating configure with autoconf 2.5x"
autoconf --force --warnings=all -o ../configure configure.ac || die "autoconf failed"
cd ..
exit 0