Skip to content

Commit 2f78608

Browse files
committed
scripts/bootstrap-prefix: some refinements for Darwin 9
Signed-off-by: Fabian Groffen <[email protected]>
1 parent e0241cd commit 2f78608

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

scripts/bootstrap-prefix.sh

+11-3
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,13 @@ configure_toolchain() {
174174
*darwin*:1)
175175
einfo "Triggering Darwin with GCC toolchain"
176176
compiler_stage1+=" sys-apps/darwin-miscutils"
177-
local ccvers="$(unset CHOST; /usr/bin/gcc --version 2>/dev/null)"
177+
# check if we have gcc-4.2 available, else use plain gcc
178+
# Darwin 9 comes with 4.2 but it isn't enabled by default
179+
if [[ -e $(type -P gcc-4.2) ]] ; then
180+
CC=gcc-4.2
181+
CXX=g++-4.2
182+
fi
183+
local ccvers="$(unset CHOST; ${CC} --version 2>/dev/null)"
178184
local isgcc=
179185
case "${ccvers}" in
180186
*"(GCC) 4.2.1 "*)
@@ -214,7 +220,7 @@ configure_toolchain() {
214220
# https://bugs.gentoo.org/show_bug.cgi?id=538366
215221
compiler_stage1="sys-apps/darwin-miscutils"
216222
compiler_type="clang"
217-
local ccvers="$(unset CHOST; /usr/bin/gcc --version 2>/dev/null)"
223+
local ccvers="$(unset CHOST; ${CC} --version 2>/dev/null)"
218224
local llvm_deps="dev-build/ninja"
219225
case "${ccvers}" in
220226
*"Apple clang version "*|*"Apple LLVM version "*)
@@ -1239,8 +1245,10 @@ bootstrap_zlib() {
12391245
}
12401246

12411247
bootstrap_libffi() {
1248+
# 3.0.8: last version to bootstrap on Darwin 9 x86
12421249
bootstrap_gnu libffi 3.3 || \
1243-
bootstrap_gnu libffi 3.2.1
1250+
bootstrap_gnu libffi 3.2.1 || \
1251+
bootstrap_gnu libffi 3.0.8
12441252
}
12451253

12461254
bootstrap_sed() {

0 commit comments

Comments
 (0)