diff options
Diffstat (limited to 'autoconf/configure.ac')
-rw-r--r-- | autoconf/configure.ac | 106 |
1 files changed, 56 insertions, 50 deletions
diff --git a/autoconf/configure.ac b/autoconf/configure.ac index d7fc95b..e18725d 100644 --- a/autoconf/configure.ac +++ b/autoconf/configure.ac @@ -30,13 +30,15 @@ dnl=== SECTION 1: Initialization & Setup dnl=== dnl===-----------------------------------------------------------------------=== dnl Initialize autoconf and define the package name, version number and -dnl email address for reporting bugs. -AC_INIT([[llvm]],[[3.1svn]],[llvmbugs@cs.uiuc.edu]) +dnl address for reporting bugs. +AC_INIT([LLVM],[3.1svn],[http://llvm.org/bugs/]) +AC_DEFINE([LLVM_VERSION_MAJOR], [3], [Major version of the LLVM API]) +AC_DEFINE([LLVM_VERSION_MINOR], [1], [Minor version of the LLVM API]) dnl Provide a copyright substitution and ensure the copyright notice is included dnl in the output of --version option of the generated configure script. -AC_SUBST(LLVM_COPYRIGHT,["Copyright (c) 2003-2011 University of Illinois at Urbana-Champaign."]) -AC_COPYRIGHT([Copyright (c) 2003-2011 University of Illinois at Urbana-Champaign.]) +AC_SUBST(LLVM_COPYRIGHT,["Copyright (c) 2003-2012 University of Illinois at Urbana-Champaign."]) +AC_COPYRIGHT([Copyright (c) 2003-2012 University of Illinois at Urbana-Champaign.]) dnl Indicate that we require autoconf 2.60 or later. AC_PREREQ(2.60) @@ -189,7 +191,7 @@ AC_CACHE_CHECK([type of operating system we're going to host on], llvm_cv_no_link_all_option="-Wl,-noall_load" llvm_cv_os_type="Minix" llvm_cv_platform_type="Unix" ;; - *-*-freebsd*) + *-*-freebsd* | *-*-kfreebsd-gnu) llvm_cv_link_all_option="-Wl,--whole-archive" llvm_cv_no_link_all_option="-Wl,--no-whole-archive" llvm_cv_os_type="FreeBSD" @@ -224,6 +226,11 @@ AC_CACHE_CHECK([type of operating system we're going to host on], llvm_cv_no_link_all_option="-Wl,--no-whole-archive" llvm_cv_os_type="Linux" llvm_cv_platform_type="Unix" ;; + *-*-gnu*) + llvm_cv_link_all_option="-Wl,--whole-archive" + llvm_cv_no_link_all_option="-Wl,--no-whole-archive" + llvm_cv_os_type="GNU" + llvm_cv_platform_type="Unix" ;; *-*-solaris*) llvm_cv_link_all_option="-Wl,-z,allextract" llvm_cv_no_link_all_option="-Wl,-z,defaultextract" @@ -355,6 +362,7 @@ AC_CACHE_CHECK([target architecture],[llvm_cv_target_arch], powerpc*-*) llvm_cv_target_arch="PowerPC" ;; arm*-*) llvm_cv_target_arch="ARM" ;; mips-*) llvm_cv_target_arch="Mips" ;; + mipsel-*) llvm_cv_target_arch="Mips" ;; xcore-*) llvm_cv_target_arch="XCore" ;; msp430-*) llvm_cv_target_arch="MSP430" ;; hexagon-*) llvm_cv_target_arch="Hexagon" ;; @@ -367,7 +375,7 @@ if test "$llvm_cv_target_arch" = "Unknown" ; then AC_MSG_WARN([Configuring LLVM for an unknown target archicture]) fi -# Determine the LLVM native architecture for the target +dnl Determine the LLVM native architecture for the target case "$llvm_cv_target_arch" in x86) LLVM_NATIVE_ARCH="X86" ;; x86_64) LLVM_NATIVE_ARCH="X86" ;; @@ -380,7 +388,7 @@ AC_SUBST(ARCH,$llvm_cv_target_arch) dnl Check for the endianness of the target AC_C_BIGENDIAN(AC_SUBST([ENDIAN],[big]),AC_SUBST([ENDIAN],[little])) -dnl Check for build platform executable suffix if we're crosscompiling +dnl Check for build platform executable suffix if we're cross-compiling if test "$cross_compiling" = yes; then AC_SUBST(LLVM_CROSS_COMPILING, [1]) AC_BUILD_EXEEXT @@ -633,6 +641,7 @@ case "$enableval" in powerpc) TARGETS_TO_BUILD="PowerPC $TARGETS_TO_BUILD" ;; arm) TARGETS_TO_BUILD="ARM $TARGETS_TO_BUILD" ;; mips) TARGETS_TO_BUILD="Mips $TARGETS_TO_BUILD" ;; + mipsel) TARGETS_TO_BUILD="Mips $TARGETS_TO_BUILD" ;; spu) TARGETS_TO_BUILD="CellSPU $TARGETS_TO_BUILD" ;; xcore) TARGETS_TO_BUILD="XCore $TARGETS_TO_BUILD" ;; msp430) TARGETS_TO_BUILD="MSP430 $TARGETS_TO_BUILD" ;; @@ -663,8 +672,8 @@ case "$enableval" in esac AC_SUBST(TARGETS_TO_BUILD,$TARGETS_TO_BUILD) -# Determine whether we are building LLVM support for the native architecture. -# If so, define LLVM_NATIVE_ARCH to that LLVM target. +dnl Determine whether we are building LLVM support for the native architecture. +dnl If so, define LLVM_NATIVE_ARCH to that LLVM target. for a_target in $TARGETS_TO_BUILD; do if test "$a_target" = "$LLVM_NATIVE_ARCH"; then AC_DEFINE_UNQUOTED(LLVM_NATIVE_ARCH, $LLVM_NATIVE_ARCH, @@ -691,8 +700,8 @@ for a_target in $TARGETS_TO_BUILD; do fi done -# Build the LLVM_TARGET and LLVM_... macros for Targets.def and the individual -# target feature def files. +dnl Build the LLVM_TARGET and LLVM_... macros for Targets.def and the individual +dnl target feature def files. LLVM_ENUM_TARGETS="" LLVM_ENUM_ASM_PRINTERS="" LLVM_ENUM_ASM_PARSERS="" @@ -826,33 +835,15 @@ AC_ARG_WITH(c-include-dirs, AC_DEFINE_UNQUOTED(C_INCLUDE_DIRS,"$withval", [Directories clang will search for headers]) -AC_ARG_WITH(cxx-include-root, - AS_HELP_STRING([--with-cxx-include-root], - [Directory with the libstdc++ headers.]),, - withval="") -AC_DEFINE_UNQUOTED(CXX_INCLUDE_ROOT,"$withval", - [Directory with the libstdc++ headers.]) - -AC_ARG_WITH(cxx-include-arch, - AS_HELP_STRING([--with-cxx-include-arch], - [Architecture of the libstdc++ headers.]),, - withval="") -AC_DEFINE_UNQUOTED(CXX_INCLUDE_ARCH,"$withval", - [Arch the libstdc++ headers.]) - -AC_ARG_WITH(cxx-include-32bit-dir, - AS_HELP_STRING([--with-cxx-include-32bit-dir], - [32 bit multilib dir.]),, - withval="") -AC_DEFINE_UNQUOTED(CXX_INCLUDE_32BIT_DIR,"$withval", - [32 bit multilib directory.]) - -AC_ARG_WITH(cxx-include-64bit-dir, - AS_HELP_STRING([--with-cxx-include-64bit-dir], - [64 bit multilib directory.]),, +# Clang normally uses the system c++ headers and libraries. With this option, +# clang will use the ones provided by a gcc installation instead. This option should +# be passed the same value that was used with --prefix when configuring gcc. +AC_ARG_WITH(gcc-toolchain, + AS_HELP_STRING([--with-gcc-toolchain], + [Directory where gcc is installed.]),, withval="") -AC_DEFINE_UNQUOTED(CXX_INCLUDE_64BIT_DIR,"$withval", - [64 bit multilib directory.]) +AC_DEFINE_UNQUOTED(GCC_INSTALL_PREFIX,"$withval", + [Directory where gcc is installed.]) dnl Allow linking of LLVM with GPLv3 binutils code. AC_ARG_WITH(binutils-include, @@ -1124,7 +1115,8 @@ dnl Check optional compiler flags. AC_MSG_CHECKING([optional compiler flags]) CXX_FLAG_CHECK(NO_VARIADIC_MACROS, [-Wno-variadic-macros]) CXX_FLAG_CHECK(NO_MISSING_FIELD_INITIALIZERS, [-Wno-missing-field-initializers]) -AC_MSG_RESULT([$NO_VARIADIC_MACROS $NO_MISSING_FIELD_INITIALIZERS]) +CXX_FLAG_CHECK(COVERED_SWITCH_DEFAULT, [-Wcovered-switch-default]) +AC_MSG_RESULT([$NO_VARIADIC_MACROS $NO_MISSING_FIELD_INITIALIZERS $COVERED_SWITCH_DEFAULT]) dnl===-----------------------------------------------------------------------=== dnl=== @@ -1428,9 +1420,9 @@ dnl Propagate the run-time library path variable that the libltdl dnl checks found to the Makefiles so we can use it there too AC_SUBST(SHLIBPATH_VAR,$libltdl_cv_shlibpath_var) -# 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 Translate the various configuration directories and other basic +dnl information into substitutions that will end up in Makefile.config.in +dnl that these configured values can be used by the makefiles if test "${prefix}" = "NONE" ; then prefix="/usr/local" fi @@ -1455,8 +1447,13 @@ AC_SUBST(LLVM_INFODIR) AC_SUBST(LLVM_MANDIR) AC_SUBST(LLVM_CONFIGTIME) -# Place the various directores into the config.h file as #defines so that we -# can know about the installation paths within LLVM. +dnl Disable embedding timestamps in the build directory, with ENABLE_TIMESTAMPS. +if test "${ENABLE_TIMESTAMPS}" = "0"; then + LLVM_CONFIGTIME="(timestamp not enabled)" +fi + +dnl Place the various directories into the config.h file as #defines so that we +dnl 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", @@ -1480,7 +1477,7 @@ AC_DEFINE_UNQUOTED(LLVM_CONFIGTIME, "$LLVM_CONFIGTIME", AC_DEFINE_UNQUOTED(LLVM_DEFAULT_TARGET_TRIPLE, "$target", [Target triple LLVM will generate code for by default]) -# Determine which bindings to build. +dnl Determine which bindings to build. if test "$BINDINGS_TO_BUILD" = auto ; then BINDINGS_TO_BUILD="" if test "x$OCAMLC" != x -a "x$OCAMLDEP" != x ; then @@ -1489,11 +1486,11 @@ if test "$BINDINGS_TO_BUILD" = auto ; then fi AC_SUBST(BINDINGS_TO_BUILD,$BINDINGS_TO_BUILD) -# This isn't really configurey, but it avoids having to repeat the list in -# other files. +dnl This isn't really configurey, but it avoids having to repeat the list in +dnl other files. AC_SUBST(ALL_BINDINGS,ocaml) -# Do any work necessary to ensure that bindings have what they need. +dnl Do any work necessary to ensure that bindings have what they need. binding_prereqs_failed=0 for a_binding in $BINDINGS_TO_BUILD ; do case "$a_binding" in @@ -1557,7 +1554,7 @@ dnl===-----------------------------------------------------------------------=== dnl Configure header files dnl WARNING: dnl If you add or remove any of the following config headers, then -dnl you MUST also update Makefile.rules so that the variable FilesToConfig +dnl you MUST also update Makefile so that the variable FilesToConfig dnl contains the same list of files as AC_CONFIG_HEADERS below. This ensures the dnl files can be updated automatically when their *.in sources change. AC_CONFIG_HEADERS([include/llvm/Config/config.h include/llvm/Config/llvm-config.h]) @@ -1579,8 +1576,17 @@ AC_CONFIG_FILES([llvm.spec]) dnl Configure doxygen's configuration file AC_CONFIG_FILES([docs/doxygen.cfg]) -if test -f ${srcdir}/tools/clang/README.txt; then - AC_CONFIG_FILES([tools/clang/docs/doxygen.cfg]) + +dnl Configure clang, if present +if test "${clang_src_root}" = ""; then + clang_src_root="$srcdir/tools/clang" +fi +if test -f ${clang_src_root}/README.txt; then + dnl Use variables to stay under 80 columns. + configh="include/clang/Config/config.h" + doxy="docs/doxygen.cfg" + AC_CONFIG_HEADERS([tools/clang/${configh}:${clang_src_root}/${configh}.in]) + AC_CONFIG_FILES([tools/clang/${doxy}:${clang_src_root}/${doxy}.in]) fi dnl OCaml findlib META file |