]> granicus.if.org Git - python/commitdiff
Bug #1600860: Search for shared python library in LIBDIR, not
authorMartin v. Löwis <martin@v.loewis.de>
Fri, 9 Feb 2007 12:37:12 +0000 (12:37 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Fri, 9 Feb 2007 12:37:12 +0000 (12:37 +0000)
lib/python/config, on "linux" and "gnu" systems.

Lib/distutils/command/build_ext.py
Misc/NEWS

index 2413829369278096960cbf9d9ba9be491fb5e99d..542b77a7ad827a7f93d6a6e6f948bb70256eb90d 100644 (file)
@@ -185,9 +185,7 @@ class build_ext (Command):
 
         # for extensions under Cygwin and AtheOS Python's library directory must be
         # appended to library_dirs
-        if sys.platform[:6] == 'cygwin' or sys.platform[:6] == 'atheos' or \
-               ((sys.platform.startswith('linux') or sys.platform.startswith('gnu')) and
-                sysconfig.get_config_var('Py_ENABLE_SHARED')):
+        if sys.platform[:6] == 'cygwin' or sys.platform[:6] == 'atheos':
             if string.find(sys.executable, sys.exec_prefix) != -1:
                 # building third party extensions
                 self.library_dirs.append(os.path.join(sys.prefix, "lib",
@@ -197,6 +195,17 @@ class build_ext (Command):
                 # building python standard extensions
                 self.library_dirs.append('.')
 
+        # for extensions under Linux with a shared Python library,
+        # Python's library directory must be appended to library_dirs
+        if (sys.platform.startswith('linux') or sys.platform.startswith('gnu')) \
+                and sysconfig.get_config_var('Py_ENABLE_SHARED'):
+            if string.find(sys.executable, sys.exec_prefix) != -1:
+                # building third party extensions
+                self.library_dirs.append(sysconfig.get_config_var('LIBDIR'))
+            else:
+                # building python standard extensions
+                self.library_dirs.append('.')
+
         # The argument parsing will result in self.define being a string, but
         # it has to be a list of 2-tuples.  All the preprocessor symbols
         # specified by the 'define' option will be set to '1'.  Multiple
index 8cecda5857a13e7e76eb5349120c5a582d10a7ab..0ac7328ea3d2a33ba73c5e6e333eb4849c40d74f 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -169,6 +169,9 @@ Extension Modules
 Library
 -------
 
+- Bug #1600860: Search for shared python library in LIBDIR, not lib/python/config,
+  on "linux" and "gnu" systems.
+
 - Bug #1124861: Automatically create pipes if GetStdHandle fails in
   subprocess.