extract-interface: perform library check using (build) C++ compiler
authorSven Verdoolaege <sven.verdoolaege@gmail.com>
Thu, 9 Jul 2020 08:43:16 +0000 (9 10:43 +0200)
committerSven Verdoolaege <sven.verdoolaege@gmail.com>
Thu, 9 Jul 2020 08:49:09 +0000 (9 10:49 +0200)
Since isl-0.22.1-359-g8b9f94f262 (build extract_interface
using build compiler, Thu May 21 14:55:46 2020 +0200),
the default C++ compiler is overridden by the build C++ compiler
inside interface.  This was meant to ensure that the clang
configure checks are performed using the right compiler,
but those checking for libraries were being performed by
the (host) C compiler instead.  Use the (build) C++ compiler
there as well.

Signed-off-by: Sven Verdoolaege <sven.verdoolaege@gmail.com>
m4/ax_detect_clang.m4

index e3d833e..36a647b 100644 (file)
@@ -72,9 +72,10 @@ if test "x$found_header" != "xyes"; then
 fi
 CC="$SAVE_CC"
 
+AC_LANG_PUSH(C++)
+
 SAVE_CPPFLAGS="$CPPFLAGS"
 CPPFLAGS="$CLANG_CXXFLAGS $CPPFLAGS"
-AC_LANG_PUSH(C++)
 AC_CHECK_HEADER([clang/Basic/SourceLocation.h], [],
        [AC_ERROR([clang header file not found])])
 AC_EGREP_HEADER([getDefaultTargetTriple], [llvm/Support/Host.h], [],
@@ -216,7 +217,6 @@ AC_TRY_COMPILE([
 AC_CHECK_HEADER([llvm/Option/Arg.h],
        [AC_DEFINE([HAVE_LLVM_OPTION_ARG_H], [],
                   [Define if llvm/Option/Arg.h exists])])
-AC_LANG_POP
 CPPFLAGS="$SAVE_CPPFLAGS"
 
 SAVE_LDFLAGS="$LDFLAGS"
@@ -237,4 +237,6 @@ else
 fi
 
 LDFLAGS="$SAVE_LDFLAGS"
+
+AC_LANG_POP
 ])