diff options
author | Russell Keith-Magee <russell@keith-magee.com> | 2024-06-30 00:34:35 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-30 00:34:35 (GMT) |
commit | 48cd104b0cf05dad8958efa9cb9666c029ef9201 (patch) | |
tree | b8ae90a1286cfa1529ad575588c6c701a56fbc68 /configure.ac | |
parent | 6b280a84988ca221b5bdc1077a914e873790cce5 (diff) | |
download | cpython-48cd104b0cf05dad8958efa9cb9666c029ef9201.zip cpython-48cd104b0cf05dad8958efa9cb9666c029ef9201.tar.gz cpython-48cd104b0cf05dad8958efa9cb9666c029ef9201.tar.bz2 |
gh-120522: Add a `--with-app-store-compliance` configure option to patch out problematic code (#120984)
* Add --app-store-compliance configuration option.
* Added blurb.
* Correct tab-vs-spaces formatting issue.
* Correct source file name in docs.
Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
* Correct source code reference in Mac docs
Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
* Only apply the patch forward, and ensure the working directory is correct.
* Make patching reslient to multiple builds.
* Documentation fixes found during review
Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com>
* Documentation and configure.ac syntax improvements
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* Regenerate configure script.
* Silence the patch echo output.
---------
Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index 84ba55e..e4f8f41 100644 --- a/configure.ac +++ b/configure.ac @@ -695,6 +695,64 @@ AC_SUBST([INSTALLTARGETS]) AC_DEFINE_UNQUOTED([_PYTHONFRAMEWORK], ["${PYTHONFRAMEWORK}"], [framework name]) +dnl quadrigraphs "@<:@" and "@:>@" produce "[" and "]" in the output +AC_MSG_CHECKING([for --with-app-store-compliance]) +AC_ARG_WITH( + [app_store_compliance], + [AS_HELP_STRING( + [--with-app-store-compliance=@<:@PATCH-FILE@:>@], + [Enable any patches required for compiliance with app stores. + Optional PATCH-FILE specifies the custom patch to apply.] + )],[ + case "$withval" in + yes) + case $ac_sys_system in + Darwin|iOS) + # iOS is able to share the macOS patch + APP_STORE_COMPLIANCE_PATCH="Mac/Resources/app-store-compliance.patch" + APP_STORE_COMPLIANCE_PATCH_TARGET="build/app-store-compliant" + APP_STORE_COMPLIANCE_PATCH_FLAGS= + ;; + *) AC_MSG_ERROR([no default app store compliance patch available for $ac_sys_system]) ;; + esac + AC_MSG_RESULT([applying default app store compliance patch]) + ;; + *) + APP_STORE_COMPLIANCE_PATCH="${withval}" + APP_STORE_COMPLIANCE_PATCH_TARGET="build/app-store-compliant" + APP_STORE_COMPLIANCE_PATCH_FLAGS= + AC_MSG_RESULT([applying custom app store compliance patch]) + ;; + esac + ],[ + case $ac_sys_system in + iOS) + # Always apply the compliance patch on iOS; we can use the macOS patch + APP_STORE_COMPLIANCE_PATCH="Mac/Resources/app-store-compliance.patch" + APP_STORE_COMPLIANCE_PATCH_TARGET="build/app-store-compliant" + APP_STORE_COMPLIANCE_PATCH_FLAGS= + AC_MSG_RESULT([applying default app store compliance patch]) + ;; + Darwin) + # Always *check* the compliance patch on macOS + APP_STORE_COMPLIANCE_PATCH="Mac/Resources/app-store-compliance.patch" + APP_STORE_COMPLIANCE_PATCH_TARGET="build/app-store-compliant" + APP_STORE_COMPLIANCE_PATCH_FLAGS="--dry-run" + AC_MSG_RESULT([checking (not applying) default app store compliance patch]) + ;; + *) + # No app compliance patching on any other platform + APP_STORE_COMPLIANCE_PATCH= + APP_STORE_COMPLIANCE_PATCH_TARGET= + APP_STORE_COMPLIANCE_PATCH_FLAGS= + AC_MSG_RESULT([not patching for app store compliance]) + ;; + esac +]) +AC_SUBST([APP_STORE_COMPLIANCE_PATCH]) +AC_SUBST([APP_STORE_COMPLIANCE_PATCH_TARGET]) +AC_SUBST([APP_STORE_COMPLIANCE_PATCH_FLAGS]) + AC_SUBST([_PYTHON_HOST_PLATFORM]) if test "$cross_compiling" = yes; then case "$host" in |