@@ -3125,6 +3125,52 @@ fi
3125
3125
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: \"$MACHDEP\"" >&5
3126
3126
$as_echo "\"$MACHDEP\"" >&6; }
3127
3127
3128
+ # On cross-compile builds, configure will look for a host-specific compiler by
3129
+ # prepending the user-provided host triple to the required binary name.
3130
+ #
3131
+ # On iOS, this results in binaries like "arm64-apple-ios12.0-simulator-gcc",
3132
+ # which isn't a binary that exists, and isn't very convenient, as it contains the
3133
+ # iOS version. As the default cross-compiler name won't exist, configure falls
3134
+ # back to gcc, which *definitely* won't work. We're providing wrapper scripts for
3135
+ # these tools; the binary names of these scripts are better defaults than "gcc".
3136
+ # This only requires that the user put the platform scripts folder (e.g.,
3137
+ # "iOS/Resources/bin") in their path, rather than defining platform-specific
3138
+ # names/paths for AR, CC, CPP, and CXX explicitly; and if the user forgets to
3139
+ # either put the platform scripts folder in the path, or specify CC etc,
3140
+ # configure will fail.
3141
+ if test -z "$AR"; then
3142
+ case "$host" in
3143
+ aarch64-apple-ios*-simulator) AR=arm64-apple-ios-simulator-ar ;;
3144
+ aarch64-apple-ios*) AR=arm64-apple-ios-ar ;;
3145
+ x86_64-apple-ios*-simulator) AR=x86_64-apple-ios-simulator-ar ;;
3146
+ *)
3147
+ esac
3148
+ fi
3149
+ if test -z "$CC"; then
3150
+ case "$host" in
3151
+ aarch64-apple-ios*-simulator) CC=arm64-apple-ios-simulator-clang ;;
3152
+ aarch64-apple-ios*) CC=arm64-apple-ios-clang ;;
3153
+ x86_64-apple-ios*-simulator) CC=x86_64-apple-ios-simulator-clang ;;
3154
+ *)
3155
+ esac
3156
+ fi
3157
+ if test -z "$CPP"; then
3158
+ case "$host" in
3159
+ aarch64-apple-ios*-simulator) CPP=arm64-apple-ios-simulator-cpp ;;
3160
+ aarch64-apple-ios*) CPP=arm64-apple-ios-cpp ;;
3161
+ x86_64-apple-ios*-simulator) CPP=x86_64-apple-ios-simulator-cpp ;;
3162
+ *)
3163
+ esac
3164
+ fi
3165
+ if test -z "$CXX"; then
3166
+ case "$host" in
3167
+ aarch64-apple-ios*-simulator) CXX=arm64-apple-ios-simulator-clang ;;
3168
+ aarch64-apple-ios*) CXX=arm64-apple-ios-clang ;;
3169
+ x86_64-apple-ios*-simulator) CXX=x86_64-apple-ios-simulator-clang ;;
3170
+ *)
3171
+ esac
3172
+ fi
3173
+
3128
3174
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --enable-universalsdk" >&5
3129
3175
$as_echo_n "checking for --enable-universalsdk... " >&6; }
3130
3176
# Check whether --enable-universalsdk was given.
@@ -3236,37 +3282,38 @@ if test "${enable_framework+set}" = set; then :
3236
3282
enableval=$enable_framework;
3237
3283
case $enableval in
3238
3284
yes)
3239
- if test " $ac_sys_system" = "iOS"; then
3240
- as_fn_error $? "iOS builds must provide an explicit path for --enable-framework" "$LINENO" 5
3241
- fi
3242
-
3243
- enableval=/Library/Frameworks
3285
+ case $ac_sys_system in
3286
+ Darwin) enableval=/Library/Frameworks ;;
3287
+ iOS) enableval=iOS/Frameworks/\$\(MULTIARCH\) ;;
3288
+ *) as_fn_error $? "Unknown platform for framework build" "$LINENO" 5
3289
+ esac
3244
3290
esac
3291
+
3245
3292
case $enableval in
3246
3293
no)
3247
- if test "$ac_sys_system" = "iOS"; then
3248
- as_fn_error $? "iOS builds must use --enable-framework=<install path>" "$LINENO" 5
3249
- fi
3294
+ case $ac_sys_system in
3295
+ iOS) as_fn_error $? "iOS builds must use --enable-framework" "$LINENO" 5 ;;
3296
+ *)
3297
+ PYTHONFRAMEWORK=
3298
+ PYTHONFRAMEWORKDIR=no-framework
3299
+ PYTHONFRAMEWORKPREFIX=
3300
+ PYTHONFRAMEWORKINSTALLDIR=
3301
+ PYTHONFRAMEWORKINSTALLNAMEPREFIX=
3302
+ RESSRCDIR=
3303
+ FRAMEWORKINSTALLFIRST=
3304
+ FRAMEWORKINSTALLLAST=
3305
+ FRAMEWORKALTINSTALLFIRST=
3306
+ FRAMEWORKALTINSTALLLAST=
3307
+ FRAMEWORKPYTHONW=
3308
+ INSTALLTARGETS="commoninstall bininstall maninstall"
3250
3309
3251
- PYTHONFRAMEWORK=
3252
- PYTHONFRAMEWORKDIR=no-framework
3253
- PYTHONFRAMEWORKPREFIX=
3254
- PYTHONFRAMEWORKINSTALLDIR=
3255
- PYTHONFRAMEWORKINSTALLNAMEPREFIX=
3256
- RESSRCDIR=
3257
- FRAMEWORKINSTALLFIRST=
3258
- FRAMEWORKINSTALLLAST=
3259
- FRAMEWORKALTINSTALLFIRST=
3260
- FRAMEWORKALTINSTALLLAST=
3261
- FRAMEWORKPYTHONW=
3262
- INSTALLTARGETS="commoninstall bininstall maninstall"
3263
-
3264
- if test "x${prefix}" = "xNONE"; then
3265
- FRAMEWORKUNIXTOOLSPREFIX="${ac_default_prefix}"
3266
- else
3267
- FRAMEWORKUNIXTOOLSPREFIX="${prefix}"
3268
- fi
3269
- enable_framework=
3310
+ if test "x${prefix}" = "xNONE"; then
3311
+ FRAMEWORKUNIXTOOLSPREFIX="${ac_default_prefix}"
3312
+ else
3313
+ FRAMEWORKUNIXTOOLSPREFIX="${prefix}"
3314
+ fi
3315
+ enable_framework=
3316
+ esac
3270
3317
;;
3271
3318
*)
3272
3319
PYTHONFRAMEWORKPREFIX="${enableval}"
@@ -3361,29 +3408,28 @@ if test "${enable_framework+set}" = set; then :
3361
3408
3362
3409
else
3363
3410
3364
- if test "$ac_sys_system" = "iOS"; then
3365
- as_fn_error $? "iOS builds must use --enable-framework=<install path>" "$LINENO" 5
3366
- fi
3367
-
3368
- PYTHONFRAMEWORK=
3369
- PYTHONFRAMEWORKDIR=no-framework
3370
- PYTHONFRAMEWORKPREFIX=
3371
- PYTHONFRAMEWORKINSTALLDIR=
3372
- PYTHONFRAMEWORKINSTALLNAMEPREFIX=
3373
- RESSRCDIR=
3374
- FRAMEWORKINSTALLFIRST=
3375
- FRAMEWORKINSTALLLAST=
3376
- FRAMEWORKALTINSTALLFIRST=
3377
- FRAMEWORKALTINSTALLLAST=
3378
- FRAMEWORKPYTHONW=
3379
- INSTALLTARGETS="commoninstall bininstall maninstall"
3380
- if test "x${prefix}" = "xNONE" ; then
3381
- FRAMEWORKUNIXTOOLSPREFIX="${ac_default_prefix}"
3382
- else
3383
- FRAMEWORKUNIXTOOLSPREFIX="${prefix}"
3384
- fi
3385
- enable_framework=
3386
-
3411
+ case $ac_sys_system in
3412
+ iOS) as_fn_error $? "iOS builds must use --enable-framework" "$LINENO" 5 ;;
3413
+ *)
3414
+ PYTHONFRAMEWORK=
3415
+ PYTHONFRAMEWORKDIR=no-framework
3416
+ PYTHONFRAMEWORKPREFIX=
3417
+ PYTHONFRAMEWORKINSTALLDIR=
3418
+ PYTHONFRAMEWORKINSTALLNAMEPREFIX=
3419
+ RESSRCDIR=
3420
+ FRAMEWORKINSTALLFIRST=
3421
+ FRAMEWORKINSTALLLAST=
3422
+ FRAMEWORKALTINSTALLFIRST=
3423
+ FRAMEWORKALTINSTALLLAST=
3424
+ FRAMEWORKPYTHONW=
3425
+ INSTALLTARGETS="commoninstall bininstall maninstall"
3426
+ if test "x${prefix}" = "xNONE" ; then
3427
+ FRAMEWORKUNIXTOOLSPREFIX="${ac_default_prefix}"
3428
+ else
3429
+ FRAMEWORKUNIXTOOLSPREFIX="${prefix}"
3430
+ fi
3431
+ enable_framework=
3432
+ esac
3387
3433
3388
3434
fi
3389
3435
@@ -9780,8 +9826,8 @@ then
9780
9826
fi
9781
9827
;;
9782
9828
iOS/*)
9783
- LDSHARED='$(CC) -dynamiclib -F . -framework Python '
9784
- LDCXXSHARED='$(CXX) -dynamiclib -F . -framework Python '
9829
+ LDSHARED='$(CC) -dynamiclib -F . -framework $(PYTHONFRAMEWORK) '
9830
+ LDCXXSHARED='$(CXX) -dynamiclib -F . -framework $(PYTHONFRAMEWORK) '
9785
9831
BLDSHARED="$LDSHARED"
9786
9832
;;
9787
9833
Linux*|GNU*|QNX*|VxWorks*)
0 commit comments