NAME

ccconfig - Get Convert::Binary::C configuration for a compiler

SYNOPSIS

ccconfig options [-- compiler-options]

options:

-c
--cc             compiler   compiler executable to test
                            default: auto-determined

-p
--ppout          flag       compiler option for sending
                            preprocessor output to stdout
                            default: -E

-t
--temp           file       name of the temporary test file
                            default: _t_e_s_t.c

-o
--output-file    file       output filename
                            default: output to stdout

-f
--output-format  format     output format
                            default: dumper

--nodelete                  don't delete temporary files

--norun                     don't try to run executables

--quiet                     don't display anything
--nostatus                  don't display status indicator

--version                   print version number

--debug                     debug mode

DESCRIPTION

ccconfig will try to determine a usable configuration for Convert::Binary::C from testing a compiler executable. It is not necessary that the binaries generated by the compiler can be executed, so ccconfig can be used for cross-compilers.

The tool is still experimental, and you should neither rely on its results without checking, nor expect it to work in your environment.

OPTIONS

--cc compiler

This option allows you to explicitly specify a compiler executable. This is especially useful if you don't want to use your system compiler.

--ppout flag

This option tells ccconfig which flag must be used to make the compiler write the preprocessor output to standard output. The default is -E, which is correct for many compilers.

--temp file

Allows you to change the name of the temporary test file.

--output-file file

Write Convert::Binary::C configuration to the specified file. The default is to write the configuration to stdout.

--output-format format

Specify the output format of the Convert::Binary::C configuration. The following formats are currently supported:

dumper      Output a %config hash using Data::Dumper
require     Output in a format suitable for require

The default is dumper.

--nodelete

Don't attempt to delete temporary files that have been created by the compiler. Normally, ccconfig will look for all files with the same basename as the temporary test file and delete them.

--norun

You can specify this option if the executables generated by your compiler cannot be run on your machine, i.e. if you have a cross-compiler. However, ccconfig will automatically find out that it cannot run the executables.

When this option is set, a different set of algorithms is used to determine a couple of configuration settings. These algorithms are all based upon placing a special signature in the object file. They are less reliable that the standard algorithms, so you shouldn't use them unless you have to.

--quiet

Don't display anything except for the final configuration.

--nostatus

Hide the status indicator. Recommended if you want to redirect the script output to a file:

ccconfig --nostatus >config.pl 2>ccconfig.log

--version

Writes the program name, version and path to standard output.

--debug

Generate tons of debug output. Don't use unless you know what you're doing.

EXAMPLES

Normally, a simple

ccconfig

without arguments is enough if you want the configuration for your system compiler. While ccconfig is running, it will write lots of status information to stderr. When it's done, it will write a Perl hash table to stdout which can be directly used as a configuration for Convert::Binary::C.

If you want the configuration for a different compiler, or ccconfig cannot determine your system compiler automatically, use

ccconfig -c gcc32

if your compiler's name is gcc32.

If you want to pass additional options to the compiler, you can do so after a double-dash on the command line:

ccconfig -- -g -DDEBUGGING

or

ccconfig -c gcc32 -- -ansi -fshort-enums

If you'd like to interface with the Perl core, you may find a suitable configuration using something like:

ccconfig --cc=`perl -MConfig -e 'print $Config{cc}'` \
         -- `perl -MConfig -e 'print $Config{ccflags}'`

COPYRIGHT

Copyright (c) 2002-2005 Marcus Holland-Moritz. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

SEE ALSO

See Convert::Binary::C.