]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-99942: correct the pkg-config/python-config flags for cygwin/android
authorEli Schwartz <eschwartz93@gmail.com>
Thu, 16 Feb 2023 17:57:59 +0000 (12:57 -0500)
committerGitHub <noreply@github.com>
Thu, 16 Feb 2023 17:57:59 +0000 (17:57 +0000)
Misc/NEWS.d/next/Build/2023-01-12-00-49-16.gh-issue-99942.DUR8b4.rst [new file with mode: 0644]
configure
configure.ac

diff --git a/Misc/NEWS.d/next/Build/2023-01-12-00-49-16.gh-issue-99942.DUR8b4.rst b/Misc/NEWS.d/next/Build/2023-01-12-00-49-16.gh-issue-99942.DUR8b4.rst
new file mode 100644 (file)
index 0000000..5b692c3
--- /dev/null
@@ -0,0 +1,2 @@
+On Android, in a static build, python-config in embed mode no longer
+incorrectly reports a library to link to.
index 7c4254f3cb176f33a63078f17741c73fefdfed64..17dc62fb63de3ba8a075ab3a9fcfc953ab14a339 100755 (executable)
--- a/configure
+++ b/configure
@@ -21496,7 +21496,7 @@ $as_echo "$LDVERSION" >&6; }
 
 # On Android and Cygwin the shared libraries must be linked with libpython.
 
-if test -n "$ANDROID_API_LEVEL" -o "$MACHDEP" = "cygwin"; then
+if test "$PY_ENABLE_SHARED" = "1" && ( test -n "$ANDROID_API_LEVEL" || test "$MACHDEP" = "cygwin"); then
   LIBPYTHON="-lpython${VERSION}${ABIFLAGS}"
 else
   LIBPYTHON=''
index 370bbe07c57634618cd915326882f48d436fa7d6..bc288b86cfa5905ee9af2dd3b7551dda546d914f 100644 (file)
@@ -5759,7 +5759,7 @@ AC_MSG_RESULT($LDVERSION)
 
 # On Android and Cygwin the shared libraries must be linked with libpython.
 AC_SUBST(LIBPYTHON)
-if test -n "$ANDROID_API_LEVEL" -o "$MACHDEP" = "cygwin"; then
+if test "$PY_ENABLE_SHARED" = "1" && ( test -n "$ANDROID_API_LEVEL" || test "$MACHDEP" = "cygwin"); then
   LIBPYTHON="-lpython${VERSION}${ABIFLAGS}"
 else
   LIBPYTHON=''