mirror of
https://github.com/sudo-project/sudo.git
synced 2025-08-29 05:17:54 +00:00
Better matching of macOS version to SDK path.
This commit is contained in:
parent
ad220d72d4
commit
981cc2f8e3
@ -369,20 +369,34 @@ case "$osversion" in
|
|||||||
sdkvers=`echo "${osversion}" | sed -e 's/^macos\([0-9][0-9]\)\([0-9]*\)-.*$/\1.\2/' -e 's/\.$//'`
|
sdkvers=`echo "${osversion}" | sed -e 's/^macos\([0-9][0-9]\)\([0-9]*\)-.*$/\1.\2/' -e 's/\.$//'`
|
||||||
# SDKs may be under Xcode.app or CommandLineTools (for non-Xcode)
|
# SDKs may be under Xcode.app or CommandLineTools (for non-Xcode)
|
||||||
if [ -d "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs" ]; then
|
if [ -d "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs" ]; then
|
||||||
SDK_DIR="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs"
|
SDKS="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs"
|
||||||
elif [ -d "/Library/Developer/CommandLineTools/SDKs" ]; then
|
elif [ -d "/Library/Developer/CommandLineTools/SDKs" ]; then
|
||||||
SDK_DIR="/Library/Developer/CommandLineTools/SDKs"
|
SDKS="/Library/Developer/CommandLineTools/SDKs"
|
||||||
else
|
else
|
||||||
echo "unable to find macOS SDKs directory" 1>&2
|
echo "unable to find macOS SDKs directory" 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
SDK_DIR="${SDK_DIR}/MacOSX${sdkvers}.sdk"
|
while :; do
|
||||||
if [ -d "${SDK_DIR}" ]; then
|
SDK_DIR="${SDKS}/MacOSX${sdkvers}.sdk"
|
||||||
SDK_FLAGS="-isysroot ${SDK_DIR} -mmacosx-version-min=${sdkvers}"
|
if [ -d "${SDK_DIR}" ]; then
|
||||||
else
|
SDK_FLAGS="-isysroot ${SDK_DIR} -mmacosx-version-min=${sdkvers}"
|
||||||
echo "unable to find SDKs directory for macOS $sdkvers" 1>&2
|
break
|
||||||
exit 1
|
fi
|
||||||
fi
|
case "$sdkvers" in
|
||||||
|
*.00)
|
||||||
|
# Try MacOSXMM.0.sdk
|
||||||
|
sdkvers=${sdkvers%0}
|
||||||
|
;;
|
||||||
|
*.0)
|
||||||
|
# Try MacOSXMM.sdk
|
||||||
|
sdkvers=${sdkvers%.0}
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "missing $SDK_DIR" 1>&2
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
fi
|
fi
|
||||||
export CFLAGS="-O2 -g $ARCH_FLAGS $SDK_FLAGS"
|
export CFLAGS="-O2 -g $ARCH_FLAGS $SDK_FLAGS"
|
||||||
export LDFLAGS="$ARCH_FLAGS $SDK_FLAGS"
|
export LDFLAGS="$ARCH_FLAGS $SDK_FLAGS"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user