@@ -439,7 +439,7 @@ if test -z "$AR"; then
439439 aarch64-apple-ios*) AR=arm64-apple-ios-ar ;;
440440 x86_64-apple-ios*-simulator) AR=x86_64-apple-ios-simulator-ar ;;
441441 *)
442- esac
442+ esac
443443fi
444444if test -z "$CC"; then
445445 case "$host" in
@@ -5576,9 +5576,24 @@ fi
55765576# found by configure), but either raise a compilation error (because the
55775577# header definition prevents usage - autoconf doesn't use the headers), or
55785578# raise an error if used at runtime. Force these symbols off.
5579- if test "$ac_sys_system" != "iOS" ; then
5580- AC_CHECK_FUNCS ( [ getentropy getgroups system] )
5581- fi
5579+ # In particular, dup3 and pipe2 are available as of iOS 27 but were
5580+ # incorrectly detected in older simulator versions.
5581+ case "$ac_sys_system" in
5582+ iOS)
5583+ AC_MSG_CHECKING ( [ if iOS SDK is older than 27] )
5584+ ios_sdk_version=$(xcrun --sdk iphoneos --show-sdk-version 2>/dev/null | cut -d. -f1)
5585+ if test -n "$ios_sdk_version" && test "$ios_sdk_version" -ge 27; then
5586+ AC_MSG_RESULT ( [ no] )
5587+ AC_CHECK_FUNCS ( [ dup3 pipe2] )
5588+ else
5589+ AC_MSG_RESULT ( [ yes] )
5590+ fi
5591+ ;;
5592+ *)
5593+ # not iOS
5594+ AC_CHECK_FUNCS ( [ dup3 getentropy getgroups pipe2 system] )
5595+ ;;
5596+ esac
55825597
55835598AC_CHECK_DECL ( [ dirfd] ,
55845599 [ AC_DEFINE ( [ HAVE_DIRFD] , [ 1] ,
@@ -5590,9 +5605,7 @@ AC_CHECK_DECL([dirfd],
55905605# For some functions, having a definition is not sufficient, since
55915606# we want to take their address.
55925607PY_CHECK_FUNC([ chroot] , [ @%:@ include <unistd.h>] )
5593- PY_CHECK_FUNC([ dup3] , [ @%:@ include <unistd.h>] )
55945608PY_CHECK_FUNC([ link] , [ @%:@ include <unistd.h>] )
5595- PY_CHECK_FUNC([ pipe2] , [ @%:@ include <unistd.h>] )
55965609PY_CHECK_FUNC([ symlink] , [ @%:@ include <unistd.h>] )
55975610PY_CHECK_FUNC([ fchdir] , [ @%:@ include <unistd.h>] )
55985611PY_CHECK_FUNC([ fsync] , [ @%:@ include <unistd.h>] )
0 commit comments