This is an automated email from the ASF dual-hosted git repository.

jimjag pushed a commit to branch python3-dev
in repository https://gitbox.apache.org/repos/asf/openoffice.git


The following commit(s) were added to refs/heads/python3-dev by this push:
     new a5678ee7c1 macOS configure: export SDKROOT, fix SDK auto-detection for 
Xcode 13+
a5678ee7c1 is described below

commit a5678ee7c1e9d0cf48a81722d43b91f0e27294e0
Author: Jim Jagielski <[email protected]>
AuthorDate: Tue Jun 30 15:27:07 2026 -0400

    macOS configure: export SDKROOT, fix SDK auto-detection for Xcode 13+
    
    SDKROOT was assigned but never exported, so the resolved clang/cc1
    subprocess couldn't see the SDK sysroot and failed with
    "ld: library 'System' not found" on a bare compile check.
    
    The SDK auto-detection cascade only matched macosx10.x/11.x/12.x in
    `xcodebuild -showsdks` output, so it always failed to find an SDK on
    any Xcode 13+ toolchain. Replaced with a generic macosx<major>.<minor>
    match, picking the newest installed SDK since -showsdks lists oldest
    to newest.
---
 main/configure.ac | 19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)

diff --git a/main/configure.ac b/main/configure.ac
index 6e49d2c834..4c76b05277 100644
--- a/main/configure.ac
+++ b/main/configure.ac
@@ -1146,6 +1146,7 @@ case "$build_os" in
                   enable_systray=no
                fi
                SDKROOT="`xcrun --sdk macosx --show-sdk-path`"
+               export SDKROOT
                if test ! -n "$CC"; then
                   CC="`xcrun -f clang`"
                fi
@@ -3915,18 +3916,13 @@ if test  "$_os" = "Darwin"; then
       MACOSX_DEPLOYMENT_TARGET=$sdk_target
       sdk_path=$with_macosx_sdk
       if test -z "$sdk_path"; then
-          dnl --macosx-sdk not used (or blank): We look for the SDK
+          dnl --macosx-sdk not used (or blank): We look for the latest 
installed SDK.
           dnl Why not MacOSX10.9.sdk? It lacks Python.h (!?)
-          dnl First look for macOS10.x SDKs (Up thru Xcode 12.1)
-          sdk_found=`xcodebuild -showsdks | $EGREP "sdk 
macosx10.(10|11|12|13|14|15)" | sed -e "s/.*sdk //" | tail -n1`
-          dnl If not found, look for macOS11.x SDKs (Xcode 12.2 and later)
-          if test -z "$sdk_found"; then
-             sdk_found=`xcodebuild -showsdks | $EGREP "sdk macosx11.(0|1|2|3)" 
| sed -e "s/.*sdk //" | tail -n1`
-          fi
-          dnl If not found, look for macOS12.x SDKs (Xcode 13.0 and later)
-          if test -z "$sdk_found"; then
-             sdk_found=`xcodebuild -showsdks | $EGREP "sdk macosx12.(0|1|2)" | 
sed -e "s/.*sdk //" | tail -n1`
-          fi
+          dnl xcodebuild -showsdks lists SDKs oldest-to-newest, so the last
+          dnl "macosx<major>.<minor>" match is the newest installed one. A 
newer
+          dnl SDK than the deployment target is fine: MACOSX_DEPLOYMENT_TARGET
+          dnl (not the SDK version) controls backward compatibility.
+          sdk_found=`xcodebuild -showsdks | $EGREP "sdk 
macosx[[0-9]]+\.[[0-9]]+" | sed -e "s/.*sdk //" | tail -n1`
           if test -z "$sdk_found"; then
              AC_MSG_ERROR([No SDK with OSX $sdk_target compatibility found])
           else
@@ -3951,6 +3947,7 @@ if test  "$_os" = "Darwin"; then
 
       MACOSX_SDK_PATH=$sdk_path
       SDKROOT=$sdk_path
+      export SDKROOT
    fi
 
 fi

Reply via email to