summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2017-12-05 10:21:53 +0100
committerStephan Bergmann <sbergman@redhat.com>2017-12-06 07:26:14 +0100
commite754d0931ca75403647cc16100edd98e7e5ceadb (patch)
treec47c4b87494d17a76b74022e57c066e74a13909d /configure.ac
parent421d4bc13017988f1a1311a92b93177cf2bbc306 (diff)
Remove CXXFLAGS_CXX11 from Clang plugin compilation
CXXFLAGS_CXX11 is for the compiler used to compile LO proper. The plugin needs to be compiled in a way compatible with compiling Clang, and the compiler and any relevant flags can be controlled with COMPILER_PLUGINS_CXX. (And at least on macOS when compiling LO against a locally-built recent Clang trunk, CXXFLAGS_CXX11 will now contain -std=gnu++17, but COMPILER_PLUGINS_CXX can still point at Apple's Xcode clang++, which does not understand -std=gnu++17.) Also, if COMPILER_PLUGINS_CXX is not set, simply default it to g++ instead of trying to construct an acceptable CLANGCXX value from CXX (which would be Clang). (The problem with using Clang without CXXFLAGS_CXX11 is that Clang, unlike GCC, typically defaults to C++03, but building compilerplugins requires C++11 at least. That would cause e.g. the Gerrit/Jenkins linux_clang_dbgutil_64 builds to fail---but which also needs COMPILER_PLUGINS_CXX to be explicitly set to "g++ -std=c++11" as GCC on those machines is still 4.8.5 defaulting to C++03.) Change-Id: Id4ee4e54fa871cb6e621069cd050ae5b31922b34 Reviewed-on: https://gerrit.libreoffice.org/45856 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac8
1 files changed, 4 insertions, 4 deletions
diff --git a/configure.ac b/configure.ac
index 874a21e95ce0..208debcbe5a0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -6431,10 +6431,10 @@ if test "$COM_IS_CLANG" = "TRUE"; then
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=${COMPILER_PLUGINS_CXX-$(echo $CXX | sed -e s/-m64// -e s/-m32//)}
- CPPFLAGS="$CPPFLAGS $CXXFLAGS_CXX11 -I$CLANGDIR/include -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS"
+ # compiler plugins must be built with "native" compiler that was used to build Clang itself:
+ : "${COMPILER_PLUGINS_CXX=g++}"
+ CXX=$COMPILER_PLUGINS_CXX
+ CPPFLAGS="$CPPFLAGS -I$CLANGDIR/include -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS"
AC_CHECK_HEADER(clang/AST/RecursiveASTVisitor.h,
[COMPILER_PLUGINS=TRUE],
[