[llvm-commits] [support] r40397 - in /support/trunk: Makefile.common.in autoconf/AutoRegen.sh autoconf/configure.ac autoconf/m4/want_feature.m4 build-for-llvm-top.sh include/llvm/Config/config.h.in

Reid Spencer rspencer at reidspencer.com
Sun Jul 22 13:16:45 PDT 2007


Author: reid
Date: Sun Jul 22 15:16:45 2007
New Revision: 40397

URL: http://llvm.org/viewvc/llvm-project?rev=40397&view=rev
Log:
Make several improvements to autoconf support:

1. Create LLVM_WANT_FEATURE macro for easy specification of feature arguments
   in configure.ac. Make this generate both substitution variables and defines
   with a WANT_ prefix (like HAVE_ prefix but specifices a wanted featured).

2. Fix the path problems that plauged previous versions of autoconf. This
   involves using the eval command so things like "bindir" actually result
   in a path instead of something like '${exec_prefix}/bin' which is useless
   in the makefiles or header files.

3. Adjust the build script to obtain configuration options from the llvm-top
   options specified and deal with them properly.

4. Update to autoconf 2.61 support.
   

Added:
    support/trunk/autoconf/m4/want_feature.m4
Modified:
    support/trunk/Makefile.common.in
    support/trunk/autoconf/AutoRegen.sh
    support/trunk/autoconf/configure.ac
    support/trunk/build-for-llvm-top.sh
    support/trunk/include/llvm/Config/config.h.in

Modified: support/trunk/Makefile.common.in
URL: http://llvm.org/viewvc/llvm-project/support/trunk/Makefile.common.in?rev=40397&r1=40396&r2=40397&view=diff

==============================================================================
--- support/trunk/Makefile.common.in (original)
+++ support/trunk/Makefile.common.in Sun Jul 22 15:16:45 2007
@@ -38,12 +38,21 @@
 # tablegen call if we're cross-compiling).
 BUILD_EXEEXT=@BUILD_EXEEXT@
 
+# Shared library extension for host platform.
+SHLIBEXT = @SHLIBEXT@
+
+# Executable file extension for host platform.
+EXEEXT = @EXEEXT@
+
 # Target triple (cpu-vendor-os) for which we should generate code
 TARGET_TRIPLE=@target@
 
 # Targets that we should build
 TARGETS_TO_BUILD=@TARGETS_TO_BUILD@
 
+# Enable JIT for this platform
+TARGET_HAS_JIT = @TARGET_HAS_JIT@
+
 # Extra options to compile LLVM with
 EXTRA_OPTIONS=@EXTRA_OPTIONS@
 
@@ -103,55 +112,81 @@
 
 LIBS       := @LIBS@
 
-# These are options that can either be enabled here, or can be enabled on the
-# make command line (ie, make ENABLE_PROFILING=1):
+##############################################################################
+# INSTALATION PATHS
+#
+# The following variables capture the installation paths set by the user or
+# defaulted by autoconf. This allows fine-grained control over what gets 
+# installed where
+DESTDIR := @DESTDIR@
+PREFIX := @prefix@
+BIN_DIR := @bindir@
+SBIN_DIR := @bindir@
+LIBEXEC_DIR := @libexecdir@
+SYSCONF_DIR := @sysconfdir@
+SHAREDSTATE_DIR := @sharedstatedir@
+LOCALSTATE_DIR := @localstatedir@
+LIB_DIR := @libdir@
+INCLUDE_DIR := @includedir@
+DATAROOT_DIR := @datarootdir@
+DATA_DIR := @datadir@
+INFO_DIR := @infodir@
+LOCALE_DIR := @localedir@
+MAN_DIR := @mandir@
+DOC_DIR := @docdir@
+HTML_DIR := @htmldir@
+DVI_DIR := @dvidir@
+PDF_DIR := @pdfdir@
+PS_DIR := @psdir@
+
+##############################################################################
+# FEATURES
+# 
+# The following macro definitions adjusts various options on build parameters
+# that affect the build output. You can specify them as part of the configure
+# options (--enable-FEATURE or --disable-FEATURE) or on the command line. Each
+# of them requires either a 0 or 1 value.
+
+# When WANT_ASSERTIONS is enabled, builds of all of the LLVM code will 
+# exclude assertion checks, otherwise they are included.
+WANT_ASSERTIONS := @WANT_ASSERTIONS@
+
+# When WANT_CHECkING is enabled, this turns on expensive runtime checking such as
+# GXXLIB_DEBUG, malloc debug, etc.
+WANT_CHECKING := @WANT_CHECKING@
+
+# When WANT_DEBUG is enabled, the compiler generates debug symbols in object code
+# and optional code is enabled.
+WANT_DEBUG := @WANT_DEBUG@
+
+# When ENABLE_DOXYGEN is enabled, the doxygen documentation will be built
+WANT_DOXYGEN = @WANT_DOXYGEN@
 
