CHanges for autconf 2.60

llvm-svn: 36937
This commit is contained in:
Reid Spencer 2007-05-08 15:22:59 +00:00
parent 2e1f804764
commit c82f324ba7
2 changed files with 62 additions and 22 deletions

View File

@ -4,15 +4,49 @@ die () {
exit 1
}
test -d autoconf && test -f autoconf/configure.ac && cd autoconf
[ -f configure.ac ] || die "Can't find 'autoconf' dir; please cd into it first"
echo "Regenerating aclocal.m4 with aclocal"
aclocal || die "aclocal failed"
autoconf --version | egrep '2\.5[0-9]' > /dev/null
if test $? -ne 0
then
die "Your autoconf was not detected as being 2.5x"
test -f configure.ac || die "Can't find 'autoconf' dir; please cd into it first"
autoconf --version | egrep '2\.6[0-9]' > /dev/null
if test $? -ne 0 ; then
die "Your autoconf was not detected as being 2.6x"
fi
echo "Regenerating configure with autoconf 2.5x"
autoconf -o ../configure configure.ac || die "autoconf failed"
cwd=`pwd`
if test -d ../../../autoconf/m4 ; then
cd ../../../autoconf/m4
llvm_m4=`pwd`
llvm_src_root=../../..
llvm_obj_root=../../..
cd $cwd
elif test -d ../../llvm/autoconf/m4 ; then
cd ../../llvm/autoconf/m4
llvm_m4=`pwd`
llvm_src_root=../..
llvm_obj_root=../..
cd $cwd
else
while true ; do
echo "LLVM source root not found."
read -p "Enter full path to LLVM source:"
if test -d "$REPLY/autoconf/m4" ; then
llvm_src_root="$REPLY"
llvm_m4="$REPLY/autoconf/m4"
read -p "Enter full path to LLVM objects (empty for same as source):"
if test -d "$REPLY" ; then
llvm_obj_root="$REPLY"
else
llvm_obj_root="$llvm_src_root"
fi
break
fi
done
fi
# 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
echo "Regenerating aclocal.m4 with aclocal"
rm -f aclocal.m4
aclocal -I $llvm_m4 -I "$llvm_m4/.." || die "aclocal failed"
echo "Regenerating configure with autoconf 2.6x"
autoconf --warnings=all -o ../configure configure.ac || die "autoconf failed"
cd ..
exit 0

View File

@ -1,7 +1,7 @@
dnl **************************************************************************
dnl * Initialize
dnl **************************************************************************
AC_INIT([[[Stacker]]],[[[1.0]]],[rspencer@x10sys.com])
AC_INIT([[[Stacker]]],[[[2.0]]],[rspencer@reidspencer.com])
dnl Place all of the extra autoconf files into the config subdirectory
AC_CONFIG_AUX_DIR([autoconf])
@ -11,16 +11,6 @@ AC_CONFIG_SRCDIR([lib/compiler/StackerParser.y])
AC_CONFIG_FILES([Makefile.common])
dnl Configure Makefiles
dnl List every Makefile that exists within your source tree
AC_CONFIG_MAKEFILE(Makefile)
AC_CONFIG_MAKEFILE(lib/Makefile)
AC_CONFIG_MAKEFILE(lib/compiler/Makefile)
AC_CONFIG_MAKEFILE(lib/runtime/Makefile)
AC_CONFIG_MAKEFILE(test/Makefile)
AC_CONFIG_MAKEFILE(tools/Makefile)
AC_CONFIG_MAKEFILE(tools/stkrc/Makefile)
dnl **************************************************************************
dnl * Determine which system we are building on
@ -68,12 +58,28 @@ dnl * Set the location of various third-party software packages
dnl **************************************************************************
dnl Location of LLVM source code
AC_ARG_WITH(llvmsrc,AC_HELP_STRING([--with-llvmsrc],[Location of LLVM Source Code]),AC_SUBST(LLVM_SRC,[$withval]),AC_SUBST(LLVM_SRC,[`cd ${srcdir}/../..; pwd`]))
AC_ARG_WITH(llvmsrc,AS_HELP_STRING([--with-llvmsrc],[Location of LLVM Source Code]),AC_SUBST(LLVM_SRC,[$withval]),AC_SUBST(LLVM_SRC,[`cd ${srcdir}/../..; pwd`]))
AC_CONFIG_COMMANDS([llvm_src],[],[llvm_src=$LLVM_SRC])
dnl Location of LLVM object code
AC_ARG_WITH(llvmobj,AC_HELP_STRING([--with-llvmobj],[Location of LLVM Object Code]),AC_SUBST(LLVM_OBJ,[$withval]),AC_SUBST(LLVM_OBJ,[`cd ../..; pwd`]))
AC_ARG_WITH(llvmobj,AS_HELP_STRING([--with-llvmobj],[Location of LLVM Object Code]),AC_SUBST(LLVM_OBJ,[$withval]),AC_SUBST(LLVM_OBJ,[`cd ../..; pwd`]))
AC_CONFIG_COMMANDS([llvm_obj],[],[llvm_obj=$LLVM_OBJ])
dnl **************************************************************************
dnl Configure Makefiles
dnl List every Makefile that exists within your source tree
dnl **************************************************************************
AC_CONFIG_MAKEFILE(Makefile)
AC_CONFIG_MAKEFILE(lib/Makefile)
AC_CONFIG_MAKEFILE(lib/compiler/Makefile)
AC_CONFIG_MAKEFILE(lib/runtime/Makefile)
AC_CONFIG_MAKEFILE(test/Makefile)
AC_CONFIG_MAKEFILE(tools/Makefile)
AC_CONFIG_MAKEFILE(tools/stkrc/Makefile)
dnl **************************************************************************
dnl * Create the output files
dnl **************************************************************************
AC_OUTPUT