@@ -3153,6 +3153,52 @@ fi
31533153{ $as_echo "$as_me:${as_lineno-$LINENO}: result: \"$MACHDEP\"" >&5
31543154$as_echo "\"$MACHDEP\"" >&6; }
31553155
3156+ # On cross-compile builds, configure will look for a host-specific compiler by
3157+ # prepending the user-provided host triple to the required binary name.
3158+ #
3159+ # On iOS, this results in binaries like "arm64-apple-ios12.0-simulator-gcc",
3160+ # which isn't a binary that exists, and isn't very convenient, as it contains the
3161+ # iOS version. As the default cross-compiler name won't exist, configure falls
3162+ # back to gcc, which *definitely* won't work. We're providing wrapper scripts for
3163+ # these tools; the binary names of these scripts are better defaults than "gcc".
3164+ # This only requires that the user put the platform scripts folder (e.g.,
3165+ # "iOS/Resources/bin") in their path, rather than defining platform-specific
3166+ # names/paths for AR, CC, CPP, and CXX explicitly; and if the user forgets to
3167+ # either put the platform scripts folder in the path, or specify CC etc,
3168+ # configure will fail.
3169+ if test -z "$AR"; then
3170+ case "$host" in
3171+ aarch64-apple-ios*-simulator) AR=arm64-apple-ios-simulator-ar ;;
3172+ aarch64-apple-ios*) AR=arm64-apple-ios-ar ;;
3173+ x86_64-apple-ios*-simulator) AR=x86_64-apple-ios-simulator-ar ;;
3174+ *)
3175+ esac
3176+ fi
3177+ if test -z "$CC"; then
3178+ case "$host" in
3179+ aarch64-apple-ios*-simulator) CC=arm64-apple-ios-simulator-clang ;;
3180+ aarch64-apple-ios*) CC=arm64-apple-ios-clang ;;
3181+ x86_64-apple-ios*-simulator) CC=x86_64-apple-ios-simulator-clang ;;
3182+ *)
3183+ esac
3184+ fi
3185+ if test -z "$CPP"; then
3186+ case "$host" in
3187+ aarch64-apple-ios*-simulator) CPP=arm64-apple-ios-simulator-cpp ;;
3188+ aarch64-apple-ios*) CPP=arm64-apple-ios-cpp ;;
3189+ x86_64-apple-ios*-simulator) CPP=x86_64-apple-ios-simulator-cpp ;;
3190+ *)
3191+ esac
3192+ fi
3193+ if test -z "$CXX"; then
3194+ case "$host" in
3195+ aarch64-apple-ios*-simulator) CXX=arm64-apple-ios-simulator-clang ;;
3196+ aarch64-apple-ios*) CXX=arm64-apple-ios-clang ;;
3197+ x86_64-apple-ios*-simulator) CXX=x86_64-apple-ios-simulator-clang ;;
3198+ *)
3199+ esac
3200+ fi
3201+
31563202{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --enable-universalsdk" >&5
31573203$as_echo_n "checking for --enable-universalsdk... " >&6; }
31583204# Check whether --enable-universalsdk was given.
@@ -3264,37 +3310,38 @@ if test "${enable_framework+set}" = set; then :
32643310 enableval=$enable_framework;
32653311 case $enableval in
32663312 yes)
3267- if test " $ac_sys_system" = "iOS"; then
3268- as_fn_error $? "iOS builds must provide an explicit path for --enable-framework" "$LINENO" 5
3269- fi
3270-
3271- enableval=/Library/Frameworks
3313+ case $ac_sys_system in
3314+ Darwin) enableval=/Library/Frameworks ;;
3315+ iOS) enableval=iOS/Frameworks/\$\(MULTIARCH\) ;;
3316+ *) as_fn_error $? "Unknown platform for framework build" "$LINENO" 5
3317+ esac
32723318 esac
3319+
32733320 case $enableval in
32743321 no)
3275- if test "$ac_sys_system" = "iOS"; then
3276- as_fn_error $? "iOS builds must use --enable-framework=<install path>" "$LINENO" 5
3277- fi
3322+ case $ac_sys_system in
3323+ iOS) as_fn_error $? "iOS builds must use --enable-framework" "$LINENO" 5 ;;
3324+ *)
3325+ PYTHONFRAMEWORK=
3326+ PYTHONFRAMEWORKDIR=no-framework
3327+ PYTHONFRAMEWORKPREFIX=
3328+ PYTHONFRAMEWORKINSTALLDIR=
3329+ PYTHONFRAMEWORKINSTALLNAMEPREFIX=
3330+ RESSRCDIR=
3331+ FRAMEWORKINSTALLFIRST=
3332+ FRAMEWORKINSTALLLAST=
3333+ FRAMEWORKALTINSTALLFIRST=
3334+ FRAMEWORKALTINSTALLLAST=
3335+ FRAMEWORKPYTHONW=
3336+ INSTALLTARGETS="commoninstall bininstall maninstall"
32783337
3279- PYTHONFRAMEWORK=
3280- PYTHONFRAMEWORKDIR=no-framework
3281- PYTHONFRAMEWORKPREFIX=
3282- PYTHONFRAMEWORKINSTALLDIR=
3283- PYTHONFRAMEWORKINSTALLNAMEPREFIX=
3284- RESSRCDIR=
3285- FRAMEWORKINSTALLFIRST=
3286- FRAMEWORKINSTALLLAST=
3287- FRAMEWORKALTINSTALLFIRST=
3288- FRAMEWORKALTINSTALLLAST=
3289- FRAMEWORKPYTHONW=
3290- INSTALLTARGETS="commoninstall bininstall maninstall"
3291-
3292- if test "x${prefix}" = "xNONE"; then
3293- FRAMEWORKUNIXTOOLSPREFIX="${ac_default_prefix}"
3294- else
3295- FRAMEWORKUNIXTOOLSPREFIX="${prefix}"
3296- fi
3297- enable_framework=
3338+ if test "x${prefix}" = "xNONE"; then
3339+ FRAMEWORKUNIXTOOLSPREFIX="${ac_default_prefix}"
3340+ else
3341+ FRAMEWORKUNIXTOOLSPREFIX="${prefix}"
3342+ fi
3343+ enable_framework=
3344+ esac
32983345 ;;
32993346 *)
33003347 PYTHONFRAMEWORKPREFIX="${enableval}"
@@ -3389,29 +3436,28 @@ if test "${enable_framework+set}" = set; then :
33893436
33903437else
33913438
3392- if test "$ac_sys_system" = "iOS"; then
3393- as_fn_error $? "iOS builds must use --enable-framework=<install path>" "$LINENO" 5
3394- fi
3395-
3396- PYTHONFRAMEWORK=
3397- PYTHONFRAMEWORKDIR=no-framework
3398- PYTHONFRAMEWORKPREFIX=
3399- PYTHONFRAMEWORKINSTALLDIR=
3400- PYTHONFRAMEWORKINSTALLNAMEPREFIX=
3401- RESSRCDIR=
3402- FRAMEWORKINSTALLFIRST=
3403- FRAMEWORKINSTALLLAST=
3404- FRAMEWORKALTINSTALLFIRST=
3405- FRAMEWORKALTINSTALLLAST=
3406- FRAMEWORKPYTHONW=
3407- INSTALLTARGETS="commoninstall bininstall maninstall"
3408- if test "x${prefix}" = "xNONE" ; then
3409- FRAMEWORKUNIXTOOLSPREFIX="${ac_default_prefix}"
3410- else
3411- FRAMEWORKUNIXTOOLSPREFIX="${prefix}"
3412- fi
3413- enable_framework=
3414-
3439+ case $ac_sys_system in
3440+ iOS) as_fn_error $? "iOS builds must use --enable-framework" "$LINENO" 5 ;;
3441+ *)
3442+ PYTHONFRAMEWORK=
3443+ PYTHONFRAMEWORKDIR=no-framework
3444+ PYTHONFRAMEWORKPREFIX=
3445+ PYTHONFRAMEWORKINSTALLDIR=
3446+ PYTHONFRAMEWORKINSTALLNAMEPREFIX=
3447+ RESSRCDIR=
3448+ FRAMEWORKINSTALLFIRST=
3449+ FRAMEWORKINSTALLLAST=
3450+ FRAMEWORKALTINSTALLFIRST=
3451+ FRAMEWORKALTINSTALLLAST=
3452+ FRAMEWORKPYTHONW=
3453+ INSTALLTARGETS="commoninstall bininstall maninstall"
3454+ if test "x${prefix}" = "xNONE" ; then
3455+ FRAMEWORKUNIXTOOLSPREFIX="${ac_default_prefix}"
3456+ else
3457+ FRAMEWORKUNIXTOOLSPREFIX="${prefix}"
3458+ fi
3459+ enable_framework=
3460+ esac
34153461
34163462fi
34173463
@@ -9993,8 +10039,8 @@ then
999310039 fi
999410040 ;;
999510041 iOS/*)
9996- LDSHARED='$(CC) -dynamiclib -F . -framework Python '
9997- LDCXXSHARED='$(CXX) -dynamiclib -F . -framework Python '
10042+ LDSHARED='$(CC) -dynamiclib -F . -framework $(PYTHONFRAMEWORK) '
10043+ LDCXXSHARED='$(CXX) -dynamiclib -F . -framework $(PYTHONFRAMEWORK) '
999810044 BLDSHARED="$LDSHARED"
999910045 ;;
1000010046 Linux*|GNU*|QNX*|VxWorks*)
0 commit comments