Lines 246-252
configure_toolchain() {
Link Here
|
246 |
app-arch/libarchive |
246 |
app-arch/libarchive |
247 |
app-crypt/rhash |
247 |
app-crypt/rhash |
248 |
dev-util/cmake |
248 |
dev-util/cmake |
249 |
dev-util/ninja" |
249 |
dev-util/ninja |
|
|
250 |
sys-devel/gnuconfig" |
250 |
case "${ccvers}" in |
251 |
case "${ccvers}" in |
251 |
*"Apple clang version "*) |
252 |
*"Apple clang version "*) |
252 |
vers=${ccvers#*Apple clang version } |
253 |
vers=${ccvers#*Apple clang version } |
Lines 261-266
configure_toolchain() {
Link Here
|
261 |
sys-libs/libcxx" |
262 |
sys-libs/libcxx" |
262 |
CC=clang |
263 |
CC=clang |
263 |
CXX=clang++ |
264 |
CXX=clang++ |
|
|
265 |
# sys-devel/binutils-apple requires sys-libs/tapi, but we |
266 |
# cannot build it first. so, stage2 needs to bootstrap it. |
267 |
#linker="sys-libs/tapi sys-devel/binutils-apple" |
264 |
linker=sys-devel/binutils-apple |
268 |
linker=sys-devel/binutils-apple |
265 |
if [[ ! -d /usr/include ]]; then |
269 |
if [[ ! -d /usr/include ]]; then |
266 |
darwin_symlink_sdk |
270 |
darwin_symlink_sdk |
Lines 330-343
configure_toolchain() {
Link Here
|
330 |
<sys-devel/clang-${cdep}" |
334 |
<sys-devel/clang-${cdep}" |
331 |
fi |
335 |
fi |
332 |
|
336 |
|
|
|
337 |
# libcxx* needs to be after llvm as llvm.eclass checks |
338 |
# for an installed copy llvm. |
333 |
compiler=" |
339 |
compiler=" |
334 |
sys-libs/csu |
340 |
sys-libs/csu |
335 |
dev-libs/libffi |
341 |
dev-libs/libffi |
336 |
${llvm_deps} |
342 |
${llvm_deps} |
337 |
sys-libs/libcxxabi |
|
|
338 |
sys-libs/libcxx |
339 |
sys-devel/llvm |
343 |
sys-devel/llvm |
340 |
sys-devel/clang" |
344 |
sys-devel/clang |
|
|
345 |
sys-libs/libcxxabi |
346 |
sys-libs/libcxx" |
341 |
;; |
347 |
;; |
342 |
*-freebsd*) |
348 |
*-freebsd*) |
343 |
CC=clang |
349 |
CC=clang |
Lines 561-566
bootstrap_setup() {
Link Here
|
561 |
# because jsoncpp requires meson which is not available yet. |
567 |
# because jsoncpp requires meson which is not available yet. |
562 |
# So, cmake needs to temporarily bootstrap its own jsconcpp. |
568 |
# So, cmake needs to temporarily bootstrap its own jsconcpp. |
563 |
dev-util/cmake -system-jsoncpp |
569 |
dev-util/cmake -system-jsoncpp |
|
|
570 |
# disable bootstrapping libcxx* with libunwind |
571 |
sys-libs/libcxxabi -libunwind |
572 |
sys-libs/libcxx -libunwind |
564 |
# Most binary Linux distributions seem to fancy toolchains that |
573 |
# Most binary Linux distributions seem to fancy toolchains that |
565 |
# do not do c++ support (need to install a separate package). |
574 |
# do not do c++ support (need to install a separate package). |
566 |
sys-libs/ncurses -cxx |
575 |
sys-libs/ncurses -cxx |
Lines 1361-1366
bootstrap_libressl() {
Link Here
|
1361 |
https://ftp.openbsd.org/pub/OpenBSD/LibreSSL |
1370 |
https://ftp.openbsd.org/pub/OpenBSD/LibreSSL |
1362 |
} |
1371 |
} |
1363 |
|
1372 |
|
|
|
1373 |
bootstrap_libtapi() { |
1374 |
# grab the libtapi headers (which are actually compiled headers) |
1375 |
# but link with libtapi.dylib from CommaandLineTools |
1376 |
|
1377 |
local PN PV A S |
1378 |
PN=libtapi |
1379 |
PV=1000.10.8_1 |
1380 |
rev=${CHOST##*darwin} |
1381 |
A=${PN}-${PV}.darwin_${rev}.x86_64.tbz2 |
1382 |
einfo "Bootstrapping ${A%-*} (link to system dylib)" |
1383 |
|
1384 |
efetch "http://packages.macports.org/libtapi/${A}" |
1385 |
|
1386 |
einfo "Unpacking ${A%-*}" |
1387 |
S="${PORTAGE_TMPDIR}/${PN}-${PV}" |
1388 |
rm -rf "${S}" |
1389 |
mkdir -p "${S}" |
1390 |
cd "${S}" |
1391 |
bzip2 -dc "${DISTDIR}/${A}" | tar -xf - || return 1 |
1392 |
cp -r opt/local/include/tapi "${ROOT}"/tmp/usr/include || return 1 |
1393 |
|
1394 |
# to link with this lib, pass '-client_name ld' in LDFLAGS |
1395 |
ln -s /Library/Developer/CommandLineTools/usr/lib/libtapi.dylib "${ROOT}"/tmp/usr/lib |
1396 |
} |
1397 |
|
1364 |
bootstrap_stage_host_gentoo() { |
1398 |
bootstrap_stage_host_gentoo() { |
1365 |
if ! is-rap ; then |
1399 |
if ! is-rap ; then |
1366 |
einfo "Shortcut only supports prefix-standalone, but we are bootstrapping" |
1400 |
einfo "Shortcut only supports prefix-standalone, but we are bootstrapping" |
Lines 1779-1789
bootstrap_stage2() {
Link Here
|
1779 |
|
1813 |
|
1780 |
emerge_pkgs --nodeps "${pkgs[@]}" || return 1 |
1814 |
emerge_pkgs --nodeps "${pkgs[@]}" || return 1 |
1781 |
|
1815 |
|
|
|
1816 |
if [[ ${CHOST} == *-darwin* ]]; then |
1817 |
# libtapi.dylib is needed to build the binutils-apple linker, |
1818 |
# but building sys-libs/tapi requires llvm to be installed |
1819 |
# because it uses llvm.eclass which checks for which version |
1820 |
# of llvm is installed. Also, building libtapi includes |
1821 |
# re-building the sources of llvm & clang to get some internal |
1822 |
# binaries that don't get installed, but we haven't installed |
1823 |
# the llvm deps yet. So, we can't install tapi via portage yet. |
1824 |
[[ ${DARWIN_USE_GCC} == 1 ]] \ |
1825 |
|| [[ -f "${ROOT}"/tmp/usr/lib/libtapi.dylib ]] \ |
1826 |
|| (bootstrap_libtapi) || return 1 |
1827 |
fi |
1828 |
|
1782 |
# Debian multiarch supported by RAP needs ld to support sysroot. |
1829 |
# Debian multiarch supported by RAP needs ld to support sysroot. |
1783 |
EXTRA_ECONF=$(rapx --with-sysroot=/) \ |
1830 |
EXTRA_ECONF=$(rapx --with-sysroot=/) \ |
1784 |
emerge_pkgs --nodeps ${linker} || return 1 |
1831 |
emerge_pkgs --nodeps ${linker} || return 1 |
1785 |
|
1832 |
|
|
|
1833 |
local save_CPPFLAGS="${CPPFLAGS}" |
1786 |
for pkg in ${compiler_stage1} ; do |
1834 |
for pkg in ${compiler_stage1} ; do |
|
|
1835 |
if [[ "${pkg}" == *sys-devel/llvm* || ${pkg} == *sys-devel/clang* ]] ; |
1836 |
then |
1837 |
# clang doesn't have the implicit framework paths configured yet. |
1838 |
export CPPFLAGS="${save_CPPFLAGS} -F${ROOT}/MacOSX.sdk/System/Library/Frameworks" |
1839 |
fi |
1840 |
|
1787 |
# <glibc-2.5 does not understand .gnu.hash, use |
1841 |
# <glibc-2.5 does not understand .gnu.hash, use |
1788 |
# --hash-style=both to produce also sysv hash. |
1842 |
# --hash-style=both to produce also sysv hash. |
1789 |
EXTRA_ECONF="--disable-bootstrap $(rapx --with-linker-hash-style=both) --with-local-prefix=${ROOT}" \ |
1843 |
EXTRA_ECONF="--disable-bootstrap $(rapx --with-linker-hash-style=both) --with-local-prefix=${ROOT}" \ |
Lines 1796-1804
bootstrap_stage2() {
Link Here
|
1796 |
if [[ "${pkg}" == *sys-devel/llvm* || ${pkg} == *sys-devel/clang* ]] ; |
1850 |
if [[ "${pkg}" == *sys-devel/llvm* || ${pkg} == *sys-devel/clang* ]] ; |
1797 |
then |
1851 |
then |
1798 |
# we need llvm/clang ASAP for libcxx* doesn't build |
1852 |
# we need llvm/clang ASAP for libcxx* doesn't build |
1799 |
# without C++11 |
1853 |
# without C++11 (this is only for older clang builds) |
1800 |
[[ -x ${ROOT}/tmp/usr/bin/clang ]] && CC=clang |
1854 |
[[ -x ${ROOT}/tmp/usr/bin/clang ]] && CC=clang |
1801 |
[[ -x ${ROOT}/tmp/usr/bin/clang++ ]] && CXX=clang++ |
1855 |
[[ -x ${ROOT}/tmp/usr/bin/clang++ ]] && CXX=clang++ |
|
|
1856 |
|
1857 |
# once clang is installed, drop the INCLUDE_PATH vars |
1858 |
# so that we do not duplicate internal include paths |
1859 |
# (duplicats can cause system header not found issues) |
1860 |
[[ ${INCLUDE_EPREFIX_DARWIN_SDK} == 1 && -d ${ROOT}/tmp/usr/lib/clang ]] \ |
1861 |
&& unset C_INCLUDE_PATH CPLUS_INCLUDE_PATH |
1862 |
|
1863 |
# reset CPPFLAGS to drop the framework path |
1864 |
export CPPFLAGS="${save_CPPFLAGS}" |
1802 |
fi |
1865 |
fi |
1803 |
done |
1866 |
done |
1804 |
|
1867 |
|