commit:     2f9568f025368d6c9a794918536bac653867f0ba
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Sat Sep 28 13:03:56 2024 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Sat Sep 28 13:03:56 2024 +0000
URL:        https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=2f9568f0

scripts/bootstrap-prefix: try harder to find matching SDK to OS

When xcrun returns the latest SDK, no symlink is present, so don't use
that to decide whether or not to find a matching SDK on macOS.

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

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

diff --git a/scripts/bootstrap-prefix.sh b/scripts/bootstrap-prefix.sh
index 73e6d10bd8..fe1b07bf25 100755
--- a/scripts/bootstrap-prefix.sh
+++ b/scripts/bootstrap-prefix.sh
@@ -1483,11 +1483,13 @@ bootstrap_stage1() {
                        SDKPATH=/
                else
                        SDKPATH=$(xcrun --show-sdk-path --sdk macosx)
-                       if [[ -L ${SDKPATH} ]] ; then
+                       if [[ -e ${SDKPATH} ]] ; then
                                local fsdk
                                local osvers
-                               # try and find a matching OS SDK
-                               fsdk="$(readlink "${SDKPATH}")"
+                               # try and find a matching OS SDK, xcrun seems 
to return
+                               # the latest installed, so not necessarily the 
one
+                               # matching the macOS version
+                               [[ -L ${SDKPATH} ]] && fsdk="$(readlink 
"${SDKPATH}")"
                                # note readlink -f is not supported on older 
versions of
                                # macOS so need to emulate it
                                if [[ ${fsdk} != /* ]] ; then

Reply via email to