-# Copyright 1999-2017 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
EAPI=6
PYTHON_COMPAT=( python2_7 )
inherit cmake-utils eapi7-ver flag-o-matic llvm \
- multilib-minimal pax-utils python-single-r1 toolchain-funcs
+ multilib-minimal pax-utils prefix python-single-r1 toolchain-funcs
MY_P=cfe-${PV/_/}.src
EXTRA_P=clang-tools-extra-${PV/_/}.src
PATCHES=(
# fix finding compiler-rt libs
"${FILESDIR}"/5.0.0/0001-Driver-Use-arch-type-to-find-compiler-rt-libraries-o.patch
+ # add Prefix include paths for Darwin
+ "${FILESDIR}"/5.0.0/darwin_prefix-include-paths.patch
)
# Multilib notes:
fi
}
+src_prepare() {
+ default
+ eprefixify lib/Frontend/InitHeaderSearch.cpp
+}
+
multilib_src_configure() {
local llvm_version=$(llvm-config --version) || die
local clang_version=$(ver_cut 1-3 "${llvm_version}")
--- /dev/null
+--- a/lib/Frontend/InitHeaderSearch.cpp
++++ b/lib/Frontend/InitHeaderSearch.cpp
+@@ -233,6 +233,7 @@
+ case llvm::Triple::Bitrig:
+ break;
+ default:
++ AddPath("@GENTOO_PORTAGE_EPREFIX@/usr/include", System, false);
+ // FIXME: temporary hack: hard-coded paths.
+ AddPath("/usr/local/include", System, false);
+ break;
+@@ -505,6 +506,7 @@
+ // Add the default framework include paths on Darwin.
+ if (HSOpts.UseStandardSystemIncludes) {
+ if (triple.isOSDarwin()) {
++ AddPath("@GENTOO_PORTAGE_EPREFIX@/Frameworks", System, true);
+ AddPath("/System/Library/Frameworks", System, true);
+ AddPath("/Library/Frameworks", System, true);
+ }