bpo-36508: python-config don't export LINKFORSHARED (GH-12661) (GH-12… · python/cpython@cd46b09 (original) (raw)

4 files changed

lines changed

Original file line number Diff line number Diff line change
@@ -106,6 +106,8 @@ NO_AS_NEEDED= @NO_AS_NEEDED@
106 106 LDLAST= @LDLAST@
107 107 SGI_ABI= @SGI_ABI@
108 108 CCSHARED= @CCSHARED@
109 +# LINKFORSHARED are the flags passed to the $(CC) command that links
110 +# the python executable -- this is only needed for a few systems
109 111 LINKFORSHARED= @LINKFORSHARED@
110 112 ARFLAGS= @ARFLAGS@
111 113 # Extra C flags added for building the interpreter object files.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
1 +``python-config --ldflags`` no longer includes flags of the
2 +``LINKFORSHARED`` variable. The ``LINKFORSHARED`` variable must only be used
3 +to build executables.
Original file line number Diff line number Diff line change
@@ -55,8 +55,6 @@ for opt in opt_flags:
55 55 if opt == '--ldflags':
56 56 if not getvar('Py_ENABLE_SHARED'):
57 57 libs.insert(0, '-L' + getvar('LIBPL'))
58 -if not getvar('PYTHONFRAMEWORK'):
59 -libs.extend(getvar('LINKFORSHARED').split())
60 58 print(' '.join(libs))
61 59
62 60 elif opt == '--extension-suffix':
Original file line number Diff line number Diff line change
@@ -44,7 +44,6 @@ ABIFLAGS="@ABIFLAGS@"
44 44 LIBS="-lpython${VERSION}${ABIFLAGS} @LIBS@ $SYSLIBS"
45 45 BASECFLAGS="@BASECFLAGS@"
46 46 LDLIBRARY="@LDLIBRARY@"
47 -LINKFORSHARED="@LINKFORSHARED@"
48 47 OPT="@OPT@"
49 48 PY_ENABLE_SHARED="@PY_ENABLE_SHARED@"
50 49 LDVERSION="@LDVERSION@"
@@ -89,15 +88,11 @@ do
89 88 echo "$LIBS"
90 89 ;;
91 90 --ldflags)
92 - LINKFORSHAREDUSED=
93 -if [ -z "$PYTHONFRAMEWORK" ] ; then
94 - LINKFORSHAREDUSED=$LINKFORSHARED
95 -fi
96 91 LIBPLUSED=
97 92 if [ "$PY_ENABLE_SHARED" = "0" ] ; then
98 93 LIBPLUSED="-L$LIBPL"
99 94 fi
100 -echo "$LIBPLUSED -L$libdir LIBSLIBS LIBSLINKFORSHAREDUSED"
95 +echo "$LIBPLUSED -L$libdir $LIBS"
101 96 ;;
102 97 --extension-suffix)
103 98 echo "$SO"