2005-01-05 06:41:10 +00:00
|
|
|
#!/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"
|
2009-03-24 23:45:13 +00:00
|
|
|
autoconf --version | egrep '2\.[56][0-9]' > /dev/null
|
2005-01-05 06:41:10 +00:00
|
|
|
if test $? -ne 0 ; then
|
2009-03-24 23:45:13 +00:00
|
|
|
die "Your autoconf was not detected as being 2.5x or 2.6x"
|
2005-01-05 06:41:10 +00:00
|
|
|
fi
|
|
|
|
cwd=`pwd`
|
|
|
|
if test -d ../../../autoconf/m4 ; then
|
|
|
|
cd ../../../autoconf/m4
|
|
|
|
llvm_m4=`pwd`
|
2009-03-25 00:52:11 +00:00
|
|
|
llvm_src_root=../../..
|
|
|
|
llvm_obj_root=../../..
|
2005-01-05 06:41:10 +00:00
|
|
|
cd $cwd
|
|
|
|
elif test -d ../../llvm/autoconf/m4 ; then
|
|
|
|
cd ../../llvm/autoconf/m4
|
|
|
|
llvm_m4=`pwd`
|
2009-03-25 00:52:11 +00:00
|
|
|
llvm_src_root=../..
|
|
|
|
llvm_obj_root=../..
|
2005-01-05 06:41:10 +00:00
|
|
|
cd $cwd
|
|
|
|
else
|
2006-04-18 06:27:47 +00:00
|
|
|
while true ; do
|
|
|
|
echo "LLVM source root not found."
|
2009-03-24 20:21:37 +00:00
|
|
|
read -p "Enter full path to LLVM source:" REPLY
|
2006-04-18 06:27:47 +00:00
|
|
|
if test -d "$REPLY/autoconf/m4" ; then
|
|
|
|
llvm_src_root="$REPLY"
|
|
|
|
llvm_m4="$REPLY/autoconf/m4"
|
2009-03-24 20:21:37 +00:00
|
|
|
read -p "Enter full path to LLVM objects (empty for same as source):" REPLY
|
2006-04-18 06:27:47 +00:00
|
|
|
if test -d "$REPLY" ; then
|
|
|
|
llvm_obj_root="$REPLY"
|
|
|
|
else
|
|
|
|
llvm_obj_root="$llvm_src_root"
|
|
|
|
fi
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
done
|
2005-01-05 06:41:10 +00:00
|
|
|
fi
|
2006-04-18 06:27:47 +00:00
|
|
|
# Patch the LLVM_ROOT in configure.ac, if it needs it
|
|
|
|
cp configure.ac configure.bak
|
|
|
|
sed -e "s#^LLVM_SRC_ROOT=.*#LLVM_SRC_ROOT=\"$llvm_src_root\"#" \
|
|
|
|
-e "s#^LLVM_OBJ_ROOT=.*#LLVM_OBJ_ROOT=\"$llvm_obj_root\"#" configure.bak > configure.ac
|
2005-01-05 06:41:10 +00:00
|
|
|
echo "Regenerating aclocal.m4 with aclocal"
|
|
|
|
rm -f aclocal.m4
|
2005-02-24 18:42:34 +00:00
|
|
|
aclocal -I $llvm_m4 -I "$llvm_m4/.." || die "aclocal failed"
|
2009-03-24 23:45:13 +00:00
|
|
|
echo "Regenerating configure with autoconf"
|
2005-02-24 18:42:34 +00:00
|
|
|
autoconf --warnings=all -o ../configure configure.ac || die "autoconf failed"
|
2005-01-05 06:41:10 +00:00
|
|
|
cd ..
|
|
|
|
exit 0
|