From 3a8c38fa3f7c0c17f0d0dc688df742ab2a7b7a42 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Tue, 4 Mar 2014 08:56:33 +0100 Subject: Use CXXFLAGS_CXX11 when detecting Clang plugin headers ...which is necessary for recent Clang trunk towards 3.5, which is implemented in C++11 now, and should not hurt for older versions. Required to move the plugin check after the check that determines CXXFLAGS_CXX11. Change-Id: I73aff79e09749e9d7c6ea813422f35c1b8475041 --- configure.ac | 107 +++++++++++++++++++++++++++++------------------------------ 1 file changed, 53 insertions(+), 54 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 9284af5fc71e..3676db5d0364 100644 --- a/configure.ac +++ b/configure.ac @@ -5658,60 +5658,6 @@ if test "$SDT_H_FOUND" = "TRUE"; then fi AC_CONFIG_HEADERS([config_host/config_probes.h]) -dnl =================================================================== -dnl Compiler plugins -dnl =================================================================== - -COMPILER_PLUGINS= -# currently only Clang -if test "$COM_GCC_IS_CLANG" = "TRUE"; then - if test -n "$enable_compiler_plugins"; then - compiler_plugins="$enable_compiler_plugins" - elif test -n "$ENABLE_DBGUTIL"; then - compiler_plugins=test - else - compiler_plugins=no - fi - if test "$compiler_plugins" != "no"; then - dnl The prefix where Clang resides, override to where Clang resides if - dnl using a source build: - if test -z "$CLANGDIR"; then - CLANGDIR=/usr - fi - AC_LANG_PUSH([C++]) - save_CPPFLAGS=$CPPFLAGS - save_CXX=$CXX - # compiler plugins must be built with "native" bitness of clang - # because they link against clang libraries - CXX=`echo $CXX | sed -e s/-m64// -e s/-m32//` - CPPFLAGS="$CPPFLAGS -I$CLANGDIR/include -I$CLANGDIR/tools/clang/include -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS" - AC_CHECK_HEADER(clang/AST/RecursiveASTVisitor.h, - [COMPILER_PLUGINS=TRUE], - [ - if test "$compiler_plugins" = "yes"; then - AC_MSG_ERROR([Cannot find Clang headers to build compiler plugins.]) - else - AC_MSG_WARN([Cannot find Clang headers to build compiler plugins, plugins disabled]) - add_warning "Cannot find Clang headers to build compiler plugins, plugins disabled." - fi - ]) - CXX=$save_CXX - CPPFLAGS=$save_CPPFLAGS - AC_LANG_POP([C++]) - fi -else - if test "$enable_compiler_plugins" = "yes"; then - AC_MSG_ERROR([Compiler plugins are currently supported only with the Clang compiler.]) - fi -fi -AC_SUBST(COMPILER_PLUGINS) -AC_SUBST(CLANGDIR) - -# Plugin to help linker. -# Add something like LD_PLUGIN=/usr/lib64/LLVMgold.so to your autogen.input. -# This makes --enable-lto build with clang work. -AC_SUBST(LD_PLUGIN) - dnl =================================================================== dnl Set the MinGW sys-root dnl =================================================================== @@ -6620,6 +6566,59 @@ fi AC_SUBST(HAVE_GCC_FNO_DEFAULT_INLINE) AC_SUBST(HAVE_GCC_FNO_ENFORCE_EH_SPECS) +dnl =================================================================== +dnl Compiler plugins +dnl =================================================================== + +COMPILER_PLUGINS= +# currently only Clang +if test "$COM_GCC_IS_CLANG" = "TRUE"; then + if test -n "$enable_compiler_plugins"; then + compiler_plugins="$enable_compiler_plugins" + elif test -n "$ENABLE_DBGUTIL"; then + compiler_plugins=test + else + compiler_plugins=no + fi + if test "$compiler_plugins" != "no"; then + dnl The prefix where Clang resides, override to where Clang resides if + dnl using a source build: + if test -z "$CLANGDIR"; then + CLANGDIR=/usr + fi + AC_LANG_PUSH([C++]) + save_CPPFLAGS=$CPPFLAGS + save_CXX=$CXX + # compiler plugins must be built with "native" bitness of clang + # because they link against clang libraries + CXX=`echo $CXX | sed -e s/-m64// -e s/-m32//` + CPPFLAGS="$CPPFLAGS $CXXFLAGS_CXX11 -I$CLANGDIR/include -I$CLANGDIR/tools/clang/include -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS" + AC_CHECK_HEADER(clang/AST/RecursiveASTVisitor.h, + [COMPILER_PLUGINS=TRUE], + [ + if test "$compiler_plugins" = "yes"; then + AC_MSG_ERROR([Cannot find Clang headers to build compiler plugins.]) + else + AC_MSG_WARN([Cannot find Clang headers to build compiler plugins, plugins disabled]) + add_warning "Cannot find Clang headers to build compiler plugins, plugins disabled." + fi + ]) + CXX=$save_CXX + CPPFLAGS=$save_CPPFLAGS + AC_LANG_POP([C++]) + fi +else + if test "$enable_compiler_plugins" = "yes"; then + AC_MSG_ERROR([Compiler plugins are currently supported only with the Clang compiler.]) + fi +fi +AC_SUBST(COMPILER_PLUGINS) +AC_SUBST(CLANGDIR) + +# Plugin to help linker. +# Add something like LD_PLUGIN=/usr/lib64/LLVMgold.so to your autogen.input. +# This makes --enable-lto build with clang work. +AC_SUBST(LD_PLUGIN) dnl =================================================================== dnl allocator -- cgit v1.2.3