summaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authorRussell Keith-Magee <russell@keith-magee.com>2024-03-07 04:24:52 (GMT)
committerGitHub <noreply@github.com>2024-03-07 04:24:52 (GMT)
commitb33980a2e3f195c63e3aadeeebd8e50eb41ad70c (patch)
tree09e24a9917954a4517c7b1ed61e539bbd9a92056 /configure
parentbc708c76d2b3ad7bbfd6577a4444e1e47db60fd6 (diff)
downloadcpython-b33980a2e3f195c63e3aadeeebd8e50eb41ad70c.zip
cpython-b33980a2e3f195c63e3aadeeebd8e50eb41ad70c.tar.gz
cpython-b33980a2e3f195c63e3aadeeebd8e50eb41ad70c.tar.bz2
gh-114099 - Add iOS testbed, plus Makefile target to invoke it. (gh-115930)
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure150
1 files changed, 98 insertions, 52 deletions
diff --git a/configure b/configure
index c758749..e62cb2b 100755
--- a/configure
+++ b/configure
@@ -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)