[llvm-commits] [hlvm] r37973 - in /hlvm/trunk: autoconf/AutoRegen.sh autoconf/configure.ac autoconf/m4/ autoconf/m4/config_makefile.m4 autoconf/m4/find_package.m4 configure

Reid Spencer reid at x10sys.com
Sat Jul 7 16:58:30 PDT 2007


Author: reid
Date: Sat Jul  7 18:58:29 2007
New Revision: 37973

URL: http://llvm.org/viewvc/llvm-project?rev=37973&view=rev
Log:
Rework the configure magic so that we have a macro for finding the packages we
need to depend on. Then, use that macro in the configure script. Also, get rid
of LLVM "project" cruft.

Added:
    hlvm/trunk/autoconf/m4/
    hlvm/trunk/autoconf/m4/config_makefile.m4
    hlvm/trunk/autoconf/m4/find_package.m4
Modified:
    hlvm/trunk/autoconf/AutoRegen.sh
    hlvm/trunk/autoconf/configure.ac
    hlvm/trunk/configure

Modified: hlvm/trunk/autoconf/AutoRegen.sh
URL: http://llvm.org/viewvc/llvm-project/hlvm/trunk/autoconf/AutoRegen.sh?rev=37973&r1=37972&r2=37973&view=diff

==============================================================================
--- hlvm/trunk/autoconf/AutoRegen.sh (original)
+++ hlvm/trunk/autoconf/AutoRegen.sh Sat Jul  7 18:58:29 2007
@@ -10,42 +10,9 @@
   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
-  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"
+aclocal -I $cwd/m4 || die "aclocal failed"
 echo "Regenerating configure with autoconf 2.5x"
 autoconf --warnings=all -o ../configure configure.ac || die "autoconf failed"
 cd ..

Modified: hlvm/trunk/autoconf/configure.ac
URL: http://llvm.org/viewvc/llvm-project/hlvm/trunk/autoconf/configure.ac?rev=37973&r1=37972&r2=37973&view=diff

==============================================================================
--- hlvm/trunk/autoconf/configure.ac (original)
+++ hlvm/trunk/autoconf/configure.ac Sat Jul  7 18:58:29 2007
@@ -2,22 +2,10 @@
 dnl * Initialize
 dnl **************************************************************************
 AC_INIT([[[HLVM]]],[[[0.1svn]]],[hlvm-dev at hlvm.org])