-# When ENABLE_OPTIMIZED is enabled, LLVM code is optimized and output is put
+# When WANT_OPTIMIZED is enabled, LLVM code is optimized and output is put
 # into the "Release" directories. Otherwise, LLVM code is not optimized and 
 # output is put in the "Debug" directories.
-#ENABLE_OPTIMIZED = 1
- at ENABLE_OPTIMIZED@
-
-# When DISABLE_ASSERTIONS is enabled, builds of all of the LLVM code will 
-# exclude assertion checks, otherwise they are included.
-#DISABLE_ASSERTIONS = 1
- at DISABLE_ASSERTIONS@
+WANT_OPTIMIZED := @WANT_OPTIMIZED@
 
-# When ENABLE_EXPENSIVE_CHECKS is enabled, builds of all of the LLVM
-# code will include expensive checks, otherwise they are excluded.
-#ENABLE_EXPENSIVE_CHECKS = 0
- at ENABLE_EXPENSIVE_CHECKS@
-
-# When DEBUG_RUNTIME is enabled, the runtime libraries will retain debug
-# symbols.
-#DEBUG_RUNTIME = 1
- at DEBUG_RUNTIME@
+# When WANT_OPT_FOR_SIZE is enabled, the optimizations performed will favor
+# optimizing for code and data size rather than for speed.
+WANT_OPT_FOR_SIZE := @WANT_OPT_FOR_SIZE@
 
 # When ENABLE_PROFILING is enabled, the llvm source base is built with profile
 # information to allow gprof to be used to get execution frequencies.
-#ENABLE_PROFILING = 1
+WANT_PROFILING = @WANT_PROFILING@
 
-# When ENABLE_DOXYGEN is enabled, the doxygen documentation will be built
-ENABLE_DOXYGEN = @ENABLE_DOXYGEN@
+# When WANT_STRIPPED is enabled, executables and libraries will be
+# stripped of debug symbols
+WANT_STRIPPED := @WANT_STRIPPED@
 
-# Do we want to enable threads?
-ENABLE_THREADS := @ENABLE_THREADS@
-
-# Do we want to build with position independent code?
-ENABLE_PIC := @ENABLE_PIC@
+# When WANT_THREADS is enabled, thread libraries will be found and included
+WANT_THREADS := @WANT_THREADS@
 
 # This option tells the Makefiles to produce verbose output.
 # It essentially prints the commands that make is executing
-#VERBOSE = 1
+WANT_VERBOSE := @WANT_VERBOSE@
 
-# Enable JIT for this platform
-TARGET_HAS_JIT = @TARGET_HAS_JIT@
-
-# Shared library extension for host platform.
-SHLIBEXT = @SHLIBEXT@
-
-# Executable file extension for host platform.
-EXEEXT = @EXEEXT@
+################################################################################
 
 # Things we just assume are "there"
 ECHO := echo

Modified: support/trunk/autoconf/AutoRegen.sh
URL: http://llvm.org/viewvc/llvm-project/support/trunk/autoconf/AutoRegen.sh?rev=40397&r1=40396&r2=40397&view=diff

==============================================================================
--- support/trunk/autoconf/AutoRegen.sh (original)
+++ support/trunk/autoconf/AutoRegen.sh Sun Jul 22 15:16:45 2007
@@ -7,7 +7,7 @@
 ### NOTE: ############################################################"
 ### The below two variables specify the auto* versions
 ### periods should be escaped with backslash, for use by grep
-want_autoconf_version='2\.60'
+want_autoconf_version='2\.61'
 want_autoheader_version=$want_autoconf_version
 ### END NOTE #########################################################"
 

Modified: support/trunk/autoconf/configure.ac
URL: http://llvm.org/viewvc/llvm-project/support/trunk/autoconf/configure.ac?rev=40397&r1=40396&r2=40397&view=diff

==============================================================================
--- support/trunk/autoconf/configure.ac (original)
+++ support/trunk/autoconf/configure.ac Sun Jul 22 15:16:45 2007
@@ -33,7 +33,7 @@
 dnl===-----------------------------------------------------------------------===
 dnl Initialize autoconf and define the package name, version number and
 dnl email address for reporting bugs.
