summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabian Groffen <grobian@gentoo.org>2024-09-28 15:03:56 +0200
committerFabian Groffen <grobian@gentoo.org>2024-09-28 15:03:56 +0200
commit2f9568f025368d6c9a794918536bac653867f0ba (patch)
tree625293950a0d5f373d3408d699938e557ee68308
parentscripts/bootstrap-prefix: drop obsolete darwin rpath workaround (diff)
downloadprefix-2f9568f025368d6c9a794918536bac653867f0ba.tar.gz
prefix-2f9568f025368d6c9a794918536bac653867f0ba.tar.bz2
prefix-2f9568f025368d6c9a794918536bac653867f0ba.zip
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@gentoo.org>
-rwxr-xr-xscripts/bootstrap-prefix.sh8
1 files 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