__revision__ = "$Id$"
import os, sys
-from types import *
+from types import StringType, NoneType
from copy import copy
+
from distutils import sysconfig
from distutils.dep_util import newer
from distutils.ccompiler import \
# should just happily stuff them into the preprocessor/compiler/linker
# options and carry on.
-
-class UnixCCompiler (CCompiler):
+class UnixCCompiler(CCompiler):
compiler_type = 'unix'
verbose=0,
dry_run=0,
force=0):
- CCompiler.__init__ (self, verbose, dry_run, force)
-
+ CCompiler.__init__(self, verbose, dry_run, force)
def preprocess(self,
source,
include_dirs=None,
extra_preargs=None,
extra_postargs=None):
-
(_, macros, include_dirs) = \
self._fix_compile_args(None, macros, include_dirs)
pp_opts = gen_preprocess_options(macros, include_dirs)
except DistutilsExecError, msg:
raise CompileError, msg
-
def compile(self,
sources,
output_dir=None,
debug=0,
extra_preargs=None,
extra_postargs=None):
-
(output_dir, macros, include_dirs) = \
self._fix_compile_args(output_dir, macros, include_dirs)
(objects, skip_sources) = self._prep_compile(sources, output_dir)
# Return *all* object filenames, not just the ones we just built.
return objects
- # compile ()
-
-
def create_static_lib(self,
objects,
output_libname,
output_dir=None,
debug=0):
-
(objects, output_dir) = self._fix_object_args(objects, output_dir)
output_filename = \
else:
log.debug("skipping %s (up-to-date)", output_filename)
- # create_static_lib ()
-
-
def link(self,
target_desc,
objects,
extra_preargs=None,
extra_postargs=None,
build_temp=None):
-
(objects, output_dir) = self._fix_object_args(objects, output_dir)
(libraries, library_dirs, runtime_library_dirs) = \
self._fix_lib_args(libraries, library_dirs, runtime_library_dirs)
else:
log.debug("skipping %s (up-to-date)", output_filename)
- # link ()
-
-
# -- Miscellaneous methods -----------------------------------------
# These are all used by the 'gen_lib_options() function, in
# ccompiler.py.
def library_option(self, lib):
return "-l" + lib
-
def find_library_file(self, dirs, lib, debug=0):
-
for dir in dirs:
shared = os.path.join(
dir, self.library_filename(lib, lib_type='shared'))
else:
# Oops, didn't find it in *any* of 'dirs'
return None
-
- # find_library_file ()
-
-# class UnixCCompiler