-AC_INIT([[Support Module]],[[2.1svn]],[http://llvm.org/bugs],[support])
+AC_INIT([[LLVM Support Module]],[[2.1svn]],[http://llvm.org/bugs],[llvm-support])
 THIS_IS_LLVM_MODULE([support])
 
 dnl Verify that the source directory is valid. This makes sure that we are
@@ -205,12 +205,12 @@
 dnl debug with assertions turned on. Without, we assume a source release and we
 dnl get an optimized build without assertions. See --enable-optimized and
 dnl --enable-assertions below
-if test -d "CVS" -o -d "${srcdir}/CVS" -o -d ".svn" -o -d "${srcdir}/.svn"; then
-  cvsbuild="yes"
+if test -d ".svn" -o -d "${srcdir}/.svn" -o -d "CVS" -o -d "${srcdir}/CVS"; then
+  svnbuild="yes"
   optimize="no"
-  AC_SUBST(CVSBUILD,[[CVSBUILD=1]])
+  AC_SUBST(SVNBUILD,[[SVNBUILD=1]])
 else
-  cvsbuild="no"
+  svnbuild="no"
   optimize="yes"
 fi
 
@@ -220,7 +220,20 @@
 dnl===
 dnl===-----------------------------------------------------------------------===
 
-LLVM_TOP=`cd .. ; pwd`
+dnl Define the standard LLVM compilation features
+LLVM_WANT_FEATURE(assertions,[Compile with assertion checks enabled],yes)
+LLVM_WANT_FEATURE(debug,[Produce debug symbols in compilation objects],yes)
+LLVM_WANT_FEATURE(doxygen,[Build doxygen documentation],no)
+LLVM_WANT_FEATURE(checking,[Compile with expensive checking enabled],no)
+LLVM_WANT_FEATURE(optimized,[Compile with optimizations enabled],no)
+LLVM_WANT_FEATURE(opt-for-size,[Optimize for executable size not speed],no)
+LLVM_WANT_FEATURE(profiling,[Compile with profiling enabled],yes)
+LLVM_WANT_FEATURE(generate-pic,[Generate position independent code],no)
+LLVM_WANT_FEATURE(stripped,[Strip symbols from libraries and executables],no)
+LLVM_WANT_FEATURE(threads,[Use threads if available],yes)
+LLVM_WANT_FEATURE(tool-verbose,[Make the tools generate verbose output],no)
+LLVM_WANT_FEATURE(verbose,[Show each command executed while building],no)
+
 dnl Allow configuration of the llvm-top directory from which all llvm software
 dnl can be found. Usually this corresponds to .., but weird things can happen
 dnl in build environments
@@ -228,87 +241,34 @@
   AS_HELP_STRING([--with-llvm-top],
                  [Specify where the llvm-top directory is]),,withval=default)
 case "$withval" in
-  default)  ;;
-  *) LLVM_TOP=$withval ;;
+  default)  LLVM_TOP=`cd .. ; pwd` ;; 
+  *)        LLVM_TOP=$withval ;;
 esac
 AC_SUBST(LLVM_TOP,$LLVM_TOP)
 
-dnl --enable-optimized : check whether they want to do an optimized build:
-AC_ARG_ENABLE(optimized, AS_HELP_STRING(
- [--enable-optimized,Compile with optimizations enabled (default is NO)]),,enableval=$optimize)
-if test ${enableval} = "no" ; then
-  AC_SUBST(ENABLE_OPTIMIZED,[[]])
-else
-  AC_SUBST(ENABLE_OPTIMIZED,[[ENABLE_OPTIMIZED=1]])
-fi
-
-dnl --enable-assertions : check whether they want to turn on assertions or not:
-AC_ARG_ENABLE(assertions,AS_HELP_STRING(
-  [--enable-assertions,Compile with assertion checks enabled (default is YES)]),, enableval="yes")
-if test ${enableval} = "yes" ; then
-  AC_SUBST(DISABLE_ASSERTIONS,[[]])
-else
-  AC_SUBST(DISABLE_ASSERTIONS,[[DISABLE_ASSERTIONS=1]])
-fi
-
-dnl --enable-expensive-checks : check whether they want to turn on expensive debug checks:
-AC_ARG_ENABLE(expensive-checks,AS_HELP_STRING(
-  [--enable-expensive-checks,Compile with expensive debug checks enabled (default is NO)]),, enableval="no")
-if test ${enableval} = "yes" ; then
-  AC_SUBST(ENABLE_EXPENSIVE_CHECKS,[[ENABLE_EXPENSIVE_CHECKS=1]])
-  AC_SUBST(EXPENSIVE_CHECKS,[[yes]])
-else
-  AC_SUBST(ENABLE_EXPENSIVE_CHECKS,[[]])
-  AC_SUBST(EXPENSIVE_CHECKS,[[no]])
-fi
-
-dnl --enable-debug-runtime : should runtime libraries have debug symbols?
-AC_ARG_ENABLE(debug-runtime,
-   AS_HELP_STRING([--enable-debug-runtime,Build runtime libs with debug symbols (default is NO)]),,enableval=no)
-if test ${enableval} = "no" ; then
-  AC_SUBST(DEBUG_RUNTIME,[[]])
-else
-  AC_SUBST(DEBUG_RUNTIME,[[DEBUG_RUNTIME=1]])
-fi
-
-dnl Allow enablement of doxygen generated documentation
-AC_ARG_ENABLE(doxygen,
-              AS_HELP_STRING([--enable-doxygen],
-                             [Build doxygen documentation (default is NO)]),,
-                             enableval=default)
-case "$enableval" in
-  yes) AC_SUBST(ENABLE_DOXYGEN,[1]) ;;
-  no)  AC_SUBST(ENABLE_DOXYGEN,[0]) ;;
-  default) AC_SUBST(ENABLE_DOXYGEN,[0]) ;;
-  *) AC_MSG_ERROR([Invalid setting for --enable-doxygen. Use "yes" or "no"]) ;;
-esac
-
-dnl Allow disablement of threads
-AC_ARG_ENABLE(threads,
-              AS_HELP_STRING([--enable-threads],
-                             [Use threads if available (default is YES)]),,
-                             enableval=default)
-case "$enableval" in
-  yes) AC_SUBST(ENABLE_THREADS,[1]) ;;
-  no)  AC_SUBST(ENABLE_THREADS,[0]) ;;
-  default) AC_SUBST(ENABLE_THREADS,[1]) ;;
-  *) AC_MSG_ERROR([Invalid setting for --enable-threads. Use "yes" or "no"]) ;;
+dnl Allow specification of the destination directory which is a meta-prefix for
+dnl the installation. It allows package maintainers for operating systems to
+dnl build an operating system image in a destination directory that uses the
+dnl final paths, without damaging their own installation.
+AC_ARG_WITH([destdir],
+  AS_HELP_STRING([--with-destdir],
+                 [Specify the install destination directory]),,withval=default)
+case "$withval" in
+  default)  DESTDIR="" ;;
+  *)        DESTDIR=$withval ;;
 esac
