Changes in directory llvm/projects/sample/autoconf:
AutoRegen.sh updated: 1.2 -> 1.3 configure.ac updated: 1.4 -> 1.5 --- Log message: Have the AutoRegen.sh script prompt the user for the LLVM src and obj directories if it can't find them. Then, replace those values into the configure.ac script and pass them to the LLVM_CONFIG_PROJECT so that the values become the default for llvm_src and llvm_obj variables. In this way the user is required to input this exactly once, and the scripts take it from there. --- Diffs of the changes: (+29 -4) AutoRegen.sh | 26 ++++++++++++++++++++++++-- configure.ac | 7 +++++-- 2 files changed, 29 insertions(+), 4 deletions(-) Index: llvm/projects/sample/autoconf/AutoRegen.sh diff -u llvm/projects/sample/autoconf/AutoRegen.sh:1.2 llvm/projects/sample/autoconf/AutoRegen.sh:1.3 --- llvm/projects/sample/autoconf/AutoRegen.sh:1.2 Thu Feb 24 12:42:34 2005 +++ llvm/projects/sample/autoconf/AutoRegen.sh Tue Apr 18 01:27:47 2006 @@ -7,20 +7,42 @@ 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" + 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` + 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 - die "Can't find the LLVM autoconf/m4 directory. The project should be checked out to projects directory" + 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" Index: llvm/projects/sample/autoconf/configure.ac diff -u llvm/projects/sample/autoconf/configure.ac:1.4 llvm/projects/sample/autoconf/configure.ac:1.5 --- llvm/projects/sample/autoconf/configure.ac:1.4 Thu Feb 24 12:50:53 2005 +++ llvm/projects/sample/autoconf/configure.ac Tue Apr 18 01:27:47 2006 @@ -3,13 +3,16 @@ dnl ************************************************************************** AC_INIT([[[SAMPLE]]],[[[x.xx]]],[EMAIL PROTECTED]) +dnl Identify where LLVM source tree is +LLVM_SRC_ROOT="../../" +LLVM_OBJ_ROOT="../../" dnl Tell autoconf that the auxilliary files are actually located in dnl the LLVM autoconf directory, not here. -AC_CONFIG_AUX_DIR(../../autoconf) +AC_CONFIG_AUX_DIR($LLVM_SRC_ROOT/autoconf) dnl Tell autoconf that this is an LLVM project being configured dnl This provides the --with-llvmsrc and --with-llvmobj options -LLVM_CONFIG_PROJECT +LLVM_CONFIG_PROJECT($LLVM_SRC_ROOT,$LLVM_OBJ_ROOT) dnl Verify that the source directory is valid AC_CONFIG_SRCDIR(["Makefile.common.in"]) _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits