Kaydet (Commit) 3a8c38fa authored tarafından Stephan Bergmann's avatar Stephan Bergmann

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
üst db247f2b
...@@ -5658,60 +5658,6 @@ if test "$SDT_H_FOUND" = "TRUE"; then ...@@ -5658,60 +5658,6 @@ if test "$SDT_H_FOUND" = "TRUE"; then
fi fi
AC_CONFIG_HEADERS([config_host/config_probes.h]) 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 ===================================================================
dnl Set the MinGW sys-root dnl Set the MinGW sys-root
dnl =================================================================== dnl ===================================================================
...@@ -6620,6 +6566,59 @@ fi ...@@ -6620,6 +6566,59 @@ fi
AC_SUBST(HAVE_GCC_FNO_DEFAULT_INLINE) AC_SUBST(HAVE_GCC_FNO_DEFAULT_INLINE)
AC_SUBST(HAVE_GCC_FNO_ENFORCE_EH_SPECS) 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 ===================================================================
dnl allocator dnl allocator
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment