# HG changeset patch # User Andi-Bogdan Postelnicu # Date 1526030610 -10800 # Fri May 11 12:23:30 2018 +0300 # Node ID c09f5d341886f816dc202f9b0f2b9849bb77fa80 # Parent 25f6376adefdbde71cf3855b243bc2b7f237615b Bug 1454667 - clear out CPPFLAGS before compiling test files for the clang plugin. r=froydnj MozReview-Commit-ID: sxnMdImxf8 diff --git a/build/autoconf/clang-plugin.m4 b/build/autoconf/clang-plugin.m4 --- a/build/autoconf/clang-plugin.m4 +++ b/build/autoconf/clang-plugin.m4 @@ -99,26 +99,29 @@ 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 API, ac_cv_have_new_ASTMatcher_api, [ AC_LANG_SAVE AC_LANG_CPLUSPLUS _SAVE_CXXFLAGS="$CXXFLAGS" + _SAVE_CPPFLAGS="$CPPFLAGS" _SAVE_CXX="$CXX" _SAVE_MACOSX_DEPLOYMENT_TARGET="$MACOSX_DEPLOYMENT_TARGET" unset MACOSX_DEPLOYMENT_TARGET CXXFLAGS="${LLVM_CXXFLAGS}" + CPPFLAGS="" 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" + CPPFLAGS="$_SAVE_CPPFLAGS" CXXFLAGS="$_SAVE_CXXFLAGS" export MACOSX_DEPLOYMENT_TARGET="$_SAVE_MACOSX_DEPLOYMENT_TARGET" AC_LANG_RESTORE ]) if test "$ac_cv_have_new_ASTMatcher_names" = "yes"; then LLVM_CXXFLAGS="$LLVM_CXXFLAGS -DHAVE_NEW_ASTMATCHER_NAMES" fi @@ -126,28 +129,31 @@ if test -n "$ENABLE_CLANG_PLUGIN"; then dnl before 3.9 that ignoringParenImpCasts was done internally by "has". dnl See https://www.mail-archive.com/cfe-commits@lists.llvm.org/msg25234.html AC_CACHE_CHECK(for has with ignoringParenImpCasts, ac_cv_has_accepts_ignoringParenImpCasts, [ AC_LANG_SAVE AC_LANG_CPLUSPLUS _SAVE_CXXFLAGS="$CXXFLAGS" + _SAVE_CPPFLAGS="$CPPFLAGS" _SAVE_CXX="$CXX" _SAVE_MACOSX_DEPLOYMENT_TARGET="$MACOSX_DEPLOYMENT_TARGET" unset MACOSX_DEPLOYMENT_TARGET CXXFLAGS="${LLVM_CXXFLAGS}" + CPPFLAGS="" CXX="${HOST_CXX}" AC_TRY_COMPILE([#include "clang/ASTMatchers/ASTMatchers.h"], [using namespace clang::ast_matchers; expr(has(ignoringParenImpCasts(declRefExpr()))); ], ac_cv_has_accepts_ignoringParenImpCasts="yes", ac_cv_has_accepts_ignoringParenImpCasts="no") CXX="$_SAVE_CXX" + CPPFLAGS="$_SAVE_CPPFLAGS" CXXFLAGS="$_SAVE_CXXFLAGS" export MACOSX_DEPLOYMENT_TARGET="$_SAVE_MACOSX_DEPLOYMENT_TARGET" AC_LANG_RESTORE ]) if test "$ac_cv_has_accepts_ignoringParenImpCasts" = "yes"; then LLVM_CXXFLAGS="$LLVM_CXXFLAGS -DHAS_ACCEPTS_IGNORINGPARENIMPCASTS" fi