.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40) .\" .\" 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 "Config::AutoConf 3pm" .TH Config::AutoConf 3pm "2021-08-23" "perl v5.32.1" "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" Config::AutoConf \- A module to implement some of AutoConf macros in pure perl. .SH "ABSTRACT" .IX Header "ABSTRACT" With this module I pretend to simulate some of the tasks AutoConf macros do. To detect a command, to detect a library, etc. .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use Config::AutoConf; \& \& Config::AutoConf\->check_prog("agrep"); \& my $grep = Config::AutoConf\->check_progs("agrep", "egrep", "grep"); \& \& Config::AutoConf\->check_header("ncurses.h"); \& my $curses = Config::AutoConf\->check_headers("ncurses.h","curses.h"); \& \& Config::AutoConf\->check_prog_awk; \& Config::AutoConf\->check_prog_egrep; \& \& Config::AutoConf\->check_cc(); \& \& Config::AutoConf\->check_lib("ncurses", "tgoto"); \& \& Config::AutoConf\->check_file("/etc/passwd"); # \-f && \-r .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" Config::AutoConf is intended to provide the same opportunities to Perl developers as \s-1GNU\s0 Autoconf does for Shell developers. .PP As Perl is the second most deployed language (mind: every Unix comes with Perl, several mini-computers have Perl and even lot's of Windows machines run Perl software \- which requires deployed Perl there, too), this gives wider support than Shell based probes. .PP The \s-1API\s0 is leaned against \s-1GNU\s0 Autoconf, but we try to make the \s-1API\s0 (especially optional arguments) more Perl'ish than m4 abilities allow to the original. .SH "CONSTRUCTOR" .IX Header "CONSTRUCTOR" .SS "new" .IX Subsection "new" This function instantiates a new instance of Config::AutoConf, e.g. to configure child components. The constructor adds also values set via environment variable \f(CW\*(C`PERL5_AUTOCONF_OPTS\*(C'\fR. .SH "METHODS" .IX Header "METHODS" .SS "check_file" .IX Subsection "check_file" This function checks if a file exists in the system and is readable by the user. Returns a boolean. You can use '\-f \f(CW$file\fR && \-r \f(CW$file\fR' so you don't need to use a function call. .SS "check_files" .IX Subsection "check_files" This function checks if a set of files exist in the system and are readable by the user. Returns a boolean. .ie n .SS "check_prog( $prog, \e@dirlist?, \e%options? )" .el .SS "check_prog( \f(CW$prog\fP, \e@dirlist?, \e%options? )" .IX Subsection "check_prog( $prog, @dirlist?, %options? )" This function checks for a program with the supplied name. In success returns the full path for the executable; .PP An optional array reference containing a list of directories to be searched instead of \f(CW$PATH\fR is gracefully honored. .PP If the very last parameter contains a hash reference, \f(CW\*(C`CODE\*(C'\fR references to \fIaction_on_true\fR or \fIaction_on_false\fR are executed, respectively. .SS "check_progs(progs, [dirlist])" .IX Subsection "check_progs(progs, [dirlist])" This function takes a list of program names. Returns the full path for the first found on the system. Returns undef if none was found. .PP An optional array reference containing a list of directories to be searched instead of \f(CW$PATH\fR is gracefully honored. .PP If the very last parameter contains a hash reference, \f(CW\*(C`CODE\*(C'\fR references to \fIaction_on_true\fR or \fIaction_on_false\fR are executed, respectively. The name of the \fI\f(CI$prog\fI\fR to check and the found full path are passed as first and second argument to the \fIaction_on_true\fR callback. .SS "check_prog_yacc" .IX Subsection "check_prog_yacc" From the \s-1GNU\s0 Autoconf documentation, .PP .Vb 4 \& If \`bison\*(Aq is found, set [...] \`bison \-y\*(Aq. \& Otherwise, if \`byacc\*(Aq is found, set [...] \`byacc\*(Aq. \& Otherwise set [...] \`yacc\*(Aq. The result of this test can be influenced \& by setting the variable YACC or the cache variable ac_cv_prog_YACC. .Ve .PP Returns the full path, if found. .SS "check_prog_awk" .IX Subsection "check_prog_awk" From the \s-1GNU\s0 Autoconf documentation, .PP .Vb 5 \& Check for \`gawk\*(Aq, \`mawk\*(Aq, \`nawk\*(Aq, and \`awk\*(Aq, in that order, and \& set output [...] to the first one that is found. It tries \& \`gawk\*(Aq first because that is reported to be the best implementation. \& The result can be overridden by setting the variable AWK or the \& cache variable ac_cv_prog_AWK. .Ve .PP Note that it returns the full path, if found. .SS "check_prog_egrep" .IX Subsection "check_prog_egrep" From the \s-1GNU\s0 Autoconf documentation, .PP .Vb 4 \& Check for \`grep \-E\*(Aq and \`egrep\*(Aq, in that order, and [...] output \& [...] the first one that is found. The result can be overridden by \& setting the EGREP variable and is cached in the ac_cv_path_EGREP \& variable. .Ve .PP Note that it returns the full path, if found. .SS "check_prog_lex" .IX Subsection "check_prog_lex" From the \s-1GNU\s0 Autoconf documentation, .PP .Vb 6 \& If flex is found, set output [...] to ‘flex’ and [...] to \-lfl, if that \& library is in a standard place. Otherwise set output [...] to ‘lex’ and \& [...] to \-ll, if found. If [...] packages [...] ship the generated \& file.yy.c alongside the source file.l, this [...] allows users without a \& lexer generator to still build the package even if the timestamp for \& file.l is inadvertently changed. .Ve .PP Note that it returns the full path, if found. .PP The structure \f(CW$self\fR\->{lex} is set with attributes .PP .Vb 3 \& prog => $LEX \& lib => $LEXLIB \& root => $lex_root .Ve .SS "check_prog_sed" .IX Subsection "check_prog_sed" From the \s-1GNU\s0 Autoconf documentation, .PP .Vb 4 \& Set output variable [...] to a Sed implementation that conforms to Posix \& and does not have arbitrary length limits. Report an error if no \& acceptable Sed is found. See Limitations of Usual Tools, for more \& information about portability problems with Sed. \& \& The result of this test can be overridden by setting the SED variable and \& is cached in the ac_cv_path_SED variable. .Ve .PP Note that it returns the full path, if found. .SS "check_prog_pkg_config" .IX Subsection "check_prog_pkg_config" Checks for \f(CW\*(C`pkg\-config\*(C'\fR program. No additional tests are made for it ... .SS "check_prog_cc" .IX Subsection "check_prog_cc" Determine a C compiler to use. Currently the probe is delegated to ExtUtils::CBuilder. .SS "check_cc" .IX Subsection "check_cc" (Deprecated) Old name of \*(L"check_prog_cc\*(R". .SS "check_valid_compiler" .IX Subsection "check_valid_compiler" This function checks for a valid compiler for the currently active language. At the very moment only \f(CW\*(C`C\*(C'\fR is understood (corresponding to your compiler default options, e.g. \-std=gnu89). .SS "check_valid_compilers(;\e@)" .IX Subsection "check_valid_compilers(;@)" Checks for valid compilers for each given language. When unspecified defaults to \f(CW\*(C`[ "C" ]\*(C'\fR. .SS "msg_checking" .IX Subsection "msg_checking" Prints \*(L"Checking \f(CW@_\fR ...\*(R" .SS "msg_result" .IX Subsection "msg_result" Prints result \en .SS "msg_notice" .IX Subsection "msg_notice" Prints \*(L"configure: \*(R" \f(CW@_\fR to stdout .SS "msg_warn" .IX Subsection "msg_warn" Prints \*(L"configure: \*(R" \f(CW@_\fR to stderr .SS "msg_error" .IX Subsection "msg_error" Prints \*(L"configure: \*(R" \f(CW@_\fR to stderr and exits with exit code 0 (tells toolchain to stop here and report unsupported environment) .SS "msg_failure" .IX Subsection "msg_failure" Prints \*(L"configure: \*(R" \f(CW@_\fR to stderr and exits with exit code 0 (tells toolchain to stop here and report unsupported environment). Additional details are provides in config.log (probably more information in a later stage). .ie n .SS "define_var( $name, $value [, $comment ] )" .el .SS "define_var( \f(CW$name\fP, \f(CW$value\fP [, \f(CW$comment\fP ] )" .IX Subsection "define_var( $name, $value [, $comment ] )" Defines a check variable for later use in further checks or code to compile. Returns the value assigned value .SS "write_config_h( [$target] )" .IX Subsection "write_config_h( [$target] )" Writes the defined constants into given target: .PP .Vb 1 \& Config::AutoConf\->write_config_h( "config.h" ); .Ve .SS "push_lang(lang [, implementor ])" .IX Subsection "push_lang(lang [, implementor ])" Puts the current used language on the stack and uses specified language for subsequent operations until ending pop_lang call. .SS "pop_lang([ lang ])" .IX Subsection "pop_lang([ lang ])" Pops the currently used language from the stack and restores previously used language. If \fIlang\fR specified, it's asserted that the current used language equals to specified language (helps finding control flow bugs). .SS "lang_build_program( prologue, body )" .IX Subsection "lang_build_program( prologue, body )" Builds program for current chosen language. If no prologue is given (\fIundef\fR), the default headers are used. If body is missing, default body is used. .PP Typical call of .PP .Vb 2 \& Config::AutoConf\->lang_build_program( "const char hw[] = \e"Hello, World\e\en\e";", \& "fputs (hw, stdout);" ) .Ve .PP will create .PP .Vb 1 \& const char hw[] = "Hello, World\en"; \& \& /* Override any gcc2 internal prototype to avoid an error. */ \& #ifdef _\|_cplusplus \& extern "C" { \& #endif \& \& int \& main (int argc, char **argv) \& { \& (void)argc; \& (void)argv; \& fputs (hw, stdout);; \& return 0; \& } \& \& #ifdef _\|_cplusplus \& } \& #endif .Ve .SS "lang_call( [prologue], function )" .IX Subsection "lang_call( [prologue], function )" Builds program which simply calls given function. When given, prologue is prepended otherwise, the default includes are used. .SS "lang_builtin( [prologue], builtin )" .IX Subsection "lang_builtin( [prologue], builtin )" Builds program which simply proves whether a builtin is known to language compiler. .SS "lang_build_bool_test (prologue, test, [@decls])" .IX Subsection "lang_build_bool_test (prologue, test, [@decls])" Builds a static test which will fail to compile when test evaluates to false. If \f(CW@decls\fR is given, it's prepended before the test code at the variable definition place. .SS "push_includes" .IX Subsection "push_includes" Adds given list of directories to preprocessor/compiler invocation. This is not proved to allow adding directories which might be created during the build. .SS "push_preprocess_flags" .IX Subsection "push_preprocess_flags" Adds given flags to the parameter list for preprocessor invocation. .SS "push_compiler_flags" .IX Subsection "push_compiler_flags" Adds given flags to the parameter list for compiler invocation. .SS "push_libraries" .IX Subsection "push_libraries" Adds given list of libraries to the parameter list for linker invocation. .SS "push_library_paths" .IX Subsection "push_library_paths" Adds given list of library paths to the parameter list for linker invocation. .SS "push_link_flags" .IX Subsection "push_link_flags" Adds given flags to the parameter list for linker invocation. .ie n .SS "compile_if_else( $src, \e%options? )" .el .SS "compile_if_else( \f(CW$src\fP, \e%options? )" .IX Subsection "compile_if_else( $src, %options? )" This function tries to compile specified code and returns a boolean value containing check success state. .PP If the very last parameter contains a hash reference, \f(CW\*(C`CODE\*(C'\fR references to \fIaction_on_true\fR or \fIaction_on_false\fR are executed, respectively. .ie n .SS "link_if_else( $src, \e%options? )" .el .SS "link_if_else( \f(CW$src\fP, \e%options? )" .IX Subsection "link_if_else( $src, %options? )" This function tries to compile and link specified code and returns a boolean value containing check success state. .PP If the very last parameter contains a hash reference, \f(CW\*(C`CODE\*(C'\fR references to \fIaction_on_true\fR or \fIaction_on_false\fR are executed, respectively. .ie n .SS "check_cached( $cache\-key, $check\-title, \e&check\-call, \e%options? )" .el .SS "check_cached( \f(CW$cache\fP\-key, \f(CW$check\fP\-title, \e&check\-call, \e%options? )" .IX Subsection "check_cached( $cache-key, $check-title, &check-call, %options? )" Retrieves the result of a previous \*(L"check_cached\*(R" invocation from \&\f(CW\*(C`cache\-key\*(C'\fR, or (when called for the first time) populates the cache by invoking \f(CW\*(C`\e&check_call\*(C'\fR. .PP If the very last parameter contains a hash reference, \f(CW\*(C`CODE\*(C'\fR references to \fIaction_on_true\fR or \fIaction_on_false\fR are executed on \fBevery\fR call to check_cached (not just the first cache-populating invocation), respectively. .SS "cache_val" .IX Subsection "cache_val" This function returns the value of a previously check_cached call. .ie n .SS "check_decl( $symbol, \e%options? )" .el .SS "check_decl( \f(CW$symbol\fP, \e%options? )" .IX Subsection "check_decl( $symbol, %options? )" This method actually tests whether symbol is defined as a macro or can be used as an r\-value, not whether it is really declared, because it is much safer to avoid introducing extra declarations when they are not needed. In order to facilitate use of \*(C+ and overloaded function declarations, it is possible to specify function argument types in parentheses for types which can be zero-initialized: .PP .Vb 1 \& Config::AutoConf\->check_decl("basename(char *)") .Ve .PP This method caches its result in the \f(CW\*(C`ac_cv_decl_\*(C'\fR_symbol variable. .PP If the very last parameter contains a hash reference, \f(CW\*(C`CODE\*(C'\fR references to \fIaction_on_true\fR or \fIaction_on_false\fR are executed, respectively. When a \fIprologue\fR exists in the optional hash at end, it will be favored over \f(CW\*(C`default includes\*(C'\fR (represented by \*(L"_default_includes\*(R"). If any of \&\fIaction_on_cache_true\fR, \fIaction_on_cache_false\fR is defined, both callbacks are passed to \*(L"check_cached\*(R" as \fIaction_on_true\fR or \fIaction_on_false\fR to \&\f(CW\*(C`check_cached\*(C'\fR, respectively. .SS "check_decls( symbols, \e%options? )" .IX Subsection "check_decls( symbols, %options? )" For each of the symbols (with optional function argument types for \*(C+ overloads), run check_decl. .PP Contrary to \fB\s-1GNU\s0 Autoconf\fR, this method does not declare \f(CW\*(C`HAVE_DECL_symbol\*(C'\fR macros for the resulting \f(CW\*(C`confdefs.h\*(C'\fR, because it differs as \f(CW\*(C`check_decl\*(C'\fR between compiling languages. .PP If the very last parameter contains a hash reference, \f(CW\*(C`CODE\*(C'\fR references to \fIaction_on_true\fR or \fIaction_on_false\fR are executed, respectively. When a \fIprologue\fR exists in the optional hash at end, it will be favored over \f(CW\*(C`default includes\*(C'\fR (represented by \*(L"_default_includes\*(R"). If any of \&\fIaction_on_cache_true\fR, \fIaction_on_cache_false\fR is defined, both callbacks are passed to \*(L"check_cached\*(R" as \fIaction_on_true\fR or \fIaction_on_false\fR to \&\f(CW\*(C`check_cached\*(C'\fR, respectively. Given callbacks for \fIaction_on_symbol_true\fR or \fIaction_on_symbol_false\fR are called for each symbol checked using \*(L"check_decl\*(R" receiving the symbol as first argument. .ie n .SS "check_func( $function, \e%options? )" .el .SS "check_func( \f(CW$function\fP, \e%options? )" .IX Subsection "check_func( $function, %options? )" This method actually tests whether \fI\f(CI$funcion\fI\fR can be linked into a program trying to call \fI\f(CI$function\fI\fR. This method caches its result in the ac_cv_func_FUNCTION variable. .PP If the very last parameter contains a hash reference, \f(CW\*(C`CODE\*(C'\fR references to \fIaction_on_true\fR or \fIaction_on_false\fR are executed, respectively. If any of \fIaction_on_cache_true\fR, \fIaction_on_cache_false\fR is defined, both callbacks are passed to \*(L"check_cached\*(R" as \fIaction_on_true\fR or \&\fIaction_on_false\fR to \f(CW\*(C`check_cached\*(C'\fR, respectively. .PP Returns: True if the function was found, false otherwise .ie n .SS "check_funcs( \e@functions\-list, $action\-if\-true?, $action\-if\-false? )" .el .SS "check_funcs( \e@functions\-list, \f(CW$action\fP\-if\-true?, \f(CW$action\fP\-if\-false? )" .IX Subsection "check_funcs( @functions-list, $action-if-true?, $action-if-false? )" The same as check_func, but takes a list of functions in \fI\e@functions\-list\fR to look for and checks for each in turn. Define \s-1HAVE_FUNCTION\s0 for each function that was found. .PP If the very last parameter contains a hash reference, \f(CW\*(C`CODE\*(C'\fR references to \fIaction_on_true\fR or \fIaction_on_false\fR are executed, respectively. If any of \fIaction_on_cache_true\fR, \fIaction_on_cache_false\fR is defined, both callbacks are passed to \*(L"check_cached\*(R" as \fIaction_on_true\fR or \&\fIaction_on_false\fR to \f(CW\*(C`check_cached\*(C'\fR, respectively. Given callbacks for \fIaction_on_function_true\fR or \fIaction_on_function_false\fR are called for each symbol checked using \*(L"check_func\*(R" receiving the symbol as first argument. .ie n .SS "check_builtin( $builtin, \e%options? )" .el .SS "check_builtin( \f(CW$builtin\fP, \e%options? )" .IX Subsection "check_builtin( $builtin, %options? )" This method actually tests whether \fI\f(CI$builtin\fI\fR is a supported built-in known by the compiler. Either, by giving us the type of the built-in or by taking the value from \f(CW\*(C`_\|_has_builtin\*(C'\fR. This method caches its result in the ac_cv_builtin_FUNCTION variable. .PP If the very last parameter contains a hash reference, \f(CW\*(C`CODE\*(C'\fR references to \fIaction_on_true\fR or \fIaction_on_false\fR are executed, respectively. If any of \fIaction_on_cache_true\fR, \fIaction_on_cache_false\fR is defined, both callbacks are passed to \*(L"check_cached\*(R" as \fIaction_on_true\fR or \&\fIaction_on_false\fR to \f(CW\*(C`check_cached\*(C'\fR, respectively. .PP Returns: True if the function was found, false otherwise .ie n .SS "check_type( $symbol, \e%options? )" .el .SS "check_type( \f(CW$symbol\fP, \e%options? )" .IX Subsection "check_type( $symbol, %options? )" Check whether type is defined. It may be a compiler builtin type or defined by the includes. In C, type must be a type-name, so that the expression \&\f(CW\*(C`sizeof (type)\*(C'\fR is valid (but \f(CW\*(C`sizeof ((type))\*(C'\fR is not). .PP If \fItype\fR type is defined, preprocessor macro \s-1HAVE_\s0\fItype\fR (in all capitals, with \*(L"*\*(R" replaced by \*(L"P\*(R" and spaces and dots replaced by underscores) is defined. .PP This method caches its result in the \f(CW\*(C`ac_cv_type_\*(C'\fRtype variable. .PP If the very last parameter contains a hash reference, \f(CW\*(C`CODE\*(C'\fR references to \fIaction_on_true\fR or \fIaction_on_false\fR are executed, respectively. When a \fIprologue\fR exists in the optional hash at end, it will be favored over \f(CW\*(C`default includes\*(C'\fR (represented by \*(L"_default_includes\*(R"). If any of \&\fIaction_on_cache_true\fR, \fIaction_on_cache_false\fR is defined, both callbacks are passed to \*(L"check_cached\*(R" as \fIaction_on_true\fR or \fIaction_on_false\fR to \&\f(CW\*(C`check_cached\*(C'\fR, respectively. .SS "check_types( \e@type\-list, \e%options? )" .IX Subsection "check_types( @type-list, %options? )" For each type in \fI\f(CI@type\fI\-list\fR, call check_type is called to check for type and return the accumulated result (accumulation op is binary and). .PP If the very last parameter contains a hash reference, \f(CW\*(C`CODE\*(C'\fR references to \fIaction_on_true\fR or \fIaction_on_false\fR are executed, respectively. When a \fIprologue\fR exists in the optional hash at end, it will be favored over \f(CW\*(C`default includes\*(C'\fR (represented by \*(L"_default_includes\*(R"). If any of \&\fIaction_on_cache_true\fR, \fIaction_on_cache_false\fR is defined, both callbacks are passed to \*(L"check_cached\*(R" as \fIaction_on_true\fR or \fIaction_on_false\fR to \&\f(CW\*(C`check_cached\*(C'\fR, respectively. Given callbacks for \fIaction_on_type_true\fR or \fIaction_on_type_false\fR are called for each symbol checked using \*(L"check_type\*(R" receiving the symbol as first argument. .ie n .SS "compute_int( $expression, @decls?, \e%options )" .el .SS "compute_int( \f(CW$expression\fP, \f(CW@decls\fP?, \e%options )" .IX Subsection "compute_int( $expression, @decls?, %options )" Returns the value of the integer \fIexpression\fR. The value should fit in an initializer in a C variable of type signed long. It should be possible to evaluate the expression at compile-time. If no includes are specified, the default includes are used. .PP If the very last parameter contains a hash reference, \f(CW\*(C`CODE\*(C'\fR references to \fIaction_on_true\fR or \fIaction_on_false\fR are executed, respectively. When a \fIprologue\fR exists in the optional hash at end, it will be favored over \f(CW\*(C`default includes\*(C'\fR (represented by \*(L"_default_includes\*(R"). If any of \&\fIaction_on_cache_true\fR, \fIaction_on_cache_false\fR is defined, both callbacks are passed to \*(L"check_cached\*(R" as \fIaction_on_true\fR or \fIaction_on_false\fR to \&\f(CW\*(C`check_cached\*(C'\fR, respectively. .ie n .SS "check_sizeof_type( $type, \e%options? )" .el .SS "check_sizeof_type( \f(CW$type\fP, \e%options? )" .IX Subsection "check_sizeof_type( $type, %options? )" Checks for the size of the specified type by compiling and define \&\f(CW\*(C`SIZEOF_type\*(C'\fR using the determined size. .PP In opposition to \s-1GNU\s0 AutoConf, this method can determine size of structure members, e.g. .PP .Vb 3 \& $ac\->check_sizeof_type( "SV.sv_refcnt", { prologue => $include_perl } ); \& # or \& $ac\->check_sizeof_type( "struct utmpx.ut_id", { prologue => "#include " } ); .Ve .PP This method caches its result in the \f(CW\*(C`ac_cv_sizeof_\*(C'\fR_type variable. .PP If the very last parameter contains a hash reference, \f(CW\*(C`CODE\*(C'\fR references to \fIaction_on_true\fR or \fIaction_on_false\fR are executed, respectively. When a \fIprologue\fR exists in the optional hash at end, it will be favored over \f(CW\*(C`default includes\*(C'\fR (represented by \*(L"_default_includes\*(R"). If any of \&\fIaction_on_cache_true\fR, \fIaction_on_cache_false\fR is defined, both callbacks are passed to \*(L"check_cached\*(R" as \fIaction_on_true\fR or \fIaction_on_false\fR to \&\f(CW\*(C`check_cached\*(C'\fR, respectively. .SS "check_sizeof_types( type, \e%options? )" .IX Subsection "check_sizeof_types( type, %options? )" For each type check_sizeof_type is called to check for size of type. .PP If \fIaction-if-found\fR is given, it is additionally executed when all of the sizes of the types could determined. If \fIaction-if-not-found\fR is given, it is executed when one size of the types could not determined. .PP If the very last parameter contains a hash reference, \f(CW\*(C`CODE\*(C'\fR references to \fIaction_on_true\fR or \fIaction_on_false\fR are executed, respectively. When a \fIprologue\fR exists in the optional hash at end, it will be favored over \f(CW\*(C`default includes\*(C'\fR (represented by \*(L"_default_includes\*(R"). If any of \&\fIaction_on_cache_true\fR, \fIaction_on_cache_false\fR is defined, both callbacks are passed to \*(L"check_cached\*(R" as \fIaction_on_true\fR or \fIaction_on_false\fR to \&\f(CW\*(C`check_cached\*(C'\fR, respectively. Given callbacks for \fIaction_on_size_true\fR or \fIaction_on_size_false\fR are called for each symbol checked using \*(L"check_sizeof_type\*(R" receiving the symbol as first argument. .SS "check_alignof_type( type, \e%options? )" .IX Subsection "check_alignof_type( type, %options? )" Define ALIGNOF_type to be the alignment in bytes of type. \fItype\fR must be valid as a structure member declaration or \fItype\fR must be a structure member itself. .PP This method caches its result in the \f(CW\*(C`ac_cv_alignof_\*(C'\fR_type variable, with \fI*\fR mapped to \f(CW\*(C`p\*(C'\fR and other characters not suitable for a variable name mapped to underscores. .PP If the very last parameter contains a hash reference, \f(CW\*(C`CODE\*(C'\fR references to \fIaction_on_true\fR or \fIaction_on_false\fR are executed, respectively. When a \fIprologue\fR exists in the optional hash at end, it will be favored over \f(CW\*(C`default includes\*(C'\fR (represented by \*(L"_default_includes\*(R"). If any of \&\fIaction_on_cache_true\fR, \fIaction_on_cache_false\fR is defined, both callbacks are passed to \*(L"check_cached\*(R" as \fIaction_on_true\fR or \fIaction_on_false\fR to \&\f(CW\*(C`check_cached\*(C'\fR, respectively. .SS "check_alignof_types (type, [action\-if\-found], [action\-if\-not\-found], [prologue = default includes])" .IX Subsection "check_alignof_types (type, [action-if-found], [action-if-not-found], [prologue = default includes])" For each type check_alignof_type is called to check for align of type. .PP If \fIaction-if-found\fR is given, it is additionally executed when all of the aligns of the types could determined. If \fIaction-if-not-found\fR is given, it is executed when one align of the types could not determined. .PP If the very last parameter contains a hash reference, \f(CW\*(C`CODE\*(C'\fR references to \fIaction_on_true\fR or \fIaction_on_false\fR are executed, respectively. When a \fIprologue\fR exists in the optional hash at end, it will be favored over \f(CW\*(C`default includes\*(C'\fR (represented by \*(L"_default_includes\*(R"). If any of \&\fIaction_on_cache_true\fR, \fIaction_on_cache_false\fR is defined, both callbacks are passed to \*(L"check_cached\*(R" as \fIaction_on_true\fR or \fIaction_on_false\fR to \&\f(CW\*(C`check_cached\*(C'\fR, respectively. Given callbacks for \fIaction_on_align_true\fR or \fIaction_on_align_false\fR are called for each symbol checked using \*(L"check_alignof_type\*(R" receiving the symbol as first argument. .SS "check_member( member, \e%options? )" .IX Subsection "check_member( member, %options? )" Check whether \fImember\fR is in form of \fIaggregate\fR.\fImember\fR and \&\fImember\fR is a member of the \fIaggregate\fR aggregate. .PP which are used prior to the aggregate under test. .PP .Vb 7 \& Config::AutoConf\->check_member( \& "struct STRUCT_SV.sv_refcnt", \& { \& action_on_false => sub { Config::AutoConf\->msg_failure( "sv_refcnt member required for struct STRUCT_SV" ); }, \& prologue => "#include \en#include " \& } \& ); .Ve .PP This function will return a true value (1) if the member is found. .PP If \fIaggregate\fR aggregate has \fImember\fR member, preprocessor macro \s-1HAVE_\s0\fIaggregate\fR_\fI\s-1MEMBER\s0\fR (in all capitals, with spaces and dots replaced by underscores) is defined. .PP This macro caches its result in the \f(CW\*(C`ac_cv_\*(C'\fRaggr_member variable. .PP If the very last parameter contains a hash reference, \f(CW\*(C`CODE\*(C'\fR references to \fIaction_on_true\fR or \fIaction_on_false\fR are executed, respectively. When a \fIprologue\fR exists in the optional hash at end, it will be favored over \f(CW\*(C`default includes\*(C'\fR (represented by \*(L"_default_includes\*(R"). If any of \&\fIaction_on_cache_true\fR, \fIaction_on_cache_false\fR is defined, both callbacks are passed to \*(L"check_cached\*(R" as \fIaction_on_true\fR or \fIaction_on_false\fR to \&\f(CW\*(C`check_cached\*(C'\fR, respectively. .SS "check_members( members, \e%options? )" .IX Subsection "check_members( members, %options? )" For each member check_member is called to check for member of aggregate. .PP This function will return a true value (1) if at least one member is found. .PP If the very last parameter contains a hash reference, \f(CW\*(C`CODE\*(C'\fR references to \fIaction_on_true\fR or \fIaction_on_false\fR are executed, respectively. When a \fIprologue\fR exists in the optional hash at end, it will be favored over \f(CW\*(C`default includes\*(C'\fR (represented by \*(L"_default_includes\*(R"). If any of \&\fIaction_on_cache_true\fR, \fIaction_on_cache_false\fR is defined, both callbacks are passed to \*(L"check_cached\*(R" as \fIaction_on_true\fR or \fIaction_on_false\fR to \&\f(CW\*(C`check_cached\*(C'\fR, respectively. Given callbacks for \fIaction_on_member_true\fR or \fIaction_on_member_false\fR are called for each symbol checked using \*(L"check_member\*(R" receiving the symbol as first argument. .ie n .SS "check_header( $header, \e%options? )" .el .SS "check_header( \f(CW$header\fP, \e%options? )" .IX Subsection "check_header( $header, %options? )" This function is used to check if a specific header file is present in the system: if we detect it and if we can compile anything with that header included. Note that normally you want to check for a header first, and then check for the corresponding library (not all at once). .PP The standard usage for this module is: .PP .Vb 1 \& Config::AutoConf\->check_header("ncurses.h"); .Ve .PP This function will return a true value (1) on success, and a false value if the header is not present or not available for common usage. .PP If the very last parameter contains a hash reference, \f(CW\*(C`CODE\*(C'\fR references to \fIaction_on_true\fR or \fIaction_on_false\fR are executed, respectively. When a \fIprologue\fR exists in the optional hash at end, it will be prepended to the tested header. If any of \fIaction_on_cache_true\fR, \&\fIaction_on_cache_false\fR is defined, both callbacks are passed to \&\*(L"check_cached\*(R" as \fIaction_on_true\fR or \fIaction_on_false\fR to \&\f(CW\*(C`check_cached\*(C'\fR, respectively. .SS "check_headers" .IX Subsection "check_headers" This function uses check_header to check if a set of include files exist in the system and can be included and compiled by the available compiler. Returns the name of the first header file found. .PP Passes an optional \e%options hash to each \*(L"check_header\*(R" call. .SS "check_all_headers" .IX Subsection "check_all_headers" This function checks each given header for usability and returns true when each header can be used \*(-- otherwise false. .PP If the very last parameter contains a hash reference, \f(CW\*(C`CODE\*(C'\fR references to \fIaction_on_true\fR or \fIaction_on_false\fR are executed, respectively. Each of existing key/value pairs using \fIprologue\fR, \fIaction_on_cache_true\fR or \fIaction_on_cache_false\fR as key are passed-through to each call of \&\*(L"check_header\*(R". Given callbacks for \fIaction_on_header_true\fR or \fIaction_on_header_false\fR are called for each symbol checked using \*(L"check_header\*(R" receiving the symbol as first argument. .SS "check_stdc_headers" .IX Subsection "check_stdc_headers" Checks for standard C89 headers, namely stdlib.h, stdarg.h, string.h and float.h. If those are found, additional all remaining C89 headers are checked: assert.h, ctype.h, errno.h, limits.h, locale.h, math.h, setjmp.h, signal.h, stddef.h, stdio.h and time.h. .PP Returns a false value if it fails. .PP Passes an optional \e%options hash to each \*(L"check_all_headers\*(R" call. .SS "check_default_headers" .IX Subsection "check_default_headers" This function checks for some default headers, the std c89 headers and sys/types.h, sys/stat.h, memory.h, strings.h, inttypes.h, stdint.h and unistd.h .PP Passes an optional \e%options hash to each \*(L"check_all_headers\*(R" call. .SS "check_dirent_header" .IX Subsection "check_dirent_header" Check for the following header files. For the first one that is found and defines '\s-1DIR\s0', define the listed C preprocessor macro: .PP .Vb 4 \& dirent.h HAVE_DIRENT_H \& sys/ndir.h HAVE_SYS_NDIR_H \& sys/dir.h HAVE_SYS_DIR_H \& ndir.h HAVE_NDIR_H .Ve .PP The directory-library declarations in your source code should look something like the following: .PP .Vb 10 \& #include \& #ifdef HAVE_DIRENT_H \& # include \& # define NAMLEN(dirent) strlen ((dirent)\->d_name) \& #else \& # define dirent direct \& # define NAMLEN(dirent) ((dirent)\->d_namlen) \& # ifdef HAVE_SYS_NDIR_H \& # include \& # endif \& # ifdef HAVE_SYS_DIR_H \& # include \& # endif \& # ifdef HAVE_NDIR_H \& # include \& # endif \& #endif .Ve .PP Using the above declarations, the program would declare variables to be of type \f(CW\*(C`struct dirent\*(C'\fR, not \f(CW\*(C`struct direct\*(C'\fR, and would access the length of a directory entry name by passing a pointer to a \f(CW\*(C`struct dirent\*(C'\fR to the \f(CW\*(C`NAMLEN\*(C'\fR macro. .PP For the found header, the macro HAVE_DIRENT_IN_${header} is defined. .PP This method might be obsolescent, as all current systems with directory libraries have \f(CW\*(C`\*(C'\fR. Programs supporting only newer \s-1OS\s0 might not need to use this method. .PP If the very last parameter contains a hash reference, \f(CW\*(C`CODE\*(C'\fR references to \fIaction_on_true\fR or \fIaction_on_false\fR are executed, respectively. Each of existing key/value pairs using \fIprologue\fR, \fIaction_on_header_true\fR (as \fIaction_on_true\fR having the name of the tested header as first argument) or \fIaction_on_header_false\fR (as \fIaction_on_false\fR having the name of the tested header as first argument) as key are passed-through to each call of \&\*(L"_check_header\*(R". Given callbacks for \fIaction_on_cache_true\fR or \fIaction_on_cache_false\fR are passed to the call of \*(L"check_cached\*(R". .SS "_check_perlapi_program" .IX Subsection "_check_perlapi_program" This method provides the program source which is suitable to do basic compile/link tests to prove perl development environment. .SS "_check_compile_perlapi" .IX Subsection "_check_compile_perlapi" This method can be used from other checks to prove whether we have a perl development environment or not (perl.h, reasonable basic checks \- types, etc.) .SS "check_compile_perlapi" .IX Subsection "check_compile_perlapi" This method can be used from other checks to prove whether we have a perl development environment or not (perl.h, reasonable basic checks \- types, etc.) .SS "check_compile_perlapi_or_die" .IX Subsection "check_compile_perlapi_or_die" Dies when not being able to compile using the Perl \s-1API\s0 .SS "check_linkable_xs_so" .IX Subsection "check_linkable_xs_so" Checks whether a dynamic loadable object containing an \s-1XS\s0 module can be linked or not. Due the nature of the beast, this test currently always succeed. .SS "check_linkable_xs_so_or_die" .IX Subsection "check_linkable_xs_so_or_die" Dies when \*(L"check_linkable_xs_so\*(R" fails. .SS "check_loadable_xs_so" .IX Subsection "check_loadable_xs_so" Checks whether a dynamic loadable object containing an \s-1XS\s0 module can be loaded or not. Due the nature of the beast, this test currently always succeed. .SS "check_loadable_xs_so_or_die" .IX Subsection "check_loadable_xs_so_or_die" Dies when \*(L"check_loadable_xs_so\*(R" fails. .SS "_check_link_perlapi" .IX Subsection "_check_link_perlapi" This method can be used from other checks to prove whether we have a perl development environment including a suitable libperl or not (perl.h, reasonable basic checks \- types, etc.) .PP Caller must ensure that the linker flags are set appropriate (\f(CW\*(C`\-lperl\*(C'\fR or similar). .SS "check_link_perlapi" .IX Subsection "check_link_perlapi" This method can be used from other checks to prove whether we have a perl development environment or not (perl.h, libperl.la, reasonable basic checks \- types, etc.) .ie n .SS "check_lib( lib, func, @other\-libs?, \e%options? )" .el .SS "check_lib( lib, func, \f(CW@other\fP\-libs?, \e%options? )" .IX Subsection "check_lib( lib, func, @other-libs?, %options? )" This function is used to check if a specific library includes some function. Call it with the library name (without the lib portion), and the name of the function you want to test: .PP .Vb 1 \& Config::AutoConf\->check_lib("z", "gzopen"); .Ve .PP It returns 1 if the function exist, 0 otherwise. .PP In case of function found, the HAVE_LIBlibrary (all in capitals) preprocessor macro is defined with 1 and \f(CW$lib\fR together with \f(CW@other_libs\fR are added to the list of libraries to link with. .PP If linking with library results in unresolved symbols that would be resolved by linking with additional libraries, give those libraries as the \fIother-libs\fR argument: e.g., \f(CW\*(C`[qw(Xt X11)]\*(C'\fR. Otherwise, this routine may fail to detect that library is present, because linking the test program can fail with unresolved symbols. The other-libraries argument should be limited to cases where it is desirable to test for one library in the presence of another that is not already in \s-1LIBS.\s0 .PP This method caches its result in the \f(CW\*(C`ac_cv_lib_\*(C'\fRlib_func variable. .PP If the very last parameter contains a hash reference, \f(CW\*(C`CODE\*(C'\fR references to \fIaction_on_true\fR or \fIaction_on_false\fR are executed, respectively. If any of \fIaction_on_cache_true\fR, \fIaction_on_cache_false\fR is defined, both callbacks are passed to \*(L"check_cached\*(R" as \fIaction_on_true\fR or \&\fIaction_on_false\fR to \f(CW\*(C`check_cached\*(C'\fR, respectively. .PP It's recommended to use search_libs instead of check_lib these days. .ie n .SS "search_libs( function, search-libs, @other\-libs?, @extra_link_flags?, \e%options? )" .el .SS "search_libs( function, search-libs, \f(CW@other\fP\-libs?, \f(CW@extra_link_flags\fP?, \e%options? )" .IX Subsection "search_libs( function, search-libs, @other-libs?, @extra_link_flags?, %options? )" .Vb 7 \& Config::AutoConf\->search_libs("gethostent", "nsl", [qw(socket net)], { \& action_on_true => sub { ... } \& }); \& Config::AutoConf\->search_libs("log4cplus_initialize", ["log4cplus"], \& [[qw(stdc++)], [qw(stdc++ unwind)]], \& [qw(\-pthread \-thread)] \& ); .Ve .PP Search for a library defining function if it's not already available. This equates to calling .PP .Vb 2 \& Config::AutoConf\->link_if_else( \& Config::AutoConf\->lang_call( "", "$function" ) ); .Ve .PP first with no libraries, then for each library listed in search-libs. \&\fIsearch-libs\fR must be specified as an array reference to avoid confusion in argument order. .PP Prepend \-llibrary to \s-1LIBS\s0 for the first library found to contain function. .PP If linking with library results in unresolved symbols that would be resolved by linking with additional libraries, give those libraries as the \fIother-libraries\fR argument: e.g., \f(CW\*(C`[qw(Xt X11)]\*(C'\fR or \f(CW\*(C`[qw(intl), qw(intl iconv)]\*(C'\fR. Otherwise, this method fails to detect that function is present, because linking the test program always fails with unresolved symbols. .PP The result of this test is cached in the ac_cv_search_function variable as \*(L"none required\*(R" if function is already available, as \f(CW0\fR if no library containing function was found, otherwise as the \-llibrary option that needs to be prepended to \s-1LIBS.\s0 .PP If the very last parameter contains a hash reference, \f(CW\*(C`CODE\*(C'\fR references to \fIaction_on_true\fR or \fIaction_on_false\fR are executed, respectively. If any of \fIaction_on_cache_true\fR, \fIaction_on_cache_false\fR is defined, both callbacks are passed to \*(L"check_cached\*(R" as \fIaction_on_true\fR or \&\fIaction_on_false\fR to \f(CW\*(C`check_cached\*(C'\fR, respectively. Given callbacks for \fIaction_on_lib_true\fR or \fIaction_on_lib_false\fR are called for each library checked using \*(L"link_if_else\*(R" receiving the library as first argument and all \f(CW@other_libs\fR subsequently. .SS "check_lm( \e%options? )" .IX Subsection "check_lm( %options? )" This method is used to check if some common \f(CW\*(C`math.h\*(C'\fR functions are available, and if \f(CW\*(C`\-lm\*(C'\fR is needed. Returns the empty string if no library is needed, or the \*(L"\-lm\*(R" string if libm is needed. .PP If the very last parameter contains a hash reference, \f(CW\*(C`CODE\*(C'\fR references to \fIaction_on_true\fR or \fIaction_on_false\fR are executed, respectively. Each of existing key/value pairs using \fIaction_on_func_true\fR (as \&\fIaction_on_true\fR having the name of the tested functions as first argument), \&\fIaction_on_func_false\fR (as \fIaction_on_false\fR having the name of the tested functions as first argument), \fIaction_on_func_lib_true\fR (as \&\fIaction_on_lib_true\fR having the name of the tested functions as first argument), \fIaction_on_func_lib_false\fR (as \fIaction_on_lib_false\fR having the name of the tested functions as first argument) as key are passed\- through to each call of \*(L"search_libs\*(R". Given callbacks for \fIaction_on_lib_true\fR, \fIaction_on_lib_false\fR, \&\fIaction_on_cache_true\fR or \fIaction_on_cache_false\fR are passed to the call of \*(L"search_libs\*(R". .PP \&\fBNote\fR that \fIaction_on_lib_true\fR and \fIaction_on_func_lib_true\fR or \&\fIaction_on_lib_false\fR and \fIaction_on_func_lib_false\fR cannot be used at the same time, respectively. .SS "pkg_config_package_flags($package, \e%options?)" .IX Subsection "pkg_config_package_flags($package, %options?)" .Vb 1 \& use Config::AutoConf \& \& my $c = Config::AutoConf\->new; \& $c\->pkg_config_package_flags(\*(Aqlog4cplus\*(Aq); \& WriteMakefile( \& ... \& INC => $c\->_get_extra_compiler_flags, \& LIBS => $c\->_get_extra_linker_flags, \& ); .Ve .PP Search for \f(CW\*(C`pkg\-config\*(C'\fR flags for package as specified. The flags which are extracted are \f(CW\*(C`\-\-cflags\*(C'\fR and \f(CW\*(C`\-\-libs\*(C'\fR. The extracted flags are appended to the global \f(CW\*(C`extra_preprocess_flags\*(C'\fR, \f(CW\*(C`extra_link_flags\*(C'\fR or \f(CW\*(C`extra_libs\*(C'\fR, respectively. Distinguishing between \f(CW\*(C`extra_link_flags\*(C'\fR and \f(CW\*(C`extra_libs\*(C'\fR is essential to avoid conflicts with search_libs function and family. In case, no \fIpackage configuration\fR matching given criteria could be found, return a \f(CW\*(C`false\*(C'\fR value (\f(CW0\fR). .PP The \f(CW\*(C`pkg\-config\*(C'\fR flags are taken from \fIenvironment variables\fR \&\f(CW\*(C`${package}_CFLAGS\*(C'\fR or \f(CW\*(C`${package}_LIBS\*(C'\fR when defined, respectively. It will be a nice touch to document the particular environment variables for your build procedure \- as for above example it should be .PP .Vb 3 \& $ env log4cplus_CFLAGS="\-I/opt/coolapp/include" \e \& log4cplus_LIBS="\-L/opt/coolapp/lib \-Wl,\-R/opt/coolapp/lib \-llog4cplus" \e \& perl Makefile.PL .Ve .PP Call \f(CW\*(C`pkg_config_package_flags\*(C'\fR with the package you're looking for and optional callback whether found or not. .PP To support stage compiling properly (\f(CW\*(C`rpath\*(C'\fR vs. library file location), the internal representation is a moving target. Do not use the result directly \- the getters _get_extra_compiler_flags and _get_extra_linker_flags are strongly encouraged. In case this is not possible, please open a ticket to get informed on invasive changes. .PP If the very last parameter contains a hash reference, \f(CW\*(C`CODE\*(C'\fR references to \fIaction_on_true\fR or \fIaction_on_false\fR are executed, respectively. If any of \fIaction_on_cache_true\fR, \fIaction_on_cache_false\fR is defined, both callbacks are passed to \*(L"check_cached\*(R" as \fIaction_on_true\fR or \&\fIaction_on_false\fR to \*(L"check_cached\*(R", respectively. .SS "_check_mm_pureperl_build_wanted" .IX Subsection "_check_mm_pureperl_build_wanted" This method proves the \f(CW\*(C`_argv\*(C'\fR attribute and (when set) the \f(CW\*(C`PERL_MM_OPT\*(C'\fR whether they contain \fIPUREPERL_ONLY=(0|1)\fR or not. The attribute \f(CW\*(C`_force_xs\*(C'\fR is set as appropriate, which allows a compile test to bail out when \f(CW\*(C`Makefile.PL\*(C'\fR is called with \fIPUREPERL_ONLY=0\fR. .SS "_check_mb_pureperl_build_wanted" .IX Subsection "_check_mb_pureperl_build_wanted" This method proves the \f(CW\*(C`_argv\*(C'\fR attribute and (when set) the \f(CW\*(C`PERL_MB_OPT\*(C'\fR whether they contain \fI\-\-pureperl\-only\fR or not. .SS "_check_pureperl_required" .IX Subsection "_check_pureperl_required" This method calls \f(CW\*(C`_check_mm_pureperl_build_wanted\*(C'\fR when running under ExtUtils::MakeMaker (\f(CW\*(C`Makefile.PL\*(C'\fR) or \f(CW\*(C`_check_mb_pureperl_build_wanted\*(C'\fR when running under a \f(CW\*(C`Build.PL\*(C'\fR (Module::Build compatible) environment. .PP When neither is found (\f(CW$0\fR contains neither \f(CW\*(C`Makefile.PL\*(C'\fR nor \f(CW\*(C`Build.PL\*(C'\fR), simply 0 is returned. .SS "check_pureperl_required" .IX Subsection "check_pureperl_required" This check method proves whether a pure perl build is wanted or not by cached-checking \f(CW\*(C`$self\->_check_pureperl_required\*(C'\fR. .SS "check_produce_xs_build" .IX Subsection "check_produce_xs_build" This routine checks whether \s-1XS\s0 can be produced. Therefore it does following checks in given order: .IP "\(bu" 4 check pure perl environment variables (\*(L"check_pureperl_required\*(R") or command line arguments and return false when pure perl is requested .IP "\(bu" 4 check whether a compiler is available (\*(L"check_valid_compilers\*(R") and return false if none found .IP "\(bu" 4 check whether a test program accessing Perl \s-1API\s0 can be compiled and die with error if not .PP When all checks passed successfully, return a true value. .PP If the very last parameter contains a hash reference, \f(CW\*(C`CODE\*(C'\fR references to \fIaction_on_true\fR or \fIaction_on_false\fR are executed, respectively. .SS "check_produce_loadable_xs_build" .IX Subsection "check_produce_loadable_xs_build" This routine proves whether \s-1XS\s0 should be built and it's possible to create a dynamic linked object which can be loaded using Perl's Dynaloader. .PP The extension over \*(L"check_produce_xs_build\*(R" can be avoided by adding the \&\f(CW\*(C`notest_loadable_xs\*(C'\fR to \f(CW$ENV{PERL5_AC_OPTS}\fR. .PP If the very last parameter contains a hash reference, \f(CW\*(C`CODE\*(C'\fR references to \fIaction_on_true\fR or \fIaction_on_false\fR are executed, respectively. .SS "_set_argv" .IX Subsection "_set_argv" Intended to act as a helper for evaluating given command line arguments. Stores given arguments in instances \f(CW\*(C`_argv\*(C'\fR attribute. .PP Call once at very begin of \f(CW\*(C`Makefile.PL\*(C'\fR or \f(CW\*(C`Build.PL\*(C'\fR: .PP .Vb 1 \& Your::Pkg::Config::AutoConf\->_set_args(@ARGV); .Ve .SS "_default_includes" .IX Subsection "_default_includes" returns a string containing default includes for program prologue taken from \f(CW\*(C`autoconf/headers.m4\*(C'\fR: .PP .Vb 10 \& #include \& #ifdef HAVE_SYS_TYPES_H \& # include \& #endif \& #ifdef HAVE_SYS_STAT_H \& # include \& #endif \& #ifdef STDC_HEADERS \& # include \& # include \& #else \& # ifdef HAVE_STDLIB_H \& # include \& # endif \& #endif \& #ifdef HAVE_STRING_H \& # if !defined STDC_HEADERS && defined HAVE_MEMORY_H \& # include \& # endif \& # include \& #endif \& #ifdef HAVE_STRINGS_H \& # include \& #endif \& #ifdef HAVE_INTTYPES_H \& # include \& #endif \& #ifdef HAVE_STDINT_H \& # include \& #endif \& #ifdef HAVE_UNISTD_H \& # include \& #endif .Ve .SS "_default_includes_with_perl" .IX Subsection "_default_includes_with_perl" returns a string containing default includes for program prologue containing \&\fI_default_includes\fR plus .PP .Vb 2 \& #include \& #include .Ve .SS "add_log_fh" .IX Subsection "add_log_fh" Push new file handles at end of log-handles to allow tee'ing log-output .SS "delete_log_fh" .IX Subsection "delete_log_fh" Removes specified log file handles. This method allows you to shoot yourself in the foot \- it doesn't prove whether the primary nor the last handle is removed. Use with caution. .SS "_get_extra_compiler_flags" .IX Subsection "_get_extra_compiler_flags" Returns the determined flags required to run the compile stage as string .SS "_get_extra_linker_flags" .IX Subsection "_get_extra_linker_flags" Returns the determined flags required to run the link stage as string .SH "AUTHOR" .IX Header "AUTHOR" Alberto Simões, \f(CW\*(C`\*(C'\fR .PP Jens Rehsack, \f(CW\*(C`\*(C'\fR .SH "NEXT STEPS" .IX Header "NEXT STEPS" Although a lot of work needs to be done, these are the next steps I intend to take. .PP .Vb 3 \& \- detect flex/lex \& \- detect yacc/bison/byacc \& \- detect ranlib (not sure about its importance) .Ve .PP These are the ones I think not too much important, and will be addressed later, or by request. .PP .Vb 3 \& \- detect an \*(Aqinstall\*(Aq command \& \- detect a \*(Aqln \-s\*(Aq command \-\- there should be a module doing \& this kind of task. .Ve .SH "BUGS" .IX Header "BUGS" A lot. Portability is a pain. \fB. .PP Please report any bugs or feature requests to \&\f(CW\*(C`bug\-Config\-AutoConf@rt.cpan.org\*(C'\fR, or through the web interface at . We will be notified, and then you'll automatically be notified of progress on your bug as we make changes. .SH "SUPPORT" .IX Header "SUPPORT" You can find documentation for this module with the perldoc command. .PP .Vb 1 \& perldoc Config::AutoConf .Ve .PP You can also look for information at: .IP "\(bu" 4 AnnoCPAN: Annotated \s-1CPAN\s0 documentation .Sp .IP "\(bu" 4 \&\s-1CPAN\s0 Ratings .Sp .IP "\(bu" 4 MetaCPAN .Sp .IP "\(bu" 4 Git Repository .Sp .SH "ACKNOWLEDGEMENTS" .IX Header "ACKNOWLEDGEMENTS" Michael Schwern for kind MacOS X help. .PP Ken Williams for ExtUtils::CBuilder .PP Peter Rabbitson for help on refactoring and making the \s-1API\s0 more Perl'ish .SH "COPYRIGHT & LICENSE" .IX Header "COPYRIGHT & LICENSE" Copyright 2004\-2020 by the Authors .PP This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fBExtUtils::CBuilder\fR\|(3)