Parrot::Configure::Compiler - C-Related methods for configuration
The Parrot::Configure::Compiler module provides methods inherited by Parrot::Configure which prepare and/or run C programs during compilation.
- Generates test_$$.c from the specified source file.
- These items are used from current config settings:
$cc, $ccflags, $ldout, $o, $link, $linkflags, $cc_exe_out, $exe, $libs
- Calls the compiler and linker on test_$$.c.
- Calls the test (or test.exe) executable. Any output is directed to test.out.
- Same as
cc_run() except that warnings and errors are also directed to test.out.
- Cleans up all files in the root folder that match the glob test.*.
$conf->genfile($source, $target, %options);
- Takes the specified source file, replacing entries like
FOO's value from the configuration system's data, and writes the results to specified target file.
- Respects the following options when manipulating files (Note: most of the replacement syntax assumes the source text is on a single line.)
- If set to a
comment_type will be set to corresponding value. Moreover, when set to a
makefile value, it will set
replace_slashes to enabled, and
conditioned_lines to enabled.
- Its value will be detected automatically by target file name unless you set it to a special value
conditioned_lines is true, then lines in the file that begin with:
#CONDITIONED_LINE(var): are skipped if the
var condition is false. Lines that begin with
#INVERSE_CONDITIONED_LINE(var): are skipped if the
var condition is true. For instance:
- will be processed if the platform is win32.
- This option takes has two possible values,
/*. If present and set to one of these two values, the generated file will contain a generated header that is commented out appropriately.
- A regular expression. Any lines in the file matching this expression are ignored when determining if the target file has changed (and should therefore be overwritten with a new copy).
- When feature_file is set to a true value, a lines beginning with
#perl forces the remaining lines of the file to be evaluated as perl code. Before this evaluation occurs, any substitution of @@ values is performed on the original text.
- If set to a true value, this causes any
/s in the file to automatically be replaced with an architecture appropriate slash.
\. This is a very helpful option when writing Makefiles.
- If set to a true value, then certain types of gmake syntax will be expanded into their full equivalents. For example:
- Will be replaced at config time with the list of files that match this pattern. Note! Be very careful when determining whether or not to disable this expansion during config time and letting gmake evaluate these: the config system itself may change state of the filesystem, causing the directives to expand differently depending on when they're run. Another potential issue to consider there is that most makefiles, while generated from the root directory, are run from a subdirectory. So relative path names become an issue.
- The gmake replacements are done repeatedly on a single line, so nested syntax works ok.