diff --git a/Makefile.inc1 b/Makefile.inc1 index 7f72092d9966..ed9388610f17 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -2742,8 +2742,7 @@ CD2CFLAGS+= -isystem ${XDDESTDIR}/usr/include -L${XDDESTDIR}/usr/lib # combined with --sysroot. CD2CFLAGS+= -B${XDDESTDIR}/usr/lib # Force using libc++ for external GCC. -# XXX: This should be checking MK_GNUCXX == no -.if ${X_COMPILER_VERSION} >= 40800 +.if ${X_COMPILER_TYPE} == gcc && ${X_COMPILER_VERSION} >= 40800 CD2CXXFLAGS+= -isystem ${XDDESTDIR}/usr/include/c++/v1 -std=c++11 \ -nostdinc++ .endif diff --git a/Makefile.libcompat b/Makefile.libcompat index 3c0aabb2d05f..8542d5b246ae 100644 --- a/Makefile.libcompat +++ b/Makefile.libcompat @@ -99,8 +99,7 @@ LIBCOMPATCFLAGS+= -B${LIBCOMPATTMP}/usr/lib${libcompat} # sysroot path which --sysroot does not actually do for headers. LIBCOMPATCFLAGS+= -isystem ${LIBCOMPATTMP}/usr/include # Force using libc++ for external GCC. -# XXX: This should be checking MK_GNUCXX == no -.if ${X_COMPILER_VERSION} >= 40800 && \ +.if ${X_COMPILER_TYPE} == gcc && ${X_COMPILER_VERSION} >= 40800 && \ (${MK_CLANG_BOOTSTRAP} == "no" && ${MK_GCC_BOOTSTRAP} == "no") LIBCOMPATCXXFLAGS+= -isystem ${LIBCOMPATTMP}/usr/include/c++/v1 -std=c++11 \ -nostdinc++