diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2007-02-09 12:36:48 (GMT) |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2007-02-09 12:36:48 (GMT) |
commit | 0a2032673cb151949b0788d74bb1ed6d55f2b0df (patch) | |
tree | a090c66eb188ca36c4208e4964f840e5f12f7079 /Lib/distutils/command | |
parent | fd963265e21686fb306eaa3f0e63c15bfdbcc9ba (diff) | |
download | cpython-0a2032673cb151949b0788d74bb1ed6d55f2b0df.zip cpython-0a2032673cb151949b0788d74bb1ed6d55f2b0df.tar.gz cpython-0a2032673cb151949b0788d74bb1ed6d55f2b0df.tar.bz2 |
Bug #1600860: Search for shared python library in LIBDIR, not
lib/python/config, on "linux" and "gnu" systems.
Will backport.
Diffstat (limited to 'Lib/distutils/command')
-rw-r--r-- | Lib/distutils/command/build_ext.py | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/Lib/distutils/command/build_ext.py b/Lib/distutils/command/build_ext.py index 2413829..542b77a 100644 --- a/Lib/distutils/command/build_ext.py +++ b/Lib/distutils/command/build_ext.py @@ -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 |