-AC_DEFINE_UNQUOTED([ENABLE_THREADS],$ENABLE_THREADS,[Define if threads enabled])
+AC_SUBST(DESTDIR,$DESTDIR)
 
-dnl Allow building with position independent code
-AC_ARG_ENABLE(pic,
-  AS_HELP_STRING([--enable-pic],
-                 [Build LLVM with Position Independent Code (default is NO)]),,
-                 enableval=default)
-case "$enableval" in
-  yes) AC_SUBST(ENABLE_PIC,[1]) ;;
-  no)  AC_SUBST(ENABLE_PIC,[0]) ;;
-  default) AC_SUBST(ENABLE_PIC,[0]) ;;
-  *) AC_MSG_ERROR([Invalid setting for --enable-pic. Use "yes" or "no"]) ;;
+dnl Specify extra build options
+AC_ARG_WITH(extra-options,
+  AS_HELP_STRING([--with-extra-options],
+                 [Specify addtional options to compile LLVM with]),,
+                 withval=default)
+case "$withval" in
+  default) EXTRA_OPTIONS="" ;;
+  *) EXTRA_OPTIONS=$withval ;;
 esac
-AC_DEFINE_UNQUOTED([ENABLE_PIC],$ENABLE_PIC,
-                   [Define if position independent code is enabled])
+AC_SUBST(EXTRA_OPTIONS,$EXTRA_OPTIONS)
 
 dnl Allow specific targets to be specified for building (or not)
 TARGETS_TO_BUILD=""
@@ -316,7 +276,7 @@
     [Build specific host targets: all,host-only,{target-name} (default=all)]),,
     enableval=all)
 case "$enableval" in
-  all) TARGETS_TO_BUILD="X86 Sparc PowerPC Alpha IA64 ARM" ;;
+  all) TARGETS_TO_BUILD="X86 Sparc PowerPC Alpha IA64 ARM MIPS" ;;
   host-only)
     case "$llvm_cv_target_arch" in
       x86)     TARGETS_TO_BUILD="X86" ;;
@@ -348,51 +308,53 @@
 TARGETS_TO_BUILD="CBackend MSIL $TARGETS_TO_BUILD"
 AC_SUBST(TARGETS_TO_BUILD,$TARGETS_TO_BUILD)
 
-dnl Specify extra build options
-AC_ARG_WITH(extra-options,
-  AS_HELP_STRING([--with-extra-options],
-                 [Specify addtional options to compile LLVM with]),,
-                 withval=default)
-case "$withval" in
-  default) EXTRA_OPTIONS= ;;
-  *) EXTRA_OPTIONS=$withval ;;
-esac
-AC_SUBST(EXTRA_OPTIONS,$EXTRA_OPTIONS)
-
 dnl===-----------------------------------------------------------------------===
 dnl===
 dnl=== SECTION 4: Check for programs we need and that they are the right version
 dnl===
 dnl===-----------------------------------------------------------------------===
 
-dnl Check for compilation tools
+dnl Check for standard compilation tools
+AC_PROG_INSTALL
 AC_PROG_CPP
 AC_PROG_CC(gcc)
 AC_PROG_CXX(g++)
 AC_PROG_FLEX
 AC_PROG_BISON
-
+AC_PROG_RANLIB
 AC_PROG_NM
