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

Collapse All | Expand All

(-)a/scripts/bootstrap-prefix.sh (-10 / +63 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() {
105
	local SDKPATH="${ROOT}/MacOSX.sdk"
106
	export C_INCLUDE_PATH="${SDKPATH}/usr/include"
107
108
	# we require command line tools. This allows stage2 to progress.
109
	export CPLUS_INCLUDE_PATH="/Library/Developer/CommandLineTools/usr/include/c++/v1:${C_INCLUDE_PATH}"
110
}
111
94
configure_cflags() {
112
configure_cflags() {
95
	export CPPFLAGS="-I${ROOT}/tmp/usr/include"
113
	export CPPFLAGS="-I${ROOT}/tmp/usr/include"
96
	
114
	
Lines 242-247 configure_toolchain() { Link Here
242
					CC=clang
260
					CC=clang
243
					CXX=clang++
261
					CXX=clang++
244
					linker=sys-devel/binutils-apple
262
					linker=sys-devel/binutils-apple
263
					if [[ ! -d /usr/include ]]; then
264
						darwin_symlink_sdk
265
						darwin_include_paths
266
					fi
245
					;;
267
					;;
246
				*"Apple LLVM version "*)
268
				*"Apple LLVM version "*)
247
					vers=${ccvers#*Apple LLVM version }
269
					vers=${ccvers#*Apple LLVM version }
Lines 504-516 bootstrap_setup() { Link Here
504
	esac
526
	esac
505
527
506
	if [[ ${DARWIN_USE_GCC} == 1 ]] ; then
528
	if [[ ${DARWIN_USE_GCC} == 1 ]] ; then
507
		# setup MacOSX.sdk symlink for GCC, this should probably be
529
		darwin_symlink_sdk
508
		# managed using an eselect module in the future
509
		rm -f "${ROOT}"/MacOSX.sdk
510
		local SDKPATH=$(xcrun --show-sdk-path --sdk macosx)
511
		( cd "${ROOT}" && ln -s "${SDKPATH}" MacOSX.sdk )
512
		einfo "using system sources from ${SDKPATH}"
513
514
		# amend profile, to use gcc one
530
		# amend profile, to use gcc one
515
		profile="${profile}/gcc"
531
		profile="${profile}/gcc"
516
	fi
532
	fi
Lines 1332-1337 bootstrap_libressl() { Link Here
1332
		https://ftp.openbsd.org/pub/OpenBSD/LibreSSL
1348
		https://ftp.openbsd.org/pub/OpenBSD/LibreSSL
1333
}
1349
}
1334
1350
1351
bootstrap_libtapi() {
1352
	# grab the libtapi headers (which are actually compiled headers)
1353
	# but link with libtapi.dylib from CommaandLineTools
1354
1355
	local PN PV A S
1356
	PN=libtapi
1357
	PV=1000.10.8_1
1358
	rev=${CHOST##*darwin}
1359
	A=${PN}-${PV}.darwin_${rev}.x86_64.tbz2
1360
	einfo "Bootstrapping ${A%-*} (link to system dylib)"
1361
1362
	efetch "http://packages.macports.org/libtapi/${A}"
1363
1364
	einfo "Unpacking ${A%-*}"
1365
	S="${PORTAGE_TMPDIR}/${PN}-${PV}"
1366
	rm -rf "${S}"
1367
	mkdir -p "${S}"
1368
	cd "${S}"
1369
	bzip2 -dc "${DISTDIR}/${A}" | tar -xf - || return 1
1370
	cp -r opt/local/include/tapi "${ROOT}"/tmp/usr/include || return 1
1371
1372
	# to link with this lib, pass '-client_name ld' in LDFLAGS
1373
	ln -s /Library/Developer/CommandLineTools/usr/lib/libtapi.dylib "${ROOT}"/tmp/usr/lib
1374
}
1375
1335
bootstrap_stage_host_gentoo() {
1376
bootstrap_stage_host_gentoo() {
1336
	if ! is-rap ; then
1377
	if ! is-rap ; then
1337
		einfo "Shortcut only supports prefix-standalone, but we are bootstrapping"
1378
		einfo "Shortcut only supports prefix-standalone, but we are bootstrapping"
Lines 1453-1458 bootstrap_stage1() { Link Here
1453
			} > "${ROOT}"/tmp/usr/local/bin/java
1494
			} > "${ROOT}"/tmp/usr/local/bin/java
1454
			cp "${ROOT}"/tmp/usr/local/bin/java{,c}
1495
			cp "${ROOT}"/tmp/usr/local/bin/java{,c}
1455
			chmod 755 "${ROOT}"/tmp/usr/local/bin/java{,c}
1496
			chmod 755 "${ROOT}"/tmp/usr/local/bin/java{,c}
1497
1498
			# libtapi.dylib is needed to build binutils-apple in stage2
1499
			[[ ${DARWIN_USE_GCC} == 1 ]] \
1500
				|| [[ -f "${ROOT}"/tmp/usr/lib/libtapi.dylib ]] \
1501
				|| (bootstrap_libtapi) || return 1
1456
			;;
1502
			;;
1457
		*-linux*)
1503
		*-linux*)
1458
			if [[ ! -x "${ROOT}"/tmp/usr/bin/gcc ]] \
1504
			if [[ ! -x "${ROOT}"/tmp/usr/bin/gcc ]] \
Lines 1713-1720 bootstrap_stage2() { Link Here
1713
		$([[ ${CHOST} == *-aix* ]] && echo dev-libs/libiconv ) # bash dependency
1759
		$([[ ${CHOST} == *-aix* ]] && echo dev-libs/libiconv ) # bash dependency
1714
		$([[ ${CHOST} == *-cygwin* ]] && echo dev-libs/libiconv ) # bash dependency
1760
		$([[ ${CHOST} == *-cygwin* ]] && echo dev-libs/libiconv ) # bash dependency
1715
		sys-libs/ncurses
1761
		sys-libs/ncurses
1762
		dev-util/pkgconf # needed to build readline
1716
		sys-libs/readline
1763
		sys-libs/readline
1717
		app-shells/bash
1764
		app-shells/bash
1765
		app-misc/pax-utils # needed to build xz-utils
1718
		app-arch/xz-utils
1766
		app-arch/xz-utils
1719
		sys-apps/sed
1767
		sys-apps/sed
1720
		sys-apps/baselayout-prefix
1768
		sys-apps/baselayout-prefix
Lines 1736-1743 bootstrap_stage2() { Link Here
1736
	[[ ${CHOST} == *-solaris* ]] && echo "=dev-libs/libffi-3.3_rc0" \
1784
	[[ ${CHOST} == *-solaris* ]] && echo "=dev-libs/libffi-3.3_rc0" \
1737
		>> "${ROOT}"/tmp/etc/portage/package.mask
1785
		>> "${ROOT}"/tmp/etc/portage/package.mask
1738
1786
1739
	# unlock GCC on Darwin for DARWIN_USE_GCC bootstraps
1787
	# unlock Darwin builds for GCC and clang bootstraps
1740
	if [[ ${DARWIN_USE_GCC} == 1 ]] ; then
1788
	if [[ -d "${ROOT}/MacOSX.sdk" ]] ; then
1741
		rm -f "${ROOT}"/tmp/MacOSX.sdk
1789
		rm -f "${ROOT}"/tmp/MacOSX.sdk
1742
		( cd "${ROOT}"/tmp && ln -s ../MacOSX.sdk )
1790
		( cd "${ROOT}"/tmp && ln -s ../MacOSX.sdk )
1743
	fi
1791
	fi
Lines 1746-1751 bootstrap_stage2() { Link Here
1746
	# unless we only build the buildtool, bug #603012
1794
	# unless we only build the buildtool, bug #603012
1747
	echo "dev-util/cmake -server" >> "${ROOT}"/tmp/etc/portage/package.use
1795
	echo "dev-util/cmake -server" >> "${ROOT}"/tmp/etc/portage/package.use
1748
1796
1797
	# rhash (dep of cmake) configure can't find the openssl/libressl.
1798
	# ssl use flag allows RHash to "use optimized algorithms"
1799
	# but RHash will work fine without, so disable during bootstrap.
1800
	echo "app-crypt/rhash -ssl" >> "${ROOT}"/tmp/etc/portage/package.use
1801
1749
	emerge_pkgs --nodeps "${pkgs[@]}" || return 1
1802
	emerge_pkgs --nodeps "${pkgs[@]}" || return 1
1750
1803
1751
	# Debian multiarch supported by RAP needs ld to support sysroot.
1804
	# Debian multiarch supported by RAP needs ld to support sysroot.
Lines 2836-2842 EOF Link Here
2836
	export CHOST=$(portageq envvar CHOST)
2889
	export CHOST=$(portageq envvar CHOST)
2837
2890
2838
	# after stage1 and stage2 we should have a bash of our own, which
2891
	# after stage1 and stage2 we should have a bash of our own, which
2839
	# is preferably over the host-provided one, because we know it can
2892
	# is preferable over the host-provided one, because we know it can
2840
	# deal with the bash-constructs we use in stage3 and onwards
2893
	# deal with the bash-constructs we use in stage3 and onwards
2841
	hash -r
2894
	hash -r
2842
2895

Return to bug 757381