diff options
author | Greg Ward <gward@python.net> | 1999-12-12 16:57:47 (GMT) |
---|---|---|
committer | Greg Ward <gward@python.net> | 1999-12-12 16:57:47 (GMT) |
commit | 04d78328f39864cada04591ebb1d99ad30671cec (patch) | |
tree | 5e5354745f44c2c8f51f10b08aa1423a8e336b85 /Lib | |
parent | 44f8e4ea0860863c35fa311bf3deb32aadf882ab (diff) | |
download | cpython-04d78328f39864cada04591ebb1d99ad30671cec.zip cpython-04d78328f39864cada04591ebb1d99ad30671cec.tar.gz cpython-04d78328f39864cada04591ebb1d99ad30671cec.tar.bz2 |
In 'compile()' method, renamed 'includes' parameter to 'include_dirs' for
consistency with 'build_ext' command option.
Changed 'compile()' and 'link_shared_object()' so 'include_dirs',
'libraries', and 'library_dirs' can be lists or tuples.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/distutils/unixccompiler.py | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/Lib/distutils/unixccompiler.py b/Lib/distutils/unixccompiler.py index 8f68919..edff4f0 100644 --- a/Lib/distutils/unixccompiler.py +++ b/Lib/distutils/unixccompiler.py @@ -92,7 +92,7 @@ class UnixCCompiler (CCompiler): sources, output_dir=None, macros=None, - includes=None, + include_dirs=None, extra_preargs=None, extra_postargs=None): @@ -100,18 +100,19 @@ class UnixCCompiler (CCompiler): output_dir = self.output_dir if macros is None: macros = [] - if includes is None: - includes = [] + if include_dirs is None: + include_dirs = [] if type (macros) is not ListType: raise TypeError, \ "'macros' (if supplied) must be a list of tuples" - if type (includes) is not ListType: + if type (include_dirs) not in (ListType, TupleType): raise TypeError, \ - "'includes' (if supplied) must be a list of strings" + "'include_dirs' (if supplied) must be a list of strings" + include_dirs = list (include_dirs) pp_opts = gen_preprocess_options (self.macros + macros, - self.include_dirs + includes) + self.include_dirs + include_dirs) # So we can mangle 'sources' without hurting the caller's data orig_sources = sources @@ -204,6 +205,15 @@ class UnixCCompiler (CCompiler): if library_dirs is None: library_dirs = [] + if type (libraries) not in (ListType, TupleType): + raise TypeError, \ + "'libraries' (if supplied) must be a list of strings" + if type (library_dirs) not in (ListType, TupleType): + raise TypeError, \ + "'library_dirs' (if supplied) must be a list of strings" + libraries = list (libraries) + library_dirs = list (library_dirs) + lib_opts = gen_lib_options (self, self.library_dirs + library_dirs, self.libraries + libraries) |