+AC_PROG_LN_S
 AC_SUBST(NM)
 
-dnl Check for the tools that the makefiles require
+dnl Check for various build and documentation tools that could be used
 AC_CHECK_GNU_MAKE
-AC_PROG_LN_S
+AC_PATH_PROG(BINPWD,[pwd],  [pwd])
+AC_PATH_PROG(BZIP2,[bzip2],[echo "Skipped: bzip2 not found"])
 AC_PATH_PROG(CMP, [cmp], [cmp])
 AC_PATH_PROG(CP, [cp], [cp])
+AC_PATH_PROG(DOXYGEN,[doxygen],[echo "Skipped: doxygen not found"])
 AC_PATH_PROG(DATE, [date], [date])
+AC_PATH_PROG(DOT, [dot], [echo dot])
+AC_PATH_PROG(DOTTY, [dotty], [echo dotty])
 AC_PATH_PROG(FIND, [find], [find])
 AC_PATH_PROG(GREP, [grep], [grep])
+AC_PATH_PROG(GRAPHVIZ, [Graphviz], [echo Graphviz])
+AC_PATH_PROG(GROFF,[groff],[echo "Skipped: groff not found"])
+AC_PATH_PROG(GV, [gv gsview32], [echo gv])
+AC_PATH_PROG(GZIP,[gzip],[echo "Skipped: gzip not found"])
 AC_PATH_PROG(MKDIR,[mkdir],[mkdir])
 AC_PATH_PROG(MV,   [mv],   [mv])
-AC_PROG_RANLIB
+AC_PATH_PROG(POD2HTML,[pod2html],[echo "Skipped: pod2html not found"])
+AC_PATH_PROG(POD2MAN,[pod2man],[echo "Skipped: pod2man not found"])
 AC_PATH_PROG(RM,   [rm],   [rm])
+AC_PATH_PROG(RUNTEST,[runtest],[echo "Skipped: runtest not found"])
 AC_PATH_PROG(SED,  [sed],  [sed])
 AC_PATH_PROG(TAR,  [tar],  [gtar])
-AC_PATH_PROG(BINPWD,[pwd],  [pwd])
+AC_PATH_PROG(ZIP,[zip],[echo "Skipped: zip not found"])
+DJ_AC_PATH_TCLSH
 
-dnl Looking for misc. graph plotting software
-AC_PATH_PROG(GRAPHVIZ, [Graphviz], [echo Graphviz])
+dnl Adjust program paths for specific platforms so they can be used directly
+dnl inside the program from config.h
 if test "$GRAPHVIZ" != "echo Graphviz" ; then
   AC_DEFINE([HAVE_GRAPHVIZ],[1],[Define if the Graphviz program is available])
   dnl If we're targeting for mingw we should emit windows paths, not msys
@@ -400,9 +362,8 @@
     GRAPHVIZ=`echo $GRAPHVIZ | sed 's/^\/\([[A-Za-z]]\)\//\1:\//' `
   fi
   AC_DEFINE_UNQUOTED([LLVM_PATH_GRAPHVIZ],"$GRAPHVIZ${EXEEXT}",
-   [Define to path to Graphviz program if found or 'echo Graphviz' otherwise])
+   [Define path to Graphviz program if found or 'echo Graphviz' otherwise])
 fi
-AC_PATH_PROG(DOT, [dot], [echo dot])
 if test "$DOT" != "echo dot" ; then
   AC_DEFINE([HAVE_DOT],[1],[Define if the dot program is available])
   dnl If we're targeting for mingw we should emit windows paths, not msys
@@ -410,9 +371,8 @@
     DOT=`echo $DOT | sed 's/^\/\([[A-Za-z]]\)\//\1:\//' `
   fi
   AC_DEFINE_UNQUOTED([LLVM_PATH_DOT],"$DOT${EXEEXT}",
-   [Define to path to dot program if found or 'echo dot' otherwise])
+   [Define path to dot program if found or 'echo dot' otherwise])
 fi
-AC_PATH_PROGS(GV, [gv gsview32], [echo gv])
 if test "$GV" != "echo gv" ; then
   AC_DEFINE([HAVE_GV],[1],[Define if the gv program is available])
   dnl If we're targeting for mingw we should emit windows paths, not msys
@@ -420,9 +380,8 @@
     GV=`echo $GV | sed 's/^\/\([[A-Za-z]]\)\//\1:\//' `
   fi
   AC_DEFINE_UNQUOTED([LLVM_PATH_GV],"$GV${EXEEXT}",
-   [Define to path to gv program if found or 'echo gv' otherwise])
+   [Define path to gv program if found or 'echo gv' otherwise])
 fi
-AC_PATH_PROG(DOTTY, [dotty], [echo dotty])
 if test "$DOTTY" != "echo dotty" ; then
   AC_DEFINE([HAVE_DOTTY],[1],[Define if the dotty program is available])
   dnl If we're targeting for mingw we should emit windows paths, not msys
