commit:     081cc7192ffa253711ff3bd4612967a02ecd8046
Author:     Yuta Satoh <nigoro.dev <AT> gmail <DOT> com>
AuthorDate: Sun Oct  2 09:04:29 2016 +0000
Commit:     Alexis Ballier <aballier <AT> gentoo <DOT> org>
CommitDate: Mon Oct  3 17:02:12 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=081cc719

eclass/freebsd.eclass: If CC=clang, force use clang-cpp.

https://bugs.gentoo.org/show_bug.cgi?id=595878

 eclass/freebsd.eclass | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/eclass/freebsd.eclass b/eclass/freebsd.eclass
index 57f9d45..c5d9464 100644
--- a/eclass/freebsd.eclass
+++ b/eclass/freebsd.eclass
@@ -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() {

Reply via email to