Package distutils :: Package command :: Module config :: Class config
[hide private]
[frames] | no frames]

_ClassType config

cmd.Command --+
              |
             config

Instance Methods [hide private]
 
initialize_options(self)
Set default values for all the options that this command supports.
 
finalize_options(self)
Set final values for all the options that this command supports.
 
run(self)
A command's raison d'etre: carry out the action it exists to perform, controlled by the options initialized in 'initialize_options()', customized by other commands, the setup script, the command-line, and config files, and finalized in 'finalize_options()'.
 
_check_compiler(self)
Check that 'self.compiler' really is a CCompiler object; if not, make it one.
 
_gen_temp_sourcefile(self, body, headers, lang)
 
_preprocess(self, body, headers, include_dirs, lang)
 
_compile(self, body, headers, include_dirs, lang)
 
_link(self, body, headers, include_dirs, libraries, library_dirs, lang)
 
_clean(self, *filenames)
 
try_cpp(self, body=None, headers=None, include_dirs=None, lang='c')
Construct a source file from 'body' (a string containing lines of C/C++ code) and 'headers' (a list of header files to include) and run it through the preprocessor.
 
search_cpp(self, pattern, body=None, headers=None, include_dirs=None, lang='c')
Construct a source file (just like 'try_cpp()'), run it through the preprocessor, and return true if any line of the output matches 'pattern'.
 
try_compile(self, body, headers=None, include_dirs=None, lang='c')
Try to compile a source file built from 'body' and 'headers'.
 
try_link(self, body, headers=None, include_dirs=None, libraries=None, library_dirs=None, lang='c')
Try to compile and link a source file, built from 'body' and 'headers', to executable form.
 
try_run(self, body, headers=None, include_dirs=None, libraries=None, library_dirs=None, lang='c')
Try to compile, link to an executable, and run a program built from 'body' and 'headers'.
 
check_func(self, func, headers=None, include_dirs=None, libraries=None, library_dirs=None, decl=0, call=0)
Determine if function 'func' is available by constructing a source file that refers to 'func', and compiles and links it.
 
check_lib(self, library, library_dirs=None, headers=None, include_dirs=None, other_libraries=[])
Determine if 'library' is available to be linked against, without actually checking that any particular symbols are provided by it.
 
check_header(self, header, include_dirs=None, library_dirs=None, lang='c')
Determine if the system header file named by 'header_file' exists and can be found by the preprocessor; return true if so, false otherwise.

Inherited from cmd.Command: __getattr__, __init__, announce, copy_file, copy_tree, debug_print, dump_options, ensure_dirname, ensure_filename, ensure_finalized, ensure_string, ensure_string_list, execute, get_command_name, get_finalized_command, get_sub_commands, make_archive, make_file, mkpath, move_file, reinitialize_command, run_command, set_undefined_options, spawn, warn

Class Variables [hide private]
  description = 'prepare to build'
  user_options = [('compiler=', None, 'specify the compiler type...

Inherited from cmd.Command: sub_commands

Method Details [hide private]

initialize_options(self)

 

Set default values for all the options that this command supports. Note that these defaults may be overridden by other commands, by the setup script, by config files, or by the command-line. Thus, this is not the place to code dependencies between options; generally, 'initialize_options()' implementations are just a bunch of "self.foo = None" assignments.

This method must be implemented by all command classes.

Overrides: cmd.Command.initialize_options
(inherited documentation)

finalize_options(self)

 

Set final values for all the options that this command supports. This is always called as late as possible, ie. after any option assignments from the command-line or from other commands have been done. Thus, this is the place to code option dependencies: if 'foo' depends on 'bar', then it is safe to set 'foo' from 'bar' as long as 'foo' still has the same value it was assigned in 'initialize_options()'.

This method must be implemented by all command classes.

Overrides: cmd.Command.finalize_options
(inherited documentation)

run(self)

 

A command's raison d'etre: carry out the action it exists to perform, controlled by the options initialized in 'initialize_options()', customized by other commands, the setup script, the command-line, and config files, and finalized in 'finalize_options()'. All terminal output and filesystem interaction should be done by 'run()'.

This method must be implemented by all command classes.

Overrides: cmd.Command.run
(inherited documentation)

try_cpp(self, body=None, headers=None, include_dirs=None, lang='c')

 

Construct a source file from 'body' (a string containing lines of C/C++ code) and 'headers' (a list of header files to include) and run it through the preprocessor. Return true if the preprocessor succeeded, false if there were any errors. ('body' probably isn't of much use, but what the heck.)

search_cpp(self, pattern, body=None, headers=None, include_dirs=None, lang='c')

 

Construct a source file (just like 'try_cpp()'), run it through the preprocessor, and return true if any line of the output matches 'pattern'. 'pattern' should either be a compiled regex object or a string containing a regex. If both 'body' and 'headers' are None, preprocesses an empty file -- which can be useful to determine the symbols the preprocessor and compiler set by default.

try_compile(self, body, headers=None, include_dirs=None, lang='c')

 

Try to compile a source file built from 'body' and 'headers'. Return true on success, false otherwise.

try_link(self, body, headers=None, include_dirs=None, libraries=None, library_dirs=None, lang='c')

 

Try to compile and link a source file, built from 'body' and 'headers', to executable form. Return true on success, false otherwise.

try_run(self, body, headers=None, include_dirs=None, libraries=None, library_dirs=None, lang='c')

 

Try to compile, link to an executable, and run a program built from 'body' and 'headers'. Return true on success, false otherwise.

check_func(self, func, headers=None, include_dirs=None, libraries=None, library_dirs=None, decl=0, call=0)

 

Determine if function 'func' is available by constructing a source file that refers to 'func', and compiles and links it. If everything succeeds, returns true; otherwise returns false.

The constructed source file starts out by including the header files listed in 'headers'. If 'decl' is true, it then declares 'func' (as "int func()"); you probably shouldn't supply 'headers' and set 'decl' true in the same call, or you might get errors about a conflicting declarations for 'func'. Finally, the constructed 'main()' function either references 'func' or (if 'call' is true) calls it. 'libraries' and 'library_dirs' are used when linking.

check_lib(self, library, library_dirs=None, headers=None, include_dirs=None, other_libraries=[])

 

Determine if 'library' is available to be linked against, without actually checking that any particular symbols are provided by it. 'headers' will be used in constructing the source file to be compiled, but the only effect of this is to check if all the header files listed are available. Any libraries listed in 'other_libraries' will be included in the link, in case 'library' has symbols that depend on other libraries.


Class Variable Details [hide private]

user_options

Value:
[('compiler=', None, 'specify the compiler type'),
 ('cc=', None, 'specify the compiler executable'),
 ('include-dirs=',
  'I',
  'list of directories to search for header files'),
 ('define=', 'D', 'C preprocessor macros to define'),
 ('undef=', 'U', 'C preprocessor macros to undefine'),
 ('libraries=', 'l', 'external C libraries to link with'),
...