From e30a3cf87afff228dc7c2a6f8c255d4bc51b6766 Mon Sep 17 00:00:00 2001 From: Yaksh Bariya Date: Fri, 13 Feb 2026 11:21:55 +0530 Subject: [PATCH] GH-138800: fix variable substitution in python3.pc for Android $(BLDLIBRARY) substitution works in Makefiles where variables are expanded at the time of execution. This expansion does not happen in static files like .pc, so use value of BLDLIBRARY instead of trying to substitute the value. Patch stolen from downstream distribution of Python for Termux (Android): https://github.com/termux/termux-packages/pull/27739 Preferably needs to be backported to both Python 3.13 as well as Python 3.14, along with the main branch Fixes #138800 --- .../next/Build/2026-02-13-23-26-40.gh-issue-138800.wRCFW-.rst | 1 + configure | 2 +- configure.ac | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 Misc/NEWS.d/next/Build/2026-02-13-23-26-40.gh-issue-138800.wRCFW-.rst diff --git a/Misc/NEWS.d/next/Build/2026-02-13-23-26-40.gh-issue-138800.wRCFW-.rst b/Misc/NEWS.d/next/Build/2026-02-13-23-26-40.gh-issue-138800.wRCFW-.rst new file mode 100644 index 00000000000000..980c07fc8df123 --- /dev/null +++ b/Misc/NEWS.d/next/Build/2026-02-13-23-26-40.gh-issue-138800.wRCFW-.rst @@ -0,0 +1 @@ +fix variable substitution in python3.pc for Android diff --git a/configure b/configure index 73a758384553b2..a74e787d99fe22 100755 --- a/configure +++ b/configure @@ -27017,7 +27017,7 @@ LIBPYTHON='' # On Android and Cygwin the shared libraries must be linked with libpython. if test "$PY_ENABLE_SHARED" = "1" && ( test -n "$ANDROID_API_LEVEL" || test "$MACHDEP" = "cygwin"); then MODULE_DEPS_SHARED="$MODULE_DEPS_SHARED \$(LDLIBRARY)" - LIBPYTHON="\$(BLDLIBRARY)" + LIBPYTHON="$(BLDLIBRARY)" fi # On iOS the shared libraries must be linked with the Python framework diff --git a/configure.ac b/configure.ac index 2ba63b2a8a05e0..4e940a5ec28c15 100644 --- a/configure.ac +++ b/configure.ac @@ -6452,7 +6452,7 @@ LIBPYTHON='' # On Android and Cygwin the shared libraries must be linked with libpython. if test "$PY_ENABLE_SHARED" = "1" && ( test -n "$ANDROID_API_LEVEL" || test "$MACHDEP" = "cygwin"); then MODULE_DEPS_SHARED="$MODULE_DEPS_SHARED \$(LDLIBRARY)" - LIBPYTHON="\$(BLDLIBRARY)" + LIBPYTHON="$(BLDLIBRARY)" fi # On iOS the shared libraries must be linked with the Python framework