Skip to content

Commit d486c43

Browse files
committed
- Issue python#18096: Fix library order returned by python-config.
1 parent 1de0ba2 commit d486c43

3 files changed

Lines changed: 6 additions & 3 deletions

File tree

Misc/NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ Build
3838
- Issue #16537: Check whether self.extensions is empty in setup.py. Patch by
3939
Jonathan Hosmer.
4040

41+
- Issue #18096: Fix library order returned by python-config.
42+
4143

4244
What's New in Python 3.4.2?
4345
===========================

Misc/python-config.in

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,9 @@ for opt in opt_flags:
4747
print(' '.join(flags))
4848

4949
elif opt in ('--libs', '--ldflags'):
50-
libs = getvar('LIBS').split() + getvar('SYSLIBS').split()
51-
libs.append('-lpython' + pyver + sys.abiflags)
50+
libs = ['-lpython' + pyver + sys.abiflags]
51+
libs += getvar('LIBS').split()
52+
libs += getvar('SYSLIBS').split()
5253
# add the prefix/lib/pythonX.Y/config dir, but only if there is no
5354
# shared library in prefix/lib/.
5455
if opt == '--ldflags':

Misc/python-config.sh.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ LIBM="@LIBM@"
4040
LIBC="@LIBC@"
4141
SYSLIBS="$LIBM $LIBC"
4242
ABIFLAGS="@ABIFLAGS@"
43-
LIBS="@LIBS@ $SYSLIBS -lpython${VERSION}${ABIFLAGS}"
43+
LIBS="-lpython${VERSION}${ABIFLAGS} @LIBS@ $SYSLIBS"
4444
BASECFLAGS="@BASECFLAGS@"
4545
LDLIBRARY="@LDLIBRARY@"
4646
LINKFORSHARED="@LINKFORSHARED@"

0 commit comments

Comments
 (0)