Bug #1655392: don't add -L/usr/lib/pythonX.Y/config to the LDFLAGS

returned by python-config if Python was built with --enable-shared
because that prevented the shared library from being used.
  (backport from rev. 54634)
This commit is contained in:
Georg Brandl 2007-03-31 18:58:21 +00:00
parent 65407fb734
commit 48642d4a0a
2 changed files with 7 additions and 1 deletions

View File

@ -426,6 +426,10 @@ Tests
Build
-----
- Bug #1655392: don't add -L/usr/lib/pythonX.Y/config to the LDFLAGS
returned by python-config if Python was built with --enable-shared
because that prevented the shared library from being used.
- Patch #1569798: fix a bug in distutils when building Python from a
directory within sys.exec_prefix.

View File

@ -45,7 +45,9 @@ elif opt in ('--includes', '--cflags'):
elif opt in ('--libs', '--ldflags'):
libs = getvar('LIBS').split() + getvar('SYSLIBS').split()
libs.append('-lpython'+pyver)
if opt == '--ldflags':
# add the prefix/lib/pythonX.Y/config dir, but only if there is no
# shared library in prefix/lib/.
if opt == '--ldflags' and not getvar('Py_ENABLE_SHARED'):
libs.insert(0, '-L' + getvar('LIBPL'))
print ' '.join(libs)