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.
This commit is contained in:
Greg Ward 1999-12-12 16:57:47 +00:00
parent 44f8e4ea08
commit 04d78328f3
1 changed files with 16 additions and 6 deletions

View File

@ -92,7 +92,7 @@ class UnixCCompiler (CCompiler):
sources, sources,
output_dir=None, output_dir=None,
macros=None, macros=None,
includes=None, include_dirs=None,
extra_preargs=None, extra_preargs=None,
extra_postargs=None): extra_postargs=None):
@ -100,18 +100,19 @@ class UnixCCompiler (CCompiler):
output_dir = self.output_dir output_dir = self.output_dir
if macros is None: if macros is None:
macros = [] macros = []
if includes is None: if include_dirs is None:
includes = [] include_dirs = []
if type (macros) is not ListType: if type (macros) is not ListType:
raise TypeError, \ raise TypeError, \
"'macros' (if supplied) must be a list of tuples" "'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, \ 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, 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 # So we can mangle 'sources' without hurting the caller's data
orig_sources = sources orig_sources = sources
@ -204,6 +205,15 @@ class UnixCCompiler (CCompiler):
if library_dirs is None: if library_dirs is None:
library_dirs = [] 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, lib_opts = gen_lib_options (self,
self.library_dirs + library_dirs, self.library_dirs + library_dirs,
self.libraries + libraries) self.libraries + libraries)