eclass/freebsd.eclass: If CC=clang, force use clang-cpp.
authorYuta Satoh <nigoro.dev@gmail.com>
Sun, 2 Oct 2016 09:04:29 +0000 (18:04 +0900)
committerAlexis Ballier <aballier@gentoo.org>
Mon, 3 Oct 2016 17:02:12 +0000 (19:02 +0200)
https://bugs.gentoo.org/show_bug.cgi?id=595878

eclass/freebsd.eclass

index 57f9d451e0f921b5a73405e87d0c1c7a69fd0032..c5d946417de90a7022f552392a0e0d4928fcbf75 100644 (file)
@@ -195,6 +195,17 @@ freebsd_src_unpack() {
                export INSTALL_LINK="ln -f"
                export INSTALL_SYMLINK="ln -fs"
        fi
+
+       # When CC=clang, force use clang-cpp #478810, #595878
+       if [[ $(tc-getCC) == *clang* ]] ; then
+               if type -P clang-cpp > /dev/null ; then
+                       export CPP=clang-cpp
+               else
+                       mkdir "${WORKDIR}"/workaround_clang-cpp || die "Could not create ${WORKDIR}/workaround_clang-cpp"
+                       ln -s "$(type -P clang)" "${WORKDIR}"/workaround_clang-cpp/clang-cpp || die "Could not create clang-cpp symlink."
+                       export CPP="${WORKDIR}/workaround_clang-cpp/clang-cpp"
+               fi
+       fi
 }
 
 freebsd_src_compile() {