@@ -443,22 +402,10 @@
    AC_SUBST(HAVE_PERL,1)
 fi
 
-dnl Find the install program
-AC_PROG_INSTALL
-
 dnl Checks for documentation and testing tools that we can do without. If these
 dnl are not found then they are set to "true" which always succeeds but does
 dnl nothing. This just lets the build output show that we could have done 
 dnl something if the tool was available. 
-AC_PATH_PROG(BZIP2,[bzip2],[echo "Skipped: bzip2 not found"])
-AC_PATH_PROG(DOXYGEN,[doxygen],[echo "Skipped: doxygen not found"])
-AC_PATH_PROG(GROFF,[groff],[echo "Skipped: groff not found"])
-AC_PATH_PROG(GZIP,[gzip],[echo "Skipped: gzip not found"])
-AC_PATH_PROG(POD2HTML,[pod2html],[echo "Skipped: pod2html not found"])
-AC_PATH_PROG(POD2MAN,[pod2man],[echo "Skipped: pod2man not found"])
-AC_PATH_PROG(RUNTEST,[runtest],[echo "Skipped: runtest not found"])
-DJ_AC_PATH_TCLSH
-AC_PATH_PROG(ZIP,[zip],[echo "Skipped: zip not found"])
 
 dnl Determine if the linker supports the -R option.
 AC_LINK_USE_R
@@ -575,7 +522,7 @@
 
 dnl pthread locking functions are optional - but llvm will not be thread-safe
 dnl without locks.
