diff --git a/Misc/NEWS.d/next/Build/2026-03-07-02-09-57.gh-issue-138800.VD8qbz.rst b/Misc/NEWS.d/next/Build/2026-03-07-02-09-57.gh-issue-138800.VD8qbz.rst new file mode 100644 index 00000000000000..b04da2e2c6852f --- /dev/null +++ b/Misc/NEWS.d/next/Build/2026-03-07-02-09-57.gh-issue-138800.VD8qbz.rst @@ -0,0 +1 @@ +fix LIBPYTHON substitution in python3.pc on Android diff --git a/Modules/makesetup b/Modules/makesetup index 104c824b846540..4d0ef59edeca83 100755 --- a/Modules/makesetup +++ b/Modules/makesetup @@ -277,7 +277,7 @@ sed -e 's/[ ]*#.*//' -e '/^[ ]*$/d' | ;; esac rule="$file: $objs \$(MODULE_${mods_upper}_LDEPS)" - rule="$rule; \$(BLDSHARED) $objs $libs \$(LIBPYTHON) -o $file" + rule="$rule; \$(BLDSHARED) $objs $libs \$(BLDLIBRARY) -o $file" echo "$rule" >>$rulesf done done diff --git a/configure b/configure index 4726b4fe3102ac..c4c374ac494dd6 100755 --- a/configure +++ b/configure @@ -27155,7 +27155,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="-lpython${VERSION}${ABIFLAGS}" fi # On iOS the shared libraries must be linked with the Python framework diff --git a/configure.ac b/configure.ac index dd860292cc2058..aeb74dc32c3c51 100644 --- a/configure.ac +++ b/configure.ac @@ -6509,7 +6509,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="-lpython${VERSION}${ABIFLAGS}" fi # On iOS the shared libraries must be linked with the Python framework