Skip to content

Commit 8ec582a

Browse files
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): termux/termux-packages#27739 Preferably needs to be backported to both Python 3.13 as well as Python 3.14, along with the main branch Fixes #138800
1 parent cf6758f commit 8ec582a

File tree

4 files changed

+4
-3
lines changed

4 files changed

+4
-3
lines changed

Makefile.pre.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ SOABI= @SOABI@
4343
ABIFLAGS= @ABIFLAGS@
4444
ABI_THREAD= @ABI_THREAD@
4545
LDVERSION= @LDVERSION@
46-
LIBPYTHON=@LIBPYTHON@
4746
GITVERSION= @GITVERSION@
4847
GITTAG= @GITTAG@
4948
GITBRANCH= @GITBRANCH@
@@ -285,6 +284,7 @@ INSTSONAME= @INSTSONAME@
285284
LIBRARY_DEPS= @LIBRARY_DEPS@
286285
LINK_PYTHON_DEPS=@LINK_PYTHON_DEPS@
287286
PY_ENABLE_SHARED= @PY_ENABLE_SHARED@
287+
LIBPYTHON=@LIBPYTHON@
288288
STATIC_LIBPYTHON= @STATIC_LIBPYTHON@
289289

290290

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
fix variable substitution in python3.pc for Android

configure

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6424,7 +6424,7 @@ LIBPYTHON=''
64246424
# On Android and Cygwin the shared libraries must be linked with libpython.
64256425
if test "$PY_ENABLE_SHARED" = "1" && ( test -n "$ANDROID_API_LEVEL" || test "$MACHDEP" = "cygwin"); then
64266426
MODULE_DEPS_SHARED="$MODULE_DEPS_SHARED \$(LDLIBRARY)"
6427-
LIBPYTHON="\$(BLDLIBRARY)"
6427+
LIBPYTHON="$(BLDLIBRARY)"
64286428
fi
64296429

64306430
# On iOS the shared libraries must be linked with the Python framework

0 commit comments

Comments
 (0)