Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 757513 | Differences between
and this patch

Collapse All | Expand All

(-)a/scripts/bootstrap-prefix.sh (-9 / +37 lines)
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 SDKPATH="${ROOT}/MacOSX.sdk"
108
	export C_INCLUDE_PATH="${SDKPATH}/usr/include"
109
110
	# we require command line tools. This allows stage2 to progress.
111
	export CPLUS_INCLUDE_PATH="/Library/Developer/CommandLineTools/usr/include/c++/v1:${C_INCLUDE_PATH}"
112
}
113
94
configure_cflags() {
114
configure_cflags() {
95
	export CPPFLAGS="-I${ROOT}/tmp/usr/include"
115
	export CPPFLAGS="-I${ROOT}/tmp/usr/include"
96
	
116
	
Lines 241-247 configure_toolchain() { Link Here
241
						sys-libs/libcxx"
261
						sys-libs/libcxx"
242
					CC=clang
262
					CC=clang
243
					CXX=clang++
263
					CXX=clang++
244
					linker=sys-devel/binutils-apple
264
					linker=sys-devel/binutils-apple
265
					if [[ ! -d /usr/include ]]; then
266
						darwin_symlink_sdk
267
						export INCLUDE_EPREFIX_DARWIN_SDK=1
268
					fi
245
					;;
269
					;;
246
				*"Apple LLVM version "*)
270
				*"Apple LLVM version "*)
247
					vers=${ccvers#*Apple LLVM version }
271
					vers=${ccvers#*Apple LLVM version }
Lines 507-519 bootstrap_setup() { Link Here
507
	esac
531
	esac
508
532
509
	if [[ ${DARWIN_USE_GCC} == 1 ]] ; then
533
	if [[ ${DARWIN_USE_GCC} == 1 ]] ; then
510
		# setup MacOSX.sdk symlink for GCC, this should probably be
534
		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
535
		# amend profile, to use gcc one
518
		profile="${profile}/gcc"
536
		profile="${profile}/gcc"
519
	fi
537
	fi
Lines 535-540 bootstrap_setup() { Link Here
535
	# Use package.use to disable in the portage tree to be shared between
553
	# 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.
554
	# stage2 and stage3. The hack will be undone during tree sync in stage3.
537
	cat >> "${ROOT}"/etc/portage/make.profile/package.use <<-EOF
555
	cat >> "${ROOT}"/etc/portage/make.profile/package.use <<-EOF
556
	# rhash (dep of cmake) configure can't find the openssl/libressl.
557
	# ssl use flag allows RHash to "use optimized algorithms"
558
	# but rhash will work fine without, so disable during bootstrap.
559
	app-crypt/rhash -ssl
560
	# sys-libs/jsoncpp cannot be installed in stage2 and early stage3
561
	# because jsoncpp requires meson which is not available yet.
562
	# So, cmake needs to temporarily bootstrap its own jsconcpp.
563
	dev-util/cmake -system-jsoncpp
538
	# Most binary Linux distributions seem to fancy toolchains that
564
	# Most binary Linux distributions seem to fancy toolchains that
539
	# do not do c++ support (need to install a separate package).
565
	# do not do c++ support (need to install a separate package).
540
	sys-libs/ncurses -cxx
566
	sys-libs/ncurses -cxx
Lines 1382-1387 bootstrap_stage1() { Link Here
1382
1408
1383
	configure_toolchain
1409
	configure_toolchain
1384
	export CC CXX
1410
	export CC CXX
1411
	[[ ${INCLUDE_EPREFIX_DARWIN_SDK} == 1 ]] && darwin_include_paths_for_clang
1385
1412
1386
	# run all bootstrap_* commands in a subshell since the targets
1413
	# run all bootstrap_* commands in a subshell since the targets
1387
	# frequently pollute the environment using exports which affect
1414
	# frequently pollute the environment using exports which affect
Lines 1645-1650 bootstrap_stage2() { Link Here
1645
	# Find out what toolchain packages we need, and configure LDFLAGS
1672
	# Find out what toolchain packages we need, and configure LDFLAGS
1646
	# and friends.
1673
	# and friends.
1647
	configure_toolchain || return 1
1674
	configure_toolchain || return 1
1675
	[[ ${INCLUDE_EPREFIX_DARWIN_SDK} == 1 ]] && darwin_include_paths_for_clang
1648
	configure_cflags || return 1
1676
	configure_cflags || return 1
1649
	export CONFIG_SHELL="${ROOT}"/tmp/bin/bash
1677
	export CONFIG_SHELL="${ROOT}"/tmp/bin/bash
1650
	export CC CXX
1678
	export CC CXX
Lines 1739-1746 bootstrap_stage2() { Link Here
1739
	[[ ${CHOST} == *-solaris* ]] && echo "=dev-libs/libffi-3.3_rc0" \
1770
	[[ ${CHOST} == *-solaris* ]] && echo "=dev-libs/libffi-3.3_rc0" \
1740
		>> "${ROOT}"/tmp/etc/portage/package.mask
1771
		>> "${ROOT}"/tmp/etc/portage/package.mask
1741
1772
1742
	# unlock GCC on Darwin for DARWIN_USE_GCC bootstraps
1773
	# unlock Darwin builds for GCC and clang bootstraps
1743
	if [[ ${DARWIN_USE_GCC} == 1 ]] ; then
1774
	if [[ -d "${ROOT}/MacOSX.sdk" ]] ; then
1744
		rm -f "${ROOT}"/tmp/MacOSX.sdk
1775
		rm -f "${ROOT}"/tmp/MacOSX.sdk
1745
		( cd "${ROOT}"/tmp && ln -s ../MacOSX.sdk )
1776
		( cd "${ROOT}"/tmp && ln -s ../MacOSX.sdk )
1746
	fi
1777
	fi

Return to bug 757513