summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Misc/NEWS.d/next/Build/2023-01-12-00-49-16.gh-issue-99942.DUR8b4.rst2
-rwxr-xr-xconfigure2
-rw-r--r--configure.ac2
3 files changed, 4 insertions, 2 deletions
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
index 0000000..5b692c3
--- /dev/null
+++ b/Misc/NEWS.d/next/Build/2023-01-12-00-49-16.gh-issue-99942.DUR8b4.rst
@@ -0,0 +1,2 @@
+On Android, in a static build, python-config in embed mode no longer
+incorrectly reports a library to link to.
diff --git a/configure b/configure
index 7c4254f..17dc62f 100755
--- 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=''
diff --git a/configure.ac b/configure.ac
index 370bbe0..bc288b8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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=''