-
-dnl Identify where LLVM source tree is
-LLVM_SRC_ROOT="/proj/llvm/llvm"
-LLVM_OBJ_ROOT="/proj/llvm/build"
-dnl Tell autoconf that the auxilliary files are actually located in
-dnl the LLVM autoconf directory, not here.
-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_SRC_ROOT,$LLVM_OBJ_ROOT)
-
-dnl Verify that the source directory is valid
-AC_CONFIG_SRCDIR(["Makefile.common.in"])
-
-dnl Configure a common Makefile
+AC_SUBST(HLVM_COPYRIGHT,["Copyright (c) 2006 HLVM Programmer's Group"])
+AC_COPYRIGHT[Copyright (c) 2006 HLVM Programmer's Group])
+AC_PREREQ(2.59)
+AC_CONFIG_SRCDIR(["lib/Makefile"])
 AC_CONFIG_FILES(Makefile.common)
 
 dnl Configure project makefiles
@@ -27,6 +15,13 @@
 AC_CONFIG_MAKEFILE(tools/Makefile)
 
 dnl **************************************************************************
+dnl * Set the location of various third-party software packages
+dnl **************************************************************************
+FIND_PACKAGE([llvm],[llvm/Module.h],[LLVMCore.o],[llc],
+             [Low Level Virtual Machine])
+FIND_PACKAGE([apr],[apr-1/apr.h],[libapr-1.so],[],[Apache Portable Runtime])
+
+dnl **************************************************************************
 dnl * Determine which system we are building on
 dnl **************************************************************************
 
@@ -55,10 +50,6 @@
 dnl **************************************************************************
 
 dnl **************************************************************************
-dnl * Set the location of various third-party software packages
-dnl **************************************************************************
-
-dnl **************************************************************************
 dnl * Create the output files
 dnl **************************************************************************
 

Added: hlvm/trunk/autoconf/m4/config_makefile.m4
URL: http://llvm.org/viewvc/llvm-project/hlvm/trunk/autoconf/m4/config_makefile.m4?rev=37973&view=auto

==============================================================================
--- hlvm/trunk/autoconf/m4/config_makefile.m4 (added)
+++ hlvm/trunk/autoconf/m4/config_makefile.m4 Sat Jul  7 18:58:29 2007
@@ -0,0 +1,9 @@
+#
+# Configure a Makefile without clobbering it if it exists and is not out of
+# date.  This macro is unique to LLVM.
+#
+AC_DEFUN([AC_CONFIG_MAKEFILE],
+[AC_CONFIG_COMMANDS($1,
+  [${llvm_src}/autoconf/mkinstalldirs `dirname $1`
+   ${SHELL} ${llvm_src}/autoconf/install-sh -c ${srcdir}/$1 $1])
+])

Added: hlvm/trunk/autoconf/m4/find_package.m4
URL: http://llvm.org/viewvc/llvm-project/hlvm/trunk/autoconf/m4/find_package.m4?rev=37973&view=auto

==============================================================================
--- hlvm/trunk/autoconf/m4/find_package.m4 (added)
+++ hlvm/trunk/autoconf/m4/find_package.m4 Sat Jul  7 18:58:29 2007
@@ -0,0 +1,118 @@
+dnl Check for a package and its libraries and include files
+dnl 
+dnl Parameters:
+dnl   $1 - prefix directory to check
+dnl   $2 - program name to check
+dnl   $3 - header file to check 
+dnl   $4 - library file to check 
+AC_DEFUN([CHECK_PACKAGE],
+[m4_define([allcapsname],translit($2,a-z,A-Z))
+if test -n "$1" -a -d "$1" -a -n "$2" -a -d "$1/bin" -a -x "$1/bin/$2" ; then
+  AC_SUBST([USE_]allcapsname(),["USE_]allcapsname()[ = 1"])
+  AC_SUBST(allcapsname(),[$1/bin/$2])
+  AC_SUBST(allcapsname()[_BIN],[$1/bin])
+  AC_SUBST(allcapsname()[_DIR],[$1])
+  if test -n "$3" -a -d "$1/include" -a -f "$1/include/$3" ; then 
+    AC_SUBST(allcapsname()[_INC],[$1/include])
+  fi
+  if test -n "$4" -a -d "$1/lib" -a -f "$1/lib/$4" ; then
+    AC_SUBST(allcapsname()[_LIB],[$1/lib])
+  fi
+fi
+])
+
+dnl Find a program via --with options, in the path, or well known places
+dnl
+dnl Parameters:
+dnl   $1 - short name for the package
+dnl   $2 - header file name to check (optional)
+dnl   $3 - library file name to check (optional)
+dnl   $4 - program's executable name
+dnl   $5 - alternate (long) name for the program
+AC_DEFUN([FIND_PACKAGE],
+[m4_define([allcapsname],translit($1,a-z,A-Z))
+AC_MSG_CHECKING([for ]$5[ bin/lib/include locations])
+AC_ARG_WITH(allcapsname(),
+  AS_HELP_STRING([--with-]allcapsname()[=DIR],
+  [Specify that the ]$5[ install prefix is DIR]),
+  $1[pfxdir=$withval],$1[pfxdir=nada])
+AC_ARG_WITH(allcapsname()[-bin],
+  AS_HELP_STRING([--with-]allcapsname()[-bin=DIR],
+  [Specify that the ]$5[ binary is in DIR]),
+    $1[bindir=$withval],$1[bindir=nada])
+AC_ARG_WITH(allcapsname()[-lib],
+  AS_HELP_STRING([--with-]allcapsname()[-lib=DIR],
+  [Specify that ]$5[ libraries are in DIR]),
+  $1[libdir=$withval],$1[libdir=nada])
+AC_ARG_WITH(allcapsname()[-inc],
+  AS_HELP_STRING([--with-]allcapsname()[-inc=DIR],
+  [Specify that the ]$5[ includes are in DIR]),
+  $1[incdir=$withval],$1[incdir=nada])
+eval pfxval=\$\{$1pfxdir\}
+eval binval=\$\{$1bindir\}
+eval incval=\$\{$1incdir\}
+eval libvar=\$\{$1libdir\}
+if test "${pfxval}" != "nada" ; then
+  CHECK_STD_PROGRAM(${pfxval},$4,$2,$3)
+elif test "${binval}" != "nada" ; then
+  if test "${libval}" != "nada" ; then
+    if test "${incval}" != "nada" ; then
+      if test -d "${binval}" ; then
+        if test -d "${incval}" ; then
+          if test -d "${libval}" ; then
+            AC_SUBST(allcapsname(),${binval}/$1)
+            AC_SUBST(allcapsname()[_BIN],${binval})
+            AC_SUBST(allcapsname()[_INC],${incval})
+            AC_SUBST(allcapsname()[_LIB],${libval})
+            AC_SUBST([USE_]allcapsname(),[1])
+            AC_MSG_RESULT([found via --with options])
+          else
+            AC_MSG_RESULT([failed])
+            AC_MSG_ERROR([The --with-]$1[-libdir value must be a directory])
+          fi
+        else
+          AC_MSG_RESULT([failed])
+          AC_MSG_ERROR([The --with-]$1[-incdir value must be a directory])
+        fi
+      else
+        AC_MSG_RESULT([failed])
+        AC_MSG_ERROR([The --with-]$1[-bindir value must be a directory])
+      fi
+    else
+      AC_MSG_RESULT([failed])
+      AC_MSG_ERROR([The --with-]$1[-incdir option must be specified])
+    fi
+  else
+    AC_MSG_RESULT([failed])
+    AC_MSG_ERROR([The --with-]$1[-libdir option must be specified])
+  fi
+else
+  tmppfxdir=`which $1 2>&1`
+  if test -n "$tmppfxdir" -a -d "${tmppfxdir%*$1}" -a \
+          -d "${tmppfxdir%*$1}/.." ; then
+    tmppfxdir=`cd "${tmppfxdir%*$1}/.." ; pwd`
+    CHECK_STD_PROGRAM($tmppfxdir,$4,$2,$3)
+    AC_MSG_RESULT([found in PATH at ]$tmppfxdir)
+  else
+    checkresult="yes"
+    eval checkval=\$\{"USE_"allcapsname()\}
+    CHECK_STD_PROGRAM([/usr],$4,$2,$3)
+    if test -z "${checkval}" ; then
+      CHECK_STD_PROGRAM([/usr/local],$4,$2,$3)
+      if test -z "${checkval}" ; then
+        CHECK_STD_PROGRAM([/sw],$4,$2,$3)
+        if test -z "${checkval}" ; then
+          CHECK_STD_PROGRAM([/opt],$4,$2,$3)
+          if test -z "${checkval}" ; then
+            CHECK_STD_PROGRAM([/],$4,$2,$3)
+            if test -z "${checkval}" ; then
+              checkresult="no"
+            fi
+          fi
+        fi
+      fi
+    fi
+    AC_MSG_RESULT($checkresult)
+  fi
+fi
+])

Modified: hlvm/trunk/configure
URL: http://llvm.org/viewvc/llvm-project/hlvm/trunk/configure?rev=37973&r1=37972&r2=37973&view=diff

==============================================================================
--- hlvm/trunk/configure (original)
+++ hlvm/trunk/configure Sat Jul  7 18:58:29 2007
@@ -7,6 +7,8 @@
 # Copyright (C) 2003 Free Software Foundation, Inc.
 # This configure script is free software; the Free Software Foundation
 # gives unlimited permission to copy, distribute and modify it.
+#
+
 ## --------------------- ##
 ## M4sh Initialization.  ##
 ## --------------------- ##
@@ -273,8 +275,8 @@
 PACKAGE_STRING='[HLVM] [0.1svn]'
 PACKAGE_BUGREPORT='hlvm-dev at hlvm.org'
 
-ac_unique_file=""Makefile.common.in""
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS LLVM_SRC LLVM_OBJ LIBOBJS LTLIBOBJS'
+ac_unique_file=""lib/Makefile""
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS HLVM_COPYRIGHT USE_LLC LLC LLC_BIN LLC_DIR LLC_INC LLC_LIB USE_  _BIN _DIR _INC _LIB LIBOBJS LTLIBOBJS'
 ac_subst_files=''
 
 # Initialize some variables set by options.
@@ -787,8 +789,22 @@
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
-  --with-llvmsrc          Location of LLVM Source Code
-  --with-llvmobj          Location of LLVM Object Code
+  --with-LLVM=DIR         Specify that the Low Level Virtual Machine install
+                          prefix is DIR
+  --with-LLVM-bin=DIR     Specify that the Low Level Virtual Machine binary is
+                          in DIR
+  --with-LLVM-lib=DIR     Specify that Low Level Virtual Machine libraries are
+                          in DIR
+  --with-LLVM-inc=DIR     Specify that the Low Level Virtual Machine includes
+                          are in DIR
+  --with-APR=DIR          Specify that the Apache Portable Runtime install
+                          prefix is DIR
+  --with-APR-bin=DIR      Specify that the Apache Portable Runtime binary is
+                          in DIR
+  --with-APR-lib=DIR      Specify that Apache Portable Runtime libraries are
+                          in DIR
+  --with-APR-inc=DIR      Specify that the Apache Portable Runtime includes
+                          are in DIR
 
 Report bugs to <hlvm-dev at hlvm.org>.
 _ACEOF
@@ -892,6 +908,8 @@
 Copyright (C) 2003 Free Software Foundation, Inc.
 This configure script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it.
+
+
 _ACEOF
   exit 0
 fi
@@ -1236,73 +1254,541 @@
 
 
 
+HLVM_COPYRIGHT="Copyright (c) 2006 HLVM Programmer's Group"
+
+Copyright (c) 2006 HLVM Programmer's Group)
+
+
+          ac_config_files="$ac_config_files Makefile.common"
+
+
+          ac_config_commands="$ac_config_commands Makefile"
+
+
+          ac_config_commands="$ac_config_commands lib/Makefile"
+
+
+          ac_config_commands="$ac_config_commands tools/Makefile"
+
+
+
+
+echo "$as_me:$LINENO: checking for Low Level Virtual Machine bin/lib/include locations" >&5
+echo $ECHO_N "checking for Low Level Virtual Machine bin/lib/include locations... $ECHO_C" >&6
+
+# Check whether --with-LLVM or --without-LLVM was given.
+if test "${with_LLVM+set}" = set; then
+  withval="$with_LLVM"
+  llvmpfxdir=$withval
+else
+  llvmpfxdir=nada
+fi;
+
+# Check whether --with-LLVM-bin or --without-LLVM-bin was given.
+if test "${with_LLVM_bin+set}" = set; then
+  withval="$with_LLVM_bin"
+  llvmbindir=$withval
+else
+  llvmbindir=nada
+fi;
+
+# Check whether --with-LLVM-lib or --without-LLVM-lib was given.
+if test "${with_LLVM_lib+set}" = set; then
+  withval="$with_LLVM_lib"
+  llvmlibdir=$withval
+else
+  llvmlibdir=nada
+fi;
+
+# Check whether --with-LLVM-inc or --without-LLVM-inc was given.
+if test "${with_LLVM_inc+set}" = set; then
+  withval="$with_LLVM_inc"
+  llvmincdir=$withval
+else
+  llvmincdir=nada
+fi;
+eval pfxval=\$\{llvmpfxdir\}
+eval binval=\$\{llvmbindir\}
+eval incval=\$\{llvmincdir\}
+eval libvar=\$\{llvmlibdir\}
+if test "${pfxval}" != "nada" ; then
+
+if test -n "${pfxval}" -a -d "${pfxval}" -a -n "llc" -a -d "${pfxval}/bin" -a -x "${pfxval}/bin/llc" ; then
+  USE_LLC="USE_LLC = 1"
+
+  LLC=${pfxval}/bin/llc
+
+  LLC_BIN=${pfxval}/bin
+
+  LLC_DIR=${pfxval}
+
+  if test -n "llvm/Module.h" -a -d "${pfxval}/include" -a -f "${pfxval}/include/llvm/Module.h" ; then
+    LLC_INC=${pfxval}/include
 
-LLVM_SRC_ROOT="/proj/llvm/llvm"
-LLVM_OBJ_ROOT="/proj/llvm/build"
-ac_aux_dir=
-for ac_dir in $LLVM_SRC_ROOT/autoconf $srcdir/$LLVM_SRC_ROOT/autoconf; do
-  if test -f $ac_dir/install-sh; then
-    ac_aux_dir=$ac_dir
-    ac_install_sh="$ac_aux_dir/install-sh -c"
-    break
-  elif test -f $ac_dir/install.sh; then
-    ac_aux_dir=$ac_dir
-    ac_install_sh="$ac_aux_dir/install.sh -c"
-    break
-  elif test -f $ac_dir/shtool; then
-    ac_aux_dir=$ac_dir
-    ac_install_sh="$ac_aux_dir/shtool install -c"
-    break
   fi
-done
-if test -z "$ac_aux_dir"; then
-  { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $LLVM_SRC_ROOT/autoconf $srcdir/$LLVM_SRC_ROOT/autoconf" >&5
-echo "$as_me: error: cannot find install-sh or install.sh in $LLVM_SRC_ROOT/autoconf $srcdir/$LLVM_SRC_ROOT/autoconf" >&2;}
+  if test -n "LLVMCore.o" -a -d "${pfxval}/lib" -a -f "${pfxval}/lib/LLVMCore.o" ; then
+    LLC_LIB=${pfxval}/lib
+
+  fi
+fi
+
+elif test "${binval}" != "nada" ; then
+  if test "${libval}" != "nada" ; then
+    if test "${incval}" != "nada" ; then
+      if test -d "${binval}" ; then
+        if test -d "${incval}" ; then
+          if test -d "${libval}" ; then
+            LLC=${binval}/llvm
+
+            LLC_BIN=${binval}
+
+            LLC_INC=${incval}
+
+            LLC_LIB=${libval}
+
+            USE_LLC=1
+
+            echo "$as_me:$LINENO: result: found via --with options" >&5
+echo "${ECHO_T}found via --with options" >&6
+          else
+            echo "$as_me:$LINENO: result: failed" >&5
+echo "${ECHO_T}failed" >&6
+            { { echo "$as_me:$LINENO: error: The --with-llvm-libdir value must be a directory" >&5
+echo "$as_me: error: The --with-llvm-libdir value must be a directory" >&2;}
+   { (exit 1); exit 1; }; }
+          fi
+        else
+          echo "$as_me:$LINENO: result: failed" >&5
+echo "${ECHO_T}failed" >&6
+          { { echo "$as_me:$LINENO: error: The --with-llvm-incdir value must be a directory" >&5
+echo "$as_me: error: The --with-llvm-incdir value must be a directory" >&2;}
+   { (exit 1); exit 1; }; }
+        fi
+      else
+        echo "$as_me:$LINENO: result: failed" >&5
+echo "${ECHO_T}failed" >&6
+        { { echo "$as_me:$LINENO: error: The --with-llvm-bindir value must be a directory" >&5
+echo "$as_me: error: The --with-llvm-bindir value must be a directory" >&2;}
+   { (exit 1); exit 1; }; }
+      fi
+    else
+      echo "$as_me:$LINENO: result: failed" >&5
+echo "${ECHO_T}failed" >&6
+      { { echo "$as_me:$LINENO: error: The --with-llvm-incdir option must be specified" >&5
+echo "$as_me: error: The --with-llvm-incdir option must be specified" >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+  else
+    echo "$as_me:$LINENO: result: failed" >&5
+echo "${ECHO_T}failed" >&6
+    { { echo "$as_me:$LINENO: error: The --with-llvm-libdir option must be specified" >&5
+echo "$as_me: error: The --with-llvm-libdir option must be specified" >&2;}
    { (exit 1); exit 1; }; }
+  fi
+else
+  tmppfxdir=`which llvm 2>&1`
+  if test -n "$tmppfxdir" -a -d "${tmppfxdir%*llvm}" -a \
+          -d "${tmppfxdir%*llvm}/.." ; then
+    tmppfxdir=`cd "${tmppfxdir%*llvm}/.." ; pwd`
+
+if test -n "$tmppfxdir" -a -d "$tmppfxdir" -a -n "llc" -a -d "$tmppfxdir/bin" -a -x "$tmppfxdir/bin/llc" ; then
+  USE_LLC="USE_LLC = 1"
+
+  LLC=$tmppfxdir/bin/llc
+
+  LLC_BIN=$tmppfxdir/bin
+
+  LLC_DIR=$tmppfxdir
+
+  if test -n "llvm/Module.h" -a -d "$tmppfxdir/include" -a -f "$tmppfxdir/include/llvm/Module.h" ; then
+    LLC_INC=$tmppfxdir/include
+
+  fi
+  if test -n "LLVMCore.o" -a -d "$tmppfxdir/lib" -a -f "$tmppfxdir/lib/LLVMCore.o" ; then
+    LLC_LIB=$tmppfxdir/lib
+
+  fi
+fi
+
+    echo "$as_me:$LINENO: result: found in PATH at $tmppfxdir" >&5
+echo "${ECHO_T}found in PATH at $tmppfxdir" >&6
+  else
+    checkresult="yes"
+    eval checkval=\$\{"USE_"LLC\}
+
+if test -n "/usr" -a -d "/usr" -a -n "llc" -a -d "/usr/bin" -a -x "/usr/bin/llc" ; then
+  USE_LLC="USE_LLC = 1"
+
+  LLC=/usr/bin/llc
+
+  LLC_BIN=/usr/bin
+
+  LLC_DIR=/usr
+
+  if test -n "llvm/Module.h" -a -d "/usr/include" -a -f "/usr/include/llvm/Module.h" ; then
+    LLC_INC=/usr/include
+
+  fi
+  if test -n "LLVMCore.o" -a -d "/usr/lib" -a -f "/usr/lib/LLVMCore.o" ; then
+    LLC_LIB=/usr/lib
+
+  fi
+fi
+
+    if test -z "${checkval}" ; then
+
+if test -n "/usr/local" -a -d "/usr/local" -a -n "llc" -a -d "/usr/local/bin" -a -x "/usr/local/bin/llc" ; then
+  USE_LLC="USE_LLC = 1"
+
+  LLC=/usr/local/bin/llc
+
+  LLC_BIN=/usr/local/bin
+
+  LLC_DIR=/usr/local
+
+  if test -n "llvm/Module.h" -a -d "/usr/local/include" -a -f "/usr/local/include/llvm/Module.h" ; then
+    LLC_INC=/usr/local/include
+
+  fi
+  if test -n "LLVMCore.o" -a -d "/usr/local/lib" -a -f "/usr/local/lib/LLVMCore.o" ; then
+    LLC_LIB=/usr/local/lib
+
+  fi
+fi
+
+      if test -z "${checkval}" ; then
+
+if test -n "/sw" -a -d "/sw" -a -n "llc" -a -d "/sw/bin" -a -x "/sw/bin/llc" ; then
+  USE_LLC="USE_LLC = 1"
+
+  LLC=/sw/bin/llc
+
+  LLC_BIN=/sw/bin
+
+  LLC_DIR=/sw
+
+  if test -n "llvm/Module.h" -a -d "/sw/include" -a -f "/sw/include/llvm/Module.h" ; then
+    LLC_INC=/sw/include
+
+  fi
+  if test -n "LLVMCore.o" -a -d "/sw/lib" -a -f "/sw/lib/LLVMCore.o" ; then
+    LLC_LIB=/sw/lib
+
+  fi
+fi
+
+        if test -z "${checkval}" ; then
+
+if test -n "/opt" -a -d "/opt" -a -n "llc" -a -d "/opt/bin" -a -x "/opt/bin/llc" ; then
+  USE_LLC="USE_LLC = 1"
+
+  LLC=/opt/bin/llc
+
+  LLC_BIN=/opt/bin
+
+  LLC_DIR=/opt
+
+  if test -n "llvm/Module.h" -a -d "/opt/include" -a -f "/opt/include/llvm/Module.h" ; then
+    LLC_INC=/opt/include
+
+  fi
+  if test -n "LLVMCore.o" -a -d "/opt/lib" -a -f "/opt/lib/LLVMCore.o" ; then
+    LLC_LIB=/opt/lib
+
+  fi
+fi
+
+          if test -z "${checkval}" ; then
+
+if test -n "/" -a -d "/" -a -n "llc" -a -d "//bin" -a -x "//bin/llc" ; then
+  USE_LLC="USE_LLC = 1"
+
+  LLC=//bin/llc
+
+  LLC_BIN=//bin
+
+  LLC_DIR=/
+
+  if test -n "llvm/Module.h" -a -d "//include" -a -f "//include/llvm/Module.h" ; then
+    LLC_INC=//include
+
+  fi
+  if test -n "LLVMCore.o" -a -d "//lib" -a -f "//lib/LLVMCore.o" ; then
+    LLC_LIB=//lib
+
+  fi
+fi
+
+            if test -z "${checkval}" ; then
+              checkresult="no"
+            fi
+          fi
+        fi
+      fi
+    fi
+    echo "$as_me:$LINENO: result: $checkresult" >&5
+echo "${ECHO_T}$checkresult" >&6
+  fi
 fi
-ac_config_guess="$SHELL $ac_aux_dir/config.guess"
-ac_config_sub="$SHELL $ac_aux_dir/config.sub"
-ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
 
 
+echo "$as_me:$LINENO: checking for Apache Portable Runtime bin/lib/include locations" >&5
+echo $ECHO_N "checking for Apache Portable Runtime bin/lib/include locations... $ECHO_C" >&6
 
-# Check whether --with-llvmsrc or --without-llvmsrc was given.
-if test "${with_llvmsrc+set}" = set; then
-  withval="$with_llvmsrc"
-  llvm_src="$withval"
+# Check whether --with-APR or --without-APR was given.
+if test "${with_APR+set}" = set; then
+  withval="$with_APR"
+  aprpfxdir=$withval
 else
-  llvm_src="$LLVM_SRC_ROOT"
+  aprpfxdir=nada
 fi;
-  LLVM_SRC=$llvm_src
 
+# Check whether --with-APR-bin or --without-APR-bin was given.
+if test "${with_APR_bin+set}" = set; then
+  withval="$with_APR_bin"
+  aprbindir=$withval
+else
+  aprbindir=nada
+fi;
 
-# Check whether --with-llvmobj or --without-llvmobj was given.
-if test "${with_llvmobj+set}" = set; then
-  withval="$with_llvmobj"
-  llvm_obj="$withval"
+# Check whether --with-APR-lib or --without-APR-lib was given.
+if test "${with_APR_lib+set}" = set; then
+  withval="$with_APR_lib"
+  aprlibdir=$withval
 else
-  llvm_obj="$LLVM_OBJ_ROOT"
+  aprlibdir=nada
 fi;
-  LLVM_OBJ=$llvm_obj
 
-            ac_config_commands="$ac_config_commands setup"
+# Check whether --with-APR-inc or --without-APR-inc was given.
+if test "${with_APR_inc+set}" = set; then
+  withval="$with_APR_inc"
+  aprincdir=$withval
+else
+  aprincdir=nada
+fi;
+eval pfxval=\$\{aprpfxdir\}
+eval binval=\$\{aprbindir\}
+eval incval=\$\{aprincdir\}
+eval libvar=\$\{aprlibdir\}
+if test "${pfxval}" != "nada" ; then
 
+if test -n "${pfxval}" -a -d "${pfxval}" -a -n "" -a -d "${pfxval}/bin" -a -x "${pfxval}/bin/" ; then
+  USE_="USE_ = 1"
 
+  =${pfxval}/bin/
 
+  _BIN=${pfxval}/bin
 
+  _DIR=${pfxval}
 
-          ac_config_files="$ac_config_files Makefile.common"
+  if test -n "apr-1/apr.h" -a -d "${pfxval}/include" -a -f "${pfxval}/include/apr-1/apr.h" ; then
+    _INC=${pfxval}/include
 
+  fi
+  if test -n "libapr-1.so" -a -d "${pfxval}/lib" -a -f "${pfxval}/lib/libapr-1.so" ; then
+    _LIB=${pfxval}/lib
 
-          ac_config_commands="$ac_config_commands Makefile"
+  fi
+fi
 
+elif test "${binval}" != "nada" ; then
+  if test "${libval}" != "nada" ; then
+    if test "${incval}" != "nada" ; then
+      if test -d "${binval}" ; then
+        if test -d "${incval}" ; then
+          if test -d "${libval}" ; then
+            =${binval}/apr
 
-          ac_config_commands="$ac_config_commands lib/Makefile"
+            _BIN=${binval}
 
+            _INC=${incval}
 
-          ac_config_commands="$ac_config_commands tools/Makefile"
+            _LIB=${libval}
+
+            USE_=1
+
+            echo "$as_me:$LINENO: result: found via --with options" >&5
+echo "${ECHO_T}found via --with options" >&6
+          else
+            echo "$as_me:$LINENO: result: failed" >&5
+echo "${ECHO_T}failed" >&6
+            { { echo "$as_me:$LINENO: error: The --with-apr-libdir value must be a directory" >&5
+echo "$as_me: error: The --with-apr-libdir value must be a directory" >&2;}
+   { (exit 1); exit 1; }; }
+          fi
+        else
+          echo "$as_me:$LINENO: result: failed" >&5
+echo "${ECHO_T}failed" >&6
+          { { echo "$as_me:$LINENO: error: The --with-apr-incdir value must be a directory" >&5
+echo "$as_me: error: The --with-apr-incdir value must be a directory" >&2;}
+   { (exit 1); exit 1; }; }
+        fi
+      else
+        echo "$as_me:$LINENO: result: failed" >&5
+echo "${ECHO_T}failed" >&6
+        { { echo "$as_me:$LINENO: error: The --with-apr-bindir value must be a directory" >&5
+echo "$as_me: error: The --with-apr-bindir value must be a directory" >&2;}
+   { (exit 1); exit 1; }; }
+      fi
+    else
+      echo "$as_me:$LINENO: result: failed" >&5
+echo "${ECHO_T}failed" >&6
+      { { echo "$as_me:$LINENO: error: The --with-apr-incdir option must be specified" >&5
+echo "$as_me: error: The --with-apr-incdir option must be specified" >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+  else
+    echo "$as_me:$LINENO: result: failed" >&5
+echo "${ECHO_T}failed" >&6
+    { { echo "$as_me:$LINENO: error: The --with-apr-libdir option must be specified" >&5
+echo "$as_me: error: The --with-apr-libdir option must be specified" >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+else
+  tmppfxdir=`which apr 2>&1`
+  if test -n "$tmppfxdir" -a -d "${tmppfxdir%*apr}" -a \
+          -d "${tmppfxdir%*apr}/.." ; then
+    tmppfxdir=`cd "${tmppfxdir%*apr}/.." ; pwd`
+
+if test -n "$tmppfxdir" -a -d "$tmppfxdir" -a -n "" -a -d "$tmppfxdir/bin" -a -x "$tmppfxdir/bin/" ; then
+  USE_="USE_ = 1"
+
+  =$tmppfxdir/bin/
+
+  _BIN=$tmppfxdir/bin
+
+  _DIR=$tmppfxdir
+
+  if test -n "apr-1/apr.h" -a -d "$tmppfxdir/include" -a -f "$tmppfxdir/include/apr-1/apr.h" ; then
+    _INC=$tmppfxdir/include
+
+  fi
+  if test -n "libapr-1.so" -a -d "$tmppfxdir/lib" -a -f "$tmppfxdir/lib/libapr-1.so" ; then
+    _LIB=$tmppfxdir/lib
+
+  fi
+fi
+
+    echo "$as_me:$LINENO: result: found in PATH at $tmppfxdir" >&5
+echo "${ECHO_T}found in PATH at $tmppfxdir" >&6
+  else
+    checkresult="yes"
+    eval checkval=\$\{"USE_"\}
+
+if test -n "/usr" -a -d "/usr" -a -n "" -a -d "/usr/bin" -a -x "/usr/bin/" ; then
+  USE_="USE_ = 1"
+
+  =/usr/bin/
+
+  _BIN=/usr/bin
+
+  _DIR=/usr
+
+  if test -n "apr-1/apr.h" -a -d "/usr/include" -a -f "/usr/include/apr-1/apr.h" ; then
+    _INC=/usr/include
 
+  fi
+  if test -n "libapr-1.so" -a -d "/usr/lib" -a -f "/usr/lib/libapr-1.so" ; then
+    _LIB=/usr/lib
+
+  fi
+fi
 
+    if test -z "${checkval}" ; then
+
+if test -n "/usr/local" -a -d "/usr/local" -a -n "" -a -d "/usr/local/bin" -a -x "/usr/local/bin/" ; then
+  USE_="USE_ = 1"
+
+  =/usr/local/bin/
+
+  _BIN=/usr/local/bin
+
+  _DIR=/usr/local
+
+  if test -n "apr-1/apr.h" -a -d "/usr/local/include" -a -f "/usr/local/include/apr-1/apr.h" ; then
+    _INC=/usr/local/include
+
+  fi
+  if test -n "libapr-1.so" -a -d "/usr/local/lib" -a -f "/usr/local/lib/libapr-1.so" ; then
+    _LIB=/usr/local/lib
+
+  fi
+fi
+
+      if test -z "${checkval}" ; then
+
+if test -n "/sw" -a -d "/sw" -a -n "" -a -d "/sw/bin" -a -x "/sw/bin/" ; then
+  USE_="USE_ = 1"
+
+  =/sw/bin/
+
+  _BIN=/sw/bin
+
+  _DIR=/sw
+
+  if test -n "apr-1/apr.h" -a -d "/sw/include" -a -f "/sw/include/apr-1/apr.h" ; then
+    _INC=/sw/include
+
+  fi
+  if test -n "libapr-1.so" -a -d "/sw/lib" -a -f "/sw/lib/libapr-1.so" ; then
+    _LIB=/sw/lib
+
+  fi
+fi
+
+        if test -z "${checkval}" ; then
+
+if test -n "/opt" -a -d "/opt" -a -n "" -a -d "/opt/bin" -a -x "/opt/bin/" ; then
+  USE_="USE_ = 1"
+
+  =/opt/bin/
+
+  _BIN=/opt/bin
+
+  _DIR=/opt
+
+  if test -n "apr-1/apr.h" -a -d "/opt/include" -a -f "/opt/include/apr-1/apr.h" ; then
+    _INC=/opt/include
+
+  fi
+  if test -n "libapr-1.so" -a -d "/opt/lib" -a -f "/opt/lib/libapr-1.so" ; then
+    _LIB=/opt/lib
+
+  fi
+fi
+
+          if test -z "${checkval}" ; then
+
+if test -n "/" -a -d "/" -a -n "" -a -d "//bin" -a -x "//bin/" ; then
+  USE_="USE_ = 1"
+
+  =//bin/
+
+  _BIN=//bin
+
+  _DIR=/
+
+  if test -n "apr-1/apr.h" -a -d "//include" -a -f "//include/apr-1/apr.h" ; then
+    _INC=//include
+
+  fi
+  if test -n "libapr-1.so" -a -d "//lib" -a -f "//lib/libapr-1.so" ; then
+    _LIB=//lib
+
+  fi
+fi
+
+            if test -z "${checkval}" ; then
+              checkresult="no"
+            fi
+          fi
+        fi
+      fi
+    fi
+    echo "$as_me:$LINENO: result: $checkresult" >&5
+echo "${ECHO_T}$checkresult" >&6
+  fi
+fi
 
 
 
@@ -1857,14 +2343,7 @@
 
 _ACEOF
 
-cat >>$CONFIG_STATUS <<_ACEOF
-#
-# INIT-COMMANDS section.
-#
-
-llvm_src="${LLVM_SRC}"
 
-_ACEOF
 
 
 
@@ -1874,7 +2353,6 @@
   case "$ac_config_target" in
   # Handling of arguments.
   "Makefile.common" ) CONFIG_FILES="$CONFIG_FILES Makefile.common" ;;
-  "setup" ) CONFIG_COMMANDS="$CONFIG_COMMANDS setup" ;;
   "Makefile" ) CONFIG_COMMANDS="$CONFIG_COMMANDS Makefile" ;;
   "lib/Makefile" ) CONFIG_COMMANDS="$CONFIG_COMMANDS lib/Makefile" ;;
   "tools/Makefile" ) CONFIG_COMMANDS="$CONFIG_COMMANDS tools/Makefile" ;;
@@ -1962,8 +2440,18 @@
 s, at ECHO_N@,$ECHO_N,;t t
 s, at ECHO_T@,$ECHO_T,;t t
 s, at LIBS@,$LIBS,;t t
-s, at LLVM_SRC@,$LLVM_SRC,;t t
-s, at LLVM_OBJ@,$LLVM_OBJ,;t t
+s, at HLVM_COPYRIGHT@,$HLVM_COPYRIGHT,;t t
+s, at USE_LLC@,$USE_LLC,;t t
+s, at LLC@,$LLC,;t t
+s, at LLC_BIN@,$LLC_BIN,;t t
+s, at LLC_DIR@,$LLC_DIR,;t t
+s, at LLC_INC@,$LLC_INC,;t t
+s, at LLC_LIB@,$LLC_LIB,;t t
+s, at USE_@,$USE_,;t t
+s, at _BIN@,$_BIN,;t t
+s, at _DIR@,$_DIR,;t t
+s, at _INC@,$_INC,;t t
+s, at _LIB@,$_LIB,;t t
 s, at LIBOBJS@,$LIBOBJS,;t t
 s, at LTLIBOBJS@,$LTLIBOBJS,;t t
 CEOF





More information about the llvm-commits mailing list