8000 Detect macOS SDKROOT with xcrun · python/cpython@7932611 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7932611

Browse files
committed
Detect macOS SDKROOT with xcrun
1 parent 5fabd8b commit 7932611

File tree

2 files changed

+154
-0
lines changed

2 files changed

+154
-0
lines changed

configure

Lines changed: 125 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

configure.ac

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -713,6 +713,21 @@ fi
713713

714714
if test "$ac_sys_system" = "Darwin"
715715
then
716+
dnl look for SDKROOT
717+
AC_CHECK_PROG([HAS_XCRUN], [xcrun], [yes], [missing])
718+
AC_MSG_CHECKING([macOS SDKROOT])
719+
if test -z "$SDKROOT"; then
720+
dnl SDKROOT not set
721+
if test "$HAS_XCRUN" = "yes"; then
722+
dnl detect with Xcode
723+
SDKROOT=$(xcrun --show-sdk-path)
724+
else
725+
dnl default to root
726+
SDKROOT="/"
727+
fi
728+
fi
729+
AC_MSG_RESULT([$SDKROOT])
730+
716731
# Compiler selection on MacOSX is more complicated than
717732
# AC_PROG_CC can handle, see Mac/README for more
718733
# information
@@ -3574,6 +3589,20 @@ AS_VAR_IF([with_system_ffi], [yes], [
35743589
])
35753590
])
35763591
])
3592+
], [
3593+
AS_VAR_IF([ac_sys_system], [Darwin], [
3594+
WITH_SAVE_ENV([
3595+
CFLAGS="${SDKROOT}/usr/include/ffi $CFLAGS"
3596+
AC_CHECK_HEADER([ffi.h], [
3597+
AC_CHECK_LIB([ffi], [ffi_call], [
3598+
dnl use ffi from SDK root
3599+
have_libffi=yes
3600+
LIBFFI_CFLAGS="${SDKROOT}/usr/include/ffi -DUSING_APPLE_OS_LIBFFI=1"
3601+
LIBFFI_LIBS="-lffi"
3602+
], [have_libffi=no])
3603+
])
3604+
])
3605+
])
35773606
])
35783607

35793608
ctypes_malloc_closure=no

0 commit comments

Comments
 (0)
0