@@ -189,7 +189,7 @@ configure_toolchain() {
189
189
* " (GCC) " [1-9]* |" gcc (" * " ) " [1-9]* )
190
190
local cvers=" ${ccvers#* )} " ; cvers=" ${cvers%% .* } "
191
191
# GCC-5 has C11 see above
192
- if [[ ${ccvers } -ge 5 ]] ; then
192
+ if [[ ${cvers } -ge 5 ]] ; then
193
193
: # ok!
194
194
else
195
195
# FIXME: should probably stage1 bootstrap GCC-5
@@ -866,6 +866,27 @@ bootstrap_gnu() {
866
866
myconf=" ${myconf} --disable-perl-regexp"
867
867
fi
868
868
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
+
869
890
# pod2man may be too old (not understanding --utf8) but we don't
870
891
# care about manpages at this stage
871
892
export ac_cv_path_POD2MAN=no
@@ -1244,6 +1265,23 @@ bootstrap_libffi() {
1244
1265
bootstrap_gnu libffi 3.0.8
1245
1266
}
1246
1267
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
+
1247
1285
bootstrap_sed () {
1248
1286
bootstrap_gnu sed 4.5 || \
1249
1287
bootstrap_gnu sed 4.2.2 || bootstrap_gnu sed 4.2.1
@@ -1399,6 +1437,27 @@ bootstrap_stage1() {
1399
1437
[[ -e ${ROOT} /tmp/${x} ]] || ( cd " ${ROOT} " /tmp && ln -s usr/${x} )
1400
1438
done
1401
1439
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
+
1402
1461
configure_toolchain
1403
1462
export CC CXX
1404
1463
@@ -1456,7 +1515,7 @@ bootstrap_stage1() {
1456
1515
|| (bootstrap_grep) || return 1
1457
1516
[[ -x ${ROOT} /tmp/usr/bin/gawk ]] \
1458
1517
|| [[ $( awk --version < /dev/null 2>&1 ) == * GNU" Awk " [456789]* ]] \
1459
- || bootstrap_gawk || return 1
1518
+ || ( bootstrap_gawk) || return 1
1460
1519
# always build our own bash, for we don't know what devilish thing
1461
1520
# we're working with now, bug #650284
1462
1521
[[ -x ${ROOT} /tmp/usr/bin/bash ]] \
@@ -1514,6 +1573,7 @@ bootstrap_stage1() {
1514
1573
fi
1515
1574
;;
1516
1575
esac
1576
+
1517
1577
# Host compiler can output a variety of libdirs. At stage1,
1518
1578
# they should be the same as lib. Otherwise libffi may not be
1519
1579
# found by python.
0 commit comments