can't use PKG_CXX before the wrappers have been created
authorTobias Nygren <tnn@NetBSD.org>
Thu, 10 Mar 2016 14:32:53 +0000 (15:32 +0100)
committerTobias Nygren <tnn@NetBSD.org>
Thu, 10 Mar 2016 14:33:25 +0000 (15:33 +0100)
clang-git/Makefile.common
clang/Makefile.common

index ff1fad30e128419cfeb8547c968237dacab19550..67fc27adcf8f8dfd22fd845e3759d7cec4e55252 100644 (file)
@@ -66,11 +66,15 @@ REPLACE_PYTHON+=    www/builtins.py
 
 .include "../../mk/compiler.mk"
 
-# command to check if the PKG_CXX compiler is using libc++ or libstdc++
-LIBCPP_CHECK_SH=       printf "\#include <ciso646>\n\#ifdef _LIBCPP_VERSION\nYES\n\#endif" | ${PKG_CXX} -x c++ -E - | grep YES || true
+.if ${OPSYS} == "NetBSD" && !empty(PKGSRC_COMPILER:Mclang)
+# command to check if clang is using libc++ or libstdc++
+LIBCPP_CHECK_SH=       printf "\#include <ciso646>\n\#ifdef _LIBCPP_VERSION\nYES\n\#endif" | ${CLANGBASE}/bin/clang++ -x c++ -E - 2>&1 | grep YES || true
+.else
+LIBCPP_CHECK_SH=       echo NO
+.endif
 
 # patch NetBSD::GetCXXStdlibType
-.if ${OPSYS} == "NetBSD" && (!empty(PKGSRC_COMPILER:Mgcc) || empty(LIBCPP_CHECK_SH:sh:MYES))
+.if ${OPSYS} == "NetBSD" && empty(LIBCPP_CHECK_SH:sh:MYES)
 SUBST_CLASSES+=                        libcxx
 SUBST_STAGE.libcxx=            pre-configure
 SUBST_MESSAGE.libcxx=          Patching toolchain to use libstdc++ (matching the host compiler)
index c9f42733b4b9f45823f5ed9fe36dc8ee9382132d..748fe1da13d2ffd5ce772d41f450c89d888d1545 100644 (file)
@@ -66,11 +66,15 @@ REPLACE_PYTHON+=    www/builtins.py
 
 .include "../../mk/compiler.mk"
 
-# command to check if the PKG_CXX compiler is using libc++ or libstdc++
-LIBCPP_CHECK_SH=       printf "\#include <ciso646>\n\#ifdef _LIBCPP_VERSION\nYES\n\#endif" | ${PKG_CXX} -x c++ -E - | grep YES || true
+.if ${OPSYS} == "NetBSD" && !empty(PKGSRC_COMPILER:Mclang)
+# command to check if clang is using libc++ or libstdc++
+LIBCPP_CHECK_SH=       printf "\#include <ciso646>\n\#ifdef _LIBCPP_VERSION\nYES\n\#endif" | ${CLANGBASE}/bin/clang++ -x c++ -E - 2>&1 | grep YES || true
+.else
+LIBCPP_CHECK_SH=       echo NO
+.endif
 
 # patch NetBSD::GetCXXStdlibType
-.if ${OPSYS} == "NetBSD" && (!empty(PKGSRC_COMPILER:Mgcc) || empty(LIBCPP_CHECK_SH:sh:MYES))
+.if ${OPSYS} == "NetBSD" && empty(LIBCPP_CHECK_SH:sh:MYES)
 SUBST_CLASSES+=                        libcxx
 SUBST_STAGE.libcxx=            pre-configure
 SUBST_MESSAGE.libcxx=          Patching toolchain to use libstdc++ (matching the host compiler)