diff options
author | Jack Jansen <jack.jansen@cwi.nl> | 2001-08-27 15:08:16 (GMT) |
---|---|---|
committer | Jack Jansen <jack.jansen@cwi.nl> | 2001-08-27 15:08:16 (GMT) |
commit | e259e5980c0a0889024ee99e4879a80fa8cd2086 (patch) | |
tree | 36622f59422fc1d0517fed2bea5768846b3f7aa3 /Lib/distutils | |
parent | 9403591014c5904baef0ad4d808cf222b107dc1f (diff) | |
download | cpython-e259e5980c0a0889024ee99e4879a80fa8cd2086.zip cpython-e259e5980c0a0889024ee99e4879a80fa8cd2086.tar.gz cpython-e259e5980c0a0889024ee99e4879a80fa8cd2086.tar.bz2 |
Patch by Bill Noon: added 'dylib' as a library type along with
'static' and 'shared'. This fixes extension building for dynamic
Pythons on MacOSX.
Diffstat (limited to 'Lib/distutils')
-rw-r--r-- | Lib/distutils/ccompiler.py | 4 | ||||
-rw-r--r-- | Lib/distutils/unixccompiler.py | 9 |
2 files changed, 9 insertions, 4 deletions
diff --git a/Lib/distutils/ccompiler.py b/Lib/distutils/ccompiler.py index 4a282d4..4efd934 100644 --- a/Lib/distutils/ccompiler.py +++ b/Lib/distutils/ccompiler.py @@ -792,8 +792,8 @@ class CCompiler: output_dir=''): if output_dir is None: output_dir = '' - if lib_type not in ("static","shared"): - raise ValueError, "'lib_type' must be \"static\" or \"shared\"" + if lib_type not in ("static","shared","dylib"): + raise ValueError, "'lib_type' must be \"static\", \"shared\" or \"dylib\"" fmt = getattr (self, lib_type + "_lib_format") ext = getattr (self, lib_type + "_lib_extension") diff --git a/Lib/distutils/unixccompiler.py b/Lib/distutils/unixccompiler.py index da1f2a4..a4f0ac4 100644 --- a/Lib/distutils/unixccompiler.py +++ b/Lib/distutils/unixccompiler.py @@ -71,7 +71,8 @@ class UnixCCompiler (CCompiler): obj_extension = ".o" static_lib_extension = ".a" shared_lib_extension = ".so" - static_lib_format = shared_lib_format = "lib%s%s" + dylib_lib_extension = ".dylib" + static_lib_format = shared_lib_format = dylib_lib_format = "lib%s%s" @@ -259,6 +260,8 @@ class UnixCCompiler (CCompiler): for dir in dirs: shared = os.path.join( dir, self.library_filename(lib, lib_type='shared')) + dylib = os.path.join( + dir, self.library_filename(lib, lib_type='dylib')) static = os.path.join( dir, self.library_filename(lib, lib_type='static')) @@ -266,7 +269,9 @@ class UnixCCompiler (CCompiler): # data to go on: GCC seems to prefer the shared library, so I'm # assuming that *all* Unix C compilers do. And of course I'm # ignoring even GCC's "-static" option. So sue me. - if os.path.exists(shared): + if os.path.exists(dylib): + return dylib + elif os.path.exists(shared): return shared elif os.path.exists(static): return static |