]> granicus.if.org Git - python/commitdiff
Bug #1655392: don't add -L/usr/lib/pythonX.Y/config to the LDFLAGS
authorGeorg Brandl <georg@python.org>
Sat, 31 Mar 2007 18:58:21 +0000 (18:58 +0000)
committerGeorg Brandl <georg@python.org>
Sat, 31 Mar 2007 18:58:21 +0000 (18:58 +0000)
returned by python-config if Python was built with --enable-shared
because that prevented the shared library from being used.
  (backport from rev. 54634)

Misc/NEWS
Misc/python-config.in

index 77aa41485ace753738319a77adb361e363b96e04..da35e71090329867b0d5e55b1e415679011993b2 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -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.
 
index e0215a2695874e4a2f45a709f2937533102adc84..9ac44146d4da47bfc94ad481d47f616d7e9ebf09 100644 (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)