-if test "$ENABLE_THREADS" -eq 1 ; then
+if test "$WANT_THREADS" -eq 1 ; then
   AC_CHECK_LIB(pthread,pthread_mutex_init)
   AC_SEARCH_LIBS(pthread_mutex_lock,pthread,
                  AC_DEFINE([HAVE_PTHREAD_MUTEX_LOCK],[1],
@@ -622,12 +569,10 @@
 AC_CHECK_HEADERS([malloc.h setjmp.h signal.h stdint.h unistd.h utime.h])
 AC_CHECK_HEADERS([windows.h sys/mman.h sys/param.h sys/resource.h sys/time.h])
 AC_CHECK_HEADERS([sys/types.h malloc/malloc.h mach/mach.h])
-if test "$ENABLE_THREADS" -eq 1 ; then
-  AC_CHECK_HEADER(pthread.h,
-                  AC_SUBST(HAVE_PTHREAD, 1),
-		   AC_SUBST(HAVE_PTHREAD, 0))
+if test "$WANT_THREADS" -eq 1 ; then
+  AC_CHECK_HEADERS([pthread.h])
 else
-  AC_SUBST(HAVE_PTHREAD, 0)
+  AC_SUBST(HAVE_PTHREAD_,0)
 fi
 
 dnl===-----------------------------------------------------------------------===
@@ -701,53 +646,42 @@
 dnl the Makefiles so we can use it there too
 AC_SUBST(SHLIBEXT,$libltdl_cv_shlibext)
 
-# Translate the various configuration directories and other basic
-# information into substitutions that will end up in Makefile.config.in 
-# that these configured values can be used by the makefiles
+dnl Get the time at which we were configured.
+LLVM_CONFIGTIME=`date`
+AC_SUBST(LLVM_CONFIGTIME)
+AC_DEFINE_UNQUOTED([LLVM_CONFIGTIME],["$LLVM_CONFIGTIME"],
+                   [Time at which LLVM was configured])
+
+# Make sure we have a prefix and exec_prefix value that makes sense.
 if test "${prefix}" = "NONE" ; then
   prefix="/usr/local"
 fi
-eval LLVM_PREFIX="${prefix}";
-eval LLVM_BINDIR="${prefix}/bin";
-eval LLVM_LIBDIR="${prefix}/lib";
-eval LLVM_DATADIR="${prefix}/share/llvm";
-eval LLVM_DOCSDIR="${prefix}/docs/llvm";
-eval LLVM_ETCDIR="${prefix}/etc/llvm";
-eval LLVM_INCLUDEDIR="${prefix}/include";
-eval LLVM_INFODIR="${prefix}/info";
-eval LLVM_MANDIR="${prefix}/man";
-AC_SUBST(LLVM_PREFIX)
-AC_SUBST(LLVM_BINDIR)
-AC_SUBST(LLVM_LIBDIR)
-AC_SUBST(LLVM_DATADIR)
-AC_SUBST(LLVM_DOCSDIR)
-AC_SUBST(LLVM_ETCDIR)
-AC_SUBST(LLVM_INCLUDEDIR)
-AC_SUBST(LLVM_INFODIR)
-AC_SUBST(LLVM_MANDIR)
-
-# Place the various directores into the config.h file as #defines so that we
-# can know about the installation paths within LLVM.
-AC_DEFINE_UNQUOTED(LLVM_PREFIX,"$LLVM_PREFIX", 
-                   [Installation prefix directory])
-AC_DEFINE_UNQUOTED(LLVM_BINDIR, "$LLVM_BINDIR", 
-                   [Installation directory for binary executables])
-AC_DEFINE_UNQUOTED(LLVM_LIBDIR, "$LLVM_LIBDIR", 
-                   [Installation directory for libraries])
-AC_DEFINE_UNQUOTED(LLVM_DATADIR, "$LLVM_DATADIR", 
-                   [Installation directory for data files])
-AC_DEFINE_UNQUOTED(LLVM_DATADIR, "$LLVM_DOCSDIR", 
-                   [Installation directory for documentation])
-AC_DEFINE_UNQUOTED(LLVM_ETCDIR, "$LLVM_ETCDIR", 
-                   [Installation directory for config files])
-AC_DEFINE_UNQUOTED(LLVM_INCLUDEDIR, "$LLVM_INCLUDEDIR", 
-                   [Installation directory for include files])
-AC_DEFINE_UNQUOTED(LLVM_INFODIR, "$LLVM_INFODIR", 
-                   [Installation directory for .info files])
-AC_DEFINE_UNQUOTED(LLVM_MANDIR, "$LLVM_MANDIR", 
-                   [Installation directory for man pages])
-AC_DEFINE_UNQUOTED(LLVM_CONFIGTIME, "$LLVM_CONFIGTIME", 
-                   [Time at which LLVM was configured])
+if test "${exec_prefix}" = "NONE" ; then
+  exec_prefix="$prefix"
+fi
+
+dnl make sure we resolve shell variables for paths because silly autoconf 
+dnl doesn't get this right.
+eval bindir="$bindir"
+eval sbindir="$sbindir"
+eval libexecdir="$libexecdir"
+eval sysconfdir="$sysconfdir"
+eval sharedstatedir="$sharedstatedir"
+eval localstatedir="$localstatedir"
+eval libdir="$libdir"
+eval includedir="$includedir"
+eval oldincludedir="$oldincludedir"
+eval datarootdir="$datarootdir"
+eval datadir="$datadir"
+eval infodir="$infodir"
+eval localedir="$localedir"
+eval mandir="$mandir"
+eval docdir="$docdir"
+eval htmldir="$htmldir"
+eval dvidir="$dvidir"
+eval pdfdir="$pdfdir"
+eval psdir="$psdir"
+
 
 dnl===-----------------------------------------------------------------------===
 dnl===
@@ -772,4 +706,3 @@
 
 dnl Finally, crank out the output
 AC_OUTPUT
-

Added: support/trunk/autoconf/m4/want_feature.m4
URL: http://llvm.org/viewvc/llvm-project/support/trunk/autoconf/m4/want_feature.m4?rev=40397&view=auto

==============================================================================
--- support/trunk/autoconf/m4/want_feature.m4 (added)
+++ support/trunk/autoconf/m4/want_feature.m4 Sun Jul 22 15:16:45 2007
@@ -0,0 +1,24 @@
+dnl Make it easier to use the AC_ARG_ENABLE macro for certain boolean switches
+dnl that turn features on and off.  The arguments are:
+dnl   1 - feature name
+dnl   2 - feature description
+dnl   3 - default value
+AC_DEFUN([LLVM_WANT_FEATURE],[
+  m4_define([allcapsname],translit($1,a-z-,A-Z_))
+  AC_ARG_ENABLE([$1],
+    AS_HELP_STRING([--enable-$1],[$2 ($3)]),,enableval="$3")
+  case "$enableval" in
+    yes)     enableval="1" ;;
+    no)      enableval="0" ;;
+    on)      enableval="1" ;;
+    off)     enableval="0" ;;
+    in)      enableval="1" ;;
+    out)     enableval="0" ;;
+    default) enableval="$3" ;;
+    *) AC_MSG_ERROR([Invalid setting for --enable-$1. Use "yes" or "no"]) ;;
+  esac
+  AC_SUBST([WANT_]allcapsname(),$enableval)
+  want_var=[WANT_]allcapsname()
+  AC_DEFINE_UNQUOTED($want_var,$enableval,[$2])
+])
+

Modified: support/trunk/build-for-llvm-top.sh
URL: http://llvm.org/viewvc/llvm-project/support/trunk/build-for-llvm-top.sh?rev=40397&r1=40396&r2=40397&view=diff

==============================================================================
--- support/trunk/build-for-llvm-top.sh (original)
+++ support/trunk/build-for-llvm-top.sh Sun Jul 22 15:16:45 2007
@@ -3,19 +3,47 @@
 # This includes the Bourne shell library from llvm-top. Since this file is
 # generally only used when building from llvm-top, it is safe to assume that
 # llvm is checked out into llvm-top in which case .. just works.
