Skip to content

Commit c682495

Browse files
committed
scripts/bootstrap-prefix: bootstrap GCC-5 on Darwin 9
This is sufficient to compile Python, and should be sufficient to compile GCC-13. Signed-off-by: Fabian Groffen <[email protected]>
1 parent 99a5383 commit c682495

File tree

1 file changed

+62
-2
lines changed

1 file changed

+62
-2
lines changed

scripts/bootstrap-prefix.sh

+62-2
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ configure_toolchain() {
189189
*"(GCC) "[1-9]*|"gcc ("*") "[1-9]*)
190190
local cvers="${ccvers#*)}"; cvers="${cvers%%.*}"
191191
# GCC-5 has C11 see above
192-
if [[ ${ccvers} -ge 5 ]] ; then
192+
if [[ ${cvers} -ge 5 ]] ; then
193193
: # ok!
194194
else
195195
# FIXME: should probably stage1 bootstrap GCC-5
@@ -866,6 +866,27 @@ bootstrap_gnu() {
866866
myconf="${myconf} --disable-perl-regexp"
867867
fi
868868

869+
if [[ ${PN} == "mpfr" || ${PN} == "mpc" || ${PN} == "gcc" ]] ; then
870+
[[ -e "${ROOT}"/tmp/usr/include/gmp.h ]] \
871+
&& myconf="${myconf} --with-gmp=${ROOT}/tmp/usr"
872+
fi
873+
if [[ ${PN} == "mpc" || ${PN} == "gcc" ]] ; then
874+
[[ -e "${ROOT}"/tmp/usr/include/mpfr.h ]] \
875+
&& myconf="${myconf} --with-mpfr=${ROOT}/tmp/usr"
876+
fi
877+
if [[ ${PN} == "gcc" ]] ; then
878+
[[ -e "${ROOT}"/tmp/usr/include/mpc.h ]] \
879+
&& myconf="${myconf} --with-mpc=${ROOT}/tmp/usr"
880+
881+
myconf="${myconf} --enable-languages=c,c++"
882+
myconf="${myconf} --disable-bootstrap"
883+
myconf="${myconf} --disable-multilib"
884+
myconf="${myconf} --disable-nls"
885+
886+
export CFLAGS="-O1 -pipe"
887+
export CXXFLAGS="-O1 -pipe"
888+
fi
889+
869890
# pod2man may be too old (not understanding --utf8) but we don't
870891
# care about manpages at this stage
871892
export ac_cv_path_POD2MAN=no
@@ -1244,6 +1265,23 @@ bootstrap_libffi() {
12441265
bootstrap_gnu libffi 3.0.8
12451266
}
12461267

1268+
bootstrap_gmp() {
1269+
bootstrap_gnu gmp 6.2.1
1270+
}
1271+
1272+
bootstrap_mpfr() {
1273+
bootstrap_gnu mpfr 4.1.0
1274+
}
1275+
1276+
bootstrap_mpc() {
1277+
bootstrap_gnu mpc 1.2.1
1278+
}
1279+
1280+
bootstrap_gcc5() {
1281+
# bootstraps with gcc-4.0.1 (Darwin 8), provides C11
1282+
bootstrap_gnu gcc 5.5.0
1283+
}
1284+
12471285
bootstrap_sed() {
12481286
bootstrap_gnu sed 4.5 || \
12491287
bootstrap_gnu sed 4.2.2 || bootstrap_gnu sed 4.2.1
@@ -1399,6 +1437,27 @@ bootstrap_stage1() {
13991437
[[ -e ${ROOT}/tmp/${x} ]] || ( cd "${ROOT}"/tmp && ln -s usr/${x} )
14001438
done
14011439

1440+
# we could check compiler version here, but we just know
1441+
# it's Darwin 8 and 9 being affected here, so handle them to
1442+
# get a GCC-5 which is sufficient to compile the current tree
1443+
# packages
1444+
# see also configure_toolchain
1445+
if [[ ${CHOST} == *-darwin[89] ]] ; then
1446+
# benefit from 4.2 if it's present
1447+
if [[ -e /usr/bin/gcc-4.2 ]] ; then
1448+
export CC=gcc-4.2
1449+
export CXX=g++-4.2
1450+
fi
1451+
[[ -e ${ROOT}/tmp/usr/include/gmp.h ]] \
1452+
|| (bootstrap_gmp) || return 1
1453+
[[ -e ${ROOT}/tmp/usr/include/mpfr.h ]] \
1454+
|| (bootstrap_mpfr) || return 1
1455+
[[ -e ${ROOT}/tmp/usr/include/mpc.h ]] \
1456+
|| (bootstrap_mpc) || return 1
1457+
[[ -x ${ROOT}/tmp/usr/bin/gcc ]] \
1458+
|| (bootstrap_gcc5) || return 1
1459+
fi
1460+
14021461
configure_toolchain
14031462
export CC CXX
14041463

@@ -1456,7 +1515,7 @@ bootstrap_stage1() {
14561515
|| (bootstrap_grep) || return 1
14571516
[[ -x ${ROOT}/tmp/usr/bin/gawk ]] \
14581517
|| [[ $(awk --version < /dev/null 2>&1) == *GNU" Awk "[456789]* ]] \
1459-
|| bootstrap_gawk || return 1
1518+
|| (bootstrap_gawk) || return 1
14601519
# always build our own bash, for we don't know what devilish thing
14611520
# we're working with now, bug #650284
14621521
[[ -x ${ROOT}/tmp/usr/bin/bash ]] \
@@ -1514,6 +1573,7 @@ bootstrap_stage1() {
15141573
fi
15151574
;;
15161575
esac
1576+
15171577
# Host compiler can output a variety of libdirs. At stage1,
15181578
# they should be the same as lib. Otherwise libffi may not be
15191579
# found by python.

0 commit comments

Comments
 (0)