Commit e65f01f7 authored by Victor Stinner's avatar Victor Stinner Committed by GitHub

bpo-36508: python-config don't export LINKFORSHARED (GH-12661)

python-config --ldflags no longer includes flags of the LINKFORSHARED
variable. The LINKFORSHARED variable must only be used to build
executables.
parent 2ee077f7
...@@ -104,6 +104,8 @@ PY_LDFLAGS_NODIST=$(CONFIGURE_LDFLAGS_NODIST) $(LDFLAGS_NODIST) ...@@ -104,6 +104,8 @@ PY_LDFLAGS_NODIST=$(CONFIGURE_LDFLAGS_NODIST) $(LDFLAGS_NODIST)
NO_AS_NEEDED= @NO_AS_NEEDED@ NO_AS_NEEDED= @NO_AS_NEEDED@
SGI_ABI= @SGI_ABI@ SGI_ABI= @SGI_ABI@
CCSHARED= @CCSHARED@ CCSHARED= @CCSHARED@
# LINKFORSHARED are the flags passed to the $(CC) command that links
# the python executable -- this is only needed for a few systems
LINKFORSHARED= @LINKFORSHARED@ LINKFORSHARED= @LINKFORSHARED@
ARFLAGS= @ARFLAGS@ ARFLAGS= @ARFLAGS@
# Extra C flags added for building the interpreter object files. # Extra C flags added for building the interpreter object files.
......
``python-config --ldflags`` no longer includes flags of the
``LINKFORSHARED`` variable. The ``LINKFORSHARED`` variable must only be used
to build executables.
...@@ -55,8 +55,6 @@ for opt in opt_flags: ...@@ -55,8 +55,6 @@ for opt in opt_flags:
if opt == '--ldflags': if opt == '--ldflags':
if not getvar('Py_ENABLE_SHARED'): if not getvar('Py_ENABLE_SHARED'):
libs.insert(0, '-L' + getvar('LIBPL')) libs.insert(0, '-L' + getvar('LIBPL'))
if not getvar('PYTHONFRAMEWORK'):
libs.extend(getvar('LINKFORSHARED').split())
print(' '.join(libs)) print(' '.join(libs))
elif opt == '--extension-suffix': elif opt == '--extension-suffix':
......
...@@ -44,7 +44,6 @@ ABIFLAGS="@ABIFLAGS@" ...@@ -44,7 +44,6 @@ ABIFLAGS="@ABIFLAGS@"
LIBS="-lpython${VERSION}${ABIFLAGS} @LIBS@ $SYSLIBS" LIBS="-lpython${VERSION}${ABIFLAGS} @LIBS@ $SYSLIBS"
BASECFLAGS="@BASECFLAGS@" BASECFLAGS="@BASECFLAGS@"
LDLIBRARY="@LDLIBRARY@" LDLIBRARY="@LDLIBRARY@"
LINKFORSHARED="@LINKFORSHARED@"
OPT="@OPT@" OPT="@OPT@"
PY_ENABLE_SHARED="@PY_ENABLE_SHARED@" PY_ENABLE_SHARED="@PY_ENABLE_SHARED@"
LDVERSION="@LDVERSION@" LDVERSION="@LDVERSION@"
...@@ -89,15 +88,11 @@ do ...@@ -89,15 +88,11 @@ do
echo "$LIBS" echo "$LIBS"
;; ;;
--ldflags) --ldflags)
LINKFORSHAREDUSED=
if [ -z "$PYTHONFRAMEWORK" ] ; then
LINKFORSHAREDUSED=$LINKFORSHARED
fi
LIBPLUSED= LIBPLUSED=
if [ "$PY_ENABLE_SHARED" = "0" ] ; then if [ "$PY_ENABLE_SHARED" = "0" ] ; then
LIBPLUSED="-L$LIBPL" LIBPLUSED="-L$LIBPL"
fi fi
echo "$LIBPLUSED -L$libdir $LIBS $LINKFORSHAREDUSED" echo "$LIBPLUSED -L$libdir $LIBS"
;; ;;
--extension-suffix) --extension-suffix)
echo "$SO" echo "$SO"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment