https://github.com/python/cpython/commit/2f5c3b09e45798a18d60841d04a165fb062be666
commit: 2f5c3b09e45798a18d60841d04a165fb062be666
branch: main
author: Malcolm Smith <sm...@chaquo.com>
committer: erlend-aasland <erlend.aasl...@protonmail.com>
date: 2024-08-09T00:00:55+02:00
summary:

gh-116622: Rename build variable MODULE_LDFLAGS back to LIBPYTHON (#122764)

(LIBPYTHON was renamed MODULE_LDFLAGS in commit 7f5e3f04f.)

files:
A Misc/NEWS.d/next/Build/2024-08-07-00-20-18.gh-issue-116622.U9cxHM.rst
M Makefile.pre.in
M Misc/python-config.sh.in
M Misc/python.pc.in
M Modules/makesetup
M configure
M configure.ac

diff --git a/Makefile.pre.in b/Makefile.pre.in
index 0bb2b5097f7c97..6eb9afefada313 100644
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -43,7 +43,7 @@ SOABI=                @SOABI@
 ABIFLAGS=      @ABIFLAGS@
 ABI_THREAD=    @ABI_THREAD@
 LDVERSION=     @LDVERSION@
-MODULE_LDFLAGS=@MODULE_LDFLAGS@
+LIBPYTHON=@LIBPYTHON@
 GITVERSION=    @GITVERSION@
 GITTAG=                @GITTAG@
 GITBRANCH=     @GITBRANCH@
diff --git 
a/Misc/NEWS.d/next/Build/2024-08-07-00-20-18.gh-issue-116622.U9cxHM.rst 
b/Misc/NEWS.d/next/Build/2024-08-07-00-20-18.gh-issue-116622.U9cxHM.rst
new file mode 100644
index 00000000000000..c9a56d65ad0cd3
--- /dev/null
+++ b/Misc/NEWS.d/next/Build/2024-08-07-00-20-18.gh-issue-116622.U9cxHM.rst
@@ -0,0 +1,2 @@
+Rename build variable ``MODULE_LDFLAGS`` back to ``LIBPYTHON``, as it's used by
+package build systems (e.g. Meson).
diff --git a/Misc/python-config.sh.in b/Misc/python-config.sh.in
index 9929f5b2653dca..555b0cb6ba2a48 100644
--- a/Misc/python-config.sh.in
+++ b/Misc/python-config.sh.in
@@ -47,7 +47,7 @@ LIBM="@LIBM@"
 LIBC="@LIBC@"
 SYSLIBS="$LIBM $LIBC"
 ABIFLAGS="@ABIFLAGS@"
-LIBS="@MODULE_LDFLAGS@ @LIBS@ $SYSLIBS"
+LIBS="@LIBPYTHON@ @LIBS@ $SYSLIBS"
 LIBS_EMBED="-lpython${VERSION}${ABIFLAGS} @LIBS@ $SYSLIBS"
 BASECFLAGS="@BASECFLAGS@"
 LDLIBRARY="@LDLIBRARY@"
diff --git a/Misc/python.pc.in b/Misc/python.pc.in
index c2c740e82b1fde..027dba38585a89 100644
--- a/Misc/python.pc.in
+++ b/Misc/python.pc.in
@@ -9,5 +9,5 @@ Description: Build a C extension for Python
 Requires:
 Version: @VERSION@
 Libs.private: @LIBS@
-Libs: -L${libdir} @MODULE_LDFLAGS@
+Libs: -L${libdir} @LIBPYTHON@
 Cflags: -I${includedir}/python@VERSION@@ABIFLAGS@
diff --git a/Modules/makesetup b/Modules/makesetup
index d41b6640bb5186..8bb971b152a522 100755
--- a/Modules/makesetup
+++ b/Modules/makesetup
@@ -274,7 +274,7 @@ sed -e 's/[         ]*#.*//' -e '/^[        ]*$/d' |
                                ;;
                        esac
                        rule="$file: $objs"
-                       rule="$rule; \$(BLDSHARED) $objs $libs 
\$(MODULE_LDFLAGS) -o $file"
+                       rule="$rule; \$(BLDSHARED) $objs $libs \$(LIBPYTHON) -o 
$file"
                        echo "$rule" >>$rulesf
                done
        done
diff --git a/configure b/configure
index 329373560f8578..a0fbebcb0442b9 100755
--- a/configure
+++ b/configure
@@ -838,7 +838,7 @@ LIBPL
 PY_ENABLE_SHARED
 PLATLIBDIR
 BINLIBDEST
-MODULE_LDFLAGS
+LIBPYTHON
 MODULE_DEPS_SHARED
 EXT_SUFFIX
 ALT_SOABI
@@ -24796,16 +24796,19 @@ LDVERSION='$(VERSION)$(ABIFLAGS)'
 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LDVERSION" >&5
 printf "%s\n" "$LDVERSION" >&6; }
 
-# Configure the flags and dependencies used when compiling shared modules
+# Configure the flags and dependencies used when compiling shared modules.
+# Do not rename LIBPYTHON - it's accessed via sysconfig by package build
+# systems (e.g. Meson) to decide whether to link extension modules against
+# libpython.
 
 
 MODULE_DEPS_SHARED='$(MODULE_DEPS_STATIC) $(EXPORTSYMS)'
-MODULE_LDFLAGS=''
+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)"
-  MODULE_LDFLAGS="\$(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 fb40607abfa73c..9a17fc279e5a69 100644
--- a/configure.ac
+++ b/configure.ac
@@ -6224,16 +6224,19 @@ AC_MSG_CHECKING([LDVERSION])
 LDVERSION='$(VERSION)$(ABIFLAGS)'
 AC_MSG_RESULT([$LDVERSION])
 
-# Configure the flags and dependencies used when compiling shared modules
+# Configure the flags and dependencies used when compiling shared modules.
+# Do not rename LIBPYTHON - it's accessed via sysconfig by package build
+# systems (e.g. Meson) to decide whether to link extension modules against
+# libpython.
 AC_SUBST([MODULE_DEPS_SHARED])
-AC_SUBST([MODULE_LDFLAGS])
+AC_SUBST([LIBPYTHON])
 MODULE_DEPS_SHARED='$(MODULE_DEPS_STATIC) $(EXPORTSYMS)'
-MODULE_LDFLAGS=''
+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)"
-  MODULE_LDFLAGS="\$(BLDLIBRARY)"
+  LIBPYTHON="\$(BLDLIBRARY)"
 fi
 
 # On iOS the shared libraries must be linked with the Python framework

_______________________________________________
Python-checkins mailing list -- python-checkins@python.org
To unsubscribe send an email to python-checkins-le...@python.org
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: arch...@mail-archive.com

Reply via email to