-. ../library.sh
+if test -z "$LLVM_TOP" ; then
+  . ../library.sh
+else
+  . "$LLVM_TOP/library.sh"
+fi
 
 # Call the library function to process the arguments
 process_arguments "$@"
 
+function add_config_option() {
+  local name="$1"
+  lc=`echo ${name} | tr 'A-Z_' 'a-z-'`
+  if test -z "${!name}" -o "${!name}" -eq 0 ; then
+    config_options="$config_options --disable-$lc"
+  else
+    config_options="$config_options --enable-$lc"
+  fi
+}
+
 # See if we have previously been configured by sensing the presense
 # of the config.status scripts
 if test ! -x "config.status" ; then
-  # We must configure so build a list of configure options
-  config_options="--prefix=$PREFIX --with-llvm-top=$LLVM_TOP "
+  # We must configure, so build a list of configure options
+  config_options="--config-cache --prefix=$PREFIX --with-llvm-top=$LLVM_TOP"
+  config_options="$config_options --with-destdir='$DESTDIR'"
   config_options="$config_options $OPTIONS_DASH_DASH"
+  add_config_option ASSERTIONS 
+  add_config_option CHECKING
+  add_config_option DEBUG 
+  add_config_option DOXYGEN
+  add_config_option OPTIMIZED
+  add_config_option OPT_FOR_SIZE
+  add_config_option PROFILING
+  add_config_option STRIPPED
+  add_config_option THREADS
+  add_config_option VERBOSE
   msg 0 Configuring $module with:
   msg 0 "  ./configure" $config_options
+  if test "$VERBOSE" -eq 0 ; then
+    config_options="$config_options --quiet"
+  fi
   ./configure $config_options || (echo "Can't configure llvm" ; exit 1)
 fi
 

Modified: support/trunk/include/llvm/Config/config.h.in
URL: http://llvm.org/viewvc/llvm-project/support/trunk/include/llvm/Config/config.h.in?rev=40397&r1=40396&r2=40397&view=diff

==============================================================================
--- support/trunk/include/llvm/Config/config.h.in (original)
+++ support/trunk/include/llvm/Config/config.h.in Sun Jul 22 15:16:45 2007
@@ -11,12 +11,6 @@
 /* Define to 1 if using `alloca.c'. */
 #undef C_ALLOCA
 
-/* Define if position independent code is enabled */
-#undef ENABLE_PIC
-
-/* Define if threads enabled */
-#undef ENABLE_THREADS
-
 /* Define to 1 if you have `alloca', as a function or macro. */
 #undef HAVE_ALLOCA
 
@@ -279,6 +273,9 @@
 /* Define to have the %a format string */
 #undef HAVE_PRINTF_A
 
+/* Define to 1 if you have the <pthread.h> header file. */
+#undef HAVE_PTHREAD_H
+
 /* Have pthread_mutex_lock */
 #undef HAVE_PTHREAD_MUTEX_LOCK
 
@@ -434,51 +431,27 @@
 /* Define to 1 if you have the <windows.h> header file. */
 #undef HAVE_WINDOWS_H
 
-/* Installation directory for binary executables */
-#undef LLVM_BINDIR
-
 /* Time at which LLVM was configured */
 #undef LLVM_CONFIGTIME
 
-/* Installation directory for documentation */
-#undef LLVM_DATADIR
-
-/* Installation directory for config files */
-#undef LLVM_ETCDIR
-
-/* Installation directory for include files */
-#undef LLVM_INCLUDEDIR
-
-/* Installation directory for .info files */
-#undef LLVM_INFODIR
-
-/* Installation directory for libraries */
-#undef LLVM_LIBDIR
-
-/* Installation directory for man pages */
-#undef LLVM_MANDIR
-
 /* Define if this is Unixish platform */
 #undef LLVM_ON_UNIX
 
 /* Define if this is Win32ish platform */
 #undef LLVM_ON_WIN32
 
-/* Define to path to dot program if found or 'echo dot' otherwise */
+/* Define path to dot program if found or 'echo dot' otherwise */
 #undef LLVM_PATH_DOT
 
 /* Define to path to dotty program if found or 'echo dotty' otherwise */
 #undef LLVM_PATH_DOTTY
 
-/* Define to path to Graphviz program if found or 'echo Graphviz' otherwise */
+/* Define path to Graphviz program if found or 'echo Graphviz' otherwise */
 #undef LLVM_PATH_GRAPHVIZ
 
-/* Define to path to gv program if found or 'echo gv' otherwise */
+/* Define path to gv program if found or 'echo gv' otherwise */
 #undef LLVM_PATH_GV
 
-/* Installation prefix directory */
-#undef LLVM_PREFIX
-
 /* Define if the OS needs help to load dependent libraries for dlopen(). */
 #undef LTDL_DLOPEN_DEPLIBS
 





More information about the llvm-commits mailing list