<!-- This file automatically generated by ParseAutoconfTexinfo utility --> <!-- cvs -d:pserver:anonymous@sources.redhat.com:/cvs/eclipse \ --> <!-- co autotools/ParseTexinfo --> <!DOCTYPE macros [ <!ELEMENT macros (macro)*> <!ELEMENT macro (prototype*,synopsis)> <!ATTLIST macro id ID #REQUIRED > <!ELEMENT synopsis (#PCDATA)*> <!ELEMENT prototype (parameter+)?> <!ELEMENT parameter (#PCDATA)*> <!ATTLIST parameter content CDATA #REQUIRED > ]> <macros> <macro id="AC_INIT"> <prototype> <parameter content="package"/> <parameter content="version"/> <parameter content="[bug-report]"/> <parameter content="[tarname]"/> </prototype> <synopsis> Process any command-line arguments and perform various initializations and verifications.</P><P> Set the name of the <VAR>package</VAR> and its <VAR>version</VAR>. These are typically used in <samp>--version</samp> support, including that of <CODE>configure</CODE>. The optional argument <VAR>bug-report</VAR> should be the email to which users should send bug reports. The package <VAR>tarname</VAR> differs from <VAR>package</VAR>: the latter designates the full package name (e.g., <samp>GNU Autoconf</samp>), while the former is meant for distribution tar ball names (e.g., <samp>autoconf</samp>). It defaults to <VAR>package</VAR> with <samp>GNU </samp> stripped, lower-cased, and all characters other than alphanumerics and underscores are changed to <samp>-</samp>.</P><P> It is preferable that the arguments of <CODE>AC_INIT</CODE> be static, i.e., there should not be any shell computation, but they can be computed by M4.</P><P> The following M4 macros (e.g., <CODE>AC_PACKAGE_NAME</CODE>), output variables (e.g., <CODE>PACKAGE_NAME</CODE>), and preprocessor symbols (e.g., <CODE>PACKAGE_NAME</CODE>) are defined by <CODE>AC_INIT</CODE>:</P><P> <DL> <DT><CODE>AC_PACKAGE_NAME</CODE>, <CODE>PACKAGE_NAME</CODE> <DD> Exactly <VAR>package</VAR>.</P><P> <DT><CODE>AC_PACKAGE_TARNAME</CODE>, <CODE>PACKAGE_TARNAME</CODE> <DD> Exactly <VAR>tarname</VAR>.</P><P> <DT><CODE>AC_PACKAGE_VERSION</CODE>, <CODE>PACKAGE_VERSION</CODE> <DD> Exactly <VAR>version</VAR>.</P><P> <DT><CODE>AC_PACKAGE_STRING</CODE>, <CODE>PACKAGE_STRING</CODE> <DD> Exactly <samp><VAR>package</VAR> <VAR>version</VAR></samp>.</P><P> <DT><CODE>AC_PACKAGE_BUGREPORT</CODE>, <CODE>PACKAGE_BUGREPORT</CODE> <DD> Exactly <VAR>bug-report</VAR>. </DL> </synopsis> </macro> <macro id="AC_PREREQ"> <prototype> <parameter content="version"/> </prototype> <synopsis> Ensure that a recent enough version of Autoconf is being used. If the version of Autoconf being used to create <CODE>configure</CODE> is earlier than <VAR>version</VAR>, print an error message to the standard error output and exit with failure (exit status is 63). For example:</P><P> <TABLE><tr><td>&nbsp;</td><td class=example><pre> AC_PREREQ(VERSION) </pre></td></tr></table></P><P> This macro is the only macro that may be used before <CODE>AC_INIT</CODE>, but for consistency, you are invited not to do so. </synopsis> </macro> <macro id="AC_COPYRIGHT"> <prototype> <parameter content="copyright-notice"/> </prototype> <synopsis> Notice State that, in addition to the Free Software Foundation's copyright on the Autoconf macros, parts of your <CODE>configure</CODE> are covered by the <VAR>copyright-notice</VAR>.</P><P> The <VAR>copyright-notice</VAR> will show up in both the head of <CODE>configure</CODE> and in <samp>configure --version</samp>. </synopsis> </macro> <macro id="AC_REVISION"> <prototype> <parameter content="revision-info"/> </prototype> <synopsis> Copy revision stamp <VAR>revision-info</VAR> into the <CODE>configure</CODE> script, with any dollar signs or double-quotes removed. This macro lets you put a revision stamp from <TT>configure.ac</TT> into <CODE>configure</CODE> without RCS or CVS changing it when you check in <CODE>configure</CODE>. That way, you can determine easily which revision of <TT>configure.ac</TT> a particular <CODE>configure</CODE> corresponds to.</P><P> For example, this line in <TT>configure.ac</TT>:</P><P> <TABLE><tr><td>&nbsp;</td><td class=example><pre> AC_REVISION($Revision: 1.1 $) </pre></td></tr></table></P><P> produces this in <CODE>configure</CODE>:</P><P> <TABLE><tr><td>&nbsp;</td><td class=example><pre> #! /bin/sh # From configure.ac Revision: 1.30 </pre></td></tr></table> </synopsis> </macro> <macro id="AC_CONFIG_SRCDIR"> <prototype> <parameter content="unique-file-in-source-dir"/> </prototype> <synopsis> <VAR>unique-file-in-source-dir</VAR> is some file that is in the package's source directory; <CODE>configure</CODE> checks for this file's existence to make sure that the directory that it is told contains the source code in fact does. Occasionally people accidentally specify the wrong directory with <samp>--srcdir</samp>; this is a safety check. , for more information. </synopsis> </macro> <macro id="AC_CONFIG_AUX_DIR"> <prototype> <parameter content="dir"/> </prototype> <synopsis> Use the auxiliary build tools (e.g., <TT>install-sh</TT>, <TT>config.sub</TT>, <TT>config.guess</TT>, Cygnus <CODE>configure</CODE>, Automake and Libtool scripts etc.) that are in directory <VAR>dir</VAR>. These are auxiliary files used in configuration. <VAR>dir</VAR> can be either absolute or relative to <TT><VAR>srcdir</VAR></TT>. The default is <TT><VAR>srcdir</VAR></TT> or <TT><VAR>srcdir</VAR>/..</TT> or <TT><VAR>srcdir</VAR>/../..</TT>, whichever is the first that contains <TT>install-sh</TT>. The other files are not checked for, so that using <CODE>AC_PROG_INSTALL</CODE> does not automatically require distributing the other auxiliary files. It checks for <TT>install.sh</TT> also, but that name is obsolete because some <CODE>make</CODE> have a rule that creates <TT>install</TT> from it if there is no <TT>Makefile</TT>. </synopsis> </macro> <macro id="AC_CONFIG_MACRO_DIR"> <prototype> <parameter content="dir"/> </prototype> <synopsis> Future versions of <CODE>autopoint</CODE>, <CODE>libtoolize</CODE>, <CODE>aclocal</CODE> and <CODE>autoreconf</CODE> will use directory <VAR>dir</VAR> as the location of additional local Autoconf macros. Be sure to call this macro directly from <TT>configure.ac</TT> so that tools that install macros for <CODE>aclocal</CODE> can find the declaration before <samp>--trace</samp> can be called safely. </synopsis> </macro> <macro id="AC_OUTPUT"> <prototype> </prototype> <synopsis> Generate <TT>config.status</TT> and launch it. Call this macro once, at the end of <TT>configure.ac</TT>.</P><P> <TT>config.status</TT> will perform all the configuration actions: all the output files (see Configuration Files, macro <CODE>AC_CONFIG_FILES</CODE>), header files (see Configuration Headers, macro <CODE>AC_CONFIG_HEADERS</CODE>), commands (see Configuration Commands, macro <CODE>AC_CONFIG_COMMANDS</CODE>), links (see Configuration Links, macro <CODE>AC_CONFIG_LINKS</CODE>), subdirectories to configure (see Subdirectories, macro <CODE>AC_CONFIG_SUBDIRS</CODE>) are honored.</P><P> The location of your <CODE>AC_OUTPUT</CODE> invocation is the exact point where configuration actions are taken: any code afterwards will be executed by <CODE>configure</CODE> once <CODE>config.status</CODE> was run. If you want to bind actions to <CODE>config.status</CODE> itself (independently of whether <CODE>configure</CODE> is being run), see Configuration Commands, , Running Arbitrary Configuration Commands. </synopsis> </macro> <macro id="AC_PROG_MAKE_SET"> <prototype> </prototype> <synopsis> If <CODE>make</CODE> predefines the Make variable <CODE>MAKE</CODE>, define output variable <CODE>SET_MAKE</CODE> to be empty. Otherwise, define <CODE>SET_MAKE</CODE> to contain <samp>MAKE=make</samp>. Calls <CODE>AC_SUBST</CODE> for <CODE>SET_MAKE</CODE>. </synopsis> </macro> <macro id="AC_CONFIG_FILES"> <prototype> <parameter content="file..."/> <parameter content="[cmds]"/> <parameter content="[init-cmds]"/> </prototype> <synopsis> Make <CODE>AC_OUTPUT</CODE> create each <TT><VAR>file</VAR></TT> by copying an input file (by default <TT><VAR>file</VAR>.in</TT>), substituting the output variable values. This macro is one of the instantiating macros; see Configuration Actions. , for more information on using output variables. , for more information on creating them. This macro creates the directory that the file is in if it doesn't exist. Usually, <TT>Makefile</TT>s are created this way, but other files, such as <TT>.gdbinit</TT>, can be specified as well.</P><P> Typical calls to <CODE>AC_CONFIG_FILES</CODE> look like this:</P><P> <TABLE><tr><td>&nbsp;</td><td class=example><pre> AC_CONFIG_FILES([Makefile src/Makefile man/Makefile X/Imakefile]) AC_CONFIG_FILES([autoconf], [chmod +x autoconf]) </pre></td></tr></table></P><P> You can override an input file name by appending to <VAR>file</VAR> a colon-separated list of input files. Examples:</P><P> <TABLE><tr><td>&nbsp;</td><td class=example><pre> AC_CONFIG_FILES([Makefile:boiler/top.mk:boiler/bot.mk] [lib/Makefile:boiler/lib.mk]) </pre></td></tr></table></P><P> Doing this allows you to keep your file names acceptable to MS-DOS, or to prepend and/or append boilerplate to the file. </synopsis> </macro> <macro id="AC_CONFIG_HEADERS"> <prototype> <parameter content="header ..."/> <parameter content="[cmds]"/> <parameter content="[init-cmds]"/> </prototype> <synopsis> This macro is one of the instantiating macros; see Configuration Actions. Make <CODE>AC_OUTPUT</CODE> create the file(s) in the whitespace-separated list <VAR>header</VAR> containing C preprocessor <CODE>#define</CODE> statements, and replace <samp>@@DEFS@@</samp> in generated files with <samp>-DHAVE_CONFIG_H</samp> instead of the value of <CODE>DEFS</CODE>. The usual name for <VAR>header</VAR> is <TT>config.h</TT>.</P><P> If <VAR>header</VAR> already exists and its contents are identical to what <CODE>AC_OUTPUT</CODE> would put in it, it is left alone. Doing this allows making some changes in the configuration without needlessly causing object files that depend on the header file to be recompiled.</P><P> Usually the input file is named <TT><VAR>header</VAR>.in</TT>; however, you can override the input file name by appending to <VAR>header</VAR> a colon-separated list of input files. Examples:</P><P> <TABLE><tr><td>&nbsp;</td><td class=example><pre> AC_CONFIG_HEADERS([config.h:config.hin]) AC_CONFIG_HEADERS([defines.h:defs.pre:defines.h.in:defs.post]) </pre></td></tr></table></P><P> Doing this allows you to keep your file names acceptable to MS-DOS, or to prepend and/or append boilerplate to the file. </synopsis> </macro> <macro id="AH_VERBATIM"> <prototype> <parameter content="key"/> <parameter content="template"/> </prototype> <synopsis> Tell <CODE>autoheader</CODE> to include the <VAR>template</VAR> as-is in the header template file. This <VAR>template</VAR> is associated with the <VAR>key</VAR>, which is used to sort all the different templates and guarantee their uniqueness. It should be a symbol that can be <CODE>AC_DEFINE</CODE>'d.</P><P> For example:</P><P> <TABLE><tr><td>&nbsp;</td><td class=example><pre> AH_VERBATIM([_GNU_SOURCE], [/* Enable GNU extensions on systems that have them. */ #ifndef _GNU_SOURCE # define _GNU_SOURCE #endif]) </pre></td></tr></table> </synopsis> </macro> <macro id="AH_TEMPLATE"> <prototype> <parameter content="key"/> <parameter content="description"/> </prototype> <synopsis> Tell <CODE>autoheader</CODE> to generate a template for <VAR>key</VAR>. This macro generates standard templates just like <CODE>AC_DEFINE</CODE> when a <VAR>description</VAR> is given.</P><P> For example:</P><P> <TABLE><tr><td>&nbsp;</td><td class=example><pre> AH_TEMPLATE([CRAY_STACKSEG_END], [Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems. This function is required for alloca.c support on those systems.]) </pre></td></tr></table></P><P> will generate the following template, with the description properly justified.</P><P> <TABLE><tr><td>&nbsp;</td><td class=example><pre> /* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems. This function is required for alloca.c support on those systems. */ #undef CRAY_STACKSEG_END </pre></td></tr></table> </synopsis> </macro> <macro id="AH_TOP"> <prototype> <parameter content="text"/> </prototype> <synopsis> Include <VAR>text</VAR> at the top of the header template file. </synopsis> </macro> <macro id="AH_BOTTOM"> <prototype> <parameter content="text"/> </prototype> <synopsis> Include <VAR>text</VAR> at the bottom of the header template file. </synopsis> </macro> <macro id="AC_CONFIG_COMMANDS"> <prototype> <parameter content="tag..."/> <parameter content="[cmds]"/> <parameter content="[init-cmds]"/> </prototype> <synopsis> Specify additional shell commands to run at the end of <TT>config.status</TT>, and shell commands to initialize any variables from <CODE>configure</CODE>. Associate the commands with <VAR>tag</VAR>. Since typically the <VAR>cmds</VAR> create a file, <VAR>tag</VAR> should naturally be the name of that file. If needed, the directory hosting <VAR>tag</VAR> is created. This macro is one of the instantiating macros; see Configuration Actions.</P><P> Here is an unrealistic example: <TABLE><tr><td>&nbsp;</td><td class=example><pre> fubar=42 AC_CONFIG_COMMANDS([fubar], [echo this is extra $fubar, and so on.], [fubar=$fubar]) </pre></td></tr></table></P><P> Here is a better one: <TABLE><tr><td>&nbsp;</td><td class=example><pre> AC_CONFIG_COMMANDS([time-stamp], [date >time-stamp]) </pre></td></tr></table> </synopsis> </macro> <macro id="AC_CONFIG_COMMANDS_PRE"> <prototype> <parameter content="cmds"/> </prototype> <synopsis> Execute the <VAR>cmds</VAR> right before creating <TT>config.status</TT>. </synopsis> </macro> <macro id="AC_CONFIG_COMMANDS_POST"> <prototype> <parameter content="cmds"/> </prototype> <synopsis> Execute the <VAR>cmds</VAR> right after creating <TT>config.status</TT>. </synopsis> </macro> <macro id="AC_CONFIG_LINKS"> <prototype> <parameter content="dest:source..."/> <parameter content="[cmds]"/> <parameter content="[init-cmds]"/> </prototype> <synopsis> Make <CODE>AC_OUTPUT</CODE> link each of the existing files <VAR>source</VAR> to the corresponding link name <VAR>dest</VAR>. Makes a symbolic link if possible, otherwise a hard link if possible, otherwise a copy. The <VAR>dest</VAR> and <VAR>source</VAR> names should be relative to the top level source or build directory. This macro is one of the instantiating macros; see Configuration Actions.</P><P> For example, this call:</P><P> <TABLE><tr><td>&nbsp;</td><td class=example><pre> AC_CONFIG_LINKS(host.h:config/$machine.h object.h:config/$obj_format.h) </pre></td></tr></table></P><P> creates in the current directory <TT>host.h</TT> as a link to <TT><VAR>srcdir</VAR>/config/$machine.h</TT>, and <TT>object.h</TT> as a link to <TT><VAR>srcdir</VAR>/config/$obj_format.h</TT>.</P><P> The tempting value <samp>.</samp> for <VAR>dest</VAR> is invalid: it makes it impossible for <samp>config.status</samp> to guess the links to establish.</P><P> One can then run: <TABLE><tr><td>&nbsp;</td><td class=example><pre> ./config.status host.h object.h </pre></td></tr></table> to create the links. </synopsis> </macro> <macro id="AC_CONFIG_SUBDIRS"> <prototype> <parameter content="dir ..."/> </prototype> <synopsis> Make <CODE>AC_OUTPUT</CODE> run <CODE>configure</CODE> in each subdirectory <VAR>dir</VAR> in the given whitespace-separated list. Each <VAR>dir</VAR> should be a literal, i.e., please do not use:</P><P> <TABLE><tr><td>&nbsp;</td><td class=example><pre> if test "$package_foo_enabled" = yes; then $my_subdirs="$my_subdirs foo" fi AC_CONFIG_SUBDIRS($my_subdirs) </pre></td></tr></table></P><P> because this prevents <samp>./configure --help=recursive</samp> from displaying the options of the package <CODE>foo</CODE>. Rather, you should write:</P><P> <TABLE><tr><td>&nbsp;</td><td class=example><pre> if test "$package_foo_enabled" = yes; then AC_CONFIG_SUBDIRS(foo) fi </pre></td></tr></table></P><P> If a given <VAR>dir</VAR> is not found, an error is reported: if the subdirectory is optional, write:</P><P> <TABLE><tr><td>&nbsp;</td><td class=example><pre> if test -d $srcdir/foo; then AC_CONFIG_SUBDIRS(foo) fi </pre></td></tr></table></P><P> If a given <VAR>dir</VAR> contains <CODE>configure.gnu</CODE>, it is run instead of <CODE>configure</CODE>. This is for packages that might use a non-Autoconf script <CODE>Configure</CODE>, which can't be called through a wrapper <CODE>configure</CODE> since it would be the same file on case-insensitive filesystems. Likewise, if a <VAR>dir</VAR> contains <TT>configure.in</TT> but no <CODE>configure</CODE>, the Cygnus <CODE>configure</CODE> script found by <CODE>AC_CONFIG_AUX_DIR</CODE> is used.</P><P> The subdirectory <CODE>configure</CODE> scripts are given the same command line options that were given to this <CODE>configure</CODE> script, with minor changes if needed, which include:</P><P> <UL> <LI> adjusting a relative path for the cache file;</P><P> <LI> adjusting a relative path for the source directory;</P><P> <LI> propagating the current value of <CODE>$prefix</CODE>, including if it was defaulted, and if the default values of the top level and of the subdirectory <TT>configure</TT> differ. </UL></P><P> This macro also sets the output variable <CODE>subdirs</CODE> to the list of directories <samp><VAR>dir</VAR> <small>...</small></samp>. <TT>Makefile</TT> rules can use this variable to determine which subdirectories to recurse into.</P><P> This macro may be called multiple times. </synopsis> </macro> <macro id="AC_PREFIX_DEFAULT"> <prototype> <parameter content="prefix"/> </prototype> <synopsis> Set the default installation prefix to <VAR>prefix</VAR> instead of <TT>/usr/local</TT>. </synopsis> </macro> <macro id="AC_PREFIX_PROGRAM"> <prototype> <parameter content="program"/> </prototype> <synopsis> If the user did not specify an installation prefix (using the <samp>--prefix</samp> option), guess a value for it by looking for <VAR>program</VAR> in <CODE>PATH</CODE>, the way the shell does. If <VAR>program</VAR> is found, set the prefix to the parent of the directory containing <VAR>program</VAR>, else default the prefix as described above (<TT>/usr/local</TT> or <CODE>AC_PREFIX_DEFAULT</CODE>). For example, if <VAR>program</VAR> is <CODE>gcc</CODE> and the <CODE>PATH</CODE> contains <TT>/usr/local/gnu/bin/gcc</TT>, set the prefix to <TT>/usr/local/gnu</TT>. </synopsis> </macro> <macro id="AC_DEFAULT_INCLUDES"> <prototype> <parameter content="[include-directives]"/> </prototype> <synopsis> Expand to <VAR>include-directives</VAR> if defined, otherwise to:</P><P> <TABLE><tr><td>&nbsp;</td><td class=example><pre> @group #include <stdio.h> #if HAVE_SYS_TYPES_H # include <sys/types.h> #endif #if HAVE_SYS_STAT_H # include <sys/stat.h> #endif #if STDC_HEADERS # include <stdlib.h> # include <stddef.h> #else # if HAVE_STDLIB_H # include <stdlib.h> # endif #endif #if HAVE_STRING_H # if !STDC_HEADERS && HAVE_MEMORY_H # include <memory.h> # endif # include <string.h> #endif #if HAVE_STRINGS_H # include <strings.h> #endif #if HAVE_INTTYPES_H # include <inttypes.h> #else # if HAVE_STDINT_H # include <stdint.h> # endif #endif #if HAVE_UNISTD_H # include <unistd.h> #endif @end group </pre></td></tr></table></P><P> If the default includes are used, then check for the presence of these headers and their compatibility, i.e., you don't need to run <CODE>AC_HEADERS_STDC</CODE>, nor check for <TT>stdlib.h</TT> etc.</P><P> These headers are checked for in the same order as they are included. For instance, on some systems <TT>string.h</TT> and <TT>strings.h</TT> both exist, but conflict. Then <CODE>HAVE_STRING_H</CODE> will be defined, but <CODE>HAVE_STRINGS_H</CODE> won't. </synopsis> </macro> <macro id="AC_PROG_AWK"> <prototype> </prototype> <synopsis> Check for <CODE>gawk</CODE>, <CODE>mawk</CODE>, <CODE>nawk</CODE>, and <CODE>awk</CODE>, in that order, and set output variable <CODE>AWK</CODE> to the first one that is found. It tries <CODE>gawk</CODE> first because that is reported to be the best implementation. </synopsis> </macro> <macro id="AC_PROG_EGREP"> <prototype> </prototype> <synopsis> Check for <CODE>grep -E</CODE> and <CODE>egrep</CODE>, in that order, and set output variable <CODE>EGREP</CODE> to the first one that is found. </synopsis> </macro> <macro id="AC_PROG_FGREP"> <prototype> </prototype> <synopsis> Check for <CODE>grep -F</CODE> and <CODE>fgrep</CODE>, in that order, and set output variable <CODE>FGREP</CODE> to the first one that is found. </synopsis> </macro> <macro id="AC_PROG_INSTALL"> <prototype> </prototype> <synopsis> Set output variable <CODE>INSTALL</CODE> to the path of a BSD-compatible <CODE>install</CODE> program, if one is found in the current <CODE>PATH</CODE>. Otherwise, set <CODE>INSTALL</CODE> to <samp><VAR>dir</VAR>/install-sh -c</samp>, checking the directories specified to <CODE>AC_CONFIG_AUX_DIR</CODE> (or its default directories) to determine <VAR>dir</VAR> (Output). Also set the variables <CODE>INSTALL_PROGRAM</CODE> and <CODE>INSTALL_SCRIPT</CODE> to <samp>$INSTALL@</samp> and <CODE>INSTALL_DATA</CODE> to <samp>$INSTALL@</samp> -m 644.</P><P> This macro screens out various instances of <CODE>install</CODE> known not to work. It prefers to find a C program rather than a shell script, for speed. Instead of <TT>install-sh</TT>, it can also use <TT>install.sh</TT>, but that name is obsolete because some <CODE>make</CODE> programs have a rule that creates <TT>install</TT> from it if there is no <TT>Makefile</TT>.</P><P> Autoconf comes with a copy of <TT>install-sh</TT> that you can use. If you use <CODE>AC_PROG_INSTALL</CODE>, you must include either <TT>install-sh</TT> or <TT>install.sh</TT> in your distribution, or <CODE>configure</CODE> will produce an error message saying it can't find them---even if the system you're on has a good <CODE>install</CODE> program. This check is a safety measure to prevent you from accidentally leaving that file out, which would prevent your package from installing on systems that don't have a BSD-compatible <CODE>install</CODE> program.</P><P> If you need to use your own installation program because it has features not found in standard <CODE>install</CODE> programs, there is no reason to use <CODE>AC_PROG_INSTALL</CODE>; just put the file name of your program into your <TT>Makefile.in</TT> files. </synopsis> </macro> <macro id="AC_PROG_LEX"> <prototype> </prototype> <synopsis> If <CODE>flex</CODE> is found, set output variable <CODE>LEX</CODE> to <samp>flex</samp> and <CODE>LEXLIB</CODE> to <samp>-lfl</samp>, if that library is in a standard place. Otherwise set <CODE>LEX</CODE> to <samp>lex</samp> and <CODE>LEXLIB</CODE> to <samp>-ll</samp>.</P><P> Define <CODE>YYTEXT_POINTER</CODE> if <CODE>yytext</CODE> is a <samp>char *</samp> instead of a <samp>char []</samp>. Also set output variable <CODE>LEX_OUTPUT_ROOT</CODE> to the base of the file name that the lexer generates; usually <TT>lex.yy</TT>, but sometimes something else. These results vary according to whether <CODE>lex</CODE> or <CODE>flex</CODE> is being used.</P><P> You are encouraged to use Flex in your sources, since it is both more pleasant to use than plain Lex and the C source it produces is portable. In order to ensure portability, however, you must either provide a function <CODE>yywrap</CODE> or, if you don't use it (e.g., your scanner has no <samp>#include</samp>-like feature), simply include a <samp>%noyywrap</samp> statement in the scanner's source. Once this done, the scanner is portable (unless <EM>you</EM> felt free to use nonportable constructs) and does not depend on any library. In this case, and in this case only, it is suggested that you use this Autoconf snippet:</P><P> <TABLE><tr><td>&nbsp;</td><td class=example><pre> AC_PROG_LEX if test "$LEX" != flex; then LEX="$SHELL $missing_dir/missing flex" AC_SUBST(LEX_OUTPUT_ROOT, lex.yy) AC_SUBST(LEXLIB, '') fi </pre></td></tr></table></P><P> The shell script <CODE>missing</CODE> can be found in the Automake distribution.</P><P> To ensure backward compatibility, Automake's <CODE>AM_PROG_LEX</CODE> invokes (indirectly) this macro twice, which will cause an annoying but benign ``<CODE>AC_PROG_LEX</CODE> invoked multiple times'' warning. Future versions of Automake will fix this issue; meanwhile, just ignore this message. </synopsis> </macro> <macro id="AC_PROG_LN_S"> <prototype> </prototype> <synopsis> If <samp>ln -s</samp> works on the current file system (the operating system and file system support symbolic links), set the output variable <CODE>LN_S</CODE> to <samp>ln -s</samp>; otherwise, if <samp>ln</samp> works, set <CODE>LN_S</CODE> to <samp>ln</samp>, and otherwise set it to <samp>cp -p</samp>.</P><P> If you make a link in a directory other than the current directory, its meaning depends on whether <samp>ln</samp> or <samp>ln -s</samp> is used. To safely create links using <samp>$(LN_S)</samp>, either find out which form is used and adjust the arguments, or always invoke <CODE>ln</CODE> in the directory where the link is to be created.</P><P> In other words, it does not work to do: <TABLE><tr><td>&nbsp;</td><td class=example><pre> $(LN_S) foo /x/bar </pre></td></tr></table></P><P> Instead, do:</P><P> <TABLE><tr><td>&nbsp;</td><td class=example><pre> (cd /x && $(LN_S) foo bar) </pre></td></tr></table> </synopsis> </macro> <macro id="AC_PROG_RANLIB"> <prototype> </prototype> <synopsis> Set output variable <CODE>RANLIB</CODE> to <samp>ranlib</samp> if <CODE>ranlib</CODE> is found, and otherwise to <samp>:</samp> (do nothing). </synopsis> </macro> <macro id="AC_PROG_YACC"> <prototype> </prototype> <synopsis> If <CODE>bison</CODE> is found, set output variable <CODE>YACC</CODE> to <samp>bison -y</samp>. Otherwise, if <CODE>byacc</CODE> is found, set <CODE>YACC</CODE> to <samp>byacc</samp>. Otherwise set <CODE>YACC</CODE> to <samp>yacc</samp>. </synopsis> </macro> <macro id="AC_CHECK_PROG"> <prototype> <parameter content="variable"/> <parameter content="prog-to-check-for"/> <parameter content="value-if-found"/> <parameter content="[value-if-not-found]"/> <parameter content="[path]"/> <parameter content=" [reject]"/> </prototype> <synopsis> Check whether program <VAR>prog-to-check-for</VAR> exists in <CODE>PATH</CODE>. If it is found, set <VAR>variable</VAR> to <VAR>value-if-found</VAR>, otherwise to <VAR>value-if-not-found</VAR>, if given. Always pass over <VAR>reject</VAR> (an absolute file name) even if it is the first found in the search path; in that case, set <VAR>variable</VAR> using the absolute file name of the <VAR>prog-to-check-for</VAR> found that is not <VAR>reject</VAR>. If <VAR>variable</VAR> was already set, do nothing. Calls <CODE>AC_SUBST</CODE> for <VAR>variable</VAR>. </synopsis> </macro> <macro id="AC_CHECK_PROGS"> <prototype> <parameter content="variable"/> <parameter content="progs-to-check-for"/> <parameter content="[value-if-not-found]"/> <parameter content="[path]"/> </prototype> <synopsis> Check for each program in the whitespace-separated list <VAR>progs-to-check-for</VAR> existing in the <CODE>PATH</CODE>. If one is found, set <VAR>variable</VAR> to the name of that program. Otherwise, continue checking the next program in the list. If none of the programs in the list are found, set <VAR>variable</VAR> to <VAR>value-if-not-found</VAR>; if <VAR>value-if-not-found</VAR> is not specified, the value of <VAR>variable</VAR> is not changed. Calls <CODE>AC_SUBST</CODE> for <VAR>variable</VAR>. </synopsis> </macro> <macro id="AC_CHECK_TOOL"> <prototype> <parameter content="variable"/> <parameter content="prog-to-check-for"/> <parameter content="[value-if-not-found]"/> <parameter content="[path]"/> </prototype> <synopsis> Like <CODE>AC_CHECK_PROG</CODE>, but first looks for <VAR>prog-to-check-for</VAR> with a prefix of the host type as determined by <CODE>AC_CANONICAL_HOST</CODE>, followed by a dash (Canonicalizing). For example, if the user runs <samp>configure --host=i386-gnu</samp>, then this call: <TABLE><tr><td>&nbsp;</td><td class=example><pre> AC_CHECK_TOOL(RANLIB, ranlib, :) </pre></td></tr></table> sets <CODE>RANLIB</CODE> to <TT>i386-gnu-ranlib</TT> if that program exists in <CODE>PATH</CODE>, or otherwise to <samp>ranlib</samp> if that program exists in <CODE>PATH</CODE>, or to <samp>:</samp> if neither program exists. </synopsis> </macro> <macro id="AC_CHECK_TOOLS"> <prototype> <parameter content="variable"/> <parameter content="progs-to-check-for"/> <parameter content="[value-if-not-found]"/> <parameter content="[path]"/> </prototype> <synopsis> Like <CODE>AC_CHECK_TOOL</CODE>, each of the tools in the list <VAR>progs-to-check-for</VAR> are checked with a prefix of the host type as determined by <CODE>AC_CANONICAL_HOST</CODE>, followed by a dash (Canonicalizing). If none of the tools can be found with a prefix, then the first one without a prefix is used. If a tool is found, set <VAR>variable</VAR> to the name of that program. If none of the tools in the list are found, set <VAR>variable</VAR> to <VAR>value-if-not-found</VAR>; if <VAR>value-if-not-found</VAR> is not specified, the value of <VAR>variable</VAR> is not changed. Calls <CODE>AC_SUBST</CODE> for <VAR>variable</VAR>. </synopsis> </macro> <macro id="AC_PATH_PROG"> <prototype> <parameter content="variable"/> <parameter content="prog-to-check-for"/> <parameter content="[value-if-not-found]"/> <parameter content="[path]"/> </prototype> <synopsis> Like <CODE>AC_CHECK_PROG</CODE>, but set <VAR>variable</VAR> to the entire path of <VAR>prog-to-check-for</VAR> if found. </synopsis> </macro> <macro id="AC_PATH_PROGS"> <prototype> <parameter content="variable"/> <parameter content="progs-to-check-for"/> <parameter content="[value-if-not-found]"/> <parameter content="[path]"/> </prototype> <synopsis> Like <CODE>AC_CHECK_PROGS</CODE>, but if any of <VAR>progs-to-check-for</VAR> are found, set <VAR>variable</VAR> to the entire path of the program found. </synopsis> </macro> <macro id="AC_PATH_TOOL"> <prototype> <parameter content="variable"/> <parameter content="prog-to-check-for"/> <parameter content="[value-if-not-found]"/> <parameter content="[path]"/> </prototype> <synopsis> Like <CODE>AC_CHECK_TOOL</CODE>, but set <VAR>variable</VAR> to the entire path of the program if it is found. </synopsis> </macro> <macro id="AC_CHECK_FILE"> <prototype> <parameter content="file"/> <parameter content="[action-if-found]"/> <parameter content="[action-if-not-found]"/> </prototype> <synopsis> Check whether file <VAR>file</VAR> exists on the native system. If it is found, execute <VAR>action-if-found</VAR>, otherwise do <VAR>action-if-not-found</VAR>, if given. </synopsis> </macro> <macro id="AC_CHECK_FILES"> <prototype> <parameter content="files"/> <parameter content="[action-if-found]"/> <parameter content="[action-if-not-found]"/> </prototype> <synopsis> Executes <CODE>AC_CHECK_FILE</CODE> once for each file listed in <VAR>files</VAR>. Additionally, defines <samp>HAVE_<VAR>file</VAR></samp> (Standard Symbols) for each file found. </synopsis> </macro> <macro id="AC_CHECK_LIB"> <prototype> <parameter content="library"/> <parameter content="function"/> <parameter content="[action-if-found]"/> <parameter content="[action-if-not-found]"/> <parameter content="[other-libraries]"/> </prototype> <synopsis> Depending on the current language(Language Choice), try to ensure that the C, C++, or Fortran function <VAR>function</VAR> is available by checking whether a test program can be linked with the library <VAR>library</VAR> to get the function. <VAR>library</VAR> is the base name of the library; e.g., to check for <samp>-lmp</samp>, use <samp>mp</samp> as the <VAR>library</VAR> argument.</P><P> <VAR>action-if-found</VAR> is a list of shell commands to run if the link with the library succeeds; <VAR>action-if-not-found</VAR> is a list of shell commands to run if the link fails. If <VAR>action-if-found</VAR> is not specified, the default action will prepend <samp>-l<VAR>library</VAR></samp> to <CODE>LIBS</CODE> and define <samp>HAVE_LIB<VAR>library</VAR></samp> (in all capitals). This macro is intended to support building <CODE>LIBS</CODE> in a right-to-left (least-dependent to most-dependent) fashion such that library dependencies are satisfied as a natural side-effect of consecutive tests. Some linkers are very sensitive to library ordering so the order in which <CODE>LIBS</CODE> is generated is important to reliable detection of libraries.</P><P> If linking with <VAR>library</VAR> results in unresolved symbols that would be resolved by linking with additional libraries, give those libraries as the <VAR>other-libraries</VAR> argument, separated by spaces: e.g., <samp>-lXt -lX11</samp>. Otherwise, this macro will fail to detect that <VAR>library</VAR> is present, because linking the test program will always fail with unresolved symbols. The <VAR>other-libraries</VAR> 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 <CODE>LIBS</CODE>. </synopsis> </macro> <macro id="AC_SEARCH_LIBS"> <prototype> <parameter content="function"/> <parameter content="search-libs"/> <parameter content="[action-if-found]"/> <parameter content="[action-if-not-found]"/> <parameter content="[other-libraries]"/> </prototype> <synopsis> Search for a library defining <VAR>function</VAR> if it's not already available. This equates to calling <samp>AC_LINK_IFELSE([AC_LANG_CALL([], [<VAR>function</VAR>])])</samp> first with no libraries, then for each library listed in <VAR>search-libs</VAR>.</P><P> Add <samp>-l<VAR>library</VAR></samp> to <CODE>LIBS</CODE> for the first library found to contain <VAR>function</VAR>, and run <VAR>action-if-found</VAR>. If the function is not found, run <VAR>action-if-not-found</VAR>.</P><P> If linking with <VAR>library</VAR> results in unresolved symbols that would be resolved by linking with additional libraries, give those libraries as the <VAR>other-libraries</VAR> argument, separated by spaces: e.g., <samp>-lXt -lX11</samp>. Otherwise, this macro will fail to detect that <VAR>function</VAR> is present, because linking the test program will always fail with unresolved symbols. </synopsis> </macro> <macro id="AC_FUNC_ALLOCA"> <prototype> </prototype> <synopsis> .h Check how to get <CODE>alloca</CODE>. Tries to get a builtin version by checking for <TT>alloca.h</TT> or the predefined C preprocessor macros <CODE>__GNUC__</CODE> and <CODE>_AIX</CODE>. If this macro finds <TT>alloca.h</TT>, it defines <CODE>HAVE_ALLOCA_H</CODE>.</P><P> If those attempts fail, it looks for the function in the standard C library. If any of those methods succeed, it defines <CODE>HAVE_ALLOCA</CODE>. Otherwise, it sets the output variable <CODE>ALLOCA</CODE> to <samp>alloca.o</samp> and defines <CODE>C_ALLOCA</CODE> (so programs can periodically call <samp>alloca(0)</samp> to garbage collect). This variable is separate from <CODE>LIBOBJS</CODE> so multiple programs can share the value of <CODE>ALLOCA</CODE> without needing to create an actual library, in case only some of them use the code in <CODE>LIBOBJS</CODE>.</P><P> This macro does not try to get <CODE>alloca</CODE> from the System V R3 <TT>libPW</TT> or the System V R4 <TT>libucb</TT> because those libraries contain some incompatible functions that cause trouble. Some versions do not even contain <CODE>alloca</CODE> or contain a buggy version. If you still want to use their <CODE>alloca</CODE>, use <CODE>ar</CODE> to extract <TT>alloca.o</TT> from them instead of compiling <TT>alloca.c</TT>.</P><P> Source files that use <CODE>alloca</CODE> should start with a piece of code like the following, to declare it properly. In some versions of AIX, the declaration of <CODE>alloca</CODE> must precede everything else except for comments and preprocessor directives. The <CODE>#pragma</CODE> directive is indented so that pre-ANSI C compilers will ignore it, rather than choke on it.</P><P> <TABLE><tr><td>&nbsp;</td><td class=example><pre> @group /* AIX requires this to be the first thing in the file. */ #ifndef __GNUC__ # if HAVE_ALLOCA_H # include <alloca.h> # else # ifdef _AIX #pragma alloca # else # ifndef alloca /* predefined by HP cc +Olibcalls */ char *alloca (); # endif # endif # endif #endif @end group </pre></td></tr></table> </synopsis> </macro> <macro id="AC_FUNC_CHOWN"> <prototype> </prototype> <synopsis> If the <CODE>chown</CODE> function is available and works (in particular, it should accept <samp>-1</samp> for <CODE>uid</CODE> and <CODE>gid</CODE>), define <CODE>HAVE_CHOWN</CODE>. </synopsis> </macro> <macro id="AC_FUNC_CLOSEDIR_VOID"> <prototype> </prototype> <synopsis> If the <CODE>closedir</CODE> function does not return a meaningful value, define <CODE>CLOSEDIR_VOID</CODE>. Otherwise, callers ought to check its return value for an error indicator. </synopsis> </macro> <macro id="AC_FUNC_ERROR_AT_LINE"> <prototype> </prototype> <synopsis> If the <CODE>error_at_line</CODE> function is not found, require an <CODE>AC_LIBOBJ</CODE> replacement of <samp>error</samp>. </synopsis> </macro> <macro id="AC_FUNC_FNMATCH"> <prototype> </prototype> <synopsis> If the <CODE>fnmatch</CODE> function conforms to POSIX, define <CODE>HAVE_FNMATCH</CODE>. Detect common implementation bugs, for example, the bugs in Solaris 2.4.</P><P> Note that for historical reasons, contrary to the other specific <CODE>AC_FUNC</CODE> macros, <CODE>AC_FUNC_FNMATCH</CODE> does not replace a broken/missing <CODE>fnmatch</CODE>. See <CODE>AC_REPLACE_FNMATCH</CODE> below. </synopsis> </macro> <macro id="AC_FUNC_FNMATCH_GNU"> <prototype> </prototype> <synopsis> Behave like <CODE>AC_REPLACE_FNMATCH</CODE> (<EM>replace</EM>) but also test whether <CODE>fnmatch</CODE> supports GNU extensions. Detect common implementation bugs, for example, the bugs in the GNU C Library 2.1. </synopsis> </macro> <macro id="AC_FUNC_FORK"> <prototype> </prototype> <synopsis> .h This macro checks for the <CODE>fork</CODE> and <CODE>vfork</CODE> functions. If a working <CODE>fork</CODE> is found, define <CODE>HAVE_WORKING_FORK</CODE>. This macro checks whether <CODE>fork</CODE> is just a stub by trying to run it.</P><P> If <TT>vfork.h</TT> is found, define <CODE>HAVE_VFORK_H</CODE>. If a working <CODE>vfork</CODE> is found, define <CODE>HAVE_WORKING_VFORK</CODE>. Otherwise, define <CODE>vfork</CODE> to be <CODE>fork</CODE> for backward compatibility with previous versions of <CODE>autoconf</CODE>. This macro checks for several known errors in implementations of <CODE>vfork</CODE> and considers the system to not have a working <CODE>vfork</CODE> if it detects any of them. It is not considered to be an implementation error if a child's invocation of <CODE>signal</CODE> modifies the parent's signal handler, since child processes rarely change their signal handlers.</P><P> Since this macro defines <CODE>vfork</CODE> only for backward compatibility with previous versions of <CODE>autoconf</CODE> you're encouraged to define it yourself in new code: <TABLE><tr><td>&nbsp;</td><td class=example><pre> @group #if !HAVE_WORKING_VFORK # define vfork fork #endif @end group </pre></td></tr></table> </synopsis> </macro> <macro id="AC_FUNC_FSEEKO"> <prototype> </prototype> <synopsis> If the <CODE>fseeko</CODE> function is available, define <CODE>HAVE_FSEEKO</CODE>. Define <CODE>_LARGEFILE_SOURCE</CODE> if necessary to make the prototype visible on some systems (e.g. glibc 2.2). Otherwise linkage problems may occur when compiling with <CODE>AC_SYS_LARGEFILE</CODE> on largefile-sensitive systems where <CODE>off_t</CODE> does not default to a 64bit entity. </synopsis> </macro> <macro id="AC_FUNC_GETGROUPS"> <prototype> </prototype> <synopsis> If the <CODE>getgroups</CODE> function is available and works (unlike on Ultrix 4.3, where <samp>getgroups (0, 0)</samp> always fails), define <CODE>HAVE_GETGROUPS</CODE>. Set <CODE>GETGROUPS_LIBS</CODE> to any libraries needed to get that function. This macro runs <CODE>AC_TYPE_GETGROUPS</CODE>. </synopsis> </macro> <macro id="AC_FUNC_GETLOADAVG"> <prototype> </prototype> <synopsis> Check how to get the system load averages. To perform its tests properly, this macro needs the file <TT>getloadavg.c</TT>; therefore, be sure to set the <CODE>AC_LIBOBJ</CODE> replacement directory properly (see Generic Functions, <CODE>AC_CONFIG_LIBOBJ_DIR</CODE>).</P><P> If the system has the <CODE>getloadavg</CODE> function, define <CODE>HAVE_GETLOADAVG</CODE>, and set <CODE>GETLOADAVG_LIBS</CODE> to any libraries needed to get that function. Also add <CODE>GETLOADAVG_LIBS</CODE> to <CODE>LIBS</CODE>. Otherwise, require an <CODE>AC_LIBOBJ</CODE> replacement for <samp>getloadavg</samp> with source code in <TT><VAR>dir</VAR>/getloadavg.c</TT>, and possibly define several other C preprocessor macros and output variables:</P><P> <OL> <LI> Define <CODE>C_GETLOADAVG</CODE>.</P><P> <LI> Define <CODE>SVR4</CODE>, <CODE>DGUX</CODE>, <CODE>UMAX</CODE>, or <CODE>UMAX4_3</CODE> if on those systems.</P><P> <LI> .h If <TT>nlist.h</TT> is found, define <CODE>HAVE_NLIST_H</CODE>.</P><P> <LI> If <samp>struct nlist</samp> has an <samp>n_un.n_name</samp> member, define <CODE>HAVE_STRUCT_NLIST_N_UN_N_NAME</CODE>. The obsolete symbol <CODE>NLIST_NAME_UNION</CODE> is still defined, but do not depend upon it.</P><P> <LI> Programs may need to be installed setgid (or setuid) for <CODE>getloadavg</CODE> to work. In this case, define <CODE>GETLOADAVG_PRIVILEGED</CODE>, set the output variable <CODE>NEED_SETGID</CODE> to <samp>true</samp> (and otherwise to <samp>false</samp>), and set <CODE>KMEM_GROUP</CODE> to the name of the group that should own the installed program. </OL> </synopsis> </macro> <macro id="AC_FUNC_GETMNTENT"> <prototype> </prototype> <synopsis> Check for <CODE>getmntent</CODE> in the <TT>sun</TT>, <TT>seq</TT>, and <TT>gen</TT> libraries, for irix 4, PTX, and Unixware, respectively. Then, if <CODE>getmntent</CODE> is available, define <CODE>HAVE_GETMNTENT</CODE>. </synopsis> </macro> <macro id="AC_FUNC_GETPGRP"> <prototype> </prototype> <synopsis> Define <CODE>GETPGRP_VOID</CODE> if it is an error to pass 0 to <CODE>getpgrp</CODE>; this is the POSIX behavior. On older BSD systems, you must pass 0 to <CODE>getpgrp</CODE>, as it takes an argument and behaves like POSIX's <CODE>getpgid</CODE>.</P><P> <TABLE><tr><td>&nbsp;</td><td class=example><pre> #if GETPGRP_VOID pid = getpgrp (); #else pid = getpgrp (0); #endif </pre></td></tr></table></P><P> This macro does not check whether <CODE>getpgrp</CODE> exists at all; if you need to work in that situation, first call <CODE>AC_CHECK_FUNC</CODE> for <CODE>getpgrp</CODE>. </synopsis> </macro> <macro id="AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK"> <prototype> </prototype> <synopsis> If <TT>link</TT> is a symbolic link, then <CODE>lstat</CODE> should treat <TT>link/</TT> the same as <TT>link/.</TT>. However, many older <CODE>lstat</CODE> implementations incorrectly ignore trailing slashes.</P><P> It is safe to assume that if <CODE>lstat</CODE> incorrectly ignores trailing slashes, then other symbolic-link-aware functions like <CODE>unlink</CODE> also incorrectly ignore trailing slashes.</P><P> If <CODE>lstat</CODE> behaves properly, define <CODE>LSTAT_FOLLOWS_SLASHED_SYMLINK</CODE>, otherwise require an <CODE>AC_LIBOBJ</CODE> replacement of <CODE>lstat</CODE>. </synopsis> </macro> <macro id="AC_FUNC_MALLOC"> <prototype> </prototype> <synopsis> If the <CODE>malloc</CODE> function is compatible with the GNU C library <CODE>malloc</CODE> (i.e., <samp>malloc (0)</samp> returns a valid pointer), define <CODE>HAVE_MALLOC</CODE> to 1. Otherwise define <CODE>HAVE_MALLOC</CODE> to 0, ask for an <CODE>AC_LIBOBJ</CODE> replacement for <samp>malloc</samp>, and define <CODE>malloc</CODE> to <CODE>rpl_malloc</CODE> so that the native <CODE>malloc</CODE> is not used in the main project.</P><P> Typically, the replacement file <TT>malloc.c</TT> should look like (note the <samp>#undef malloc</samp>):</P><P> <CODE> #if HAVE_CONFIG_H # include <config.h> #endif #undef malloc</P><P> #include <sys/types.h></P><P> void *malloc ();</P><P> /* Allocate an N-byte block of memory from the heap. If N is zero, allocate a 1-byte block. */</P><P> void * rpl_malloc (size_t n) { if (n == 0) n = 1; return malloc (n); } </CODE> </synopsis> </macro> <macro id="AC_FUNC_MEMCMP"> <prototype> </prototype> <synopsis> If the <CODE>memcmp</CODE> function is not available, or does not work on 8-bit data (like the one on SunOS 4.1.3), or fails when comparing 16 bytes or more and with at least one buffer not starting on a 4-byte boundary (such as the one on NeXT x86 OpenStep), require an <CODE>AC_LIBOBJ</CODE> replacement for <samp>memcmp</samp>. </synopsis> </macro> <macro id="AC_FUNC_MBRTOWC"> <prototype> </prototype> <synopsis> Define <CODE>HAVE_MBRTOWC</CODE> to 1 if the function <CODE>mbrtowc</CODE> and the type <CODE>mbstate_t</CODE> are properly declared. </synopsis> </macro> <macro id="AC_FUNC_MKTIME"> <prototype> </prototype> <synopsis> If the <CODE>mktime</CODE> function is not available, or does not work correctly, require an <CODE>AC_LIBOBJ</CODE> replacement for <samp>mktime</samp>. For the purposes of this test, <CODE>mktime</CODE> should conform to the POSIX standard and should be the inverse of <CODE>localtime</CODE>. </synopsis> </macro> <macro id="AC_FUNC_MMAP"> <prototype> </prototype> <synopsis> If the <CODE>mmap</CODE> function exists and works correctly, define <CODE>HAVE_MMAP</CODE>. Only checks private fixed mapping of already-mapped memory. </synopsis> </macro> <macro id="AC_FUNC_OBSTACK"> <prototype> </prototype> <synopsis> If the obstacks are found, define <CODE>HAVE_OBSTACK</CODE>, else require an <CODE>AC_LIBOBJ</CODE> replacement for <samp>obstack</samp>. </synopsis> </macro> <macro id="AC_FUNC_REALLOC"> <prototype> </prototype> <synopsis> If the <CODE>realloc</CODE> function is compatible with the GNU C library <CODE>realloc</CODE> (i.e., <samp>realloc (0, 0)</samp> returns a valid pointer), define <CODE>HAVE_REALLOC</CODE> to 1. Otherwise define <CODE>HAVE_REALLOC</CODE> to 0, ask for an <CODE>AC_LIBOBJ</CODE> replacement for <samp>realloc</samp>, and define <CODE>realloc</CODE> to <CODE>rpl_realloc</CODE> so that the native <CODE>realloc</CODE> is not used in the main project. See <CODE>AC_FUNC_MALLOC</CODE> for details. </synopsis> </macro> <macro id="AC_FUNC_SELECT_ARGTYPES"> <prototype> </prototype> <synopsis> Determines the correct type to be passed for each of the <CODE>select</CODE> function's arguments, and defines those types in <CODE>SELECT_TYPE_ARG1</CODE>, <CODE>SELECT_TYPE_ARG234</CODE>, and <CODE>SELECT_TYPE_ARG5</CODE> respectively. <CODE>SELECT_TYPE_ARG1</CODE> defaults to <samp>int</samp>, <CODE>SELECT_TYPE_ARG234</CODE> defaults to <samp>int *</samp>, and <CODE>SELECT_TYPE_ARG5</CODE> defaults to <samp>struct timeval *</samp>. </synopsis> </macro> <macro id="AC_FUNC_SETPGRP"> <prototype> </prototype> <synopsis> If <CODE>setpgrp</CODE> takes no argument (the POSIX version), define <CODE>SETPGRP_VOID</CODE>. Otherwise, it is the BSD version, which takes two process IDs as arguments. This macro does not check whether <CODE>setpgrp</CODE> exists at all; if you need to work in that situation, first call <CODE>AC_CHECK_FUNC</CODE> for <CODE>setpgrp</CODE>. </synopsis> </macro> <macro id="AC_FUNC_STAT"> <prototype> </prototype> <prototype> </prototype> <synopsis> Determine whether <CODE>stat</CODE> or <CODE>lstat</CODE> have the bug that it succeeds when given the zero-length file name as argument. The <CODE>stat</CODE> and <CODE>lstat</CODE> from SunOS 4.1.4 and the Hurd (as of 1998-11-01) do this.</P><P> If it does, then define <CODE>HAVE_STAT_EMPTY_STRING_BUG</CODE> (or <CODE>HAVE_LSTAT_EMPTY_STRING_BUG</CODE>) and ask for an <CODE>AC_LIBOBJ</CODE> replacement of it. </synopsis> </macro> <macro id="AC_FUNC_SETVBUF_REVERSED"> <prototype> </prototype> <synopsis> If <CODE>setvbuf</CODE> takes the buffering type as its second argument and the buffer pointer as the third, instead of the other way around, define <CODE>SETVBUF_REVERSED</CODE>. </synopsis> </macro> <macro id="AC_FUNC_STRCOLL"> <prototype> </prototype> <synopsis> If the <CODE>strcoll</CODE> function exists and works correctly, define <CODE>HAVE_STRCOLL</CODE>. This does a bit more than <samp>AC_CHECK_FUNCS(strcoll)</samp>, because some systems have incorrect definitions of <CODE>strcoll</CODE> that should not be used. </synopsis> </macro> <macro id="AC_FUNC_STRTOD"> <prototype> </prototype> <synopsis> If the <CODE>strtod</CODE> function does not exist or doesn't work correctly, ask for an <CODE>AC_LIBOBJ</CODE> replacement of <samp>strtod</samp>. In this case, because <TT>strtod.c</TT> is likely to need <samp>pow</samp>, set the output variable <CODE>POW_LIB</CODE> to the extra library needed. </synopsis> </macro> <macro id="AC_FUNC_STRERROR_R"> <prototype> </prototype> <synopsis> If <CODE>strerror_r</CODE> is available, define <CODE>HAVE_STRERROR_R</CODE>, and if it is declared, define <CODE>HAVE_DECL_STRERROR_R</CODE>. If it returns a <CODE>char *</CODE> message, define <CODE>STRERROR_R_CHAR_P</CODE>; otherwise it returns an <CODE>int</CODE> error number. The Thread-Safe Functions option of POSIX requires <CODE>strerror_r</CODE> to return <CODE>int</CODE>, but many systems (including, for example, version 2.2.4 of the GNU C Library) return a <CODE>char *</CODE> value that is not necessarily equal to the buffer argument. </synopsis> </macro> <macro id="AC_FUNC_STRFTIME"> <prototype> </prototype> <synopsis> Check for <CODE>strftime</CODE> in the <TT>intl</TT> library, for SCO unix. Then, if <CODE>strftime</CODE> is available, define <CODE>HAVE_STRFTIME</CODE>. </synopsis> </macro> <macro id="AC_FUNC_STRNLEN"> <prototype> </prototype> <synopsis> If the <CODE>strnlen</CODE> function is not available, or is buggy (like the one from AIX 4.3), require an <CODE>AC_LIBOBJ</CODE> replacement for it. </synopsis> </macro> <macro id="AC_FUNC_UTIME_NULL"> <prototype> </prototype> <synopsis> If <samp>utime(<VAR>file</VAR>, NULL)</samp> sets <VAR>file</VAR>'s timestamp to the present, define <CODE>HAVE_UTIME_NULL</CODE>. </synopsis> </macro> <macro id="AC_FUNC_VPRINTF"> <prototype> </prototype> <synopsis> If <CODE>vprintf</CODE> is found, define <CODE>HAVE_VPRINTF</CODE>. Otherwise, if <CODE>_doprnt</CODE> is found, define <CODE>HAVE_DOPRNT</CODE>. (If <CODE>vprintf</CODE> is available, you may assume that <CODE>vfprintf</CODE> and <CODE>vsprintf</CODE> are also available.) </synopsis> </macro> <macro id="AC_REPLACE_FNMATCH"> <prototype> </prototype> <synopsis> .h If the <CODE>fnmatch</CODE> function does not conform to POSIX (see <CODE>AC_FUNC_FNMATCH</CODE>), ask for its <CODE>AC_LIBOBJ</CODE> replacement.</P><P> The files <TT>fnmatch.c</TT>, <TT>fnmatch_loop.c</TT>, and <TT>fnmatch_.h</TT> in the <CODE>AC_LIBOBJ</CODE> replacement directory are assumed to contain a copy of the source code of GNU <CODE>fnmatch</CODE>. If necessary, this source code is compiled as an <CODE>AC_LIBOBJ</CODE> replacement, and the <TT>fnmatch_.h</TT> file is linked to <TT>fnmatch.h</TT> so that it can be included in place of the system <CODE><fnmatch.h></CODE>. </synopsis> </macro> <macro id="AC_CHECK_FUNC"> <prototype> <parameter content="function"/> <parameter content="[action-if-found]"/> <parameter content="[action-if-not-found]"/> </prototype> <synopsis> If C function <VAR>function</VAR> is available, run shell commands <VAR>action-if-found</VAR>, otherwise <VAR>action-if-not-found</VAR>. If you just want to define a symbol if the function is available, consider using <CODE>AC_CHECK_FUNCS</CODE> instead. This macro checks for functions with C linkage even when <CODE>AC_LANG(C++)</CODE> has been called, since C is more standardized than C++. (Language Choice, for more information about selecting the language for checks.) </synopsis> </macro> <macro id="AC_CHECK_FUNCS"> <prototype> <parameter content="function..."/> <parameter content="[action-if-found]"/> <parameter content="[action-if-not-found]"/> </prototype> <synopsis> For each <VAR>function</VAR> in the whitespace-separated argument list, define <CODE>HAVE_<VAR>function</VAR></CODE> (in all capitals) if it is available. If <VAR>action-if-found</VAR> is given, it is additional shell code to execute when one of the functions is found. You can give it a value of <samp>break</samp> to break out of the loop on the first match. If <VAR>action-if-not-found</VAR> is given, it is executed when one of the functions is not found. </synopsis> </macro> <macro id="AC_LIBOBJ"> <prototype> <parameter content="function"/> </prototype> <synopsis> Specify that <samp><VAR>function</VAR>.c</samp> must be included in the executables to replace a missing or broken implementation of <VAR>function</VAR>.</P><P> Technically, it adds <samp><VAR>function</VAR>.$ac_objext</samp> to the output variable <CODE>LIBOBJS</CODE> if it is not already in, and calls <CODE>AC_LIBSOURCE</CODE> for <samp><VAR>function</VAR>.c</samp>. You should not directly change <CODE>LIBOBJS</CODE>, since this is not traceable. </synopsis> </macro> <macro id="AC_LIBSOURCE"> <prototype> <parameter content="file"/> </prototype> <synopsis> Specify that <VAR>file</VAR> might be needed to compile the project. If you need to know what files might be needed by a <TT>configure.ac</TT>, you should trace <CODE>AC_LIBSOURCE</CODE>. <VAR>file</VAR> must be a literal.</P><P> This macro is called automatically from <CODE>AC_LIBOBJ</CODE>, but you must call it explicitly if you pass a shell variable to <CODE>AC_LIBOBJ</CODE>. In that case, since shell variables cannot be traced statically, you must pass to <CODE>AC_LIBSOURCE</CODE> any possible files that the shell variable might cause <CODE>AC_LIBOBJ</CODE> to need. For example, if you want to pass a variable <CODE>$foo_or_bar</CODE> to <CODE>AC_LIBOBJ</CODE> that holds either <CODE>"foo"</CODE> or <CODE>"bar"</CODE>, you should do:</P><P> <TABLE><tr><td>&nbsp;</td><td class=example><pre> AC_LIBSOURCE(foo.c) AC_LIBSOURCE(bar.c) AC_LIBOBJ($foo_or_bar) </pre></td></tr></table></P><P> There is usually a way to avoid this, however, and you are encouraged to simply call <CODE>AC_LIBOBJ</CODE> with literal arguments.</P><P> Note that this macro replaces the obsolete <CODE>AC_LIBOBJ_DECL</CODE>, with slightly different semantics: the old macro took the function name, e.g., <CODE>foo</CODE>, as its argument rather than the file name. </synopsis> </macro> <macro id="AC_LIBSOURCES"> <prototype> <parameter content="files"/> </prototype> <synopsis> Like <CODE>AC_LIBSOURCE</CODE>, but accepts one or more <VAR>files</VAR> in a comma-separated M4 list. Thus, the above example might be rewritten:</P><P> <TABLE><tr><td>&nbsp;</td><td class=example><pre> AC_LIBSOURCES([foo.c, bar.c]) AC_LIBOBJ($foo_or_bar) </pre></td></tr></table> </synopsis> </macro> <macro id="AC_CONFIG_LIBOBJ_DIR"> <prototype> <parameter content="directory"/> </prototype> <synopsis> Specify that <CODE>AC_LIBOBJ</CODE> replacement files are to be found in <VAR>directory</VAR>, a relative path starting from the top level of the source tree. The replacement directory defaults to <TT>.</TT>, the top level directory, and the most typical value is <TT>lib</TT>, corresponding to <samp>AC_CONFIG_LIBOBJ_DIR(lib)</samp>.</P><P> <CODE>configure</CODE> might need to know the replacement directory for the following reasons: (i) some checks use the replacement files, (ii) some macros bypass broken system headers by installing links to the replacement headers, etc. </synopsis> </macro> <macro id="AC_REPLACE_FUNCS"> <prototype> <parameter content="function..."/> </prototype> <synopsis> Like <CODE>AC_CHECK_FUNCS</CODE>, but uses <samp>AC_LIBOBJ(<VAR>function</VAR>)</samp> as <VAR>action-if-not-found</VAR>. You can declare your replacement function by enclosing the prototype in <samp>#if !HAVE_<VAR>function</VAR></samp>. If the system has the function, it probably declares it in a header file you should be including, so you shouldn't redeclare it lest your declaration conflict. </synopsis> </macro> <macro id="AC_HEADER_DIRENT"> <prototype> </prototype> <synopsis> .h /ndir.h /dir.h .h Check for the following header files. For the first one that is found and defines <samp>DIR</samp>, define the listed C preprocessor macro:</P><P> @multitable {<TT>sys/ndir.h</TT>} {<CODE>HAVE_SYS_NDIR_H</CODE>} <LI> <TT>dirent.h</TT> @tab <CODE>HAVE_DIRENT_H</CODE> <LI> <TT>sys/ndir.h</TT> @tab <CODE>HAVE_SYS_NDIR_H</CODE> <LI> <TT>sys/dir.h</TT> @tab <CODE>HAVE_SYS_DIR_H</CODE> <LI> <TT>ndir.h</TT> @tab <CODE>HAVE_NDIR_H</CODE> @end multitable</P><P> The directory-library declarations in your source code should look something like the following:</P><P> <TABLE><tr><td>&nbsp;</td><td class=example><pre> @group #if HAVE_DIRENT_H # include <dirent.h> # define NAMLEN(dirent) strlen((dirent)->d_name) #else # define dirent direct # define NAMLEN(dirent) (dirent)->d_namlen # if HAVE_SYS_NDIR_H # include <sys/ndir.h> # endif # if HAVE_SYS_DIR_H # include <sys/dir.h> # endif # if HAVE_NDIR_H # include <ndir.h> # endif #endif @end group </pre></td></tr></table></P><P> Using the above declarations, the program would declare variables to be of type <CODE>struct dirent</CODE>, not <CODE>struct direct</CODE>, and would access the length of a directory entry name by passing a pointer to a <CODE>struct dirent</CODE> to the <CODE>NAMLEN</CODE> macro.</P><P> This macro also checks for the SCO Xenix <TT>dir</TT> and <TT>x</TT> libraries. </synopsis> </macro> <macro id="AC_HEADER_MAJOR"> <prototype> </prototype> <synopsis> /mkdev.h /sysmacros.h If <TT>sys/types.h</TT> does not define <CODE>major</CODE>, <CODE>minor</CODE>, and <CODE>makedev</CODE>, but <TT>sys/mkdev.h</TT> does, define <CODE>MAJOR_IN_MKDEV</CODE>; otherwise, if <TT>sys/sysmacros.h</TT> does, define <CODE>MAJOR_IN_SYSMACROS</CODE>. </synopsis> </macro> <macro id="AC_HEADER_STAT"> <prototype> </prototype> <synopsis> /stat.h If the macros <CODE>S_ISDIR</CODE>, <CODE>S_ISREG</CODE>, etc.@: defined in <TT>sys/stat.h</TT> do not work properly (returning false positives), define <CODE>STAT_MACROS_BROKEN</CODE>. This is the case on Tektronix UTekV, Amdahl UTS and Motorola System V/88. </synopsis> </macro> <macro id="AC_HEADER_STDBOOL"> <prototype> </prototype> <synopsis> .h .h If <TT>stdbool.h</TT> exists and is conformant to C99, define <CODE>HAVE_STDBOOL_H</CODE> to 1; if the type <CODE>_Bool</CODE> is defined, define <CODE>HAVE__BOOL</CODE> to 1. To fulfill the C99 requirements, your <TT>system.h</TT> should contain the following code:</P><P> <CODE> #if HAVE_STDBOOL_H # include <stdbool.h> #else # if ! HAVE__BOOL # ifdef __cplusplus typedef bool _Bool; # else typedef unsigned char _Bool; # endif # endif # define bool _Bool # define false 0 # define true 1 # define __bool_true_false_are_defined 1 #endif </CODE> </synopsis> </macro> <macro id="AC_HEADER_STDC"> <prototype> </prototype> <synopsis> .h .h .h .h .h Define <CODE>STDC_HEADERS</CODE> if the system has ANSI C header files. Specifically, this macro checks for <TT>stdlib.h</TT>, <TT>stdarg.h</TT>, <TT>string.h</TT>, and <TT>float.h</TT>; if the system has those, it probably has the rest of the ANSI C header files. This macro also checks whether <TT>string.h</TT> declares <CODE>memchr</CODE> (and thus presumably the other <CODE>mem</CODE> functions), whether <TT>stdlib.h</TT> declare <CODE>free</CODE> (and thus presumably <CODE>malloc</CODE> and other related functions), and whether the <TT>ctype.h</TT> macros work on characters with the high bit set, as ANSI C requires.</P><P> Use <CODE>STDC_HEADERS</CODE> instead of <CODE>__STDC__</CODE> to determine whether the system has ANSI-compliant header files (and probably C library functions) because many systems that have GCC do not have ANSI C header files.</P><P> .h .h On systems without ANSI C headers, there is so much variation that it is probably easier to declare the functions you use than to figure out exactly what the system header files declare. Some systems contain a mix of functions from ANSI and BSD; some are mostly ANSI but lack <samp>memmove</samp>; some define the BSD functions as macros in <TT>string.h</TT> or <TT>strings.h</TT>; some have only the BSD functions but <TT>string.h</TT>; some declare the memory functions in <TT>memory.h</TT>, some in <TT>string.h</TT>; etc. It is probably sufficient to check for one string function and one memory function; if the library has the ANSI versions of those then it probably has most of the others. If you put the following in <TT>configure.ac</TT>:</P><P> <TABLE><tr><td>&nbsp;</td><td class=example><pre> AC_HEADER_STDC AC_CHECK_FUNCS(strchr memcpy) </pre></td></tr></table></P><P> then, in your code, you can use declarations like this:</P><P> <TABLE><tr><td>&nbsp;</td><td class=example><pre> @group #if STDC_HEADERS # include <string.h> #else # if !HAVE_STRCHR # define strchr index # define strrchr rindex # endif char *strchr (), *strrchr (); # if !HAVE_MEMCPY # define memcpy(d, s, n) bcopy ((s), (d), (n)) # define memmove(d, s, n) bcopy ((s), (d), (n)) # endif #endif @end group </pre></td></tr></table></P><P> If you use a function like <CODE>memchr</CODE>, <CODE>memset</CODE>, <CODE>strtok</CODE>, or <CODE>strspn</CODE>, which have no BSD equivalent, then macros won't suffice; you must provide an implementation of each function. An easy way to incorporate your implementations only when needed (since the ones in system C libraries may be hand optimized) is to, taking <CODE>memchr</CODE> for example, put it in <TT>memchr.c</TT> and use <samp>AC_REPLACE_FUNCS(memchr)</samp>. </synopsis> </macro> <macro id="AC_HEADER_SYS_WAIT"> <prototype> </prototype> <synopsis> /wait.h If <TT>sys/wait.h</TT> exists and is compatible with POSIX, define <CODE>HAVE_SYS_WAIT_H</CODE>. Incompatibility can occur if <TT>sys/wait.h</TT> does not exist, or if it uses the old BSD <CODE>union wait</CODE> instead of <CODE>int</CODE> to store a status value. If <TT>sys/wait.h</TT> is not POSIX compatible, then instead of including it, define the POSIX macros with their usual interpretations. Here is an example:</P><P> <TABLE><tr><td>&nbsp;</td><td class=example><pre> @group #include <sys/types.h> #if HAVE_SYS_WAIT_H # include <sys/wait.h> #endif #ifndef WEXITSTATUS # define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8) #endif #ifndef WIFEXITED # define WIFEXITED(stat_val) (((stat_val) & 255) == 0) #endif @end group </pre></td></tr></table> </synopsis> </macro> <macro id="AC_HEADER_TIME"> <prototype> </prototype> <synopsis> .h /time.h If a program may include both <TT>time.h</TT> and <TT>sys/time.h</TT>, define <CODE>TIME_WITH_SYS_TIME</CODE>. On some older systems, <TT>sys/time.h</TT> includes <TT>time.h</TT>, but <TT>time.h</TT> is not protected against multiple inclusion, so programs should not explicitly include both files. This macro is useful in programs that use, for example, <CODE>struct timeval</CODE> as well as <CODE>struct tm</CODE>. It is best used in conjunction with <CODE>HAVE_SYS_TIME_H</CODE>, which can be checked for using <CODE>AC_CHECK_HEADERS(sys/time.h)</CODE>.</P><P> <TABLE><tr><td>&nbsp;</td><td class=example><pre> @group #if TIME_WITH_SYS_TIME # include <sys/time.h> # include <time.h> #else # if HAVE_SYS_TIME_H # include <sys/time.h> # else # include <time.h> # endif #endif @end group </pre></td></tr></table> </synopsis> </macro> <macro id="AC_HEADER_TIOCGWINSZ"> <prototype> </prototype> <synopsis> /ioctl.h .h If the use of <CODE>TIOCGWINSZ</CODE> requires <TT><sys/ioctl.h></TT>, then define <CODE>GWINSZ_IN_SYS_IOCTL</CODE>. Otherwise <CODE>TIOCGWINSZ</CODE> can be found in <TT><termios.h></TT>.</P><P> Use:</P><P> <TABLE><tr><td>&nbsp;</td><td class=example><pre> @group #if HAVE_TERMIOS_H # include <termios.h> #endif</P><P> #if GWINSZ_IN_SYS_IOCTL # include <sys/ioctl.h> #endif @end group </pre></td></tr></table> </synopsis> </macro> <macro id="AC_CHECK_HEADER"> <prototype> <parameter content="header-file"/> <parameter content="[action-if-found]"/> <parameter content="[action-if-not-found]"/> <parameter content="[includes= default-includes]"/> </prototype> <synopsis> If the system header file <VAR>header-file</VAR> is compilable, execute shell commands <VAR>action-if-found</VAR>, otherwise execute <VAR>action-if-not-found</VAR>. If you just want to define a symbol if the header file is available, consider using <CODE>AC_CHECK_HEADERS</CODE> instead.</P><P> For compatibility issues with older versions of Autoconf, please read below. </synopsis> </macro> <macro id="AC_CHECK_HEADERS"> <prototype> <parameter content="header-file..."/> <parameter content="[action-if-found]"/> <parameter content="[action-if-not-found]"/> <parameter content="[includes= default-includes]"/> </prototype> <synopsis> For each given system header file <VAR>header-file</VAR> in the whitespace-separated argument list that exists, define <CODE>HAVE_<VAR>header-file</VAR></CODE> (in all capitals). If <VAR>action-if-found</VAR> is given, it is additional shell code to execute when one of the header files is found. You can give it a value of <samp>break</samp> to break out of the loop on the first match. If <VAR>action-if-not-found</VAR> is given, it is executed when one of the header files is not found.</P><P> For compatibility issues with older versions of Autoconf, please read below. </synopsis> </macro> <macro id="AC_CHECK_DECL"> <prototype> <parameter content="symbol"/> <parameter content="[action-if-found]"/> <parameter content="[action-if-not-found]"/> <parameter content="[includes= default-includes]"/> </prototype> <synopsis> If <VAR>symbol</VAR> (a function or a variable) is not declared in <VAR>includes</VAR> and a declaration is needed, run the shell commands <VAR>action-if-not-found</VAR>, otherwise <VAR>action-if-found</VAR>. If no <VAR>includes</VAR> are specified, the default includes are used (Default Includes).</P><P> This macro actually tests whether it is valid to use <VAR>symbol</VAR> as an r-value, not if it is really declared, because it is much safer to avoid introducing extra declarations when they are not needed. </synopsis> </macro> <macro id="AC_CHECK_DECLS"> <prototype> <parameter content="symbols"/> <parameter content="[action-if-found]"/> <parameter content="[action-if-not-found]"/> <parameter content="[includes= default-includes]"/> </prototype> <synopsis> For each of the <VAR>symbols</VAR> (<EM>comma</EM>-separated list), define <CODE>HAVE_DECL_<VAR>symbol</VAR></CODE> (in all capitals) to <samp>1</samp> if <VAR>symbol</VAR> is declared, otherwise to <samp>0</samp>. If <VAR>action-if-not-found</VAR> is given, it is additional shell code to execute when one of the function declarations is needed, otherwise <VAR>action-if-found</VAR> is executed.</P><P> This macro uses an m4 list as first argument: <TABLE><tr><td>&nbsp;</td><td class=example><pre> AC_CHECK_DECLS(strdup) AC_CHECK_DECLS([strlen]) AC_CHECK_DECLS([malloc, realloc, calloc, free]) </pre></td></tr></table></P><P> Unlike the other <samp>AC_CHECK_*S</samp> macros, when a <VAR>symbol</VAR> is not declared, <CODE>HAVE_DECL_<VAR>symbol</VAR></CODE> is defined to <samp>0</samp> instead of leaving <CODE>HAVE_DECL_<VAR>symbol</VAR></CODE> undeclared. When you are <EM>sure</EM> that the check was performed, use <CODE>HAVE_DECL_<VAR>symbol</VAR></CODE> just like any other result of Autoconf:</P><P> <TABLE><tr><td>&nbsp;</td><td class=example><pre> #if !HAVE_DECL_SYMBOL extern char *symbol; #endif </pre></td></tr></table></P><P> If the test may have not been performed, however, because it is safer <EM>not</EM> to declare a symbol than to use a declaration that conflicts with the system's one, you should use:</P><P> <TABLE><tr><td>&nbsp;</td><td class=example><pre> #if defined HAVE_DECL_MALLOC && !HAVE_DECL_MALLOC void *malloc (size_t *s); #endif </pre></td></tr></table></P><P> You fall into the second category only in extreme situations: either your files may be used without being configured, or they are used during the configuration. In most cases the traditional approach is enough. </synopsis> </macro> <macro id="AC_STRUCT_ST_BLKSIZE"> <prototype> </prototype> <synopsis> If <CODE>struct stat</CODE> contains an <CODE>st_blksize</CODE> member, define <CODE>HAVE_STRUCT_STAT_ST_BLKSIZE</CODE>. The former name, <CODE>HAVE_ST_BLKSIZE</CODE> is to be avoided, as its support will cease in the future. This macro is obsoleted, and should be replaced by</P><P> <TABLE><tr><td>&nbsp;</td><td class=example><pre> AC_CHECK_MEMBERS([struct stat.st_blksize]) </pre></td></tr></table> </synopsis> </macro> <macro id="AC_STRUCT_ST_BLOCKS"> <prototype> </prototype> <synopsis> If <CODE>struct stat</CODE> contains an <CODE>st_blocks</CODE> member, define <CODE>HAVE_STRUCT_STAT_ST_BLOCKS</CODE>. Otherwise, require an <CODE>AC_LIBOBJ</CODE> replacement of <samp>fileblocks</samp>. The former name, <CODE>HAVE_ST_BLOCKS</CODE> is to be avoided, as its support will cease in the future. </synopsis> </macro> <macro id="AC_STRUCT_ST_RDEV"> <prototype> </prototype> <synopsis> If <CODE>struct stat</CODE> contains an <CODE>st_rdev</CODE> member, define <CODE>HAVE_STRUCT_STAT_ST_RDEV</CODE>. The former name for this macro, <CODE>HAVE_ST_RDEV</CODE>, is to be avoided as it will cease to be supported in the future. Actually, even the new macro is obsolete and should be replaced by: <TABLE><tr><td>&nbsp;</td><td class=example><pre> AC_CHECK_MEMBERS([struct stat.st_rdev]) </pre></td></tr></table> </synopsis> </macro> <macro id="AC_STRUCT_TM"> <prototype> </prototype> <synopsis> .h /time.h If <TT>time.h</TT> does not define <CODE>struct tm</CODE>, define <CODE>TM_IN_SYS_TIME</CODE>, which means that including <TT>sys/time.h</TT> had better define <CODE>struct tm</CODE>. </synopsis> </macro> <macro id="AC_STRUCT_TIMEZONE"> <prototype> </prototype> <synopsis> Figure out how to get the current timezone. If <CODE>struct tm</CODE> has a <CODE>tm_zone</CODE> member, define <CODE>HAVE_STRUCT_TM_TM_ZONE</CODE> (and the obsoleted <CODE>HAVE_TM_ZONE</CODE>). Otherwise, if the external array <CODE>tzname</CODE> is found, define <CODE>HAVE_TZNAME</CODE>. </synopsis> </macro> <macro id="AC_CHECK_MEMBER"> <prototype> <parameter content="aggregate.member"/> <parameter content="[action-if-found]"/> <parameter content="[action-if-not-found]"/> <parameter content="[includes= default-includes]"/> </prototype> <synopsis> Check whether <VAR>member</VAR> is a member of the aggregate <VAR>aggregate</VAR>. If no <VAR>includes</VAR> are specified, the default includes are used (Default Includes).</P><P> <TABLE><tr><td>&nbsp;</td><td class=example><pre> AC_CHECK_MEMBER(struct passwd.pw_gecos,, [AC_MSG_ERROR([We need `passwd.pw_gecos'!])], [#include <pwd.h>]) </pre></td></tr></table></P><P> You can use this macro for sub-members:</P><P> <TABLE><tr><td>&nbsp;</td><td class=example><pre> AC_CHECK_MEMBER(struct top.middle.bot) </pre></td></tr></table> </synopsis> </macro> <macro id="AC_CHECK_MEMBERS"> <prototype> <parameter content="members"/> <parameter content="[action-if-found]"/> <parameter content="[action-if-not-found]"/> <parameter content="[includes= default-includes]"/> </prototype> <synopsis> Check for the existence of each <samp><VAR>aggregate</VAR>.<VAR>member</VAR></samp> of <VAR>members</VAR> using the previous macro. When <VAR>member</VAR> belongs to <VAR>aggregate</VAR>, define <CODE>HAVE_<VAR>aggregate</VAR>_<VAR>member</VAR></CODE> (in all capitals, with spaces and dots replaced by underscores). If <VAR>action-if-found</VAR> is given, it is executed for each of the found members. If <VAR>action-if-not-found</VAR> is given, it is executed for each of the members that could not be found.</P><P> This macro uses m4 lists: <TABLE><tr><td>&nbsp;</td><td class=example><pre> AC_CHECK_MEMBERS([struct stat.st_rdev, struct stat.st_blksize]) </pre></td></tr></table> </synopsis> </macro> <macro id="AC_TYPE_GETGROUPS"> <prototype> </prototype> <synopsis> Define <CODE>GETGROUPS_T</CODE> to be whichever of <CODE>gid_t</CODE> or <CODE>int</CODE> is the base type of the array argument to <CODE>getgroups</CODE>. </synopsis> </macro> <macro id="AC_TYPE_MBSTATE_T"> <prototype> </prototype> <synopsis> .h Define <CODE>HAVE_MBSTATE_T</CODE> if <CODE><wchar.h></CODE> declares the <CODE>mbstate_t</CODE> type. Also, define <CODE>mbstate_t</CODE> to be a type if <CODE><wchar.h></CODE> does not declare it. </synopsis> </macro> <macro id="AC_TYPE_MODE_T"> <prototype> </prototype> <synopsis> Equivalent to <samp>AC_CHECK_TYPE(mode_t, int)</samp>. </synopsis> </macro> <macro id="AC_TYPE_OFF_T"> <prototype> </prototype> <synopsis> Equivalent to <samp>AC_CHECK_TYPE(off_t, long)</samp>. </synopsis> </macro> <macro id="AC_TYPE_PID_T"> <prototype> </prototype> <synopsis> Equivalent to <samp>AC_CHECK_TYPE(pid_t, int)</samp>. </synopsis> </macro> <macro id="AC_TYPE_SIGNAL"> <prototype> </prototype> <synopsis> .h If <TT>signal.h</TT> declares <CODE>signal</CODE> as returning a pointer to a function returning <CODE>void</CODE>, define <CODE>RETSIGTYPE</CODE> to be <CODE>void</CODE>; otherwise, define it to be <CODE>int</CODE>.</P><P> Define signal handlers as returning type <CODE>RETSIGTYPE</CODE>:</P><P> <TABLE><tr><td>&nbsp;</td><td class=example><pre> @group RETSIGTYPE hup_handler () <small>...</small> @ @end group </pre></td></tr></table> </synopsis> </macro> <macro id="AC_TYPE_SIZE_T"> <prototype> </prototype> <synopsis> Equivalent to <samp>AC_CHECK_TYPE(size_t, unsigned)</samp>. </synopsis> </macro> <macro id="AC_TYPE_UID_T"> <prototype> </prototype> <synopsis> If <CODE>uid_t</CODE> is not defined, define <CODE>uid_t</CODE> to be <CODE>int</CODE> and <CODE>gid_t</CODE> to be <CODE>int</CODE>. </synopsis> </macro> <macro id="AC_CHECK_TYPE"> <prototype> <parameter content="type"/> <parameter content="[action-if-found]"/> <parameter content="[action-if-not-found]"/> <parameter content="[includes= default-includes]"/> </prototype> <synopsis> Check whether <VAR>type</VAR> is defined. It may be a compiler builtin type or defined by the <VAR>includes</VAR> (Default Includes). </synopsis> </macro> <macro id="AC_CHECK_TYPES"> <prototype> <parameter content="types"/> <parameter content="[action-if-found]"/> <parameter content="[action-if-not-found]"/> <parameter content="[includes= default-includes]"/> </prototype> <synopsis> For each <VAR>type</VAR> of the <VAR>types</VAR> that is defined, define <CODE>HAVE_<VAR>type</VAR></CODE> (in all capitals). If no <VAR>includes</VAR> are specified, the default includes are used (Default Includes). If <VAR>action-if-found</VAR> is given, it is additional shell code to execute when one of the types is found. If <VAR>action-if-not-found</VAR> is given, it is executed when one of the types is not found.</P><P> This macro uses m4 lists: <TABLE><tr><td>&nbsp;</td><td class=example><pre> AC_CHECK_TYPES(ptrdiff_t) AC_CHECK_TYPES([unsigned long long, uintmax_t]) </pre></td></tr></table></P><P> </synopsis> </macro> <macro id="AC_CHECK_SIZEOF"> <prototype> <parameter content="type"/> <parameter content="[unused]"/> <parameter content="[includes= default-includes]"/> </prototype> <synopsis> Define <CODE>SIZEOF_<VAR>type</VAR></CODE> (Standard Symbols) to be the size in bytes of <VAR>type</VAR>. If <samp>type</samp> is unknown, it gets a size of 0. If no <VAR>includes</VAR> are specified, the default includes are used (Default Includes). If you provide <VAR>include</VAR>, be sure to include <TT>stdio.h</TT> which is required for this macro to run.</P><P> This macro now works even when cross-compiling. The <VAR>unused</VAR> argument was used when cross-compiling.</P><P> For example, the call</P><P> <TABLE><tr><td>&nbsp;</td><td class=example><pre> AC_CHECK_SIZEOF(int *) </pre></td></tr></table></P><P> defines <CODE>SIZEOF_INT_P</CODE> to be 8 on DEC Alpha AXP systems. </synopsis> </macro> <macro id="AC_LANG_WERROR"> <prototype> </prototype> <synopsis> Normally Autoconf ignores warnings generated by the compiler, linker, and preprocessor. If this macro is used, warnings will be treated as fatal errors instead for the current language. This macro is useful when the results of configuration will be used where warnings are unacceptable; for instance, if parts of a program are built with the GCC <samp>-Werror</samp> option. If the whole program will be built using <samp>-Werror</samp> it is often simpler to put <samp>-Werror</samp> in the compiler flags (<CODE>CFLAGS</CODE> etc.). </synopsis> </macro> <macro id="AC_PROG_CC"> <prototype> <parameter content="[compiler-search-list]"/> </prototype> <synopsis> Determine a C compiler to use. If <CODE>CC</CODE> is not already set in the environment, check for <CODE>gcc</CODE> and <CODE>cc</CODE>, then for other C compilers. Set output variable <CODE>CC</CODE> to the name of the compiler found.</P><P> This macro may, however, be invoked with an optional first argument which, if specified, must be a space separated list of C compilers to search for. This just gives the user an opportunity to specify an alternative search list for the C compiler. For example, if you didn't like the default order, then you could invoke <CODE>AC_PROG_CC</CODE> like this:</P><P> <TABLE><tr><td>&nbsp;</td><td class=example><pre> AC_PROG_CC(cl egcs gcc cc) </pre></td></tr></table></P><P> If the C compiler is not in ANSI C mode by default, try to add an option to output variable <CODE>CC</CODE> to make it so. This macro tries various options that select ANSI C on some system or another. It considers the compiler to be in ANSI C mode if it handles function prototypes correctly.</P><P> After calling this macro you can check whether the C compiler has been set to accept ANSI C; if not, the shell variable <CODE>ac_cv_prog_cc_stdc</CODE> is set to <samp>no</samp>. If you wrote your source code in ANSI C, you can make an un-ANSIfied copy of it by using the program <CODE>ansi2knr</CODE>, which comes with Automake. See also under <CODE>AC_C_PROTOTYPES</CODE> below.</P><P> If using the GNU C compiler, set shell variable <CODE>GCC</CODE> to <samp>yes</samp>. If output variable <CODE>CFLAGS</CODE> was not already set, set it to <samp>-g -O2</samp> for the GNU C compiler (<samp>-O2</samp> on systems where GCC does not accept <samp>-g</samp>), or <samp>-g</samp> for other compilers. </synopsis> </macro> <macro id="AC_PROG_CC_C_O"> <prototype> </prototype> <synopsis> If the C compiler does not accept the <samp>-c</samp> and <samp>-o</samp> options simultaneously, define <CODE>NO_MINUS_C_MINUS_O</CODE>. This macro actually tests both the compiler found by <CODE>AC_PROG_CC</CODE>, and, if different, the first <CODE>cc</CODE> in the path. The test fails if one fails. This macro was created for GNU Make to choose the default C compilation rule. </synopsis> </macro> <macro id="AC_PROG_CPP"> <prototype> </prototype> <synopsis> Set output variable <CODE>CPP</CODE> to a command that runs the C preprocessor. If <samp>$CC -E</samp> doesn't work, <TT>/lib/cpp</TT> is used. It is only portable to run <CODE>CPP</CODE> on files with a <TT>.c</TT> extension.</P><P> Some preprocessors don't indicate missing include files by the error status. For such preprocessors an internal variable is set that causes other macros to check the standard error from the preprocessor and consider the test failed if any warnings have been reported. For most preprocessors, though, warnings do not cause include-file tests to fail unless <CODE>AC_PROG_CPP_WERROR</CODE> is also specified. </synopsis> </macro> <macro id="AC_PROG_CPP_WERROR"> <prototype> </prototype> <synopsis> This acts like <CODE>AC_PROG_CPP</CODE>, except it treats warnings from the preprocessor as errors even if the preprocessor exit status indicates success. This is useful for avoiding headers that generate mandatory warnings, such as deprecation notices. </synopsis> </macro> <macro id="AC_C_BACKSLASH_A"> <prototype> </prototype> <synopsis> Define <samp>HAVE_C_BACKSLASH_A</samp> to 1 if the C compiler understands <samp>\a</samp>. </synopsis> </macro> <macro id="AC_C_BIGENDIAN"> <prototype> <parameter content="[action-if-true]"/> <parameter content="[action-if-false]"/> <parameter content="[action-if-unknown]"/> </prototype> <synopsis> If words are stored with the most significant byte first (like Motorola and SPARC CPUs), execute <VAR>action-if-true</VAR>. If words are stored with the least significant byte first (like Intel and VAX CPUs), execute <VAR>action-if-false</VAR>.</P><P> This macro runs a test-case if endianness cannot be determined from the system header files. When cross-compiling, the test-case is not run but grep'ed for some magic values. <VAR>action-if-unknown</VAR> is executed if the latter case fails to determine the byte sex of the host system.</P><P> The default for <VAR>action-if-true</VAR> is to define <samp>WORDS_BIGENDIAN</samp>. The default for <VAR>action-if-false</VAR> is to do nothing. And finally, the default for <VAR>action-if-unknown</VAR> is to abort configure and tell the installer which variable he should preset to bypass this test. </synopsis> </macro> <macro id="AC_C_CONST"> <prototype> </prototype> <synopsis> If the C compiler does not fully support the ANSI C qualifier <CODE>const</CODE>, define <CODE>const</CODE> to be empty. Some C compilers that do not define <CODE>__STDC__</CODE> do support <CODE>const</CODE>; some compilers that define <CODE>__STDC__</CODE> do not completely support <CODE>const</CODE>. Programs can simply use <CODE>const</CODE> as if every C compiler supported it; for those that don't, the <TT>Makefile</TT> or configuration header file will define it as empty.</P><P> Occasionally installers use a C++ compiler to compile C code, typically because they lack a C compiler. This causes problems with <CODE>const</CODE>, because C and C++ treat <CODE>const</CODE> differently. For example:</P><P> <TABLE><tr><td>&nbsp;</td><td class=example><pre> const int foo; </pre></td></tr></table></P><P> is valid in C but not in C++. These differences unfortunately cannot be papered over by defining <CODE>const</CODE> to be empty.</P><P> If <CODE>autoconf</CODE> detects this situation, it leaves <CODE>const</CODE> alone, as this generally yields better results in practice. However, using a C++ compiler to compile C code is not recommended or supported, and installers who run into trouble in this area should get a C compiler like GCC to compile their C code. </synopsis> </macro> <macro id="AC_C_RESTRICT"> <prototype> </prototype> <synopsis> If the C compiler recognizes the <CODE>restrict</CODE> keyword, don't do anything. If it recognizes only a variant spelling (<CODE>__restrict</CODE>, <CODE>__restrict__</CODE>, or <CODE>_Restrict</CODE>), then define <CODE>restrict</CODE> to that. Otherwise, define <CODE>restrict</CODE> to be empty. Thus, programs may simply use <CODE>restrict</CODE> as if every C compiler supported it; for those that do not, the <TT>Makefile</TT> or configuration header defines it away.</P><P> Although support in C++ for the <CODE>restrict</CODE> keyword is not required, several C++ compilers do accept the keyword. This macro works for them, too. </synopsis> </macro> <macro id="AC_C_VOLATILE"> <prototype> </prototype> <synopsis> If the C compiler does not understand the keyword <CODE>volatile</CODE>, define <CODE>volatile</CODE> to be empty. Programs can simply use <CODE>volatile</CODE> as if every C compiler supported it; for those that do not, the <TT>Makefile</TT> or configuration header will define it as empty.</P><P> If the correctness of your program depends on the semantics of <CODE>volatile</CODE>, simply defining it to be empty does, in a sense, break your code. However, given that the compiler does not support <CODE>volatile</CODE>, you are at its mercy anyway. At least your program will compile, when it wouldn't before.</P><P> In general, the <CODE>volatile</CODE> keyword is a feature of ANSI C, so you might expect that <CODE>volatile</CODE> is available only when <CODE>__STDC__</CODE> is defined. However, Ultrix 4.3's native compiler does support volatile, but does not define <CODE>__STDC__</CODE>. </synopsis> </macro> <macro id="AC_C_INLINE"> <prototype> </prototype> <synopsis> If the C compiler supports the keyword <CODE>inline</CODE>, do nothing. Otherwise define <CODE>inline</CODE> to <CODE>__inline__</CODE> or <CODE>__inline</CODE> if it accepts one of those, otherwise define <CODE>inline</CODE> to be empty. </synopsis> </macro> <macro id="AC_C_CHAR_UNSIGNED"> <prototype> </prototype> <synopsis> If the C type <CODE>char</CODE> is unsigned, define <CODE>__CHAR_UNSIGNED__</CODE>, unless the C compiler predefines it. </synopsis> </macro> <macro id="AC_C_LONG_DOUBLE"> <prototype> </prototype> <synopsis> If the C compiler supports a working <CODE>long double</CODE> type with more range or precision than the <CODE>double</CODE> type, define <CODE>HAVE_LONG_DOUBLE</CODE>. </synopsis> </macro> <macro id="AC_C_STRINGIZE"> <prototype> </prototype> <synopsis> If the C preprocessor supports the stringizing operator, define <CODE>HAVE_STRINGIZE</CODE>. The stringizing operator is <samp>#</samp> and is found in macros such as this:</P><P> <TABLE><tr><td>&nbsp;</td><td class=example><pre> #define x(y) #y </pre></td></tr></table> </synopsis> </macro> <macro id="AC_C_PROTOTYPES"> <prototype> </prototype> <synopsis> If function prototypes are understood by the compiler (as determined by <CODE>AC_PROG_CC</CODE>), define <CODE>PROTOTYPES</CODE> and <CODE>__PROTOTYPES</CODE>. In the case the compiler does not handle prototypes, you should use <CODE>ansi2knr</CODE>, which comes with the Automake distribution, to unprotoize function definitions. For function prototypes, you should first define <CODE>PARAMS</CODE>:</P><P> <TABLE><tr><td>&nbsp;</td><td class=example><pre> #ifndef PARAMS # if PROTOTYPES # define PARAMS(protos) protos # else /* no PROTOTYPES */ # define PARAMS(protos) () # endif /* no PROTOTYPES */ #endif </pre></td></tr></table></P><P> then use it this way:</P><P> <TABLE><tr><td>&nbsp;</td><td class=example><pre> size_t my_strlen PARAMS ((const char *)); </pre></td></tr></table> </synopsis> </macro> <macro id="AC_PROG_GCC_TRADITIONAL"> <prototype> </prototype> <synopsis> Add <samp>-traditional</samp> to output variable <CODE>CC</CODE> if using the GNU C compiler and <CODE>ioctl</CODE> does not work properly without <samp>-traditional</samp>. That usually happens when the fixed header files have not been installed on an old system. Since recent versions of the GNU C compiler fix the header files automatically when installed, this is becoming a less prevalent problem. </synopsis> </macro> <macro id="AC_PROG_CXX"> <prototype> <parameter content="[compiler-search-list]"/> </prototype> <synopsis> Determine a C++ compiler to use. Check if the environment variable <CODE>CXX</CODE> or <CODE>CCC</CODE> (in that order) is set; if so, then set output variable <CODE>CXX</CODE> to its value.</P><P> Otherwise, if the macro is invoked without an argument, then search for a C++ compiler under the likely names (first <CODE>g++</CODE> and <CODE>c++</CODE> then other names). If none of those checks succeed, then as a last resort set <CODE>CXX</CODE> to <CODE>g++</CODE>.</P><P> This macro may, however, be invoked with an optional first argument which, if specified, must be a space separated list of C++ compilers to search for. This just gives the user an opportunity to specify an alternative search list for the C++ compiler. For example, if you didn't like the default order, then you could invoke <CODE>AC_PROG_CXX</CODE> like this:</P><P> <TABLE><tr><td>&nbsp;</td><td class=example><pre> AC_PROG_CXX(cl KCC CC cxx cc++ xlC aCC c++ g++ egcs gcc) </pre></td></tr></table></P><P> If using the GNU C++ compiler, set shell variable <CODE>GXX</CODE> to <samp>yes</samp>. If output variable <CODE>CXXFLAGS</CODE> was not already set, set it to <samp>-g -O2</samp> for the GNU C++ compiler (<samp>-O2</samp> on systems where G++ does not accept <samp>-g</samp>), or <samp>-g</samp> for other compilers. </synopsis> </macro> <macro id="AC_PROG_CXXCPP"> <prototype> </prototype> <synopsis> Set output variable <CODE>CXXCPP</CODE> to a command that runs the C++ preprocessor. If <samp>$CXX -E</samp> doesn't work, <TT>/lib/cpp</TT> is used. It is only portable to run <CODE>CXXCPP</CODE> on files with a <TT>.c</TT>, <TT>.C</TT>, or <TT>.cc</TT> extension.</P><P> Some preprocessors don't indicate missing include files by the error status. For such preprocessors an internal variable is set that causes other macros to check the standard error from the preprocessor and consider the test failed if any warnings have been reported. However, it is not known whether such broken preprocessors exist for C++. </synopsis> </macro> <macro id="AC_PROG_F77"> <prototype> <parameter content="[compiler-search-list]"/> </prototype> <synopsis> Determine a Fortran 77 compiler to use. If <CODE>F77</CODE> is not already set in the environment, then check for <CODE>g77</CODE> and <CODE>f77</CODE>, and then some other names. Set the output variable <CODE>F77</CODE> to the name of the compiler found.</P><P> This macro may, however, be invoked with an optional first argument which, if specified, must be a space separated list of Fortran 77 compilers to search for. This just gives the user an opportunity to specify an alternative search list for the Fortran 77 compiler. For example, if you didn't like the default order, then you could invoke <CODE>AC_PROG_F77</CODE> like this:</P><P> <TABLE><tr><td>&nbsp;</td><td class=example><pre> AC_PROG_F77(fl32 f77 fort77 xlf g77 f90 xlf90) </pre></td></tr></table></P><P> If using <CODE>g77</CODE> (the GNU Fortran 77 compiler), then <CODE>AC_PROG_F77</CODE> will set the shell variable <CODE>G77</CODE> to <samp>yes</samp>. If the output variable <CODE>FFLAGS</CODE> was not already set in the environment, then set it to <samp>-g -02</samp> for <CODE>g77</CODE> (or <samp>-O2</samp> where <CODE>g77</CODE> does not accept <samp>-g</samp>). Otherwise, set <CODE>FFLAGS</CODE> to <samp>-g</samp> for all other Fortran 77 compilers. </synopsis> </macro> <macro id="AC_PROG_FC"> <prototype> <parameter content="[compiler-search-list]"/> <parameter content="[dialect]"/> </prototype> <synopsis> Determine a Fortran compiler to use. If <CODE>FC</CODE> is not already set in the environment, then <CODE>dialect</CODE> is a hint to indicate what Fortran dialect to search for; the default is to search for the newest available dialect. Set the output variable <CODE>FC</CODE> to the name of the compiler found.</P><P> By default, newer dialects are preferred over older dialects, but if <CODE>dialect</CODE> is specified then older dialects are preferred starting with the specified dialect. <CODE>dialect</CODE> can currently be one of Fortran 77, Fortran 90, or Fortran 95. However, this is only a hint of which compiler <EM>name</EM> to prefer (e.g. <CODE>f90</CODE> or <CODE>f95</CODE>), and no attempt is made to guarantee that a particular language standard is actually supported. Thus, it is preferable that you avoid the <CODE>dialect</CODE> option, and use AC_PROG_FC only for code compatible with the latest Fortran standard.</P><P> This macro may, alternatively, be invoked with an optional first argument which, if specified, must be a space separated list of Fortran compilers to search for, just as in <CODE>AC_PROG_F77</CODE>.</P><P> If the output variable <CODE>FCFLAGS</CODE> was not already set in the environment, then set it to <samp>-g -02</samp> for GNU <CODE>g77</CODE> (or <samp>-O2</samp> where <CODE>g77</CODE> does not accept <samp>-g</samp>). Otherwise, set <CODE>FCFLAGS</CODE> to <samp>-g</samp> for all other Fortran compilers. </synopsis> </macro> <macro id="AC_PROG_F77_C_O"> <prototype> </prototype> <prototype> </prototype> <synopsis> Test if the Fortran compiler accepts the options <samp>-c</samp> and <samp>-o</samp> simultaneously, and define <CODE>F77_NO_MINUS_C_MINUS_O</CODE> or <CODE>FC_NO_MINUS_C_MINUS_O</CODE>, respectively, if it does not. </synopsis> </macro> <macro id="AC_F77_LIBRARY_LDFLAGS"> <prototype> </prototype> <prototype> </prototype> <synopsis> Determine the linker flags (e.g., <samp>-L</samp> and <samp>-l</samp>) for the Fortran intrinsic and run-time libraries that are required to successfully link a Fortran program or shared library. The output variable <CODE>FLIBS</CODE> or <CODE>FCLIBS</CODE> is set to these flags (which should be include after <CODE>LIBS</CODE> when linking).</P><P> This macro is intended to be used in those situations when it is necessary to mix, e.g., C++ and Fortran source code in a single program or shared library (Mixing Fortran 77 With C and C++,,, automake, GNU Automake).</P><P> For example, if object files from a C++ and Fortran compiler must be linked together, then the C++ compiler/linker must be used for linking (since special C++-ish things need to happen at link time like calling global constructors, instantiating templates, enabling exception support, etc.).</P><P> However, the Fortran intrinsic and run-time libraries must be linked in as well, but the C++ compiler/linker doesn't know by default how to add these Fortran 77 libraries. Hence, this macro was created to determine these Fortran libraries.</P><P> The macros <CODE>AC_F77_DUMMY_MAIN</CODE>/<CODE>AC_FC_DUMMY_MAIN</CODE> or <CODE>AC_F77_MAIN</CODE>/<CODE>AC_FC_MAIN</CODE> will probably also be necessary to link C/C++ with Fortran; see below. </synopsis> </macro> <macro id="AC_F77_DUMMY_MAIN"> <prototype> <parameter content="[action-if-found]"/> <parameter content="[action-if-not-found]"/> </prototype> <prototype> <parameter content="[action-if-found]"/> <parameter content="[action-if-not-found]"/> </prototype> <synopsis> With many compilers, the Fortran libraries detected by <CODE>AC_F77_LIBRARY_LDFLAGS</CODE> or <CODE>AC_FC_LIBRARY_LDFLAGS</CODE> provide their own <CODE>main</CODE> entry function that initializes things like Fortran I/O, and which then calls a user-provided entry function named (say) <CODE>MAIN__</CODE> to run the user's program. The <CODE>AC_F77_DUMMY_MAIN</CODE>/<CODE>AC_FC_DUMMY_MAIN</CODE> or <CODE>AC_F77_MAIN</CODE>/<CODE>AC_FC_MAIN</CODE> macro figures out how to deal with this interaction.</P><P> When using Fortran for purely numerical functions (no I/O, etc.)@: often one prefers to provide one's own <CODE>main</CODE> and skip the Fortran library initializations. In this case, however, one may still need to provide a dummy <CODE>MAIN__</CODE> routine in order to prevent linking errors on some systems. <CODE>AC_F77_DUMMY_MAIN</CODE> or <CODE>AC_FC_DUMMY_MAIN</CODE> detects whether any such routine is <EM>required</EM> for linking, and what its name is; the shell variable <CODE>F77_DUMMY_MAIN</CODE> or <CODE>FC_DUMMY_MAIN</CODE> holds this name, <CODE>unknown</CODE> when no solution was found, and <CODE>none</CODE> when no such dummy main is needed.</P><P> By default, <VAR>action-if-found</VAR> defines <CODE>F77_DUMMY_MAIN</CODE> or <CODE>FC_DUMMY_MAIN</CODE> to the name of this routine (e.g., <CODE>MAIN__</CODE>) <EM>if</EM> it is required. action-if-not-found defaults to exiting with an error.</P><P> In order to link with Fortran routines, the user's C/C++ program should then include the following code to define the dummy main if it is needed:</P><P> <TABLE><tr><td>&nbsp;</td><td class=example><pre> #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() return 1; @ #endif </pre></td></tr></table></P><P> (Replace <CODE>F77</CODE> with <CODE>FC</CODE> for Fortran instead of Fortran 77.)</P><P> Note that this macro is called automatically from <CODE>AC_F77_WRAPPERS</CODE> or <CODE>AC_FC_WRAPPERS</CODE>; there is generally no need to call it explicitly unless one wants to change the default actions. </synopsis> </macro> <macro id="AC_F77_MAIN"> <prototype> </prototype> <prototype> </prototype> <synopsis> As discussed above, many Fortran libraries allow you to provide an entry point called (say) <CODE>MAIN__</CODE> instead of the usual <CODE>main</CODE>, which is then called by a <CODE>main</CODE> function in the Fortran libraries that initializes things like Fortran I/O@. The <CODE>AC_F77_MAIN</CODE>/<CODE>AC_FC_MAIN</CODE> macro detects whether it is <EM>possible</EM> to utilize such an alternate main function, and defines <CODE>F77_MAIN</CODE>/<CODE>FC_MAIN</CODE> to the name of the function. (If no alternate main function name is found, <CODE>F77_MAIN</CODE>/<CODE>FC_MAIN</CODE> is simply defined to <CODE>main</CODE>.)</P><P> Thus, when calling Fortran routines from C that perform things like I/O, one should use this macro and name the "main" function <CODE>F77_MAIN</CODE>/<CODE>FC_MAIN</CODE> instead of <CODE>main</CODE>. </synopsis> </macro> <macro id="AC_F77_WRAPPERS"> <prototype> </prototype> <prototype> </prototype> <synopsis> Defines C macros <CODE>F77_FUNC(name,NAME)</CODE>/<CODE>FC_FUNC(name,NAME)</CODE> and <CODE>F77_FUNC_(name,NAME)</CODE>/<CODE>FC_FUNC_(name,NAME)</CODE> to properly mangle the names of C/C++ identifiers, and identifiers with underscores, respectively, so that they match the name-mangling scheme used by the Fortran compiler.</P><P> Fortran is case-insensitive, and in order to achieve this the Fortran compiler converts all identifiers into a canonical case and format. To call a Fortran subroutine from C or to write a C function that is callable from Fortran, the C program must explicitly use identifiers in the format expected by the Fortran compiler. In order to do this, one simply wraps all C identifiers in one of the macros provided by <CODE>AC_F77_WRAPPERS</CODE> or <CODE>AC_FC_WRAPPERS</CODE>. For example, suppose you have the following Fortran 77 subroutine:</P><P> <TABLE><tr><td>&nbsp;</td><td class=example><pre> subroutine foobar(x,y) double precision x, y y = 3.14159 * x return end </pre></td></tr></table></P><P> You would then declare its prototype in C or C++ as:</P><P> <TABLE><tr><td>&nbsp;</td><td class=example><pre> #define FOOBAR_F77 F77_FUNC(foobar,FOOBAR) #ifdef __cplusplus extern "C" /* prevent C++ name mangling */ #endif void FOOBAR_F77(double *x, double *y); </pre></td></tr></table></P><P> Note that we pass both the lowercase and uppercase versions of the function name to <CODE>F77_FUNC</CODE> so that it can select the right one. Note also that all parameters to Fortran 77 routines are passed as pointers (Mixing Fortran 77 With C and C++,,, automake, GNU Automake).</P><P> (Replace <CODE>F77</CODE> with <CODE>FC</CODE> for Fortran instead of Fortran 77.)</P><P> Although Autoconf tries to be intelligent about detecting the name-mangling scheme of the Fortran compiler, there may be Fortran compilers that it doesn't support yet. In this case, the above code will generate a compile-time error, but some other behavior (e.g., disabling Fortran-related features) can be induced by checking whether the <CODE>F77_FUNC</CODE>/<CODE>FC_FUNC</CODE> macro is defined.</P><P> Now, to call that routine from a C program, we would do something like:</P><P> <TABLE><tr><td>&nbsp;</td><td class=example><pre> double x = 2.7183, y; FOOBAR_F77(&x, &y); @ </pre></td></tr></table></P><P> If the Fortran identifier contains an underscore (e.g., <CODE>foo_bar</CODE>), you should use <CODE>F77_FUNC_</CODE>/<CODE>FC_FUNC_</CODE> instead of <CODE>F77_FUNC</CODE>/<CODE>FC_FUNC</CODE> (with the same arguments). This is because some Fortran compilers mangle names differently if they contain an underscore. </synopsis> </macro> <macro id="AC_F77_FUNC"> <prototype> <parameter content="name"/> <parameter content="[shellvar]"/> </prototype> <prototype> <parameter content="name"/> <parameter content="[shellvar]"/> </prototype> <synopsis> Given an identifier <VAR>name</VAR>, set the shell variable <VAR>shellvar</VAR> to hold the mangled version <VAR>name</VAR> according to the rules of the Fortran linker (see also <CODE>AC_F77_WRAPPERS</CODE> or <CODE>AC_FC_WRAPPERS</CODE>). <VAR>shellvar</VAR> is optional; if it is not supplied, the shell variable will be simply <VAR>name</VAR>. The purpose of this macro is to give the caller a way to access the name-mangling information other than through the C preprocessor as above, for example, to call Fortran routines from some language other than C/C++. </synopsis> </macro> <macro id="AC_FC_SRCEXT"> <prototype> <parameter content="ext"/> <parameter content="[action-if-success]"/> <parameter content="[action-if-failure]"/> </prototype> <synopsis> By default, the <CODE>FC</CODE> macros perform their tests using a <TT>.f</TT> extension for source-code files. Some compilers, however, only enable newer language features for appropriately named files, e.g. Fortran 90 features only for <TT>.f90</TT> files. On the other hand, some other compilers expect all source files to end in <TT>.f</TT> and require special flags to support other filename extensions. The <CODE>AC_FC_SRCEXT</CODE> macro deals with both of these issues.</P><P> The <CODE>AC_FC_SRCEXT</CODE> tries to get the <CODE>FC</CODE> compiler to accept files ending with the extension .<VAR>ext</VAR> (i.e. <VAR>ext</VAR> does <EM>not</EM> contain the dot). If any special compiler flags are needed for this, it stores them in the output variable <CODE>FCFLAGS_</CODE><VAR>ext</VAR>. This extension and these flags are then used for all subsequent <CODE>FC</CODE> tests (until <CODE>AC_FC_SRCEXT</CODE> is called again).</P><P> For example, you would use <CODE>AC_FC_SRCEXT(f90)</CODE> to employ the <TT>.f90</TT> extension in future tests, and it would set a <CODE>FCFLAGS_f90</CODE> output variable with any extra flags that are needed to compile such files.</P><P> The <CODE>FCFLAGS_</CODE><VAR>ext</VAR> can <EM>not</EM> be simply absorbed into <CODE>FCFLAGS</CODE>, for two reasons based on the limitations of some compilers. First, only one <CODE>FCFLAGS_</CODE><VAR>ext</VAR> can be used at a time, so files with different extensions must be compiled separately. Second, <CODE>FCFLAGS_</CODE><VAR>ext</VAR> must appear <EM>immediately</EM> before the source-code filename when compiling. So, continuing the example above, you might compile a <TT>foo.f90</TT> file in your Makefile with the command:</P><P> <TABLE><tr><td>&nbsp;</td><td class=example><pre> foo.o: foo.f90 $(FC) -c $(FCFLAGS) $(FCFLAGS_f90) foo.f90 </pre></td></tr></table></P><P> If <CODE>AC_FC_SRCEXT</CODE> succeeds in compiling files with the <VAR>ext</VAR> extension, it calls action-if-success (defaults to nothing). If it fails, and cannot find a way to make the <CODE>FC</CODE> compiler accept such files, it calls action-if-failure (defaults to exiting with an error message).</P><P> </synopsis> </macro> <macro id="AC_FC_FREEFORM"> <prototype> <parameter content="[action-if-success]"/> <parameter content="[action-if-failure]"/> </prototype> <synopsis> </P><P> The <CODE>AC_FC_FREEFORM</CODE> tries to ensure that the Fortran compiler (<CODE>$FC</CODE>) allows free-format source code (as opposed to the older fixed-format style from Fortran 77). If necessary, it may add some additional flags to <CODE>FCFLAGS</CODE>.</P><P> This macro is most important if you are using the default <TT>.f</TT> extension, since many compilers interpret this extension as indicating fixed-format source unless an additional flag is supplied. If you specify a different extension with <CODE>AC_FC_SRCEXT</CODE>, such as <TT>.f90</TT> or <TT>.f95</TT>, then <CODE>AC_FC_FREEFORM</CODE> will ordinarily succeed without modifying <CODE>FCFLAGS</CODE>.</P><P> If <CODE>AC_FC_FREEFORM</CODE> succeeds in compiling free-form source, it calls action-if-success (defaults to nothing). If it fails, it calls action-if-failure (defaults to exiting with an error message). </synopsis> </macro> <macro id="AC_PATH_X"> <prototype> </prototype> <synopsis> Try to locate the X Window System include files and libraries. If the user gave the command line options <samp>--x-includes=<VAR>dir</VAR></samp> and <samp>--x-libraries=<VAR>dir</VAR></samp>, use those directories. If either or both were not given, get the missing values by running <CODE>xmkmf</CODE> on a trivial <TT>Imakefile</TT> and examining the <TT>Makefile</TT> that it produces. If that fails (such as if <CODE>xmkmf</CODE> is not present), look for the files in several directories where they often reside. If either method is successful, set the shell variables <CODE>x_includes</CODE> and <CODE>x_libraries</CODE> to their locations, unless they are in directories the compiler searches by default.</P><P> If both methods fail, or the user gave the command line option <samp>--without-x</samp>, set the shell variable <CODE>no_x</CODE> to <samp>yes</samp>; otherwise set it to the empty string. </synopsis> </macro> <macro id="AC_PATH_XTRA"> <prototype> </prototype> <synopsis> An enhanced version of <CODE>AC_PATH_X</CODE>. It adds the C compiler flags that X needs to output variable <CODE>X_CFLAGS</CODE>, and the X linker flags to <CODE>X_LIBS</CODE>. Define <CODE>X_DISPLAY_MISSING</CODE> if X is not available.</P><P> This macro also checks for special libraries that some systems need in order to compile X programs. It adds any that the system needs to output variable <CODE>X_EXTRA_LIBS</CODE>. And it checks for special X11R6 libraries that need to be linked with before <samp>-lX11</samp>, and adds any found to the output variable <CODE>X_PRE_LIBS</CODE>.</P><P> </synopsis> </macro> <macro id="AC_SYS_INTERPRETER"> <prototype> </prototype> <synopsis> Check whether the system supports starting scripts with a line of the form <samp>#! /bin/csh</samp> to select the interpreter to use for the script. After running this macro, shell code in <TT>configure.ac</TT> can check the shell variable <CODE>interpval</CODE>; it will be set to <samp>yes</samp> if the system supports <samp>#!</samp>, <samp>no</samp> if not. </synopsis> </macro> <macro id="AC_SYS_LARGEFILE"> <prototype> </prototype> <synopsis> Arrange for http://www.unix-systems.org/version2/whatsnew/lfs20mar.html, large-file support. On some hosts, one must use special compiler options to build programs that can access large files. Append any such options to the output variable <CODE>CC</CODE>. Define <CODE>_FILE_OFFSET_BITS</CODE> and <CODE>_LARGE_FILES</CODE> if necessary.</P><P> Large-file support can be disabled by configuring with the <samp>--disable-largefile</samp> option.</P><P> If you use this macro, check that your program works even when <CODE>off_t</CODE> is longer than <CODE>long</CODE>, since this is common when large-file support is enabled. For example, it is not correct to print an arbitrary <CODE>off_t</CODE> value <CODE>X</CODE> with <CODE>printf ("%ld", (long) X)</CODE>.</P><P> The LFS introduced the <CODE>fseeko</CODE> and <CODE>ftello</CODE> functions to replace their C counterparts <CODE>fseek</CODE> and <CODE>ftell</CODE> that do not use <CODE>off_t</CODE>. Take care to use <CODE>AC_FUNC_FSEEKO</CODE> to make their prototypes available when using them and large-file support is enabled. </synopsis> </macro> <macro id="AC_SYS_LONG_FILE_NAMES"> <prototype> </prototype> <synopsis> If the system supports file names longer than 14 characters, define <CODE>HAVE_LONG_FILE_NAMES</CODE>. </synopsis> </macro> <macro id="AC_SYS_POSIX_TERMIOS"> <prototype> </prototype> <synopsis> termios headers POSIX headers Check to see if the POSIX termios headers and functions are available on the system. If so, set the shell variable <CODE>ac_cv_sys_posix_termios</CODE> to <samp>yes</samp>. If not, set the variable to <samp>no</samp>. </synopsis> </macro> <macro id="AC_AIX"> <prototype> </prototype> <synopsis> If on AIX, define <CODE>_ALL_SOURCE</CODE>. Allows the use of some BSD functions. Should be called before any macros that run the C compiler. </synopsis> </macro> <macro id="AC_GNU_SOURCE"> <prototype> </prototype> <synopsis> If using the GNU C library, define <CODE>_GNU_SOURCE</CODE>. Allows the use of some GNU functions. Should be called before any macros that run the C compiler. </synopsis> </macro> <macro id="AC_ISC_POSIX"> <prototype> </prototype> <synopsis> For interactive unix (ISC), add <samp>-lcposix</samp> to output variable <CODE>LIBS</CODE> if necessary for POSIX facilities. Call this after <CODE>AC_PROG_CC</CODE> and before any other macros that use POSIX interfaces. interactive unix is no longer sold, and Sun says that they will drop support for it on 2006-07-23, so this macro is becoming obsolescent. </synopsis> </macro> <macro id="AC_MINIX"> <prototype> </prototype> <synopsis> If on Minix, define <CODE>_MINIX</CODE> and <CODE>_POSIX_SOURCE</CODE> and define <CODE>_POSIX_1_SOURCE</CODE> to be 2. This allows the use of POSIX facilities. Should be called before any macros that run the C compiler. </synopsis> </macro> <macro id="AC_LANG"> <prototype> <parameter content="language"/> </prototype> <synopsis> Do compilation tests using the compiler, preprocessor, and file extensions for the specified <VAR>language</VAR>.</P><P> Supported languages are:</P><P> <DL> <DT>'<SAMP>C</SAMP>' <DD> Do compilation tests using <CODE>CC</CODE> and <CODE>CPP</CODE> and use extension <TT>.c</TT> for test programs. Use compilation flags: <CODE>CPPFLAGS</CODE> with <CODE>CPP</CODE>, and both <CODE>CPPFLAGS</CODE> and <CODE>CFLAGS</CODE> with <CODE>CC</CODE>.</P><P> <DT>'<SAMP>C++</SAMP>' <DD> Do compilation tests using <CODE>CXX</CODE> and <CODE>CXXCPP</CODE> and use extension <TT>.C</TT> for test programs. Use compilation flags: <CODE>CPPFLAGS</CODE> with <CODE>CXXPP</CODE>, and both <CODE>CPPFLAGS</CODE> and <CODE>CXXFLAGS</CODE> with <CODE>CXX</CODE>.</P><P> <DT>'<SAMP>Fortran 77</SAMP>' <DD> Do compilation tests using <CODE>F77</CODE> and use extension <TT>.f</TT> for test programs. Use compilation flags: <CODE>FFLAGS</CODE>.</P><P> <DT>'<SAMP>Fortran</SAMP>' <DD> Do compilation tests using <CODE>FC</CODE> and use extension <TT>.f</TT> (or whatever has been set by <CODE>AC_FC_SRCEXT</CODE>) for test programs. Use compilation flags: <CODE>FCFLAGS</CODE>. </DL> </synopsis> </macro> <macro id="AC_LANG_PUSH"> <prototype> <parameter content="language"/> </prototype> <synopsis> Remember the current language (as set by <CODE>AC_LANG</CODE>) on a stack, and then select the <VAR>language</VAR>. Use this macro and <CODE>AC_LANG_POP</CODE> in macros that need to temporarily switch to a particular language. </synopsis> </macro> <macro id="AC_LANG_POP"> <prototype> <parameter content="[language]"/> </prototype> <synopsis> Select the language that is saved on the top of the stack, as set by <CODE>AC_LANG_PUSH</CODE>, and remove it from the stack.</P><P> If given, <VAR>language</VAR> specifies the language we just <EM>quit</EM>. It is a good idea to specify it when it's known (which should be the case<small>...</small>), since Autoconf will detect inconsistencies.</P><P> <TABLE><tr><td>&nbsp;</td><td class=example><pre> AC_LANG_PUSH(Fortran 77) # Perform some tests on Fortran 77. # <small>...</small> AC_LANG_POP(Fortran 77) </pre></td></tr></table> </synopsis> </macro> <macro id="AC_LANG_ASSERT"> <prototype> <parameter content="language"/> </prototype> <synopsis> Check statically that the current language is <VAR>language</VAR>. You should use this in your language specific macros to avoid that they be called with an inappropriate language.</P><P> This macro runs only at <CODE>autoconf</CODE> time, and incurs no cost at <CODE>configure</CODE> time. Sadly enough and because Autoconf is a two layer language Because M4 is not aware of Sh code, especially conditionals, some optimizations that look nice statically may produce incorrect results at runtime., the macros <CODE>AC_LANG_PUSH</CODE>/<CODE>AC_LANG_POP</CODE> cannot be ``optimizing'', therefore as much as possible you ought to avoid using them to wrap your code, rather, require from the user to run the macro with a correct current language, and check it with <CODE>AC_LANG_ASSERT</CODE>. And anyway, that may help the user understand she is running a Fortran macro while expecting a result about her Fortran 77 compiler... </synopsis> </macro> <macro id="AC_REQUIRE_CPP"> <prototype> </prototype> <synopsis> Ensure that whichever preprocessor would currently be used for tests has been found. Calls <CODE>AC_REQUIRE</CODE> (Prerequisite Macros) with an argument of either <CODE>AC_PROG_CPP</CODE> or <CODE>AC_PROG_CXXCPP</CODE>, depending on which language is current. </synopsis> </macro> <macro id="AC_LANG_CONFTEST"> <prototype> <parameter content="source"/> </prototype> <synopsis> Save the <VAR>source</VAR> text in the current test source file: <TT>conftest.<VAR>extension</VAR></TT> where the <VAR>extension</VAR> depends on the current language.</P><P> Note that the <VAR>source</VAR> is evaluated exactly once, like regular Autoconf macro arguments, and therefore (i) you may pass a macro invocation, (ii) if not, be sure to double quote if needed. </synopsis> </macro> <macro id="AC_LANG_SOURCE"> <prototype> <parameter content="source"/> </prototype> <synopsis> Expands into the <VAR>source</VAR>, with the definition of all the <CODE>AC_DEFINE</CODE> performed so far. </synopsis> </macro> <macro id="AC_LANG_PROGRAM"> <prototype> <parameter content="prologue"/> <parameter content="body"/> </prototype> <synopsis> Expands into a source file which consists of the <VAR>prologue</VAR>, and then <VAR>body</VAR> as body of the main function (e.g., <CODE>main</CODE> in C). Since it uses <CODE>AC_LANG_SOURCE</CODE>, the feature of the latter are available. </synopsis> </macro> <macro id="AC_LANG_CALL"> <prototype> <parameter content="prologue"/> <parameter content="function"/> </prototype> <synopsis> Expands into a source file which consists of the <VAR>prologue</VAR>, and then a call to the <VAR>function</VAR> as body of the main function (e.g., <CODE>main</CODE> in C). Since it uses <CODE>AC_LANG_PROGRAMS</CODE>, the feature of the latter are available.</P><P> This function will probably be replaced in the future by a version which would enable specifying the arguments. The use of this macro is not encouraged, as it violates strongly the typing system. </synopsis> </macro> <macro id="AC_LANG_FUNC_LINK_TRY"> <prototype> <parameter content="function"/> </prototype> <synopsis> Expands into a source file which consists of a pseudo use of the <VAR>function</VAR> as body of the main function (e.g., <CODE>main</CODE> in C): a simple (function pointer) assignment. Since it uses <CODE>AC_LANG_PROGRAMS</CODE>, the feature of the latter are available.</P><P> As <CODE>AC_LANG_CALL</CODE>, this macro is documented only for completeness. It is considered to be severely broken, and in the future will be removed in favor of actual function calls (with properly typed arguments). </synopsis> </macro> <macro id="AC_PREPROC_IFELSE"> <prototype> <parameter content="input"/> <parameter content="[action-if-true]"/> <parameter content="[action-if-false]"/> </prototype> <synopsis> Run the preprocessor of the current language (Language Choice) on the <VAR>input</VAR>, run the shell commands <VAR>action-if-true</VAR> on success, <VAR>action-if-false</VAR> otherwise. The <VAR>input</VAR> can be made by <CODE>AC_LANG_PROGRAM</CODE> and friends.</P><P> This macro uses <CODE>CPPFLAGS</CODE>, but not <CODE>CFLAGS</CODE>, because <samp>-g</samp>, <samp>-O</samp>, etc.@: are not valid options to many C preprocessors.</P><P> It is customary to report unexpected failures with <CODE>AC_MSG_FAILURE</CODE>. </synopsis> </macro> <macro id="AC_EGREP_HEADER"> <prototype> <parameter content="pattern"/> <parameter content="header-file"/> <parameter content="action-if-found"/> <parameter content="[action-if-not-found]"/> </prototype> <synopsis> If the output of running the preprocessor on the system header file <VAR>header-file</VAR> matches the extended regular expression <VAR>pattern</VAR>, execute shell commands <VAR>action-if-found</VAR>, otherwise execute <VAR>action-if-not-found</VAR>. </synopsis> </macro> <macro id="AC_EGREP_CPP"> <prototype> <parameter content="pattern"/> <parameter content="program"/> <parameter content="[action-if-found]"/> <parameter content="[action-if-not-found]"/> </prototype> <synopsis> <VAR>program</VAR> is the text of a C or C++ program, on which shell variable, back quote, and backslash substitutions are performed. If the output of running the preprocessor on <VAR>program</VAR> matches the extended regular expression <VAR>pattern</VAR>, execute shell commands <VAR>action-if-found</VAR>, otherwise execute <VAR>action-if-not-found</VAR>. </synopsis> </macro> <macro id="AC_COMPILE_IFELSE"> <prototype> <parameter content="input"/> <parameter content="[action-if-found]"/> <parameter content="[action-if-not-found]"/> </prototype> <synopsis> Run the compiler and compilation flags of the current language (Language Choice) on the <VAR>input</VAR>, run the shell commands <VAR>action-if-true</VAR> on success, <VAR>action-if-false</VAR> otherwise. The <VAR>input</VAR> can be made by <CODE>AC_LANG_PROGRAM</CODE> and friends.</P><P> It is customary to report unexpected failures with <CODE>AC_MSG_FAILURE</CODE>. This macro does not try to link; use <CODE>AC_LINK_IFELSE</CODE> if you need to do that (Running the Linker). </synopsis> </macro> <macro id="AC_LINK_IFELSE"> <prototype> <parameter content="input"/> <parameter content="[action-if-found]"/> <parameter content="[action-if-not-found]"/> </prototype> <synopsis> Run the compiler (and compilation flags) and the linker of the current language (Language Choice) on the <VAR>input</VAR>, run the shell commands <VAR>action-if-true</VAR> on success, <VAR>action-if-false</VAR> otherwise. The <VAR>input</VAR> can be made by <CODE>AC_LANG_PROGRAM</CODE> and friends.</P><P> <CODE>LDFLAGS</CODE> and <CODE>LIBS</CODE> are used for linking, in addition to the current compilation flags.</P><P> It is customary to report unexpected failures with <CODE>AC_MSG_FAILURE</CODE>. This macro does not try to execute the program; use <CODE>AC_RUN_IFELSE</CODE> if you need to do that (Run Time). </synopsis> </macro> <macro id="AC_RUN_IFELSE"> <prototype> <parameter content="input"/> <parameter content="[action-if-found]"/> <parameter content="[action-if-not-found]"/> <parameter content="[action-if-cross-compiling]"/> </prototype> <synopsis> If <VAR>program</VAR> compiles and links successfully and returns an exit status of 0 when executed, run shell commands <VAR>action-if-true</VAR>. Otherwise, run shell commands <VAR>action-if-false</VAR>.</P><P> The <VAR>input</VAR> can be made by <CODE>AC_LANG_PROGRAM</CODE> and friends. <CODE>LDFLAGS</CODE> and <CODE>LIBS</CODE> are used for linking, in addition to the compilation flags of the current language (Language Choice).</P><P> If the compiler being used does not produce executables that run on the system where <CODE>configure</CODE> is being run, then the test program is not run. If the optional shell commands <VAR>action-if-cross-compiling</VAR> are given, they are run instead. Otherwise, <CODE>configure</CODE> prints an error message and exits.</P><P> In the <VAR>action-if-false</VAR> section, the exit status of the program is available in the shell variable <samp>$?</samp>, but be very careful to limit yourself to positive values smaller than 127; bigger values should be saved into a file by the <VAR>program</VAR>. Note also that you have simply no guarantee that this exit status is issued by the <VAR>program</VAR>, or by the failure of its compilation. In other words, use this feature if sadist only, it was reestablished because the Autoconf maintainers grew tired of receiving ``bug reports''.</P><P> It is customary to report unexpected failures with <CODE>AC_MSG_FAILURE</CODE>. </synopsis> </macro> <macro id="AC_DEFINE"> <prototype> <parameter content="variable"/> <parameter content="value"/> <parameter content="[description]"/> </prototype> <prototype> <parameter content="variable"/> </prototype> <synopsis> Define the C preprocessor variable <VAR>variable</VAR> to <VAR>value</VAR> (verbatim). <VAR>value</VAR> should not contain literal newlines, and if you are not using <CODE>AC_CONFIG_HEADERS</CODE> it should not contain any <samp>#</samp> characters, as <CODE>make</CODE> tends to eat them. To use a shell variable (which you need to do in order to define a value containing the M4 quote characters <samp>[</samp> or <samp>]</samp>), use <CODE>AC_DEFINE_UNQUOTED</CODE> instead. <VAR>description</VAR> is only useful if you are using <CODE>AC_CONFIG_HEADERS</CODE>. In this case, <VAR>description</VAR> is put into the generated <TT>config.h.in</TT> as the comment before the macro define. The following example defines the C preprocessor variable <CODE>EQUATION</CODE> to be the string constant <samp>"$a > $b"</samp>:</P><P> <TABLE><tr><td>&nbsp;</td><td class=example><pre> AC_DEFINE(EQUATION, "$a > $b") </pre></td></tr></table></P><P> If neither <VAR>value</VAR> nor <VAR>description</VAR> are given, then <VAR>value</VAR> defaults to 1 instead of to the empty string. This is for backwards compatibility with older versions of Autoconf, but this usage is obsolescent and may be withdrawn in future versions of Autoconf. </synopsis> </macro> <macro id="AC_DEFINE_UNQUOTED"> <prototype> <parameter content="variable"/> <parameter content="value"/> <parameter content="[description]"/> </prototype> <prototype> <parameter content="variable"/> </prototype> <synopsis> Like <CODE>AC_DEFINE</CODE>, but three shell expansions are performed---once---on <VAR>variable</VAR> and <VAR>value</VAR>: variable expansion (<samp>$</samp>), command substitution (<samp>`</samp>), and backslash escaping (<samp>\</samp>). Single and double quote characters in the value have no special meaning. Use this macro instead of <CODE>AC_DEFINE</CODE> when <VAR>variable</VAR> or <VAR>value</VAR> is a shell variable. Examples:</P><P> <TABLE><tr><td>&nbsp;</td><td class=example><pre> AC_DEFINE_UNQUOTED(config_machfile, "$machfile") AC_DEFINE_UNQUOTED(GETGROUPS_T, $ac_cv_type_getgroups) AC_DEFINE_UNQUOTED($ac_tr_hdr) </pre></td></tr></table> </synopsis> </macro> <macro id="AC_SUBST"> <prototype> <parameter content="variable"/> <parameter content="[value]"/> </prototype> <synopsis> Create an output variable from a shell variable. Make <CODE>AC_OUTPUT</CODE> substitute the variable <VAR>variable</VAR> into output files (typically one or more <TT>Makefile</TT>s). This means that <CODE>AC_OUTPUT</CODE> will replace instances of <samp>@@<VAR>variable</VAR>@@</samp> in input files with the value that the shell variable <VAR>variable</VAR> has when <CODE>AC_OUTPUT</CODE> is called. This value of <VAR>variable</VAR> should not contain literal newlines.</P><P> If <VAR>value</VAR> is given, in addition assign it to <VAR>variable</VAR>. </synopsis> </macro> <macro id="AC_SUBST_FILE"> <prototype> <parameter content="variable"/> </prototype> <synopsis> Another way to create an output variable from a shell variable. Make <CODE>AC_OUTPUT</CODE> insert (without substitutions) the contents of the file named by shell variable <VAR>variable</VAR> into output files. This means that <CODE>AC_OUTPUT</CODE> will replace instances of <samp>@@<VAR>variable</VAR>@@</samp> in output files (such as <TT>Makefile.in</TT>) with the contents of the file that the shell variable <VAR>variable</VAR> names when <CODE>AC_OUTPUT</CODE> is called. Set the variable to <TT>/dev/null</TT> for cases that do not have a file to insert.</P><P> This macro is useful for inserting <TT>Makefile</TT> fragments containing special dependencies or other <CODE>make</CODE> directives for particular host or target types into <TT>Makefile</TT>s. For example, <TT>configure.ac</TT> could contain:</P><P> <TABLE><tr><td>&nbsp;</td><td class=example><pre> AC_SUBST_FILE(host_frag) host_frag=$srcdir/conf/sun4.mh </pre></td></tr></table></P><P> and then a <TT>Makefile.in</TT> could contain:</P><P> <TABLE><tr><td>&nbsp;</td><td class=example><pre> @@host_frag@@ </pre></td></tr></table> </synopsis> </macro> <macro id="AC_ARG_VAR"> <prototype> <parameter content="variable"/> <parameter content="description"/> </prototype> <synopsis> Declare <VAR>variable</VAR> is a precious variable, and include its <VAR>description</VAR> in the variable section of <samp>./configure --help</samp>.</P><P> Being precious means that <UL> <LI> <VAR>variable</VAR> is <CODE>AC_SUBST</CODE>'d.</P><P> <LI> The value of <VAR>variable</VAR> when <CODE>configure</CODE> was launched is saved in the cache, including if it was not specified on the command line but via the environment. Indeed, while <CODE>configure</CODE> can notice the definition of <CODE>CC</CODE> in <samp>./configure CC=bizarre-cc</samp>, it is impossible to notice it in <samp>CC=bizarre-cc ./configure</samp>, which, unfortunately, is what most users do.</P><P> We emphasize that it is the <EM>initial</EM> value of <VAR>variable</VAR> which is saved, not that found during the execution of <CODE>configure</CODE>. Indeed, specifying <samp>./configure FOO=foo</samp> and letting <samp>./configure</samp> guess that <CODE>FOO</CODE> is <CODE>foo</CODE> can be two very different runs.</P><P> <LI> <VAR>variable</VAR> is checked for consistency between two <CODE>configure</CODE> runs. For instance:</P><P> <TABLE><tr><td>&nbsp;</td><td class=example><pre> $ <KBD>./configure --silent --config-cache</KBD> $ <KBD>CC=cc ./configure --silent --config-cache</KBD> configure: error: `CC' was not set in the previous run configure: error: changes in the environment can compromise \ the build configure: error: run `make distclean' and/or \ `rm config.cache' and start over </pre></td></tr></table></P><P> and similarly if the variable is unset, or if its content is changed.</P><P> </P><P> <LI> <VAR>variable</VAR> is kept during automatic reconfiguration (config.status Invocation) as if it had been passed as a command line argument, including when no cache is used:</P><P> <TABLE><tr><td>&nbsp;</td><td class=example><pre> $ <KBD>CC=/usr/bin/cc ./configure undeclared_var=raboof --silent</KBD> $ <KBD>./config.status --recheck</KBD> running /bin/sh ./configure undeclared_var=raboof --silent \ CC=/usr/bin/cc --no-create --no-recursion </pre></td></tr></table> </UL> </synopsis> </macro> <macro id="AC_CACHE_VAL"> <prototype> <parameter content="cache-id"/> <parameter content="commands-to-set-it"/> </prototype> <synopsis> Ensure that the results of the check identified by <VAR>cache-id</VAR> are available. If the results of the check were in the cache file that was read, and <CODE>configure</CODE> was not given the <samp>--quiet</samp> or <samp>--silent</samp> option, print a message saying that the result was cached; otherwise, run the shell commands <VAR>commands-to-set-it</VAR>. If the shell commands are run to determine the value, the value will be saved in the cache file just before <CODE>configure</CODE> creates its output files. , for how to choose the name of the <VAR>cache-id</VAR> variable.</P><P> The <VAR>commands-to-set-it</VAR> <EM>must have no side effects</EM> except for setting the variable <VAR>cache-id</VAR>, see below. </synopsis> </macro> <macro id="AC_CACHE_CHECK"> <prototype> <parameter content="message"/> <parameter content="cache-id"/> <parameter content="commands-to-set-it"/> </prototype> <synopsis> A wrapper for <CODE>AC_CACHE_VAL</CODE> that takes care of printing the messages. This macro provides a convenient shorthand for the most common way to use these macros. It calls <CODE>AC_MSG_CHECKING</CODE> for <VAR>message</VAR>, then <CODE>AC_CACHE_VAL</CODE> with the <VAR>cache-id</VAR> and <VAR>commands</VAR> arguments, and <CODE>AC_MSG_RESULT</CODE> with <VAR>cache-id</VAR>.</P><P> The <VAR>commands-to-set-it</VAR> <EM>must have no side effects</EM> except for setting the variable <VAR>cache-id</VAR>, see below. </synopsis> </macro> <macro id="AC_CACHE_LOAD"> <prototype> </prototype> <synopsis> Loads values from existing cache file, or creates a new cache file if a cache file is not found. Called automatically from <CODE>AC_INIT</CODE>. </synopsis> </macro> <macro id="AC_CACHE_SAVE"> <prototype> </prototype> <synopsis> Flushes all cached values to the cache file. Called automatically from <CODE>AC_OUTPUT</CODE>, but it can be quite useful to call <CODE>AC_CACHE_SAVE</CODE> at key points in <TT>configure.ac</TT>. </synopsis> </macro> <macro id="AC_MSG_CHECKING"> <prototype> <parameter content="feature-description"/> </prototype> <synopsis> Notify the user that <CODE>configure</CODE> is checking for a particular feature. This macro prints a message that starts with <samp>checking </samp> and ends with <samp>...</samp> and no newline. It must be followed by a call to <CODE>AC_MSG_RESULT</CODE> to print the result of the check and the newline. The <VAR>feature-description</VAR> should be something like <samp>whether the Fortran compiler accepts C++ comments</samp> or <samp>for c89</samp>.</P><P> This macro prints nothing if <CODE>configure</CODE> is run with the <samp>--quiet</samp> or <samp>--silent</samp> option. </synopsis> </macro> <macro id="AC_MSG_RESULT"> <prototype> <parameter content="result-description"/> </prototype> <synopsis> Notify the user of the results of a check. <VAR>result-description</VAR> is almost always the value of the cache variable for the check, typically <samp>yes</samp>, <samp>no</samp>, or a file name. This macro should follow a call to <CODE>AC_MSG_CHECKING</CODE>, and the <VAR>result-description</VAR> should be the completion of the message printed by the call to <CODE>AC_MSG_CHECKING</CODE>.</P><P> This macro prints nothing if <CODE>configure</CODE> is run with the <samp>--quiet</samp> or <samp>--silent</samp> option. </synopsis> </macro> <macro id="AC_MSG_NOTICE"> <prototype> <parameter content="message"/> </prototype> <synopsis> Deliver the <VAR>message</VAR> to the user. It is useful mainly to print a general description of the overall purpose of a group of feature checks, e.g.,</P><P> <TABLE><tr><td>&nbsp;</td><td class=example><pre> AC_MSG_NOTICE([checking if stack overflow is detectable]) </pre></td></tr></table></P><P> This macro prints nothing if <CODE>configure</CODE> is run with the <samp>--quiet</samp> or <samp>--silent</samp> option. </synopsis> </macro> <macro id="AC_MSG_ERROR"> <prototype> <parameter content="error-description"/> <parameter content="[exit-status]"/> </prototype> <synopsis> Notify the user of an error that prevents <CODE>configure</CODE> from completing. This macro prints an error message to the standard error output and exits <CODE>configure</CODE> with <VAR>exit-status</VAR> (1 by default). <VAR>error-description</VAR> should be something like <samp>invalid value $HOME for \$HOME</samp>.</P><P> The <VAR>error-description</VAR> should start with a lower-case letter, and ``cannot'' is preferred to ``can't''. </synopsis> </macro> <macro id="AC_MSG_FAILURE"> <prototype> <parameter content="error-description"/> <parameter content="[exit-status]"/> </prototype> <synopsis> This <CODE>AC_MSG_ERROR</CODE> wrapper notifies the user of an error that prevents <CODE>configure</CODE> from completing <EM>and</EM> that additional details are provided in <TT>config.log</TT>. This is typically used when abnormal results are found during a compilation. </synopsis> </macro> <macro id="AC_MSG_WARN"> <prototype> <parameter content="problem-description"/> </prototype> <synopsis> Notify the <CODE>configure</CODE> user of a possible problem. This macro prints the message to the standard error output; <CODE>configure</CODE> continues running afterward, so macros that call <CODE>AC_MSG_WARN</CODE> should provide a default (back-up) behavior for the situations they warn about. <VAR>problem-description</VAR> should be something like <samp>ln -s seems to make hard links</samp>. </synopsis> </macro> <macro id="dnl"> <prototype> </prototype> <synopsis> This macro kept its original name: no <CODE>m4_dnl</CODE> is defined. </synopsis> </macro> <macro id="m4_defn"> <prototype> <parameter content="macro"/> </prototype> <synopsis> Contrary to the M4 builtin, this macro fails if <VAR>macro</VAR> is not defined. See <CODE>m4_undefine</CODE>. </synopsis> </macro> <macro id="m4_exit"> <prototype> <parameter content="exit-status"/> </prototype> <synopsis> This macro corresponds to <CODE>m4exit</CODE>. </synopsis> </macro> <macro id="m4_if"> <prototype> <parameter content="comment"/> </prototype> <prototype> <parameter content="string-1"/> <parameter content="string-2"/> <parameter content="equal"/> <parameter content="[not-equal]"/> </prototype> <prototype> <parameter content="string-1"/> <parameter content="string-2"/> <parameter content="equal"/> <parameter content="..."/> </prototype> <synopsis> This macro corresponds to <CODE>ifelse</CODE>. </synopsis> </macro> <macro id="m4_undefine"> <prototype> <parameter content="macro"/> </prototype> <synopsis> Contrary to the M4 builtin, this macro fails if <VAR>macro</VAR> is not defined. Use</P><P> <TABLE><tr><td>&nbsp;</td><td class=example><pre> m4_ifdef([<VAR>macro</VAR>], [m4_undefine([<VAR>macro</VAR>])]) </pre></td></tr></table></P><P> to recover the behavior of the builtin. </synopsis> </macro> <macro id="m4_bpatsubst"> <prototype> <parameter content="string"/> <parameter content="regexp"/> <parameter content="[replacement]"/> </prototype> <synopsis> This macro corresponds to <CODE>patsubst</CODE>. The name <CODE>m4_patsubst</CODE> is kept for future versions of M4sh, on top of GNU M4 which will provide extended regular expression syntax via <CODE>epatsubst</CODE>. </synopsis> </macro> <macro id="m4_popdef"> <prototype> <parameter content="macro"/> </prototype> <synopsis> Contrary to the M4 builtin, this macro fails if <VAR>macro</VAR> is not defined. See <CODE>m4_undefine</CODE>. </synopsis> </macro> <macro id="m4_bregexp"> <prototype> <parameter content="string"/> <parameter content="regexp"/> <parameter content="[replacement]"/> </prototype> <synopsis> This macro corresponds to <CODE>regexp</CODE>. The name <CODE>m4_regexp</CODE> is kept for future versions of M4sh, on top of GNU M4 which will provide extended regular expression syntax via <CODE>eregexp</CODE>. </synopsis> </macro> <macro id="m4_wrap"> <prototype> <parameter content="text"/> </prototype> <synopsis> This macro corresponds to <CODE>m4wrap</CODE>.</P><P> You are encouraged to end <VAR>text</VAR> with <samp>[]</samp>, so that there are no risks that two consecutive invocations of <CODE>m4_wrap</CODE> result in an unexpected pasting of tokens, as in</P><P> <TABLE><tr><td>&nbsp;</td><td class=example><pre> m4_define([foo], [Foo]) m4_define([bar], [Bar]) m4_define([foobar], [FOOBAR]) m4_wrap([bar]) m4_wrap([foo]) FOOBAR </pre></td></tr></table> </synopsis> </macro> <macro id="m4_dquote"> <prototype> <parameter content="arg1"/> <parameter content="..."/> </prototype> <synopsis> Return the arguments as a quoted list of quoted arguments. </synopsis> </macro> <macro id="m4_quote"> <prototype> <parameter content="arg1"/> <parameter content="..."/> </prototype> <synopsis> Return the arguments as a single entity, i.e., wrap them into a pair of quotes. </synopsis> </macro> <macro id="m4_pattern_forbid"> <prototype> <parameter content="pattern"/> </prototype> <synopsis> Declare that no token matching <VAR>pattern</VAR> must be found in the output. Comments are not checked; this can be a problem if, for instance, you have some macro left unexpanded after an <samp>#include</samp>. No consensus is currently found in the Autoconf community, as some people consider it should be valid to name macros in comments (which doesn't makes sense to the author of this documentation, as <samp>#</samp>-comments should document the output, not the input, documented by <samp>dnl</samp> comments). </synopsis> </macro> <macro id="m4_pattern_allow"> <prototype> <parameter content="pattern"/> </prototype> <synopsis> Any token matching <VAR>pattern</VAR> is allowed, including if it matches an <CODE>m4_pattern_forbid</CODE> pattern. </synopsis> </macro> <macro id="AS_DIRNAME"> <prototype> <parameter content="pathname"/> </prototype> <synopsis> Return the directory portion of <VAR>pathname</VAR>, using the algorithm required by POSIX. , for more details about what this returns and why it is more portable than the <CODE>dirname</CODE> command. </synopsis> </macro> <macro id="AS_IF"> <prototype> <parameter content="test"/> <parameter content="[RUN-IF-TRUE]"/> <parameter content="[RUN-IF-FALSE]"/> </prototype> <synopsis> Run shell code TEST. If TEST exits with a zero status then run shell code RUN-IF-TRUE, else run shell code RUN-IF-FALSE, with simplifications if either RUN-IF-TRUE or RUN-IF-FALSE is empty. </synopsis> </macro> <macro id="AS_MKDIR_P"> <prototype> <parameter content="filename"/> </prototype> <synopsis> Make the directory <VAR>filename</VAR>, including intervening directories as necessary. This is equivalent to <samp>mkdir -p <VAR>filename</VAR></samp>, except that it is portable to older versions of <CODE>mkdir</CODE> that lack support for the <samp>-p</samp> option. </synopsis> </macro> <macro id="AS_SET_CATFILE"> <prototype> <parameter content="var"/> <parameter content="dir"/> <parameter content="file"/> </prototype> <synopsis> Set the shell variable <VAR>var</VAR> to <VAR>dir</VAR>/<VAR>file</VAR>, but optimizing the common cases (<VAR>dir</VAR> or <VAR>file</VAR> is <samp>.</samp>, <VAR>file</VAR> is absolute etc.). </synopsis> </macro> <macro id="AC_DIAGNOSE"> <prototype> <parameter content="category"/> <parameter content="message"/> </prototype> <synopsis> Report <VAR>message</VAR> as a warning (or as an error if requested by the user) if warnings of the <VAR>category</VAR> are turned on. You are encouraged to use standard categories, which currently include:</P><P> <DL> <DT>'<SAMP>all</SAMP>' <DD> messages that don't fall into one of the following categories. Use of an empty <VAR>category</VAR> is equivalent.</P><P> <DT>'<SAMP>cross</SAMP>' <DD> related to cross compilation issues.</P><P> <DT>'<SAMP>obsolete</SAMP>' <DD> use of an obsolete construct.</P><P> <DT>'<SAMP>syntax</SAMP>' <DD> dubious syntactic constructs, incorrectly ordered macro calls. </DL> </synopsis> </macro> <macro id="AC_WARNING"> <prototype> <parameter content="message"/> </prototype> <synopsis> Equivalent to <samp>AC_DIAGNOSE([syntax], <VAR>message</VAR>)</samp>, but you are strongly encouraged to use a finer grained category. </synopsis> </macro> <macro id="AC_FATAL"> <prototype> <parameter content="message"/> </prototype> <synopsis> Report a severe error <VAR>message</VAR>, and have <CODE>autoconf</CODE> die. </synopsis> </macro> <macro id="AC_REQUIRE"> <prototype> <parameter content="macro-name"/> </prototype> <synopsis> If the M4 macro <VAR>macro-name</VAR> has not already been called, call it (without any arguments). Make sure to quote <VAR>macro-name</VAR> with square brackets. <VAR>macro-name</VAR> must have been defined using <CODE>AC_DEFUN</CODE> or else contain a call to <CODE>AC_PROVIDE</CODE> to indicate that it has been called.</P><P> <CODE>AC_REQUIRE</CODE> must be used inside an <CODE>AC_DEFUN</CODE>'d macro; it must not be called from the top level. </synopsis> </macro> <macro id="AC_BEFORE"> <prototype> <parameter content="this-macro-name"/> <parameter content="called-macro-name"/> </prototype> <synopsis> Make M4 print a warning message to the standard error output if <VAR>called-macro-name</VAR> has already been called. <VAR>this-macro-name</VAR> should be the name of the macro that is calling <CODE>AC_BEFORE</CODE>. The macro <VAR>called-macro-name</VAR> must have been defined using <CODE>AC_DEFUN</CODE> or else contain a call to <CODE>AC_PROVIDE</CODE> to indicate that it has been called. </synopsis> </macro> <macro id="AU_DEFUN"> <prototype> <parameter content="old-macro"/> <parameter content="implementation"/> <parameter content="[message]"/> </prototype> <synopsis> Define <VAR>old-macro</VAR> as <VAR>implementation</VAR>. The only difference with <CODE>AC_DEFUN</CODE> is that the user will be warned that <VAR>old-macro</VAR> is now obsolete.</P><P> If she then uses <CODE>autoupdate</CODE>, the call to <VAR>old-macro</VAR> will be replaced by the modern <VAR>implementation</VAR>. The additional <VAR>message</VAR> is then printed. </synopsis> </macro> <macro id="AC_CANONICAL_BUILD"> <prototype> </prototype> <synopsis> Compute the canonical build-system type variable, <CODE>build</CODE>, and its three individual parts <CODE>build_cpu</CODE>, <CODE>build_vendor</CODE>, and <CODE>build_os</CODE>.</P><P> If <samp>--build</samp> was specified, then <CODE>build</CODE> is the canonicalization of <CODE>build_alias</CODE> by <CODE>config.sub</CODE>, otherwise it is determined by the shell script <CODE>config.guess</CODE>. </synopsis> </macro> <macro id="AC_CANONICAL_HOST"> <prototype> </prototype> <synopsis> Compute the canonical host-system type variable, <CODE>host</CODE>, and its three individual parts <CODE>host_cpu</CODE>, <CODE>host_vendor</CODE>, and <CODE>host_os</CODE>.</P><P> If <samp>--host</samp> was specified, then <CODE>host</CODE> is the canonicalization of <CODE>host_alias</CODE> by <CODE>config.sub</CODE>, otherwise it defaults to <CODE>build</CODE>. </synopsis> </macro> <macro id="AC_CANONICAL_TARGET"> <prototype> </prototype> <synopsis> Compute the canonical target-system type variable, <CODE>target</CODE>, and its three individual parts <CODE>target_cpu</CODE>, <CODE>target_vendor</CODE>, and <CODE>target_os</CODE>.</P><P> If <samp>--target</samp> was specified, then <CODE>target</CODE> is the canonicalization of <CODE>target_alias</CODE> by <CODE>config.sub</CODE>, otherwise it defaults to <CODE>host</CODE>. </synopsis> </macro> <macro id="AC_ARG_WITH"> <prototype> <parameter content="package"/> <parameter content="help-string"/> <parameter content="[action-if-given]"/> <parameter content="[action-if-not-given]"/> </prototype> <synopsis> If the user gave <CODE>configure</CODE> the option <samp>--with-<VAR>package</VAR></samp> or <samp>--without-<VAR>package</VAR></samp>, run shell commands <VAR>action-if-given</VAR>. If neither option was given, run shell commands <VAR>action-if-not-given</VAR>. The name <VAR>package</VAR> indicates another software package that this program should work with. It should consist only of alphanumeric characters and dashes.</P><P> The option's argument is available to the shell commands <VAR>action-if-given</VAR> in the shell variable <CODE>withval</CODE>, which is actually just the value of the shell variable <CODE>with_<VAR>package</VAR></CODE>, with any <samp>-</samp> characters changed into <samp>_</samp>. You may use that variable instead, if you wish.</P><P> The argument <VAR>help-string</VAR> is a description of the option that looks like this: <TABLE><tr><td>&nbsp;</td><td class=example><pre> --with-readline support fancy command line editing </pre></td></tr></table></P><P> <VAR>help-string</VAR> may be more than one line long, if more detail is needed. Just make sure the columns line up in <samp>configure --help</samp>. Avoid tabs in the help string. You'll need to enclose the help string in <samp>[</samp> and <samp>]</samp> in order to produce the leading spaces.</P><P> You should format your <VAR>help-string</VAR> with the macro <CODE>AS_HELP_STRING</CODE> (Pretty Help Strings). </synopsis> </macro> <macro id="AC_WITH"> <prototype> <parameter content="package"/> <parameter content="action-if-given"/> <parameter content="[action-if-not-given]"/> </prototype> <synopsis> This is an obsolete version of <CODE>AC_ARG_WITH</CODE> that does not support providing a help string. </synopsis> </macro> <macro id="AC_ARG_ENABLE"> <prototype> <parameter content="feature"/> <parameter content="help-string"/> <parameter content="[action-if-given]"/> <parameter content="[action-if-not-given]"/> </prototype> <synopsis> If the user gave <CODE>configure</CODE> the option <samp>--enable-<VAR>feature</VAR></samp> or <samp>--disable-<VAR>feature</VAR></samp>, run shell commands <VAR>action-if-given</VAR>. If neither option was given, run shell commands <VAR>action-if-not-given</VAR>. The name <VAR>feature</VAR> indicates an optional user-level facility. It should consist only of alphanumeric characters and dashes.</P><P> The option's argument is available to the shell commands <VAR>action-if-given</VAR> in the shell variable <CODE>enableval</CODE>, which is actually just the value of the shell variable <CODE>enable_<VAR>feature</VAR></CODE>, with any <samp>-</samp> characters changed into <samp>_</samp>. You may use that variable instead, if you wish. The <VAR>help-string</VAR> argument is like that of <CODE>AC_ARG_WITH</CODE> (External Software).</P><P> You should format your <VAR>help-string</VAR> with the macro <CODE>AS_HELP_STRING</CODE> (Pretty Help Strings). </synopsis> </macro> <macro id="AC_ENABLE"> <prototype> <parameter content="feature"/> <parameter content="action-if-given"/> <parameter content="[action-if-not-given]"/> </prototype> <synopsis> This is an obsolete version of <CODE>AC_ARG_ENABLE</CODE> that does not support providing a help string. </synopsis> </macro> <macro id="AS_HELP_STRING"> <prototype> <parameter content="left-hand-side"/> <parameter content="right-hand-side"/> </prototype> <synopsis> </P><P> Expands into an help string that looks pretty when the user executes <samp>configure --help</samp>. It is typically used in <CODE>AC_ARG_WITH</CODE> (External Software) or <CODE>AC_ARG_ENABLE</CODE> (Package Options). The following example will make this clearer.</P><P> <TABLE><tr><td>&nbsp;</td><td class=example><pre> AC_DEFUN([TEST_MACRO], [AC_ARG_WITH([foo], AS_HELP_STRING([--with-foo], [use foo (default is NO)]), [ac_cv_use_foo=$withval], [ac_cv_use_foo=no]) AC_CACHE_CHECK([whether to use foo], [ac_cv_use_foo], [ac_cv_use_foo=no])]) </pre></td></tr></table></P><P> Please note that the call to <CODE>AS_HELP_STRING</CODE> is unquoted. Then the last few lines of <samp>configure --help</samp> will appear like this:</P><P> <TABLE><tr><td>&nbsp;</td><td class=example><pre> --enable and --with options recognized: --with-foo use foo (default is NO) </pre></td></tr></table></P><P> The <CODE>AS_HELP_STRING</CODE> macro is particularly helpful when the <VAR>left-hand-side</VAR> and/or <VAR>right-hand-side</VAR> are composed of macro arguments, as shown in the following example.</P><P> <TABLE><tr><td>&nbsp;</td><td class=example><pre> AC_DEFUN(MY_ARG_WITH, [AC_ARG_WITH([$1], AS_HELP_STRING([--with-$1], [use $1 (default is $2)]), ac_cv_use_$1=$withval, ac_cv_use_$1=no), AC_CACHE_CHECK(whether to use $1, ac_cv_use_$1, ac_cv_use_$1=$2)]) </pre></td></tr></table> </synopsis> </macro> <macro id="AC_ARG_PROGRAM"> <prototype> </prototype> <synopsis> Place in output variable <CODE>program_transform_name</CODE> a sequence of <CODE>sed</CODE> commands for changing the names of installed programs.</P><P> If any of the options described below are given to <CODE>configure</CODE>, program names are transformed accordingly. Otherwise, if <CODE>AC_CANONICAL_TARGET</CODE> has been called and a <samp>--target</samp> value is given, the target type followed by a dash is used as a prefix. Otherwise, no program name transformation is done. </synopsis> </macro> <macro id="AC_ALLOCA"> <prototype> </prototype> <synopsis> <CODE>AC_FUNC_ALLOCA</CODE> </synopsis> </macro> <macro id="AC_ARG_ARRAY"> <prototype> </prototype> <synopsis> removed because of limited usefulness </synopsis> </macro> <macro id="AC_C_CROSS"> <prototype> </prototype> <synopsis> This macro is obsolete; it does nothing. </synopsis> </macro> <macro id="AC_CANONICAL_SYSTEM"> <prototype> </prototype> <synopsis> Determine the system type and set output variables to the names of the canonical system types. , for details about the variables this macro sets.</P><P> The user is encouraged to use either <CODE>AC_CANONICAL_BUILD</CODE>, or <CODE>AC_CANONICAL_HOST</CODE>, or <CODE>AC_CANONICAL_TARGET</CODE>, depending on the needs. Using <CODE>AC_CANONICAL_TARGET</CODE> is enough to run the two other macros. </synopsis> </macro> <macro id="AC_CHAR_UNSIGNED"> <prototype> </prototype> <synopsis> <CODE>AC_C_CHAR_UNSIGNED</CODE> </synopsis> </macro> <macro id="AC_CHECKING"> <prototype> <parameter content="feature-description"/> </prototype> <synopsis> Same as <samp>AC_MSG_NOTICE([checking <VAR>feature-description</VAR><small>...</small>]</samp>. </synopsis> </macro> <macro id="AC_COMPILE_CHECK"> <prototype> <parameter content="echo-text"/> <parameter content="includes"/> <parameter content="function-body"/> <parameter content="action-if-found"/> <parameter content="[action-if-not-found]"/> </prototype> <synopsis> This is an obsolete version of <CODE>AC_TRY_COMPILE</CODE> itself replaced by <CODE>AC_COMPILE_IFELSE</CODE> (Running the Compiler), with the addition that it prints <samp>checking for <VAR>echo-text</VAR></samp> to the standard output first, if <VAR>echo-text</VAR> is non-empty. Use <CODE>AC_MSG_CHECKING</CODE> and <CODE>AC_MSG_RESULT</CODE> instead to print messages (Printing Messages). </synopsis> </macro> <macro id="AC_CONST"> <prototype> </prototype> <synopsis> <CODE>AC_C_CONST</CODE> </synopsis> </macro> <macro id="AC_CROSS_CHECK"> <prototype> </prototype> <synopsis> Same as <CODE>AC_C_CROSS</CODE>, which is obsolete too, and does nothing <CODE>:-)</CODE>. </synopsis> </macro> <macro id="AC_CYGWIN"> <prototype> </prototype> <synopsis> Check for the Cygwin environment in which case the shell variable <CODE>CYGWIN</CODE> is set to <samp>yes</samp>. Don't use this macro, the dignified means to check the nature of the host is using <CODE>AC_CANONICAL_HOST</CODE>. As a matter of fact this macro is defined as:</P><P> <TABLE><tr><td>&nbsp;</td><td class=example><pre> AC_REQUIRE([AC_CANONICAL_HOST])[]dnl case $host_os in *cygwin* ) CYGWIN=yes;; * ) CYGWIN=no;; esac </pre></td></tr></table></P><P> Beware that the variable <CODE>CYGWIN</CODE> has a very special meaning when running CygWin32, and should not be changed. That's yet another reason not to use this macro. </synopsis> </macro> <macro id="AC_DECL_SYS_SIGLIST"> <prototype> </prototype> <synopsis> Same as:</P><P> <TABLE><tr><td>&nbsp;</td><td class=example><pre> AC_CHECK_DECLS([sys_siglist],,, [#include <signal.h> /* NetBSD declares sys_siglist in unistd.h. */ #if HAVE_UNISTD_H # include <unistd.h> #endif ]) </pre></td></tr></table> </synopsis> </macro> <macro id="AC_DECL_YYTEXT"> <prototype> </prototype> <synopsis> Does nothing, now integrated in <CODE>AC_PROG_LEX</CODE>. </synopsis> </macro> <macro id="AC_DIR_HEADER"> <prototype> </prototype> <synopsis> Like calling <CODE>AC_FUNC_CLOSEDIR_VOID</CODE> and<CODE>AC_HEADER_DIRENT</CODE>, but defines a different set of C preprocessor macros to indicate which header file is found:</P><P> @multitable {<TT>sys/ndir.h</TT>} {Old Symbol} {<CODE>HAVE_SYS_NDIR_H</CODE>} <LI> Header @tab Old Symbol @tab New Symbol <LI> <TT>dirent.h</TT> @tab <CODE>DIRENT</CODE> @tab <CODE>HAVE_DIRENT_H</CODE> <LI> <TT>sys/ndir.h</TT> @tab <CODE>SYSNDIR</CODE> @tab <CODE>HAVE_SYS_NDIR_H</CODE> <LI> <TT>sys/dir.h</TT> @tab <CODE>SYSDIR</CODE> @tab <CODE>HAVE_SYS_DIR_H</CODE> <LI> <TT>ndir.h</TT> @tab <CODE>NDIR</CODE> @tab <CODE>HAVE_NDIR_H</CODE> @end multitable </synopsis> </macro> <macro id="AC_DYNIX_SEQ"> <prototype> </prototype> <synopsis> If on DYNIX/ptx, add <samp>-lseq</samp> to output variable <CODE>LIBS</CODE>. This macro used to be defined as</P><P> <TABLE><tr><td>&nbsp;</td><td class=example><pre> AC_CHECK_LIB(seq, getmntent, LIBS="-lseq $LIBS") </pre></td></tr></table></P><P> now it is just <CODE>AC_FUNC_GETMNTENT</CODE>. </synopsis> </macro> <macro id="AC_EXEEXT"> <prototype> </prototype> <synopsis> Defined the output variable <CODE>EXEEXT</CODE> based on the output of the compiler, which is now done automatically. Typically set to empty string if Unix and <samp>.exe</samp> if Win32 or OS/2. </synopsis> </macro> <macro id="AC_EMXOS2"> <prototype> </prototype> <synopsis> Similar to <CODE>AC_CYGWIN</CODE> but checks for the EMX environment on OS/2 and sets <CODE>EMXOS2</CODE>. </synopsis> </macro> <macro id="AC_ERROR"> <prototype> </prototype> <synopsis> <CODE>AC_MSG_ERROR</CODE> </synopsis> </macro> <macro id="AC_FIND_X"> <prototype> </prototype> <synopsis> <CODE>AC_PATH_X</CODE> </synopsis> </macro> <macro id="AC_FIND_XTRA"> <prototype> </prototype> <synopsis> <CODE>AC_PATH_XTRA</CODE> </synopsis> </macro> <macro id="AC_FUNC_CHECK"> <prototype> </prototype> <synopsis> <CODE>AC_CHECK_FUNC</CODE> </synopsis> </macro> <macro id="AC_FUNC_WAIT3"> <prototype> </prototype> <synopsis> If <CODE>wait3</CODE> is found and fills in the contents of its third argument (a <samp>struct rusage *</samp>), which HP-UX does not do, define <CODE>HAVE_WAIT3</CODE>.</P><P> These days portable programs should use <CODE>waitpid</CODE>, not <CODE>wait3</CODE>, as <CODE>wait3</CODE> is being removed from the Open Group standards, and will not appear in the next revision of POSIX@. </synopsis> </macro> <macro id="AC_GCC_TRADITIONAL"> <prototype> </prototype> <synopsis> <CODE>AC_PROG_GCC_TRADITIONAL</CODE> </synopsis> </macro> <macro id="AC_GETGROUPS_T"> <prototype> </prototype> <synopsis> <CODE>AC_TYPE_GETGROUPS</CODE> </synopsis> </macro> <macro id="AC_GETLOADAVG"> <prototype> </prototype> <synopsis> <CODE>AC_FUNC_GETLOADAVG</CODE> </synopsis> </macro> <macro id="AC_HAVE_FUNCS"> <prototype> </prototype> <synopsis> <CODE>AC_CHECK_FUNCS</CODE> </synopsis> </macro> <macro id="AC_HAVE_HEADERS"> <prototype> </prototype> <synopsis> <CODE>AC_CHECK_HEADERS</CODE> </synopsis> </macro> <macro id="AC_HAVE_LIBRARY"> <prototype> <parameter content="library"/> <parameter content="[action-if-found]"/> <parameter content="[action-if-not-found]"/> <parameter content="[other-libraries]"/> </prototype> <synopsis> This macro is equivalent to calling <CODE>AC_CHECK_LIB</CODE> with a <VAR>function</VAR> argument of <CODE>main</CODE>. In addition, <VAR>library</VAR> can be written as any of <samp>foo</samp>, <samp>-lfoo</samp>, or <samp>libfoo.a</samp>. In all of those cases, the compiler is passed <samp>-lfoo</samp>. However, <VAR>library</VAR> cannot be a shell variable; it must be a literal name. </synopsis> </macro> <macro id="AC_HAVE_POUNDBANG"> <prototype> </prototype> <synopsis> <CODE>AC_SYS_INTERPRETER</CODE> (different calling convention) </synopsis> </macro> <macro id="AC_HEADER_CHECK"> <prototype> </prototype> <synopsis> <CODE>AC_CHECK_HEADER</CODE> </synopsis> </macro> <macro id="AC_HEADER_EGREP"> <prototype> </prototype> <synopsis> <CODE>AC_EGREP_HEADER</CODE> </synopsis> </macro> <macro id="AC_HELP_STRING"> <prototype> </prototype> <synopsis> <CODE>AS_HELP_STRING</CODE> </synopsis> </macro> <macro id="AC_INLINE"> <prototype> </prototype> <synopsis> <CODE>AC_C_INLINE</CODE> </synopsis> </macro> <macro id="AC_INT_16_BITS"> <prototype> </prototype> <synopsis> If the C type <CODE>int</CODE> is 16 bits wide, define <CODE>INT_16_BITS</CODE>. Use <samp>AC_CHECK_SIZEOF(int)</samp> instead. </synopsis> </macro> <macro id="AC_IRIX_SUN"> <prototype> </prototype> <synopsis> If on irix (Silicon Graphics unix), add <samp>-lsun</samp> to output <CODE>LIBS</CODE>. If you were using it to get <CODE>getmntent</CODE>, use <CODE>AC_FUNC_GETMNTENT</CODE> instead. If you used it for the NIS versions of the password and group functions, use <samp>AC_CHECK_LIB(sun, getpwnam)</samp>. Up to Autoconf 2.13, it used to be</P><P> <TABLE><tr><td>&nbsp;</td><td class=example><pre> AC_CHECK_LIB(sun, getmntent, LIBS="-lsun $LIBS") </pre></td></tr></table></P><P> now it is defined as</P><P> <TABLE><tr><td>&nbsp;</td><td class=example><pre> AC_FUNC_GETMNTENT AC_CHECK_LIB(sun, getpwnam) </pre></td></tr></table> </synopsis> </macro> <macro id="AC_LANG_C"> <prototype> </prototype> <synopsis> Same as <samp>AC_LANG(C)</samp>. </synopsis> </macro> <macro id="AC_LANG_CPLUSPLUS"> <prototype> </prototype> <synopsis> Same as <samp>AC_LANG(C++)</samp>. </synopsis> </macro> <macro id="AC_LANG_FORTRAN77"> <prototype> </prototype> <synopsis> Same as <samp>AC_LANG(Fortran 77)</samp>. </synopsis> </macro> <macro id="AC_LANG_RESTORE"> <prototype> </prototype> <synopsis> Select the <VAR>language</VAR> that is saved on the top of the stack, as set by <CODE>AC_LANG_SAVE</CODE>, remove it from the stack, and call <CODE>AC_LANG(<VAR>language</VAR>)</CODE>. </synopsis> </macro> <macro id="AC_LANG_SAVE"> <prototype> </prototype> <synopsis> Remember the current language (as set by <CODE>AC_LANG</CODE>) on a stack. The current language does not change. <CODE>AC_LANG_PUSH</CODE> is preferred. </synopsis> </macro> <macro id="AC_LINK_FILES"> <prototype> <parameter content="source..."/> <parameter content="dest..."/> </prototype> <synopsis> This is an obsolete version of <CODE>AC_CONFIG_LINKS</CODE>. An updated version of:</P><P> <TABLE><tr><td>&nbsp;</td><td class=example><pre> AC_LINK_FILES(config/$machine.h config/$obj_format.h, host.h object.h) </pre></td></tr></table></P><P> is:</P><P> <TABLE><tr><td>&nbsp;</td><td class=example><pre> AC_CONFIG_LINKS(host.h:config/$machine.h object.h:config/$obj_format.h) </pre></td></tr></table> </synopsis> </macro> <macro id="AC_LN_S"> <prototype> </prototype> <synopsis> <CODE>AC_PROG_LN_S</CODE> </synopsis> </macro> <macro id="AC_LONG_64_BITS"> <prototype> </prototype> <synopsis> Define <CODE>LONG_64_BITS</CODE> if the C type <CODE>long int</CODE> is 64 bits wide. Use the generic macro <samp>AC_CHECK_SIZEOF([long int])</samp> instead. </synopsis> </macro> <macro id="AC_LONG_DOUBLE"> <prototype> </prototype> <synopsis> <CODE>AC_C_LONG_DOUBLE</CODE> </synopsis> </macro> <macro id="AC_LONG_FILE_NAMES"> <prototype> </prototype> <synopsis> <CODE>AC_SYS_LONG_FILE_NAMES</CODE> </synopsis> </macro> <macro id="AC_MAJOR_HEADER"> <prototype> </prototype> <synopsis> <CODE>AC_HEADER_MAJOR</CODE> </synopsis> </macro> <macro id="AC_MEMORY_H"> <prototype> </prototype> <synopsis> Used to define <CODE>NEED_MEMORY_H</CODE> if the <CODE>mem</CODE> functions were defined in <TT>memory.h</TT>. Today it is equivalent to <samp>AC_CHECK_HEADERS(memory.h)</samp>. Adjust your code to depend upon <CODE>HAVE_MEMORY_H</CODE>, not <CODE>NEED_MEMORY_H</CODE>; see Standard Symbols. </synopsis> </macro> <macro id="AC_MINGW32"> <prototype> </prototype> <synopsis> Similar to <CODE>AC_CYGWIN</CODE> but checks for the MingW32 compiler environment and sets <CODE>MINGW32</CODE>. </synopsis> </macro> <macro id="AC_MINUS_C_MINUS_O"> <prototype> </prototype> <synopsis> <CODE>AC_PROG_CC_C_O</CODE> </synopsis> </macro> <macro id="AC_MMAP"> <prototype> </prototype> <synopsis> <CODE>AC_FUNC_MMAP</CODE> </synopsis> </macro> <macro id="AC_MODE_T"> <prototype> </prototype> <synopsis> <CODE>AC_TYPE_MODE_T</CODE> </synopsis> </macro> <macro id="AC_OBJEXT"> <prototype> </prototype> <synopsis> Defined the output variable <CODE>OBJEXT</CODE> based on the output of the compiler, after .c files have been excluded. Typically set to <samp>o</samp> if Unix, <samp>obj</samp> if Win32. Now the compiler checking macros handle this automatically. </synopsis> </macro> <macro id="AC_OBSOLETE"> <prototype> <parameter content="this-macro-name"/> <parameter content="[suggestion]"/> </prototype> <synopsis> Make M4 print a message to the standard error output warning that <VAR>this-macro-name</VAR> is obsolete, and giving the file and line number where it was called. <VAR>this-macro-name</VAR> should be the name of the macro that is calling <CODE>AC_OBSOLETE</CODE>. If <VAR>suggestion</VAR> is given, it is printed at the end of the warning message; for example, it can be a suggestion for what to use instead of <VAR>this-macro-name</VAR>.</P><P> For instance</P><P> <TABLE><tr><td>&nbsp;</td><td class=example><pre> AC_OBSOLETE([$0], [; use AC_CHECK_HEADERS(unistd.h) instead])dnl </pre></td></tr></table></P><P> You are encouraged to use <CODE>AU_DEFUN</CODE> instead, since it gives better services to the user. </synopsis> </macro> <macro id="AC_OFF_T"> <prototype> </prototype> <synopsis> <CODE>AC_TYPE_OFF_T</CODE> </synopsis> </macro> <macro id="AC_OUTPUT_COMMANDS"> <prototype> <parameter content="extra-cmds"/> <parameter content="[init-cmds]"/> </prototype> <synopsis> Specify additional shell commands to run at the end of <TT>config.status</TT>, and shell commands to initialize any variables from <CODE>configure</CODE>. This macro may be called multiple times. It is obsolete, replaced by <CODE>AC_CONFIG_COMMANDS</CODE>.</P><P> Here is an unrealistic example:</P><P> <TABLE><tr><td>&nbsp;</td><td class=example><pre> fubar=27 AC_OUTPUT_COMMANDS([echo this is extra $fubar, and so on.], [fubar=$fubar]) AC_OUTPUT_COMMANDS([echo this is another, extra, bit], [echo init bit]) </pre></td></tr></table></P><P> Aside from the fact that <CODE>AC_CONFIG_COMMANDS</CODE> requires an additional key, an important difference is that <CODE>AC_OUTPUT_COMMANDS</CODE> is quoting its arguments twice, unlike <CODE>AC_CONFIG_COMMANDS</CODE>. This means that <CODE>AC_CONFIG_COMMANDS</CODE> can safely be given macro calls as arguments:</P><P> <TABLE><tr><td>&nbsp;</td><td class=example><pre> AC_CONFIG_COMMANDS(foo, [my_FOO()]) </pre></td></tr></table></P><P> Conversely, where one level of quoting was enough for literal strings with <CODE>AC_OUTPUT_COMMANDS</CODE>, you need two with <CODE>AC_CONFIG_COMMANDS</CODE>. The following lines are equivalent:</P><P> <TABLE><tr><td>&nbsp;</td><td class=example><pre> @group AC_OUTPUT_COMMANDS([echo "Square brackets: []"]) AC_CONFIG_COMMANDS([default], [[echo "Square brackets: []"]]) @end group </pre></td></tr></table> </synopsis> </macro> <macro id="AC_PID_T"> <prototype> </prototype> <synopsis> <CODE>AC_TYPE_PID_T</CODE> </synopsis> </macro> <macro id="AC_PREFIX"> <prototype> </prototype> <synopsis> <CODE>AC_PREFIX_PROGRAM</CODE> </synopsis> </macro> <macro id="AC_PROG_CC_STDC"> <prototype> </prototype> <synopsis> This macro has been integrated into <CODE>AC_PROG_CC</CODE>. </synopsis> </macro> <macro id="AC_PROGRAMS_CHECK"> <prototype> </prototype> <synopsis> <CODE>AC_CHECK_PROGS</CODE> </synopsis> </macro> <macro id="AC_PROGRAMS_PATH"> <prototype> </prototype> <synopsis> <CODE>AC_PATH_PROGS</CODE> </synopsis> </macro> <macro id="AC_PROGRAM_CHECK"> <prototype> </prototype> <synopsis> <CODE>AC_CHECK_PROG</CODE> </synopsis> </macro> <macro id="AC_PROGRAM_EGREP"> <prototype> </prototype> <synopsis> <CODE>AC_EGREP_CPP</CODE> </synopsis> </macro> <macro id="AC_PROGRAM_PATH"> <prototype> </prototype> <synopsis> <CODE>AC_PATH_PROG</CODE> </synopsis> </macro> <macro id="AC_REMOTE_TAPE"> <prototype> </prototype> <synopsis> removed because of limited usefulness </synopsis> </macro> <macro id="AC_RESTARTABLE_SYSCALLS"> <prototype> </prototype> <synopsis> <CODE>AC_SYS_RESTARTABLE_SYSCALLS</CODE> </synopsis> </macro> <macro id="AC_RETSIGTYPE"> <prototype> </prototype> <synopsis> <CODE>AC_TYPE_SIGNAL</CODE> </synopsis> </macro> <macro id="AC_RSH"> <prototype> </prototype> <synopsis> removed because of limited usefulness </synopsis> </macro> <macro id="AC_SCO_INTL"> <prototype> </prototype> <synopsis> If on SCO UNIX, add <samp>-lintl</samp> to output variable <CODE>LIBS</CODE>. This macro used to</P><P> <TABLE><tr><td>&nbsp;</td><td class=example><pre> AC_CHECK_LIB(intl, strftime, LIBS="-lintl $LIBS") </pre></td></tr></table></P><P> Now it just calls <CODE>AC_FUNC_STRFTIME</CODE> instead. </synopsis> </macro> <macro id="AC_SETVBUF_REVERSED"> <prototype> </prototype> <synopsis> <CODE>AC_FUNC_SETVBUF_REVERSED</CODE> </synopsis> </macro> <macro id="AC_SET_MAKE"> <prototype> </prototype> <synopsis> <CODE>AC_PROG_MAKE_SET</CODE> </synopsis> </macro> <macro id="AC_SIZEOF_TYPE"> <prototype> </prototype> <synopsis> <CODE>AC_CHECK_SIZEOF</CODE> </synopsis> </macro> <macro id="AC_SIZE_T"> <prototype> </prototype> <synopsis> <CODE>AC_TYPE_SIZE_T</CODE> </synopsis> </macro> <macro id="AC_STAT_MACROS_BROKEN"> <prototype> </prototype> <synopsis> <CODE>AC_HEADER_STAT</CODE> </synopsis> </macro> <macro id="AC_STDC_HEADERS"> <prototype> </prototype> <synopsis> <CODE>AC_HEADER_STDC</CODE> </synopsis> </macro> <macro id="AC_STRCOLL"> <prototype> </prototype> <synopsis> <CODE>AC_FUNC_STRCOLL</CODE> </synopsis> </macro> <macro id="AC_ST_BLKSIZE"> <prototype> </prototype> <synopsis> <CODE>AC_CHECK_MEMBERS</CODE> </synopsis> </macro> <macro id="AC_ST_BLOCKS"> <prototype> </prototype> <synopsis> <CODE>AC_STRUCT_ST_BLOCKS</CODE> </synopsis> </macro> <macro id="AC_ST_RDEV"> <prototype> </prototype> <synopsis> <CODE>AC_CHECK_MEMBERS</CODE> </synopsis> </macro> <macro id="AC_SYS_RESTARTABLE_SYSCALLS"> <prototype> </prototype> <synopsis> If the system automatically restarts a system call that is interrupted by a signal, define <CODE>HAVE_RESTARTABLE_SYSCALLS</CODE>. This macro does not check if system calls are restarted in general--it tests whether a signal handler installed with <CODE>signal</CODE> (but not <CODE>sigaction</CODE>) causes system calls to be restarted. It does not test if system calls can be restarted when interrupted by signals that have no handler.</P><P> These days portable programs should use <CODE>sigaction</CODE> with <CODE>SA_RESTART</CODE> if they want restartable system calls. They should not rely on <CODE>HAVE_RESTARTABLE_SYSCALLS</CODE>, since nowadays whether a system call is restartable is a dynamic issue, not a configuration-time issue. </synopsis> </macro> <macro id="AC_SYS_SIGLIST_DECLARED"> <prototype> </prototype> <synopsis> <CODE>AC_DECL_SYS_SIGLIST</CODE> </synopsis> </macro> <macro id="AC_TEST_CPP"> <prototype> </prototype> <synopsis> <CODE>AC_TRY_CPP</CODE>, replaced by <CODE>AC_PREPROC_IFELSE</CODE>. </synopsis> </macro> <macro id="AC_TEST_PROGRAM"> <prototype> </prototype> <synopsis> <CODE>AC_TRY_RUN</CODE>, replaced by <CODE>AC_RUN_IFELSE</CODE>. </synopsis> </macro> <macro id="AC_TIMEZONE"> <prototype> </prototype> <synopsis> <CODE>AC_STRUCT_TIMEZONE</CODE> </synopsis> </macro> <macro id="AC_TIME_WITH_SYS_TIME"> <prototype> </prototype> <synopsis> <CODE>AC_HEADER_TIME</CODE> </synopsis> </macro> <macro id="AC_TRY_COMPILE"> <prototype> <parameter content="includes"/> <parameter content="function-body"/> <parameter content="[action-if-found]"/> <parameter content="[action-if-not-found]"/> </prototype> <synopsis> Same as <samp>AC_COMPILE_IFELSE([AC_LANG_SOURCE([[<VAR>includes</VAR>]], [[<VAR>function-body</VAR>]])], [<VAR>action-if-true</VAR>], [<VAR>action-if-false</VAR>])</samp> (Running the Compiler).</P><P> This macro double quotes both <VAR>includes</VAR> and <VAR>function-body</VAR>.</P><P> For C and C++, <VAR>includes</VAR> is any <CODE>#include</CODE> statements needed by the code in <VAR>function-body</VAR> (<VAR>includes</VAR> will be ignored if the currently selected language is Fortran or Fortran 77). The compiler and compilation flags are determined by the current language (Language Choice). </synopsis> </macro> <macro id="AC_TRY_CPP"> <prototype> <parameter content="input"/> <parameter content="[action-if-true]"/> <parameter content="[action-if-false]"/> </prototype> <synopsis> Same as <samp>AC_PREPROC_IFELSE([AC_LANG_SOURCE([[<VAR>input</VAR>]])], [<VAR>action-if-true</VAR>], [<VAR>action-if-false</VAR>])</samp> (Running the Preprocessor).</P><P> This macro double quotes the <VAR>input</VAR>. </synopsis> </macro> <macro id="AC_TRY_LINK"> <prototype> <parameter content="includes"/> <parameter content="function-body"/> <parameter content="[action-if-found]"/> <parameter content="[action-if-not-found]"/> </prototype> <synopsis> Same as <samp>AC_LINK_IFELSE([AC_LANG_SOURCE([[<VAR>includes</VAR>]], [[<VAR>function-body</VAR>]])], [<VAR>action-if-true</VAR>], [<VAR>action-if-false</VAR>])</samp> (Running the Compiler).</P><P> This macro double quotes both <VAR>includes</VAR> and <VAR>function-body</VAR>.</P><P> Depending on the current language (Language Choice), create a test program to see whether a function whose body consists of <VAR>function-body</VAR> can be compiled and linked. If the file compiles and links successfully, run shell commands <VAR>action-if-found</VAR>, otherwise run <VAR>action-if-not-found</VAR>.</P><P> This macro double quotes both <VAR>includes</VAR> and <VAR>function-body</VAR>.</P><P> For C and C++, <VAR>includes</VAR> is any <CODE>#include</CODE> statements needed by the code in <VAR>function-body</VAR> (<VAR>includes</VAR> will be ignored if the currently selected language is Fortran or Fortran 77). The compiler and compilation flags are determined by the current language (Language Choice), and in addition <CODE>LDFLAGS</CODE> and <CODE>LIBS</CODE> are used for linking. </synopsis> </macro> <macro id="AC_TRY_LINK_FUNC"> <prototype> <parameter content="function"/> <parameter content="[action-if-found]"/> <parameter content="[action-if-not-found]"/> </prototype> <synopsis> This macro is equivalent to <samp>AC_LINK_IFELSE([AC_LANG_CALL([[<VAR>includes</VAR>]], [[<VAR>function-body</VAR>]])], [<VAR>action-if-true</VAR>], [<VAR>action-if-false</VAR>])</samp>. </synopsis> </macro> <macro id="AC_TRY_RUN"> <prototype> <parameter content="program"/> <parameter content="[action-if-true]"/> <parameter content="[action-if-false]"/> <parameter content="[action-if-cross-compiling]"/> </prototype> <synopsis> Same as <samp>AC_RUN_IFELSE([AC_LANG_SOURCE([[<VAR>program</VAR>]], [<VAR>action-if-true</VAR>], [<VAR>action-if-false</VAR>], [<VAR>action-if-cross-compiling</VAR>])</samp> (Run Time). </synopsis> </macro> <macro id="AC_UID_T"> <prototype> </prototype> <synopsis> <CODE>AC_TYPE_UID_T</CODE> </synopsis> </macro> <macro id="AC_UNISTD_H"> <prototype> </prototype> <synopsis> Same as <samp>AC_CHECK_HEADERS(unistd.h)</samp>. </synopsis> </macro> <macro id="AC_USG"> <prototype> </prototype> <synopsis> Define <CODE>USG</CODE> if the BSD string functions are defined in <TT>strings.h</TT>. You should no longer depend upon <CODE>USG</CODE>, but on <CODE>HAVE_STRING_H</CODE>; see Standard Symbols. </synopsis> </macro> <macro id="AC_UTIME_NULL"> <prototype> </prototype> <synopsis> <CODE>AC_FUNC_UTIME_NULL</CODE> </synopsis> </macro> <macro id="AC_VALIDATE_CACHED_SYSTEM_TUPLE"> <prototype> <parameter content="[cmd]"/> </prototype> <synopsis> If the cache file is inconsistent with the current host, target and build system types, it used to execute <VAR>cmd</VAR> or print a default error message. This is now handled by default. </synopsis> </macro> <macro id="AC_VERBOSE"> <prototype> <parameter content="result-description"/> </prototype> <synopsis> <CODE>AC_MSG_RESULT</CODE>. </synopsis> </macro> <macro id="AC_VFORK"> <prototype> </prototype> <synopsis> <CODE>AC_FUNC_VFORK</CODE> </synopsis> </macro> <macro id="AC_VPRINTF"> <prototype> </prototype> <synopsis> <CODE>AC_FUNC_VPRINTF</CODE> </synopsis> </macro> <macro id="AC_WAIT3"> <prototype> </prototype> <synopsis> <CODE>AC_FUNC_WAIT3</CODE> </synopsis> </macro> <macro id="AC_WARN"> <prototype> </prototype> <synopsis> <CODE>AC_MSG_WARN</CODE> </synopsis> </macro> <macro id="AC_WORDS_BIGENDIAN"> <prototype> </prototype> <synopsis> <CODE>AC_C_BIGENDIAN</CODE> </synopsis> </macro> <macro id="AC_XENIX_DIR"> <prototype> </prototype> <synopsis> This macro used to add <samp>-lx</samp> to output variable <CODE>LIBS</CODE> if on Xenix. Also, if <TT>dirent.h</TT> is being checked for, added <samp>-ldir</samp> to <CODE>LIBS</CODE>. Now it is merely an alias of <CODE>AC_HEADER_DIRENT</CODE> instead, plus some code to detect whether running xenix on which you should not depend:</P><P> <TABLE><tr><td>&nbsp;</td><td class=example><pre> AC_MSG_CHECKING([for Xenix]) AC_EGREP_CPP(yes, [#if defined M_XENIX && !defined M_UNIX yes #endif], [AC_MSG_RESULT([yes]); XENIX=yes], [AC_MSG_RESULT([no]); XENIX=]) </pre></td></tr></table> </synopsis> </macro> <macro id="AC_YYTEXT_POINTER"> <prototype> </prototype> <synopsis> <CODE>AC_DECL_YYTEXT</CODE> </synopsis> </macro> <macro id="AT_INIT"> <prototype> <parameter content="[name]"/> </prototype> <synopsis> Initialize Autotest. Giving a <VAR>name</VAR> to the test suite is encouraged if your package includes several test suites. In any case, the test suite always displays the package name and version. It also inherits the package bug report address. </synopsis> </macro> <macro id="AT_TESTED"> <prototype> <parameter content="executables"/> </prototype> <synopsis> Log the path and answer to <samp>--version</samp> of each program in space-separated list <VAR>executables</VAR>. Several invocations register new executables, in other words, don't fear registering one program several times. </synopsis> </macro> <macro id="AT_SETUP"> <prototype> <parameter content="test-group-name"/> </prototype> <synopsis> This macro starts a group of related tests, all to be executed in the same subshell. It accepts a single argument, which holds a few words (no more than about 30 or 40 characters) quickly describing the purpose of the test group being started. </synopsis> </macro> <macro id="AT_KEYWORDS"> <prototype> <parameter content="keywords"/> </prototype> <synopsis> Associate the space-separated list of <VAR>keywords</VAR> to the enclosing test group. This makes it possible to run ``slices'' of the test suite. For instance if some of your test groups exercise some <samp>foo</samp> feature, then using <samp>AT_KEYWORDS(foo)</samp> lets you run <samp>./testsuite -k foo</samp> to run exclusively these test groups. The <VAR>title</VAR> of the test group is automatically recorded to <CODE>AT_KEYWORDS</CODE>.</P><P> Several invocations within a test group accumulate new keywords. In other words, don't fear registering several times the same keyword in a test group. </synopsis> </macro> <macro id="AT_XFAIL_IF"> <prototype> <parameter content="shell-condition"/> </prototype> <synopsis> Determine whether the test is expected to fail because it is a known bug (for unsupported features, you should skip the test). <VAR>shell-condition</VAR> is a shell expression such as a <CODE>test</CODE> command; you can instantiate this macro many times from within the same test group, and one of the conditions will be enough to turn the test into an expected failure. </synopsis> </macro> <macro id="AT_CLEANUP"> <prototype> </prototype> <synopsis> End the current test group. </synopsis> </macro> <macro id="AT_DATA"> <prototype> <parameter content="file"/> <parameter content="contents"/> </prototype> <synopsis> Initialize an input data <VAR>file</VAR> with given <VAR>contents</VAR>. Of course, the <VAR>contents</VAR> have to be properly quoted between square brackets to protect against included commas or spurious M4 expansion. The contents ought to end with an end of line. </synopsis> </macro> <macro id="AT_CHECK"> <prototype> <parameter content="commands"/> <parameter content="[status= @samp{0]}"/> <parameter content="[stdout= @samp{]}"/> <parameter content="[stderr= @samp{]}"/> <parameter content="[run-if-fail]"/> <parameter content="[run-if-pass]"/> </prototype> <synopsis> Execute a test by performing given shell <VAR>commands</VAR>. These commands should normally exit with <VAR>status</VAR>, while producing expected <VAR>stdout</VAR> and <VAR>stderr</VAR> contents. If <VAR>commands</VAR> exit with status 77, then the whole test group is skipped. Otherwise, if this test fails, run shell commands <VAR>run-if-fail</VAR> or, if this test passes, run shell commands <VAR>run-if-pass</VAR>.</P><P> The <VAR>commands</VAR> <EM>must not</EM> redirect the standard output, nor the standard error.</P><P> If <VAR>status</VAR>, or <VAR>stdout</VAR>, or <VAR>stderr</VAR> is <samp>ignore</samp>, then the corresponding value is not checked.</P><P> The special value <samp>expout</samp> for <VAR>stdout</VAR> means the expected output of the <VAR>commands</VAR> is the content of the file <TT>expout</TT>. If <VAR>stdout</VAR> is <samp>stdout</samp>, then the standard output of the <VAR>commands</VAR> is available for further tests in the file <TT>stdout</TT>. Similarly for <VAR>stderr</VAR> with <samp>expout</samp> and <samp>stderr</samp>. </synopsis> </macro> <macro id="AC_CONFIG_TESTDIR"> <prototype> <parameter content="directory"/> <parameter content="[test-path= directory]"/> </prototype> <synopsis> An Autotest test suite is to be configured in <VAR>directory</VAR>. This macro requires the instantiation of <TT><VAR>directory</VAR>/atconfig</TT> from <TT><VAR>directory</VAR>/atconfig.in</TT>, and sets the default <CODE>AUTOTEST_PATH</CODE> to <VAR>test-path</VAR> (testsuite Invocation). </synopsis> </macro> </macros>