Lines 91-96
efetch() {
Link Here
|
91 |
return 0 |
91 |
return 0 |
92 |
} |
92 |
} |
93 |
|
93 |
|
|
|
94 |
darwin_symlink_sdk() { |
95 |
# setup MacOSX.sdk symlink for GCC/clang, this should probably be |
96 |
# managed using an eselect module in the future |
97 |
rm -f "${ROOT}/MacOSX.sdk" |
98 |
local SDKPATH=$(xcrun --show-sdk-path --sdk macosx) |
99 |
local SDKVERSION=$(xcrun --show-sdk-version --sdk macosx) |
100 |
( cd ${ROOT} && ln -s "${SDKPATH}" MacOSX.sdk ) |
101 |
einfo "using system sources (${SDKVERSION}) from: ${SDKPATH}" |
102 |
} |
103 |
|
104 |
darwin_include_paths_for_clang() { |
105 |
# only used on clang-based darwin installs |
106 |
|
107 |
local XCODE_PATH=$(xcode-select -p) |
108 |
# Xcode.app path is deeper than CommandLineTools path |
109 |
[[ "${XCODE_PATH}" == */CommandLineTools ]] || XCODE_PATH+="/Toolchains/XcodeDefault.xctoolchain" |
110 |
|
111 |
export C_INCLUDE_PATH="${ROOT}/MacOSX.sdk/usr/include" |
112 |
export CPLUS_INCLUDE_PATH="${XCODE_PATH}/usr/include/c++/v1:${C_INCLUDE_PATH}" |
113 |
} |
114 |
|
94 |
configure_cflags() { |
115 |
configure_cflags() { |
95 |
export CPPFLAGS="-I${ROOT}/tmp/usr/include" |
116 |
export CPPFLAGS="-I${ROOT}/tmp/usr/include" |
96 |
|
117 |
|
Lines 242-247
configure_toolchain() {
Link Here
|
242 |
CC=clang |
263 |
CC=clang |
243 |
CXX=clang++ |
264 |
CXX=clang++ |
244 |
linker=sys-devel/binutils-apple |
265 |
linker=sys-devel/binutils-apple |
|
|
266 |
if [[ ! -d /usr/include ]]; then |
267 |
darwin_symlink_sdk |
268 |
export INCLUDE_EPREFIX_DARWIN_SDK=1 |
269 |
fi |
245 |
;; |
270 |
;; |
246 |
*"Apple LLVM version "*) |
271 |
*"Apple LLVM version "*) |
247 |
vers=${ccvers#*Apple LLVM version } |
272 |
vers=${ccvers#*Apple LLVM version } |
Lines 507-519
bootstrap_setup() {
Link Here
|
507 |
esac |
532 |
esac |
508 |
|
533 |
|
509 |
if [[ ${DARWIN_USE_GCC} == 1 ]] ; then |
534 |
if [[ ${DARWIN_USE_GCC} == 1 ]] ; then |
510 |
# setup MacOSX.sdk symlink for GCC, this should probably be |
535 |
darwin_symlink_sdk |
511 |
# managed using an eselect module in the future |
|
|
512 |
rm -f "${ROOT}"/MacOSX.sdk |
513 |
local SDKPATH=$(xcrun --show-sdk-path --sdk macosx) |
514 |
( cd "${ROOT}" && ln -s "${SDKPATH}" MacOSX.sdk ) |
515 |
einfo "using system sources from ${SDKPATH}" |
516 |
|
517 |
# amend profile, to use gcc one |
536 |
# amend profile, to use gcc one |
518 |
profile="${profile}/gcc" |
537 |
profile="${profile}/gcc" |
519 |
fi |
538 |
fi |
Lines 535-540
bootstrap_setup() {
Link Here
|
535 |
# Use package.use to disable in the portage tree to be shared between |
554 |
# Use package.use to disable in the portage tree to be shared between |
536 |
# stage2 and stage3. The hack will be undone during tree sync in stage3. |
555 |
# stage2 and stage3. The hack will be undone during tree sync in stage3. |
537 |
cat >> "${ROOT}"/etc/portage/make.profile/package.use <<-EOF |
556 |
cat >> "${ROOT}"/etc/portage/make.profile/package.use <<-EOF |
|
|
557 |
# rhash (dep of cmake) configure can't find the openssl/libressl. |
558 |
# ssl use flag allows RHash to "use optimized algorithms" |
559 |
# but rhash will work fine without, so disable during bootstrap. |
560 |
app-crypt/rhash -ssl |
561 |
# sys-libs/jsoncpp cannot be installed in stage2 and early stage3 |
562 |
# because jsoncpp requires meson which is not available yet. |
563 |
# So, cmake needs to temporarily bootstrap its own jsconcpp. |
564 |
dev-util/cmake -system-jsoncpp |
538 |
# Most binary Linux distributions seem to fancy toolchains that |
565 |
# Most binary Linux distributions seem to fancy toolchains that |
539 |
# do not do c++ support (need to install a separate package). |
566 |
# do not do c++ support (need to install a separate package). |
540 |
sys-libs/ncurses -cxx |
567 |
sys-libs/ncurses -cxx |
Lines 1382-1387
bootstrap_stage1() {
Link Here
|
1382 |
|
1409 |
|
1383 |
configure_toolchain |
1410 |
configure_toolchain |
1384 |
export CC CXX |
1411 |
export CC CXX |
|
|
1412 |
[[ ${INCLUDE_EPREFIX_DARWIN_SDK} == 1 ]] && darwin_include_paths_for_clang |
1385 |
|
1413 |
|
1386 |
# run all bootstrap_* commands in a subshell since the targets |
1414 |
# run all bootstrap_* commands in a subshell since the targets |
1387 |
# frequently pollute the environment using exports which affect |
1415 |
# frequently pollute the environment using exports which affect |
Lines 1646-1651
bootstrap_stage2() {
Link Here
|
1646 |
# Find out what toolchain packages we need, and configure LDFLAGS |
1674 |
# Find out what toolchain packages we need, and configure LDFLAGS |
1647 |
# and friends. |
1675 |
# and friends. |
1648 |
configure_toolchain || return 1 |
1676 |
configure_toolchain || return 1 |
|
|
1677 |
[[ ${INCLUDE_EPREFIX_DARWIN_SDK} == 1 ]] && darwin_include_paths_for_clang |
1649 |
configure_cflags || return 1 |
1678 |
configure_cflags || return 1 |
1650 |
export CONFIG_SHELL="${ROOT}"/tmp/bin/bash |
1679 |
export CONFIG_SHELL="${ROOT}"/tmp/bin/bash |
1651 |
export CC CXX |
1680 |
export CC CXX |
Lines 1740-1747
bootstrap_stage2() {
Link Here
|
1740 |
[[ ${CHOST} == *-solaris* ]] && echo "=dev-libs/libffi-3.3_rc0" \ |
1769 |
[[ ${CHOST} == *-solaris* ]] && echo "=dev-libs/libffi-3.3_rc0" \ |
1741 |
>> "${ROOT}"/tmp/etc/portage/package.mask |
1770 |
>> "${ROOT}"/tmp/etc/portage/package.mask |
1742 |
|
1771 |
|
1743 |
# unlock GCC on Darwin for DARWIN_USE_GCC bootstraps |
1772 |
# unlock Darwin builds for GCC and clang bootstraps |
1744 |
if [[ ${DARWIN_USE_GCC} == 1 ]] ; then |
1773 |
if [[ -d "${ROOT}/MacOSX.sdk" ]] ; then |
1745 |
rm -f "${ROOT}"/tmp/MacOSX.sdk |
1774 |
rm -f "${ROOT}"/tmp/MacOSX.sdk |
1746 |
( cd "${ROOT}"/tmp && ln -s ../MacOSX.sdk ) |
1775 |
( cd "${ROOT}"/tmp && ln -s ../MacOSX.sdk ) |
1747 |
fi |
1776 |
fi |
1748 |
- |
|
|