Replace the old --with-cxx-* configure options with a single --with-gcc-toolchain

that just uses the new toolchain probing logic. This fixes linking with -m32 on
64 bit systems (the /32 dir was not being added to the search).

llvm-svn: 149651
This commit is contained in:
Rafael Espindola 2012-02-03 00:59:30 +00:00
parent 68e59a434c
commit 3440cd1895
7 changed files with 45 additions and 189 deletions

View File

@ -833,33 +833,15 @@ AC_ARG_WITH(c-include-dirs,
AC_DEFINE_UNQUOTED(C_INCLUDE_DIRS,"$withval", AC_DEFINE_UNQUOTED(C_INCLUDE_DIRS,"$withval",
[Directories clang will search for headers]) [Directories clang will search for headers])
AC_ARG_WITH(cxx-include-root, # Clang normally uses the system c++ headers and libraries. With this option,
AS_HELP_STRING([--with-cxx-include-root], # clang will use the ones provided by a gcc installation instead. This option should
[Directory with the libstdc++ headers.]),, # 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="") withval="")
AC_DEFINE_UNQUOTED(CXX_INCLUDE_ROOT,"$withval", AC_DEFINE_UNQUOTED(GCC_INSTALL_PREFIX,"$withval",
[Directory with the libstdc++ headers.]) [Directory where gcc is installed.])
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.]),,
withval="")
AC_DEFINE_UNQUOTED(CXX_INCLUDE_64BIT_DIR,"$withval",
[64 bit multilib directory.])
dnl Allow linking of LLVM with GPLv3 binutils code. dnl Allow linking of LLVM with GPLv3 binutils code.
AC_ARG_WITH(binutils-include, AC_ARG_WITH(binutils-include,

62
configure vendored
View File

@ -1442,12 +1442,7 @@ Optional Packages:
resource files resource files
--with-c-include-dirs Colon separated list of directories clang will --with-c-include-dirs Colon separated list of directories clang will
search for headers search for headers
--with-cxx-include-root Directory with the libstdc++ headers. --with-gcc-toolchain Directory where gcc is installed.
--with-cxx-include-arch Architecture of the libstdc++ headers.
--with-cxx-include-32bit-dir
32 bit multilib dir.
--with-cxx-include-64bit-dir
64 bit multilib directory.
--with-binutils-include Specify path to binutils/include/ containing --with-binutils-include Specify path to binutils/include/ containing
plugin-api.h file for gold plugin. plugin-api.h file for gold plugin.
--with-bug-report-url Specify the URL where bug reports should be --with-bug-report-url Specify the URL where bug reports should be
@ -5570,59 +5565,20 @@ cat >>confdefs.h <<_ACEOF
_ACEOF _ACEOF
# 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.
# Check whether --with-cxx-include-root was given. # Check whether --with-gcc-toolchain was given.
if test "${with_cxx_include_root+set}" = set; then if test "${with_gcc_toolchain+set}" = set; then
withval=$with_cxx_include_root; withval=$with_gcc_toolchain;
else else
withval="" withval=""
fi fi
cat >>confdefs.h <<_ACEOF cat >>confdefs.h <<_ACEOF
#define CXX_INCLUDE_ROOT "$withval" #define GCC_INSTALL_PREFIX "$withval"
_ACEOF
# Check whether --with-cxx-include-arch was given.
if test "${with_cxx_include_arch+set}" = set; then
withval=$with_cxx_include_arch;
else
withval=""
fi
cat >>confdefs.h <<_ACEOF
#define CXX_INCLUDE_ARCH "$withval"
_ACEOF
# Check whether --with-cxx-include-32bit-dir was given.
if test "${with_cxx_include_32bit_dir+set}" = set; then
withval=$with_cxx_include_32bit_dir;
else
withval=""
fi
cat >>confdefs.h <<_ACEOF
#define CXX_INCLUDE_32BIT_DIR "$withval"
_ACEOF
# Check whether --with-cxx-include-64bit-dir was given.
if test "${with_cxx_include_64bit_dir+set}" = set; then
withval=$with_cxx_include_64bit_dir;
else
withval=""
fi
cat >>confdefs.h <<_ACEOF
#define CXX_INCLUDE_64BIT_DIR "$withval"
_ACEOF _ACEOF
@ -10497,7 +10453,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 10500 "configure" #line 10456 "configure"
#include "confdefs.h" #include "confdefs.h"
#if HAVE_DLFCN_H #if HAVE_DLFCN_H

View File

@ -11,17 +11,8 @@
/* Relative directory for resource files */ /* Relative directory for resource files */
#define CLANG_RESOURCE_DIR "${CLANG_RESOURCE_DIR}" #define CLANG_RESOURCE_DIR "${CLANG_RESOURCE_DIR}"
/* 32 bit multilib directory. */ /* Directory wherelibstdc++ is installed. */
#define CXX_INCLUDE_32BIT_DIR "${CXX_INCLUDE_32BIT_DIR}" #define GCC_INSTALL_PREFIX "${GCC_INSTALL_PREFIX}"
/* 64 bit multilib directory. */
#define CXX_INCLUDE_64BIT_DIR "${CXX_INCLUDE_64BIT_DIR}"
/* Arch the libstdc++ headers. */
#define CXX_INCLUDE_ARCH "${CXX_INCLUDE_ARCH}"
/* Directory with the libstdc++ headers. */
#define CXX_INCLUDE_ROOT "${CXX_INCLUDE_ROOT}"
/* Directories clang will search for headers */ /* Directories clang will search for headers */
#define C_INCLUDE_DIRS "${C_INCLUDE_DIRS}" #define C_INCLUDE_DIRS "${C_INCLUDE_DIRS}"

View File

@ -9,18 +9,6 @@
/* Relative directory for resource files */ /* Relative directory for resource files */
#undef CLANG_RESOURCE_DIR #undef CLANG_RESOURCE_DIR
/* 32 bit multilib directory. */
#undef CXX_INCLUDE_32BIT_DIR
/* 64 bit multilib directory. */
#undef CXX_INCLUDE_64BIT_DIR
/* Arch the libstdc++ headers. */
#undef CXX_INCLUDE_ARCH
/* Directory with the libstdc++ headers. */
#undef CXX_INCLUDE_ROOT
/* Directories clang will search for headers */ /* Directories clang will search for headers */
#undef C_INCLUDE_DIRS #undef C_INCLUDE_DIRS
@ -33,6 +21,9 @@
/* Define if timestamp information (e.g., __DATE___) is allowed */ /* Define if timestamp information (e.g., __DATE___) is allowed */
#undef ENABLE_TIMESTAMPS #undef ENABLE_TIMESTAMPS
/* Directory where gcc is installed. */
#undef GCC_INSTALL_PREFIX
/* Define to 1 if you have the `argz_append' function. */ /* Define to 1 if you have the `argz_append' function. */
#undef HAVE_ARGZ_APPEND #undef HAVE_ARGZ_APPEND

View File

@ -745,33 +745,15 @@ AC_ARG_WITH(c-include-dirs,
AC_DEFINE_UNQUOTED(C_INCLUDE_DIRS,"$withval", AC_DEFINE_UNQUOTED(C_INCLUDE_DIRS,"$withval",
[Directories clang will search for headers]) [Directories clang will search for headers])
AC_ARG_WITH(cxx-include-root, # Clang normally uses the system c++ headers and libraries. With this option,
AS_HELP_STRING([--with-cxx-include-root], # clang will use the ones provided by a gcc installation instead. This option should
[Directory with the libstdc++ headers.]),, # 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="") withval="")
AC_DEFINE_UNQUOTED(CXX_INCLUDE_ROOT,"$withval", AC_DEFINE_UNQUOTED(GCC_INSTALL_PREFIX,"$withval",
[Directory with the libstdc++ headers.]) [Directory where gcc is installed.])
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.]),,
withval="")
AC_DEFINE_UNQUOTED(CXX_INCLUDE_64BIT_DIR,"$withval",
[64 bit multilib directory.])
dnl Allow linking of LLVM with GPLv3 binutils code. dnl Allow linking of LLVM with GPLv3 binutils code.
AC_ARG_WITH(binutils-include, AC_ARG_WITH(binutils-include,

View File

@ -1426,12 +1426,7 @@ Optional Packages:
resource files resource files
--with-c-include-dirs Colon separated list of directories clang will --with-c-include-dirs Colon separated list of directories clang will
search for headers search for headers
--with-cxx-include-root Directory with the libstdc++ headers. --with-gcc-toolchain Directory where gcc is installed.
--with-cxx-include-arch Architecture of the libstdc++ headers.
--with-cxx-include-32bit-dir
32 bit multilib dir.
--with-cxx-include-64bit-dir
64 bit multilib directory.
--with-binutils-include Specify path to binutils/include/ containing --with-binutils-include Specify path to binutils/include/ containing
plugin-api.h file for gold plugin. plugin-api.h file for gold plugin.
--with-bug-report-url Specify the URL where bug reports should be --with-bug-report-url Specify the URL where bug reports should be
@ -5493,59 +5488,20 @@ cat >>confdefs.h <<_ACEOF
_ACEOF _ACEOF
# 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.
# Check whether --with-cxx-include-root was given. # Check whether --with-gcc-toolchain was given.
if test "${with_cxx_include_root+set}" = set; then if test "${with_gcc_toolchain+set}" = set; then
withval=$with_cxx_include_root; withval=$with_gcc_toolchain;
else else
withval="" withval=""
fi fi
cat >>confdefs.h <<_ACEOF cat >>confdefs.h <<_ACEOF
#define CXX_INCLUDE_ROOT "$withval" #define GCC_INSTALL_PREFIX "$withval"
_ACEOF
# Check whether --with-cxx-include-arch was given.
if test "${with_cxx_include_arch+set}" = set; then
withval=$with_cxx_include_arch;
else
withval=""
fi
cat >>confdefs.h <<_ACEOF
#define CXX_INCLUDE_ARCH "$withval"
_ACEOF
# Check whether --with-cxx-include-32bit-dir was given.
if test "${with_cxx_include_32bit_dir+set}" = set; then
withval=$with_cxx_include_32bit_dir;
else
withval=""
fi
cat >>confdefs.h <<_ACEOF
#define CXX_INCLUDE_32BIT_DIR "$withval"
_ACEOF
# Check whether --with-cxx-include-64bit-dir was given.
if test "${with_cxx_include_64bit_dir+set}" = set; then
withval=$with_cxx_include_64bit_dir;
else
withval=""
fi
cat >>confdefs.h <<_ACEOF
#define CXX_INCLUDE_64BIT_DIR "$withval"
_ACEOF _ACEOF
@ -10409,7 +10365,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 10412 "configure" #line 10368 "configure"
#include "confdefs.h" #include "confdefs.h"
#if HAVE_DLFCN_H #if HAVE_DLFCN_H

View File

@ -347,28 +347,26 @@ class Builder(threading.Thread):
# Assume we're building with gcc for now. # Assume we're building with gcc for now.
cxxincludes = self.get_includes() cxxincludes = self.get_includes()
cxxroot = cxxincludes[0] cxxroot = os.path.dirname(cxxincludes[0]) # Remove the version
cxxarch = os.path.basename(cxxincludes[1]) cxxroot = os.path.dirname(cxxroot) # Remove the c++
cxxroot = os.path.dirname(cxxroot) # Remove the include
configure_flags = dict( configure_flags = dict(
llvm=dict(debug=["--prefix=" + self.install_prefix, llvm=dict(debug=["--prefix=" + self.install_prefix,
"--with-extra-options=-Werror", "--with-extra-options=-Werror",
"--enable-assertions", "--enable-assertions",
"--disable-optimized", "--disable-optimized",
"--with-cxx-include-root=" + cxxroot, "--with-gcc-toolchain=" + cxxroot],
"--with-cxx-include-arch=" + cxxarch],
release=["--prefix=" + self.install_prefix, release=["--prefix=" + self.install_prefix,
"--with-extra-options=-Werror", "--with-extra-options=-Werror",
"--enable-optimized", "--enable-optimized",
"--with-cxx-include-root=" + cxxroot, "--with-gcc-toolchain=" + cxxroot],
"--with-cxx-include-arch=" + cxxarch],
paranoid=["--prefix=" + self.install_prefix, paranoid=["--prefix=" + self.install_prefix,
"--with-extra-options=-Werror", "--with-extra-options=-Werror",
"--enable-assertions", "--enable-assertions",
"--enable-expensive-checks", "--enable-expensive-checks",
"--disable-optimized", "--disable-optimized",
"--with-cxx-include-root=" + cxxroot, "--with-gcc-toolchain=" + cxxroot]),
"--with-cxx-include-arch=" + cxxarch]),
dragonegg=dict(debug=[], dragonegg=dict(debug=[],
release=[], release=[],
paranoid=[])) paranoid=[]))