commit:     2f78608740da9ba4dda7194f2696d64a1fb90fef
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Tue Jan 30 11:32:54 2024 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Tue Jan 30 11:32:54 2024 +0000
URL:        https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=2f786087

scripts/bootstrap-prefix: some refinements for Darwin 9

Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>

 scripts/bootstrap-prefix.sh | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/scripts/bootstrap-prefix.sh b/scripts/bootstrap-prefix.sh
index 91463681fe..5fdf93beeb 100755
--- a/scripts/bootstrap-prefix.sh
+++ b/scripts/bootstrap-prefix.sh
@@ -174,7 +174,13 @@ configure_toolchain() {
                *darwin*:1)
                        einfo "Triggering Darwin with GCC toolchain"
                        compiler_stage1+=" sys-apps/darwin-miscutils"
-                       local ccvers="$(unset CHOST; /usr/bin/gcc --version 
2>/dev/null)"
+                       # check if we have gcc-4.2 available, else use plain gcc
+                       # Darwin 9 comes with 4.2 but it isn't enabled by 
default
+                       if [[ -e $(type -P gcc-4.2) ]] ; then
+                               CC=gcc-4.2
+                               CXX=g++-4.2
+                       fi
+                       local ccvers="$(unset CHOST; ${CC} --version 
2>/dev/null)"
                        local isgcc=
                        case "${ccvers}" in
                                *"(GCC) 4.2.1 "*)
@@ -214,7 +220,7 @@ configure_toolchain() {
                        # https://bugs.gentoo.org/show_bug.cgi?id=538366
                        compiler_stage1="sys-apps/darwin-miscutils"
                        compiler_type="clang"
-                       local ccvers="$(unset CHOST; /usr/bin/gcc --version 
2>/dev/null)"
+                       local ccvers="$(unset CHOST; ${CC} --version 
2>/dev/null)"
                        local llvm_deps="dev-build/ninja"
                        case "${ccvers}" in
                                *"Apple clang version "*|*"Apple LLVM version 
"*)
@@ -1239,8 +1245,10 @@ bootstrap_zlib() {
 }
 
 bootstrap_libffi() {
+       # 3.0.8: last version to bootstrap on Darwin 9 x86
        bootstrap_gnu libffi 3.3 || \
-       bootstrap_gnu libffi 3.2.1
+       bootstrap_gnu libffi 3.2.1 || \
+       bootstrap_gnu libffi 3.0.8
 }
 
 bootstrap_sed() {

Reply via email to