Bug 1262781 - Use the host compiler for the ASTMatcher check. r?froydnj
The check is for the clang plugin, which is a host library. It is especially
important to use the host compiler for this check on OSX-on-Linux cross builds.
--- a/build/autoconf/clang-plugin.m4
+++ b/build/autoconf/clang-plugin.m4
@@ -96,21 +96,24 @@ if test -n "$ENABLE_CLANG_PLUGIN"; then
dnl middle of the 3.8 cycle, our CLANG_VERSION_FULL is impossible to use
dnl correctly, so we have to detect this at configure time.
AC_CACHE_CHECK(for new ASTMatcher names,
ac_cv_have_new_ASTMatcher_names,
[
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
_SAVE_CXXFLAGS="$CXXFLAGS"
+ _SAVE_CXX="$CXX"
CXXFLAGS="${LLVM_CXXFLAGS}"
+ CXX="${HOST_CXX}"
AC_TRY_COMPILE([#include "clang/ASTMatchers/ASTMatchers.h"],
[clang::ast_matchers::cxxConstructExpr();],
ac_cv_have_new_ASTMatcher_names="yes",
ac_cv_have_new_ASTMatcher_names="no")
+ CXX="$_SAVE_CXX"
CXXFLAGS="$_SAVE_CXXFLAGS"
AC_LANG_RESTORE
])
if test "$ac_cv_have_new_ASTMatcher_names" = "yes"; then
LLVM_CXXFLAGS="$LLVM_CXXFLAGS -DHAVE_NEW_ASTMATCHER_NAMES"
fi
AC_DEFINE(MOZ_CLANG_PLUGIN)