Skip to content

Commit

Permalink
scripts/bootstrap-prefix: try harder to find matching SDK to OS
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
grobian committed Sep 28, 2024
1 parent 7e89bde commit 2f9568f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions scripts/bootstrap-prefix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2f9568f

Please sign in to comment.