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

4 files changed

lines changed

Original file line numberDiff line numberDiff line change

@@ -106,6 +106,8 @@ NO_AS_NEEDED= @NO_AS_NEEDED@

106106

LDLAST= @LDLAST@

107107

SGI_ABI= @SGI_ABI@

108108

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

109111

LINKFORSHARED= @LINKFORSHARED@

110112

ARFLAGS= @ARFLAGS@

111113

# Extra C flags added for building the interpreter object files.

Original file line numberDiff line numberDiff 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 numberDiff line numberDiff line change

@@ -55,8 +55,6 @@ for opt in opt_flags:

5555

if opt == '--ldflags':

5656

if not getvar('Py_ENABLE_SHARED'):

5757

libs.insert(0, '-L' + getvar('LIBPL'))

58-

if not getvar('PYTHONFRAMEWORK'):

59-

libs.extend(getvar('LINKFORSHARED').split())

6058

print(' '.join(libs))

6159
6260

elif opt == '--extension-suffix':

Original file line numberDiff line numberDiff line change

@@ -44,7 +44,6 @@ ABIFLAGS="@ABIFLAGS@"

4444

LIBS="-lpython${VERSION}${ABIFLAGS} @LIBS@ $SYSLIBS"

4545

BASECFLAGS="@BASECFLAGS@"

4646

LDLIBRARY="@LDLIBRARY@"

47-

LINKFORSHARED="@LINKFORSHARED@"

4847

OPT="@OPT@"

4948

PY_ENABLE_SHARED="@PY_ENABLE_SHARED@"

5049

LDVERSION="@LDVERSION@"

@@ -89,15 +88,11 @@ do

8988

echo "$LIBS"

9089

;;

9190

--ldflags)

92-

LINKFORSHAREDUSED=

93-

if [ -z "$PYTHONFRAMEWORK" ] ; then

94-

LINKFORSHAREDUSED=$LINKFORSHARED

95-

fi

9691

LIBPLUSED=

9792

if [ "$PY_ENABLE_SHARED" = "0" ] ; then

9893

LIBPLUSED="-L$LIBPL"

9994

fi

100-

echo "$LIBPLUSED -L$libdir $LIBS $LINKFORSHAREDUSED"

95+

echo "$LIBPLUSED -L$libdir $LIBS"

10196

;;

10297

--extension-suffix)

10398

echo "$SO"