Module ccompiler
distutils.ccompiler
Contains CCompiler, an abstract base class that defines the interface
for the Distutils compiler abstraction model.
CCompiler
Abstract base class to define the interface that must be
implemented by real compiler classes.
|
|
get_default_compiler(osname=None,
platform=None)
Determine the default compiler to use for the given platform. |
|
|
|
show_compilers()
Print list of available compilers (used by the
"--help-compiler" options to "build",
"build_ext", "build_clib"). |
|
|
|
new_compiler(plat=None,
compiler=None,
verbose=0,
dry_run=0,
force=0)
Generate an instance of some CCompiler subclass for the supplied
platform/compiler combination. |
|
|
|
gen_preprocess_options(macros,
include_dirs)
Generate C pre-processor options (-D, -U, -I) as used by at least two
types of compilers: the typical Unix compiler and Visual C++. |
|
|
|
gen_lib_options(compiler,
library_dirs,
runtime_library_dirs,
libraries)
Generate linker options for searching library directories and linking
with specific libraries. |
|
|
Imports:
sys,
os,
re,
IntType,
TypeType,
BooleanType,
CodeType,
UnboundMethodType,
StringType,
BuiltinMethodType,
FloatType,
DictionaryType,
NotImplementedType,
BuiltinFunctionType,
DictProxyType,
GeneratorType,
InstanceType,
ObjectType,
DictType,
GetSetDescriptorType,
FileType,
EllipsisType,
StringTypes,
ListType,
MethodType,
TupleType,
ModuleType,
FrameType,
LongType,
BufferType,
TracebackType,
ClassType,
MemberDescriptorType,
UnicodeType,
SliceType,
ComplexType,
LambdaType,
FunctionType,
XRangeType,
NoneType,
copy,
DistutilsPlatformError,
DistutilsArgError,
LibError,
DistutilsInternalError,
DistutilsSetupError,
DistutilsOptionError,
DistutilsClassError,
DistutilsModuleError,
DistutilsFileError,
CCompilerError,
CompileError,
LinkError,
DistutilsExecError,
DistutilsGetoptError,
DistutilsTemplateError,
DistutilsError,
UnknownFileError,
PreprocessError,
spawn,
move_file,
mkpath,
newer_pairwise,
newer_group,
split_quoted,
execute,
log
get_default_compiler(osname=None,
platform=None)
|
|
Determine the default compiler to use for the given platform.
osname should be one of the standard Python OS names (i.e. the ones
returned by os.name) and platform the common value returned by
sys.platform for the platform in question.
The default values are os.name and sys.platform in case the parameters
are not given.
|
new_compiler(plat=None,
compiler=None,
verbose=0,
dry_run=0,
force=0)
|
|
Generate an instance of some CCompiler subclass for the supplied
platform/compiler combination. 'plat' defaults to 'os.name' (eg.
'posix', 'nt'), and 'compiler' defaults to the default compiler for that
platform. Currently only 'posix' and 'nt' are supported, and the default
compilers are "traditional Unix interface" (UnixCCompiler
class) and Visual C++ (MSVCCompiler class). Note that it's perfectly
possible to ask for a Unix compiler object under Windows, and a Microsoft
compiler object under Unix -- if you supply a value for 'compiler',
'plat' is ignored.
|
gen_preprocess_options(macros,
include_dirs)
|
|
Generate C pre-processor options (-D, -U, -I) as used by at least two
types of compilers: the typical Unix compiler and Visual C++. 'macros' is
the usual thing, a list of 1- or 2-tuples, where (name,) means undefine
(-U) macro 'name', and (name,value) means define (-D) macro 'name' to
'value'. 'include_dirs' is just a list of directory names to be added to
the header file search path (-I). Returns a list of command-line options
suitable for either Unix compilers or Visual C++.
|
gen_lib_options(compiler,
library_dirs,
runtime_library_dirs,
libraries)
|
|
Generate linker options for searching library directories and linking
with specific libraries. 'libraries' and 'library_dirs' are,
respectively, lists of library names (not filenames!) and search
directories. Returns a list of command-line options suitable for use
with some compiler (depending on the two format strings passed in).
|
__revision__
- Value:
' $Id: ccompiler.py 46331 2006-05-26 14:07:23Z bob.ippolito $ '
|
|
_default_compilers
- Value:
( ( ' cygwin.* ' , ' unix ' ) ,
( ' os2emx ' , ' emx ' ) ,
( ' posix ' , ' unix ' ) ,
( ' nt ' , ' msvc ' ) ,
( ' mac ' , ' mwerks ' ) )
|
|
compiler_class
- Value:
{ ' bcpp ' : ( ' bcppcompiler ' , ' BCPPCompiler ' , ' Borland C++ Compiler ' ) ,
' cygwin ' : ( ' cygwinccompiler ' ,
' CygwinCCompiler ' ,
' Cygwin port of GNU C Compiler for Win32 ' ) ,
' emx ' : ( ' emxccompiler ' ,
' EMXCCompiler ' ,
' EMX port of GNU C Compiler for OS/2 ' ) ,
' mingw32 ' : ( ' cygwinccompiler ' , ' Mingw32CCompiler ' , ' Mingw32 port of G
...
|
|