ExtUtils::CppGuess - guess C++ compiler and flags
With Extutils::MakeMaker:
use ExtUtils::CppGuess; my $guess = ExtUtils::CppGuess->new; WriteMakefile ( # MakeMaker args, $guess->makemaker_options, );
With Module::Build:
my $guess = ExtUtils::CppGuess->new; my $build = Module::Build->new ( # Module::Build arguments $guess->module_build_options, ); $build->create_build_script;
ExtUtils::CppGuess attempts to guess the system's C++ compiler that is compatible with the C compiler that your perl was built with.
ExtUtils::CppGuess
It can generate the necessary options to the Module::Build constructor or to ExtUtils::MakeMaker's WriteMakefile function.
WriteMakefile
Creates a new ExtUtils::CppGuess object. Takes the path to the C compiler as the cc argument, but falls back to the value of $Config{cc}, which should be what you want anyway.
cc
$Config{cc}
You can specify extra_compiler_flags and extra_linker_flags (as strings) which will be merged in with the auto-detected ones.
extra_compiler_flags
extra_linker_flags
Returns the correct options to the constructor of Module::Build. These are:
Module::Build
extra_compiler_flags extra_linker_flags
Returns the correct options to the WriteMakefile function of ExtUtils::MakeMaker. These are:
ExtUtils::MakeMaker
CCFLAGS dynamic_lib => { OTHERLDFLAGS => ... }
If you specify the extra compiler or linker flags in the constructor, they'll be merged into CCFLAGS or OTHERLDFLAGS respectively.
CCFLAGS
OTHERLDFLAGS
Returns true if the detected compiler is in the gcc family.
Returns true if the detected compiler is in the MS VC family.
Takes a string as argument that is added to the string of extra compiler flags.
Takes a string as argument that is added to the string of extra linker flags.
Mattia Barbon <mbarbon@cpan.org>
Steffen Mueller <smueller@cpan.org>
Tobias Leich <froggs@cpan.org>
Copyright 2010, 2011 by Mattia Barbon.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install ExtUtils::CppGuess, copy and paste the appropriate command in to your terminal.
cpanm
cpanm ExtUtils::CppGuess
CPAN shell
perl -MCPAN -e shell install ExtUtils::CppGuess
For more information on module installation, please visit the detailed CPAN module installation guide.