.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "ExtUtils::CppGuess 3pm" .TH ExtUtils::CppGuess 3pm "2023-11-24" "perl v5.36.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" ExtUtils::CppGuess \- guess C++ compiler and flags .SH "SYNOPSIS" .IX Header "SYNOPSIS" With Extutils::MakeMaker: .PP .Vb 1 \& use ExtUtils::CppGuess; \& \& my $guess = ExtUtils::CppGuess\->new; \& \& WriteMakefile \& ( # MakeMaker args, \& $guess\->makemaker_options, \& ); .Ve .PP With Module::Build: .PP .Vb 1 \& my $guess = ExtUtils::CppGuess\->new; \& \& my $build = Module::Build\->new \& ( # Module::Build arguments \& $guess\->module_build_options, \& ); \& $build\->create_build_script; .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" \&\f(CW\*(C`ExtUtils::CppGuess\*(C'\fR attempts to guess the system's \*(C+ compiler that is compatible with the C compiler that your perl was built with. .PP It can generate the necessary options to the Module::Build constructor or to ExtUtils::MakeMaker's \f(CW\*(C`WriteMakefile\*(C'\fR function. .SH "ENVIRONMENT" .IX Header "ENVIRONMENT" As of 0.24, the environment variable \f(CW\*(C`CXX\*(C'\fR defines the obvious value, and will be used instead of any detection. Supplied arguments to \*(L"new\*(R" will still win. .SH "METHODS" .IX Header "METHODS" .SS "new" .IX Subsection "new" Creates a new \f(CW\*(C`ExtUtils::CppGuess\*(C'\fR object. Takes the path to the C compiler as the \f(CW\*(C`cc\*(C'\fR argument, but falls back to the value of \f(CW$Config{cc}\fR, which should be what you want anyway. .PP You can specify \f(CW\*(C`extra_compiler_flags\*(C'\fR and \f(CW\*(C`extra_linker_flags\*(C'\fR (as strings) which will be merged in with the auto-detected ones. .SS "module_build_options" .IX Subsection "module_build_options" Returns the correct options to the constructor of \f(CW\*(C`Module::Build\*(C'\fR. These are: .PP .Vb 3 \& extra_compiler_flags \& extra_linker_flags \& config => { cc => ... }, # as of 0.15 .Ve .PP Please note the above may have problems on Perl <= 5.8 with ExtUtils::CBuilder <= 0.280230 due to a Perl \s-1RE\s0 issue. .SS "makemaker_options" .IX Subsection "makemaker_options" Returns the correct options to the \f(CW\*(C`WriteMakefile\*(C'\fR function of \&\f(CW\*(C`ExtUtils::MakeMaker\*(C'\fR. These are: .PP .Vb 3 \& CCFLAGS \& dynamic_lib => { OTHERLDFLAGS => ... } \& CC # as of 0.15 .Ve .PP If you specify the extra compiler or linker flags in the constructor, they'll be merged into \f(CW\*(C`CCFLAGS\*(C'\fR or \&\f(CW\*(C`OTHERLDFLAGS\*(C'\fR respectively. .SS "is_gcc" .IX Subsection "is_gcc" Returns true if the detected compiler is in the gcc family. .SS "is_msvc" .IX Subsection "is_msvc" Returns true if the detected compiler is in the \s-1MS VC\s0 family. .SS "is_clang" .IX Subsection "is_clang" Returns true if the detected compiler is in the Clang family. .SS "is_sunstudio" .IX Subsection "is_sunstudio" Returns true if the detected compiler is in the Sun Studio family. .SS "add_extra_compiler_flags" .IX Subsection "add_extra_compiler_flags" Takes a string as argument that is added to the string of extra compiler flags. .SS "add_extra_linker_flags" .IX Subsection "add_extra_linker_flags" Takes a string as argument that is added to the string of extra linker flags. .SS "compiler_command" .IX Subsection "compiler_command" Returns the string that can be passed to \f(CW\*(C`system\*(C'\fR to execute the compiler. Will include the flags returned as the Module::Build \&\f(CW\*(C`extra_compiler_flags\*(C'\fR. .PP Added in 0.13. .SS "linker_flags" .IX Subsection "linker_flags" The same as returned as the Module::Build \f(CW\*(C`extra_linker_flags\*(C'\fR. .PP Added in 0.13. .SS "iostream_fname" .IX Subsection "iostream_fname" Returns the filename to \f(CW\*(C`#include\*(C'\fR to get iostream capability. .PP This can be used a bit creatively to be portable in one's \s-1XS\s0 files, as the tests for this module need to be: .PP .Vb 5 \& # in Makefile.PL: \& $guess\->add_extra_compiler_flags( \& \*(Aq\-DINCLUDE_DOT=\*(Aq . \& ($guess\->iostream_fname =~ /\e./ ? 1 : 0) \& ); \& \& // in your .xs file: \& #if INCLUDE_DOT \& #include \& #else \& #include \& #endif .Ve .PP Added in 0.15. .SS "cpp_flavor_defs" .IX Subsection "cpp_flavor_defs" Returns the text for a header that \f(CW\*(C`#define\*(C'\fRs \&\f(CW\*(C`_\|_INLINE_CPP_STANDARD_HEADERS\*(C'\fR and \f(CW\*(C`_\|_INLINE_CPP_NAMESPACE_STD\*(C'\fR if the standard headers and namespace are available. This is determined by trying to compile \*(C+ with \f(CW\*(C`#define \*(C'\fR \- if it succeeds, the symbols will be defined, else commented. .PP Added in 0.15. .SS "cpp_standard_flag" .IX Subsection "cpp_standard_flag" .Vb 1 \& $guess\->cpp_standard_flag( $standard_name ) .Ve .PP Given a string \f(CW$standard_name\fR that is currently one of .IP "\(bu" 4 \&\f(CW\*(C`C++98\*(C'\fR .IP "\(bu" 4 \&\f(CW\*(C`C++11\*(C'\fR .IP "\(bu" 4 \&\f(CW\*(C`C++14\*(C'\fR .IP "\(bu" 4 \&\f(CW\*(C`C++17\*(C'\fR .IP "\(bu" 4 \&\f(CW\*(C`C++20\*(C'\fR .IP "\(bu" 4 \&\f(CW\*(C`C++23\*(C'\fR .PP returns a string with a flag that can be used to tell the compiler to support that version of the \*(C+ standard or dies if version is not supported. .PP Added in version v0.22. .SH "AUTHOR" .IX Header "AUTHOR" Mattia Barbon .PP Steffen Mueller .PP Tobias Leich .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" Copyright 2010, 2011 by Mattia Barbon. .PP This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.