gh-114099 - Add iOS testbed, plus Makefile target to invoke it. (gh-115930)

This commit is contained in:
Russell Keith-Magee 2024-03-07 12:24:52 +08:00 committed by GitHub
parent bc708c76d2
commit b33980a2e3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
21 changed files with 1195 additions and 126 deletions

150
configure generated vendored
View file

@ -4085,6 +4085,52 @@ fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: \"$MACHDEP\"" >&5
printf "%s\n" "\"$MACHDEP\"" >&6; }
# On cross-compile builds, configure will look for a host-specific compiler by
# prepending the user-provided host triple to the required binary name.
#
# On iOS, this results in binaries like "arm64-apple-ios12.0-simulator-gcc",
# which isn't a binary that exists, and isn't very convenient, as it contains the
# iOS version. As the default cross-compiler name won't exist, configure falls
# back to gcc, which *definitely* won't work. We're providing wrapper scripts for
# these tools; the binary names of these scripts are better defaults than "gcc".
# This only requires that the user put the platform scripts folder (e.g.,
# "iOS/Resources/bin") in their path, rather than defining platform-specific
# names/paths for AR, CC, CPP, and CXX explicitly; and if the user forgets to
# either put the platform scripts folder in the path, or specify CC etc,
# configure will fail.
if test -z "$AR"; then
case "$host" in
aarch64-apple-ios*-simulator) AR=arm64-apple-ios-simulator-ar ;;
aarch64-apple-ios*) AR=arm64-apple-ios-ar ;;
x86_64-apple-ios*-simulator) AR=x86_64-apple-ios-simulator-ar ;;
*)
esac
fi
if test -z "$CC"; then
case "$host" in
aarch64-apple-ios*-simulator) CC=arm64-apple-ios-simulator-clang ;;
aarch64-apple-ios*) CC=arm64-apple-ios-clang ;;
x86_64-apple-ios*-simulator) CC=x86_64-apple-ios-simulator-clang ;;
*)
esac
fi
if test -z "$CPP"; then
case "$host" in
aarch64-apple-ios*-simulator) CPP=arm64-apple-ios-simulator-cpp ;;
aarch64-apple-ios*) CPP=arm64-apple-ios-cpp ;;
x86_64-apple-ios*-simulator) CPP=x86_64-apple-ios-simulator-cpp ;;
*)
esac
fi
if test -z "$CXX"; then
case "$host" in
aarch64-apple-ios*-simulator) CXX=arm64-apple-ios-simulator-clang ;;
aarch64-apple-ios*) CXX=arm64-apple-ios-clang ;;
x86_64-apple-ios*-simulator) CXX=x86_64-apple-ios-simulator-clang ;;
*)
esac
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --enable-universalsdk" >&5
printf %s "checking for --enable-universalsdk... " >&6; }
# Check whether --enable-universalsdk was given.
@ -4200,37 +4246,38 @@ then :
enableval=$enable_framework;
case $enableval in
yes)
if test "$ac_sys_system" = "iOS"; then
as_fn_error $? "iOS builds must provide an explicit path for --enable-framework" "$LINENO" 5
fi
enableval=/Library/Frameworks
case $ac_sys_system in
Darwin) enableval=/Library/Frameworks ;;
iOS) enableval=iOS/Frameworks/\$\(MULTIARCH\) ;;
*) as_fn_error $? "Unknown platform for framework build" "$LINENO" 5
esac
esac
case $enableval in
no)
if test "$ac_sys_system" = "iOS"; then
as_fn_error $? "iOS builds must use --enable-framework=<install path>" "$LINENO" 5
fi
case $ac_sys_system in
iOS) as_fn_error $? "iOS builds must use --enable-framework" "$LINENO" 5 ;;
*)
PYTHONFRAMEWORK=
PYTHONFRAMEWORKDIR=no-framework
PYTHONFRAMEWORKPREFIX=
PYTHONFRAMEWORKINSTALLDIR=
PYTHONFRAMEWORKINSTALLNAMEPREFIX=
RESSRCDIR=
FRAMEWORKINSTALLFIRST=
FRAMEWORKINSTALLLAST=
FRAMEWORKALTINSTALLFIRST=
FRAMEWORKALTINSTALLLAST=
FRAMEWORKPYTHONW=
INSTALLTARGETS="commoninstall bininstall maninstall"
PYTHONFRAMEWORK=
PYTHONFRAMEWORKDIR=no-framework
PYTHONFRAMEWORKPREFIX=
PYTHONFRAMEWORKINSTALLDIR=
PYTHONFRAMEWORKINSTALLNAMEPREFIX=
RESSRCDIR=
FRAMEWORKINSTALLFIRST=
FRAMEWORKINSTALLLAST=
FRAMEWORKALTINSTALLFIRST=
FRAMEWORKALTINSTALLLAST=
FRAMEWORKPYTHONW=
INSTALLTARGETS="commoninstall bininstall maninstall"
if test "x${prefix}" = "xNONE"; then
FRAMEWORKUNIXTOOLSPREFIX="${ac_default_prefix}"
else
FRAMEWORKUNIXTOOLSPREFIX="${prefix}"
fi
enable_framework=
if test "x${prefix}" = "xNONE"; then
FRAMEWORKUNIXTOOLSPREFIX="${ac_default_prefix}"
else
FRAMEWORKUNIXTOOLSPREFIX="${prefix}"
fi
enable_framework=
esac
;;
*)
PYTHONFRAMEWORKPREFIX="${enableval}"
@ -4325,29 +4372,28 @@ then :
else $as_nop
if test "$ac_sys_system" = "iOS"; then
as_fn_error $? "iOS builds must use --enable-framework=<install path>" "$LINENO" 5
fi
PYTHONFRAMEWORK=
PYTHONFRAMEWORKDIR=no-framework
PYTHONFRAMEWORKPREFIX=
PYTHONFRAMEWORKINSTALLDIR=
PYTHONFRAMEWORKINSTALLNAMEPREFIX=
RESSRCDIR=
FRAMEWORKINSTALLFIRST=
FRAMEWORKINSTALLLAST=
FRAMEWORKALTINSTALLFIRST=
FRAMEWORKALTINSTALLLAST=
FRAMEWORKPYTHONW=
INSTALLTARGETS="commoninstall bininstall maninstall"
if test "x${prefix}" = "xNONE" ; then
FRAMEWORKUNIXTOOLSPREFIX="${ac_default_prefix}"
else
FRAMEWORKUNIXTOOLSPREFIX="${prefix}"
fi
enable_framework=
case $ac_sys_system in
iOS) as_fn_error $? "iOS builds must use --enable-framework" "$LINENO" 5 ;;
*)
PYTHONFRAMEWORK=
PYTHONFRAMEWORKDIR=no-framework
PYTHONFRAMEWORKPREFIX=
PYTHONFRAMEWORKINSTALLDIR=
PYTHONFRAMEWORKINSTALLNAMEPREFIX=
RESSRCDIR=
FRAMEWORKINSTALLFIRST=
FRAMEWORKINSTALLLAST=
FRAMEWORKALTINSTALLFIRST=
FRAMEWORKALTINSTALLLAST=
FRAMEWORKPYTHONW=
INSTALLTARGETS="commoninstall bininstall maninstall"
if test "x${prefix}" = "xNONE" ; then
FRAMEWORKUNIXTOOLSPREFIX="${ac_default_prefix}"
else
FRAMEWORKUNIXTOOLSPREFIX="${prefix}"
fi
enable_framework=
esac
fi
@ -12773,8 +12819,8 @@ then
fi
;;
iOS/*)
LDSHARED='$(CC) -dynamiclib -F . -framework Python'
LDCXXSHARED='$(CXX) -dynamiclib -F . -framework Python'
LDSHARED='$(CC) -dynamiclib -F . -framework $(PYTHONFRAMEWORK)'
LDCXXSHARED='$(CXX) -dynamiclib -F . -framework $(PYTHONFRAMEWORK)'
BLDSHARED="$LDSHARED"
;;
Emscripten|WASI)