<!-- 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> shows 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 makefile.</P><P> The auxiliary directory is commonly named <TT>build-aux</TT>. If you need portability to DOS variants, do not name the auxiliary directory <TT>aux</TT>. . </synopsis> </macro> <macro id="AC_REQUIRE_AUX_FILE"> <prototype> <parameter content="file"/> </prototype> <synopsis> Declares that <VAR>file</VAR> is expected in the directory defined above. In Autoconf proper, this macro does nothing: its sole purpose is to be traced by third-party tools to produce a list of expected auxiliary files. For instance it is called by macros like <CODE>AC_PROG_INSTALL</CODE> (Particular Programs) or <CODE>AC_CANONICAL_BUILD</CODE> (Canonicalizing) to register the auxiliary files they need. </synopsis> </macro> <macro id="AC_CONFIG_MACRO_DIR"> <prototype> <parameter content="dir"/> </prototype> <synopsis> Specify <VAR>dir</VAR> as the location of additional local Autoconf macros. This macro is intended for use by future versions of commands like <CODE>autoreconf</CODE> that trace macro calls. It should be called directly from <TT>configure.ac</TT> so that tools that install macros for <CODE>aclocal</CODE> can find the macros' declarations. </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> performs 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 is 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 the Make command, <CODE>$MAKE</CODE> if set or else <samp>make</samp>, predefines <CODE>$(MAKE)</CODE>, define output variable <CODE>SET_MAKE</CODE> to be empty. Otherwise, define <CODE>SET_MAKE</CODE> to a macro definition that sets <CODE>$(MAKE)</CODE>, such as <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, makefiles 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 DOS variants, 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 blank-or-newline-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 DOS variants, or to prepend and/or append boilerplate to the file. </synopsis> </macro> <macro id="AH_HEADER"> <prototype> </prototype> <synopsis> This macro is defined as the name of the first declared config header and undefined if no config headers have been declared up to this point. A third-party macro may, for example, require use of a config header without invoking AC_CONFIG_HEADERS twice, like this:</P><P> <TABLE><tr><td>&nbsp;</td><td class=example><pre> AC_CONFIG_COMMANDS_PRE( [m4_ifndef([AH_HEADER], [AC_CONFIG_HEADERS([config.h])])]) </pre></td></tr></table></P><P> </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> generates 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_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 defined via <CODE>AC_DEFINE</CODE>. </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([timestamp], [date >timestamp]) </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>.</P><P> This macro presents the last opportunity to call <CODE>AC_SUBST</CODE>, <CODE>AC_DEFINE</CODE>, or <CODE>AC_CONFIG_FOOS</CODE> macros. </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 blank-or-newline-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>. Instead, 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 file systems. 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 name for the cache file;</P><P> <LI> adjusting a relative name 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>. Make 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 PATH, 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 PATH contains <TT>/usr/local/gnu/bin/gcc</TT>, set the prefix to <TT>/usr/local/gnu</TT>. </synopsis> </macro> <macro id="AC_INCLUDES_DEFAULT"> <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> #ifdef HAVE_SYS_TYPES_H # include <sys/types.h> #endif #ifdef HAVE_SYS_STAT_H # include <sys/stat.h> #endif #ifdef STDC_HEADERS # include <stdlib.h> # include <stddef.h> #else # ifdef HAVE_STDLIB_H # include <stdlib.h> # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include <memory.h> # endif # include <string.h> #endif #ifdef HAVE_STRINGS_H # include <strings.h> #endif #ifdef HAVE_INTTYPES_H # include <inttypes.h> #endif #ifdef HAVE_STDINT_H # include <stdint.h> #endif #ifdef 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_HEADER_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> is defined, not <CODE>HAVE_STRINGS_H</CODE>. </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_GREP"> <prototype> </prototype> <synopsis> Look for the best available <CODE>grep</CODE> or <CODE>ggrep</CODE> that accepts the longest input lines possible, and that supports multiple <samp>-e</samp> options. Set the output variable <CODE>GREP</CODE> to whatever is chosen. , for more information about portability problems with the <CODE>grep</CODE> command family. </synopsis> </macro> <macro id="AC_PROG_EGREP"> <prototype> </prototype> <synopsis> Check whether <CODE>$GREP -E</CODE> works, or else look for the best available <CODE>egrep</CODE> or <CODE>gegrep</CODE> that accepts the longest input lines possible. Set the output variable <CODE>EGREP</CODE> to whatever is chosen. </synopsis> </macro> <macro id="AC_PROG_FGREP"> <prototype> </prototype> <synopsis> Check whether <CODE>$GREP -F</CODE> works, or else look for the best available <CODE>fgrep</CODE> or <CODE>gfgrep</CODE> that accepts the longest input lines possible. Set the output variable <CODE>FGREP</CODE> to whatever is chosen. </synopsis> </macro> <macro id="AC_PROG_INSTALL"> <prototype> </prototype> <synopsis> Set output variable <CODE>INSTALL</CODE> to the name of a BSD-compatible <CODE>install</CODE> program, if one is found in the current PATH. 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> <samp>@@INSTALL@@</samp> is special, as its value may vary for different configuration files.</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 makefile.</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; otherwise <CODE>configure</CODE> produces 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_MKDIR_P"> <prototype> </prototype> <synopsis> Set output variable <CODE>MKDIR_P</CODE> to a program that ensures that for each argument, a directory named by this argument exists, creating it and its parent directories if needed, and without race conditions when two instances of the program attempt to make the same directory at nearly the same time.</P><P> This macro uses the <samp>mkdir -p</samp> command if possible. Otherwise, it falls back on invoking <CODE>install-sh</CODE> with the <samp>-d</samp> option, so your package should contain <TT>install-sh</TT> as described under <CODE>AC_PROG_INSTALL</CODE>. An <TT>install-sh</TT> file that predates Autoconf 2.60 or Automake 1.10 is vulnerable to race conditions, so if you want to support parallel installs from different packages into the same directory you need to make sure you have an up-to-date <TT>install-sh</TT>. In particular, be careful about using <samp>autoreconf -if</samp> if your Automake predates Automake 1.10.</P><P> This macro is related to the <CODE>AS_MKDIR_P</CODE> macro (Programming in M4sh), but it sets an output variable intended for use in other files, whereas <CODE>AS_MKDIR_P</CODE> is intended for use in scripts like <CODE>configure</CODE>. Also, <CODE>AS_MKDIR_P</CODE> does not accept options, but <CODE>MKDIR_P</CODE> supports the <samp>-m</samp> option, e.g., a makefile might invoke <CODE>$(MKDIR_P) -m 0 dir</CODE> to create an inaccessible directory, and conversely a makefile should use <CODE>$(MKDIR_P) -- $(FOO)</CODE> if <VAR>FOO</VAR> might yield a value that begins with <samp>-</samp>. Finally, <CODE>AS_MKDIR_P</CODE> does not check for race condition vulnerability, whereas <CODE>AC_PROG_MKDIR_P</CODE> does.</P><P> <samp>@@MKDIR_P@@</samp> is special, as its value may vary for different configuration 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> defaults to <samp>char *</samp> instead of to <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 causes 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.</P><P> As part of running the test, this macro may delete any file in the configuration directory named <TT>lex.yy.c</TT> or <TT>lexyy.c</TT>. </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_SED"> <prototype> </prototype> <synopsis> Set output variable <CODE>SED</CODE> to a Sed implementation that conforms to Posix and does not have arbitrary length limits. Report an error if no acceptable Sed is found. , for more information about portability problems with Sed. </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 PATH. 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 blank-separated list <VAR>progs-to-check-for</VAR> existing in the PATH. 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_TARGET_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 target type as determined by <CODE>AC_CANONICAL_TARGET</CODE>, followed by a dash (Canonicalizing). If the tool cannot be found with a prefix, and if the build and target types are equal, then it is also searched for without a prefix.</P><P> As noted in Specifying Names, , Specifying the system type, the target is rarely specified, because most of the time it is the same as the host: it is the type of system for which any compiler tool in the package produces code. What this macro looks for is, for example, <EM>a tool (assembler, linker, etc.)</EM>@: that the compiler driver (<CODE>gcc</CODE> for the GNU C Compiler) uses to produce objects, archives or executables. </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 PATH, or otherwise to <samp>ranlib</samp> if that program exists in PATH, or to <samp>:</samp> if neither program exists.</P><P> In the future, when cross-compiling this macro will <EM>only</EM> accept program names that are prefixed with the host type. For more information, see Specifying Names, , Specifying the system type. </synopsis> </macro> <macro id="AC_CHECK_TARGET_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_TARGET_TOOL</CODE>, each of the tools in the list <VAR>progs-to-check-for</VAR> are checked with a prefix of the target type as determined by <CODE>AC_CANONICAL_TARGET</CODE>, followed by a dash (Canonicalizing). If none of the tools can be found with a prefix, and if the build and target types are equal, 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_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>.</P><P> In the future, when cross-compiling this macro will <EM>not</EM> accept program names that are not prefixed with the host type. </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 absolute name 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 absolute name of the program found. </synopsis> </macro> <macro id="AC_PATH_TARGET_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_TARGET_TOOL</CODE>, but set <VAR>variable</VAR> to the absolute name of the program if it is 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 absolute name of the program if it is found.</P><P> In the future, when cross-compiling this macro will <EM>not</EM> accept program names that are not prefixed with the host type. </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> Test whether the library <VAR>library</VAR> is available by trying to link a test program that calls function <VAR>function</VAR> with the library. <VAR>function</VAR> should be a function provided by the library. Use 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 prepends <samp>-l<VAR>library</VAR></samp> to <CODE>LIBS</CODE> and defines <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. Linkers are 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 fails to detect that <VAR>library</VAR> is present, because linking the test program always fails 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>.</P><P> <CODE>AC_CHECK_LIB</CODE> requires some care in usage, and should be avoided in some common cases. Many standard functions like <CODE>gethostbyname</CODE> appear the standard C library on some hosts, and in special libraries like <CODE>nsl</CODE> on other hosts. On some hosts the special libraries contain variant implementations that you may not want to use. These days it is normally better to use <CODE>AC_SEARCH_LIBS([gethostbyname], [nsl])</CODE> instead of <CODE>AC_CHECK_LIB([nsl], [gethostbyname])</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 fails to detect that <VAR>function</VAR> is present, because linking the test program always fails with unresolved symbols. </synopsis> </macro> <macro id="AC_FUNC_ALLOCA"> <prototype> </prototype> <synopsis> alloca.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>$LIBOBJDIR@</samp>alloca.o 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>. The <samp>$LIBOBJDIR@</samp> prefix serves the same purpose as in <CODE>LIBOBJS</CODE> (AC_LIBOBJ vs LIBOBJS).</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.</P><P> <TABLE><tr><td>&nbsp;</td><td class=example><pre> @group #ifdef HAVE_ALLOCA_H # include <alloca.h> #elif defined __GNUC__ # define alloca __builtin_alloca #elif defined _AIX # define alloca __alloca #elif defined _MSC_VER # include <malloc.h> # define alloca _alloca #else # include <stddef.h> # ifdef __cplusplus extern "C" # endif void *alloca (size_t); #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.</P><P> Currently this test is implemented by running a test program. When cross compiling the pessimistic assumption that <CODE>closedir</CODE> does not return a meaningful value is made.</P><P> This macro is obsolescent, as <CODE>closedir</CODE> returns a meaningful value on current systems. New programs need not use this macro. </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> Unlike the other specific <CODE>AC_FUNC</CODE> macros, <CODE>AC_FUNC_FNMATCH</CODE> does not replace a broken/missing <CODE>fnmatch</CODE>. This is for historical reasons. See <CODE>AC_REPLACE_FNMATCH</CODE> below.</P><P> This macro is obsolescent. New programs should use Gnulib's <CODE>fnmatch-posix</CODE> module. . </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.</P><P> This macro is obsolescent. New programs should use Gnulib's <CODE>fnmatch-gnu</CODE> module. . </synopsis> </macro> <macro id="AC_FUNC_FORK"> <prototype> </prototype> <synopsis> vfork.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 #ifndef 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 necessary 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> nlist.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 set-group-ID (or set-user-ID) 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></P><P> The <CODE>AC_FUNC_GETLOADVG</CODE> macro is obsolescent. New programs should use Gnulib's <CODE>getloadavg</CODE> module. . </synopsis> </macro> <macro id="AC_FUNC_GETMNTENT"> <prototype> </prototype> <synopsis> Check for <CODE>getmntent</CODE> in the standard C library, and then in the <TT>sun</TT>, <TT>seq</TT>, and <TT>gen</TT> libraries, for unicos, 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> #ifdef 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>.</P><P> This macro is obsolescent, as current systems have a <CODE>getpgrp</CODE> whose signature conforms to Posix. New programs need not use this macro. </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> #ifdef 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>.</P><P> This macro is obsolescent, as current systems have a working <CODE>memcmp</CODE>. New programs need not use this macro. </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>. This checks only 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 (NULL, 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>.</P><P> This macro is obsolescent, as current systems have a <CODE>select</CODE> whose signature conforms to Posix. New programs need not use this macro. </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>.</P><P> This macro is obsolescent, as current systems have a <CODE>setpgrp</CODE> whose signature conforms to Posix. New programs need not use this macro. </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.</P><P> These macros are obsolescent, as no current systems have the bug. New programs need not use these macros. </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>.</P><P> This macro is obsolescent, as no current systems have the bug. New programs need not use this macro. </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_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>.</P><P> This macro is obsolescent, as no current systems require the <TT>intl</TT> library for <CODE>strftime</CODE>. New programs need not use this macro. </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_STRTOLD"> <prototype> </prototype> <synopsis> If the <CODE>strtold</CODE> function exists and conforms to C99, define <CODE>HAVE_STRTOLD</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>.</P><P> This macro is obsolescent, as all current systems have a <CODE>utime</CODE> that behaves this way. New programs need not use this macro. </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.)</P><P> This macro is obsolescent, as all current systems have <CODE>vprintf</CODE>. New programs need not use this macro. </synopsis> </macro> <macro id="AC_REPLACE_FNMATCH"> <prototype> </prototype> <synopsis> fnmatch.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>.</P><P> This macro is obsolescent, as it assumes the use of particular source files. New programs should use Gnulib's <CODE>fnmatch-posix</CODE> module, which provides this macro along with the source files. . </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> enumerated in the blank-or-newline-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_CHECK_FUNCS_ONCE"> <prototype> <parameter content="function..."/> </prototype> <synopsis> For each <VAR>function</VAR> enumerated in the blank-or-newline-separated argument list, define <CODE>HAVE_<VAR>function</VAR></CODE> (in all capitals) if it is available. This is a once-only variant of <CODE>AC_CHECK_FUNCS</CODE>. It generates the checking code at most once, so that <CODE>configure</CODE> is smaller and faster; but the checks cannot be conditionalized and are always done once, early during the <CODE>configure</CODE> run. </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 name relative to 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 (iii) when used in conjunction with Automake, within each makefile, <VAR>directory</VAR> is used as a relative path from <CODE>$(top_srcdir)</CODE> to each object named in <CODE>LIBOBJS</CODE> and <CODE>LTLIBOBJS</CODE>, 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>#ifndef 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_ASSERT"> <prototype> </prototype> <synopsis> assert.h Check whether to enable assertions in the style of <TT>assert.h</TT>. Assertions are enabled by default, but the user can override this by invoking <CODE>configure</CODE> with the <samp>--disable-assert</samp> option. </synopsis> </macro> <macro id="AC_HEADER_DIRENT"> <prototype> </prototype> <synopsis> dirent.h sys/ndir.h sys/dir.h ndir.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 #include <sys/types.h> #ifdef HAVE_DIRENT_H # include <dirent.h> # define NAMLEN(dirent) strlen ((dirent)->d_name) #else # define dirent direct # define NAMLEN(dirent) ((dirent)->d_namlen) # ifdef HAVE_SYS_NDIR_H # include <sys/ndir.h> # endif # ifdef HAVE_SYS_DIR_H # include <sys/dir.h> # endif # ifdef 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.</P><P> This macro is obsolescent, as all current systems with directory libraries have <CODE><dirent.h></CODE>. New programs need not use this macro.</P><P> Also see <CODE>AC_STRUCT_DIRENT_D_INO</CODE> and <CODE>AC_STRUCT_DIRENT_D_TYPE</CODE> (Particular Structures). </synopsis> </macro> <macro id="AC_HEADER_MAJOR"> <prototype> </prototype> <synopsis> sys/mkdev.h sys/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_RESOLV"> <prototype> </prototype> <synopsis> resolv.h Checks for header <TT>resolv.h</TT>, checking for prerequisites first. To properly use <TT>resolv.h</TT>, your code should contain something like the following:</P><P> <CODE> #ifdef HAVE_SYS_TYPES_H # include <sys/types.h> #endif #ifdef HAVE_NETINET_IN_H # include <netinet/in.h> /* inet_ functions / structs */ #endif #ifdef HAVE_ARPA_NAMESER_H # include <arpa/nameser.h> /* DNS HEADER struct */ #endif #ifdef HAVE_NETDB_H # include <netdb.h> #endif #include <resolv.h> </CODE> </synopsis> </macro> <macro id="AC_HEADER_STAT"> <prototype> </prototype> <synopsis> sys/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.</P><P> This macro is obsolescent, as no current systems have the bug. New programs need not use this macro. </synopsis> </macro> <macro id="AC_HEADER_STDBOOL"> <prototype> </prototype> <synopsis> stdbool.h system.h If <TT>stdbool.h</TT> exists and conforms 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> could contain the following code:</P><P> <CODE> #ifdef HAVE_STDBOOL_H # include <stdbool.h> #else # ifndef HAVE__BOOL # ifdef __cplusplus typedef bool _Bool; # else # define _Bool signed char # endif # endif # define bool _Bool # define false 0 # define true 1 # define __bool_true_false_are_defined 1 #endif </CODE></P><P> Alternatively you can use the <samp>stdbool</samp> package of Gnulib (Gnulib); it packages the above code into a replacement header and contains a few other bells and whistles.</P><P> </synopsis> </macro> <macro id="AC_HEADER_STDC"> <prototype> </prototype> <synopsis> stdlib.h stdarg.h string.h float.h ctype.h Define <CODE>STDC_HEADERS</CODE> if the system has C header files conforming to ANSI C89 (ISO C90). 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 C89 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 the C standard requires.</P><P> If you use this macro, your code can refer to <CODE>STDC_HEADERS</CODE> to determine whether the system has conforming header files (and probably C library functions).</P><P> This macro is obsolescent, as current systems have conforming header files. New programs need not use this macro.</P><P> string.h strings.h Nowadays <TT>string.h</TT> is part of the C standard and declares functions like <CODE>strcpy</CODE>, and <TT>strings.h</TT> is standardized by Posix and declares BSD functions like <CODE>bcopy</CODE>; but historically, string functions were a major sticking point in this area. If you still want to worry about portability to ancient systems without standard 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 ancient systems contained a mix of functions from the C standard and from BSD; some were mostly standard but lacked <samp>memmove</samp>; some defined the BSD functions as macros in <TT>string.h</TT> or <TT>strings.h</TT>; some had only the BSD functions but <TT>string.h</TT>; some declared 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 had the standard versions of those then it probably had 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> # This example is obsolescent. # Nowadays you can omit these macro calls. 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 /* This example is obsolescent. Nowadays you can just #include <string.h>. */ #ifdef STDC_HEADERS # include <string.h> #else # ifndef HAVE_STRCHR # define strchr index # define strrchr rindex # endif char *strchr (), *strrchr (); # ifndef 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 don't suffice to port to ancient hosts; 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> sys/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> #ifdef HAVE_SYS_WAIT_H # include <sys/wait.h> #endif #ifndef WEXITSTATUS # define WEXITSTATUS(stat_val) ((unsigned int) (stat_val) >> 8) #endif #ifndef WIFEXITED # define WIFEXITED(stat_val) (((stat_val) & 255) == 0) #endif @end group </pre></td></tr></table></P><P> This macro is obsolescent, as current systems are compatible with Posix. New programs need not use this macro. </synopsis> </macro> <macro id="AC_HEADER_TIME"> <prototype> </prototype> <synopsis> time.h sys/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 ancient systems, <TT>sys/time.h</TT> included <TT>time.h</TT>, but <TT>time.h</TT> was not protected against multiple inclusion, so programs could 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 #ifdef TIME_WITH_SYS_TIME # include <sys/time.h> # include <time.h> #else # ifdef HAVE_SYS_TIME_H # include <sys/time.h> # else # include <time.h> # endif #endif @end group </pre></td></tr></table></P><P> This macro is obsolescent, as current systems can include both files when they exist. New programs need not use this macro. </synopsis> </macro> <macro id="AC_HEADER_TIOCGWINSZ"> <prototype> </prototype> <synopsis> sys/ioctl.h termios.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 #ifdef HAVE_TERMIOS_H # include <termios.h> #endif</P><P> #ifdef 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 blank-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_HEADERS_ONCE"> <prototype> <parameter content="header-file..."/> </prototype> <synopsis> For each given system header file <VAR>header-file</VAR> in the blank-separated argument list that exists, define <CODE>HAVE_<VAR>header-file</VAR></CODE> (in all capitals). This is a once-only variant of <CODE>AC_CHECK_HEADERS</CODE>. It generates the checking code at most once, so that <CODE>configure</CODE> is smaller and faster; but the checks cannot be conditionalized and are always done once, early during the <CODE>configure</CODE> run. </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, variable, or constant) 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 <VAR>symbol</VAR> is defined as a macro or can be used as an r-value, not whether it is really declared, because it is much safer to avoid introducing extra declarations when they are not needed. </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> in <CODE>#if</CODE>:</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_CHECK_DECLS_ONCE"> <prototype> <parameter content="symbols"/> </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 in the default include files, otherwise to <samp>0</samp>. This is a once-only variant of <CODE>AC_CHECK_DECLS</CODE>. It generates the checking code at most once, so that <CODE>configure</CODE> is smaller and faster; but the checks cannot be conditionalized and are always done once, early during the <CODE>configure</CODE> run. </synopsis> </macro> <macro id="AC_STRUCT_DIRENT_D_INO"> <prototype> </prototype> <synopsis> Perform all the actions of <CODE>AC_HEADER_DIRENT</CODE> (Particular Headers). Then, if <CODE>struct dirent</CODE> contains a <CODE>d_ino</CODE> member, define <CODE>HAVE_STRUCT_DIRENT_D_INO</CODE>.</P><P> <CODE>HAVE_STRUCT_DIRENT_D_INO</CODE> indicates only the presence of <CODE>d_ino</CODE>, not whether its contents are always reliable. Traditionally, a zero <CODE>d_ino</CODE> indicated a deleted directory entry, though current systems hide this detail from the user and never return zero <CODE>d_ino</CODE> values. Many current systems report an incorrect <CODE>d_ino</CODE> for a directory entry that is a mount point. </synopsis> </macro> <macro id="AC_STRUCT_DIRENT_D_TYPE"> <prototype> </prototype> <synopsis> Perform all the actions of <CODE>AC_HEADER_DIRENT</CODE> (Particular Headers). Then, if <CODE>struct dirent</CODE> contains a <CODE>d_type</CODE> member, define <CODE>HAVE_STRUCT_DIRENT_D_TYPE</CODE>. </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> time.h sys/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>.</P><P> This macro is obsolescent, as <TT>time.h</TT> defines <CODE>struct tm</CODE> in current systems. New programs need not use this macro. </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>; if it is declared, define <CODE>HAVE_DECL_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 submembers:</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_INT8_T"> <prototype> </prototype> <synopsis> If <TT>stdint.h</TT> or <TT>inttypes.h</TT> defines the type <CODE>int8_t</CODE>, define <CODE>HAVE_INT8_T</CODE>. Otherwise, define <CODE>int8_t</CODE> to a signed integer type that is exactly 8 bits wide and that uses two's complement representation, if such a type exists. </synopsis> </macro> <macro id="AC_TYPE_INT16_T"> <prototype> </prototype> <synopsis> This is like <CODE>AC_TYPE_INT8_T</CODE>, except for 16-bit integers. </synopsis> </macro> <macro id="AC_TYPE_INT32_T"> <prototype> </prototype> <synopsis> This is like <CODE>AC_TYPE_INT8_T</CODE>, except for 32-bit integers. </synopsis> </macro> <macro id="AC_TYPE_INT64_T"> <prototype> </prototype> <synopsis> This is like <CODE>AC_TYPE_INT8_T</CODE>, except for 64-bit integers. </synopsis> </macro> <macro id="AC_TYPE_INTMAX_T"> <prototype> </prototype> <synopsis> If <TT>stdint.h</TT> or <TT>inttypes.h</TT> defines the type <CODE>intmax_t</CODE>, define <CODE>HAVE_INTMAX_T</CODE>. Otherwise, define <CODE>intmax_t</CODE> to the widest signed integer type. </synopsis> </macro> <macro id="AC_TYPE_INTPTR_T"> <prototype> </prototype> <synopsis> If <TT>stdint.h</TT> or <TT>inttypes.h</TT> defines the type <CODE>intptr_t</CODE>, define <CODE>HAVE_INTPTR_T</CODE>. Otherwise, define <CODE>intptr_t</CODE> to a signed integer type wide enough to hold a pointer, if such a type exists. </synopsis> </macro> <macro id="AC_TYPE_LONG_DOUBLE"> <prototype> </prototype> <synopsis> If the C compiler supports a working <CODE>long double</CODE> type, define <CODE>HAVE_LONG_DOUBLE</CODE>. The <CODE>long double</CODE> type might have the same range and precision as <CODE>double</CODE>. </synopsis> </macro> <macro id="AC_TYPE_LONG_DOUBLE_WIDER"> <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_WIDER</CODE>. </synopsis> </macro> <macro id="AC_TYPE_LONG_LONG_INT"> <prototype> </prototype> <synopsis> If the C compiler supports a working <CODE>long long int</CODE> type, define <CODE>HAVE_LONG_LONG_INT</CODE>. </synopsis> </macro> <macro id="AC_TYPE_MBSTATE_T"> <prototype> </prototype> <synopsis> wchar.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> Define <CODE>mode_t</CODE> to a suitable type, if standard headers do not define it. </synopsis> </macro> <macro id="AC_TYPE_OFF_T"> <prototype> </prototype> <synopsis> Define <CODE>off_t</CODE> to a suitable type, if standard headers do not define it. </synopsis> </macro> <macro id="AC_TYPE_PID_T"> <prototype> </prototype> <synopsis> Define <CODE>pid_t</CODE> to a suitable type, if standard headers do not define it. </synopsis> </macro> <macro id="AC_TYPE_SIGNAL"> <prototype> </prototype> <synopsis> signal.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> Define <CODE>size_t</CODE> to a suitable type, if standard headers do not define it. </synopsis> </macro> <macro id="AC_TYPE_SSIZE_T"> <prototype> </prototype> <synopsis> Define <CODE>ssize_t</CODE> to a suitable type, if standard headers do not define it. </synopsis> </macro> <macro id="AC_TYPE_UID_T"> <prototype> </prototype> <synopsis> Define <CODE>uid_t</CODE> and <CODE>gid_t</CODE> to suitable types, if standard headers do not define them. </synopsis> </macro> <macro id="AC_TYPE_UINT8_T"> <prototype> </prototype> <synopsis> If <TT>stdint.h</TT> or <TT>inttypes.h</TT> defines the type <CODE>uint8_t</CODE>, define <CODE>HAVE_UINT8_T</CODE>. Otherwise, define <CODE>uint8_t</CODE> to an unsigned integer type that is exactly 8 bits wide, if such a type exists. </synopsis> </macro> <macro id="AC_TYPE_UINT16_T"> <prototype> </prototype> <synopsis> This is like <CODE>AC_TYPE_UINT8_T</CODE>, except for 16-bit unsigned integers. </synopsis> </macro> <macro id="AC_TYPE_UINT32_T"> <prototype> </prototype> <synopsis> This is like <CODE>AC_TYPE_UINT8_T</CODE>, except for 32-bit unsigned integers. </synopsis> </macro> <macro id="AC_TYPE_UINT64_T"> <prototype> </prototype> <synopsis> This is like <CODE>AC_TYPE_UINT8_T</CODE>, except for 64-bit unsigned integers. </synopsis> </macro> <macro id="AC_TYPE_UINTMAX_T"> <prototype> </prototype> <synopsis> If <TT>stdint.h</TT> or <TT>inttypes.h</TT> defines the type <CODE>uintmax_t</CODE>, define <CODE>HAVE_UINTMAX_T</CODE>. Otherwise, define <CODE>uintmax_t</CODE> to the widest unsigned integer type. </synopsis> </macro> <macro id="AC_TYPE_UINTPTR_T"> <prototype> </prototype> <synopsis> If <TT>stdint.h</TT> or <TT>inttypes.h</TT> defines the type <CODE>uintptr_t</CODE>, define <CODE>HAVE_UINTPTR_T</CODE>. Otherwise, define <CODE>uintptr_t</CODE> to an unsigned integer type wide enough to hold a pointer, if such a type exists. </synopsis> </macro> <macro id="AC_TYPE_UNSIGNED_LONG_LONG_INT"> <prototype> </prototype> <synopsis> If the C compiler supports a working <CODE>unsigned long long int</CODE> type, define <CODE>HAVE_UNSIGNED_LONG_LONG_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 int, 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).</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_CHECK_ALIGNOF"> <prototype> <parameter content="type"/> <parameter content="[includes= default-includes]"/> </prototype> <synopsis> Define <CODE>ALIGNOF_<VAR>type</VAR></CODE> (Standard Symbols) to be the alignment 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). </synopsis> </macro> <macro id="AC_COMPUTE_INT"> <prototype> <parameter content="var"/> <parameter content="expression"/> <parameter content="[includes= default-includes]"/> <parameter content="[action-if-fails]"/> </prototype> <synopsis> Store into the shell variable <VAR>var</VAR> the value of the integer <VAR>expression</VAR>. The value should fit in an initializer in a C variable of type <CODE>signed long</CODE>. To support cross compilation (in which case, the macro only works on hosts that use twos-complement arithmetic), it should be possible to evaluate the expression at compile-time. If no <VAR>includes</VAR> are specified, the default includes are used (Default Includes).</P><P> Execute <VAR>action-if-fails</VAR> if the value cannot be determined correctly. </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 count as fatal errors for the current language. This macro is useful when the results of configuration are 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 is 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 blank-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([gcc cl cc]) </pre></td></tr></table></P><P> If the C compiler does not handle function prototypes correctly by default, try to add an option to output variable <CODE>CC</CODE> to make it so. This macro tries various options that select standard-conformance modes on various systems.</P><P> After calling this macro you can check whether the C compiler has been set to accept ANSI C89 (ISO C90); if not, the shell variable <CODE>ac_cv_prog_cc_c89</CODE> is set to <samp>no</samp>. See also <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_PROG_CC_STDC"> <prototype> </prototype> <synopsis> If the C compiler cannot compile ISO Standard C (currently C99), try to add an option to output variable <CODE>CC</CODE> to make it work. If the compiler does not support C99, fall back to supporting ANSI C89 (ISO C90).</P><P> After calling this macro you can check whether the C compiler has been set to accept Standard C; if not, the shell variable <CODE>ac_cv_prog_cc_stdc</CODE> is set to <samp>no</samp>. </synopsis> </macro> <macro id="AC_PROG_CC_C89"> <prototype> </prototype> <synopsis> If the C compiler is not in ANSI C89 (ISO C90) 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 C89 on some system or another. It considers the compiler to be in ANSI C89 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 C89; if not, the shell variable <CODE>ac_cv_prog_cc_c89</CODE> is set to <samp>no</samp>.</P><P> This macro is called automatically by <CODE>AC_PROG_CC</CODE>. </synopsis> </macro> <macro id="AC_PROG_CC_C99"> <prototype> </prototype> <synopsis> If the C compiler is not in C99 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 C99 on some system or another. It considers the compiler to be in C99 mode if it handles <CODE>_Bool</CODE>, <CODE>//</CODE> comments, flexible array members, <CODE>inline</CODE>, <CODE>long long int</CODE>, mixed code and declarations, named initialization of structs, <CODE>restrict</CODE>, <CODE>va_copy</CODE>, varargs macros, variable declarations in <CODE>for</CODE> loops, and variable length arrays.</P><P> After calling this macro you can check whether the C compiler has been set to accept C99; if not, the shell variable <CODE>ac_cv_prog_cc_c99</CODE> is set to <samp>no</samp>. </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>.</P><P> This macro is obsolescent, as current C compilers understand <samp>\a</samp>. New programs need not use this macro. </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 <CODE>const</CODE> keyword, 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 makefile or configuration header file defines 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.</P><P> This macro is obsolescent, as current C compilers support <CODE>const</CODE>. New programs need not use this macro. </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 makefile 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 makefile or configuration header defines 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 compiles, when it wouldn't before. , for more about <CODE>volatile</CODE>.</P><P> In general, the <CODE>volatile</CODE> keyword is a standard C feature, 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>.</P><P> This macro is obsolescent, as current C compilers support <CODE>volatile</CODE>. New programs need not use this macro. </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_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></P><P> This macro is obsolescent, as current C compilers support the stringizing operator. New programs need not use this macro. </synopsis> </macro> <macro id="AC_C_FLEXIBLE_ARRAY_MEMBER"> <prototype> </prototype> <synopsis> If the C compiler supports flexible array members, define <CODE>FLEXIBLE_ARRAY_MEMBER</CODE> to nothing; otherwise define it to 1. That way, a declaration like this:</P><P> <TABLE><tr><td>&nbsp;</td><td class=example><pre> struct s size_t n_vals; double val[FLEXIBLE_ARRAY_MEMBER]; @; </pre></td></tr></table></P><P> will let applications use the ``struct hack'' even with compilers that do not support flexible array members. To allocate and use such an object, you can use code like this:</P><P> <TABLE><tr><td>&nbsp;</td><td class=example><pre> size_t i; size_t n = compute_value_count (); struct s *p = malloc (offsetof (struct s, val) + n * sizeof (double)); p->n_vals = n; for (i = 0; i < n; i++) p->val[i] = compute_value (i); </pre></td></tr></table> </synopsis> </macro> <macro id="AC_C_VARARRAYS"> <prototype> </prototype> <synopsis> If the C compiler supports variable-length arrays, define <CODE>HAVE_C_VARRAYS</CODE>. A variable-length array is an array of automatic storage duration whose length is determined at run time, when the array is declared. </synopsis> </macro> <macro id="AC_C_TYPEOF"> <prototype> </prototype> <synopsis> If the C compiler supports GCC's <CODE>typeof</CODE> syntax either directly or through a different spelling of the keyword (e.g., <CODE>__typeof__</CODE>), define <CODE>HAVE_TYPEOF</CODE>. If the support is available only through a different spelling, define <CODE>typeof</CODE> to that spelling. </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>. Defining <CODE>__PROTOTYPES</CODE> is for the benefit of header files that cannot use macros that infringe on user name space.</P><P> This macro is obsolescent, as current C compilers support prototypes. New programs need not use this macro. </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.</P><P> This macro is obsolescent, since current versions of the GNU C compiler fix the header files automatically when installed. </synopsis> </macro> <macro id="AC_PROG_CXX"> <prototype> <parameter content="[compiler-search-list]"/> </prototype> <synopsis> Determine a C++ compiler to use. Check whether 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 blank-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([gcc cl KCC CC cxx cc++ xlC aCC c++ g++]) </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 portable to run <CODE>CXXCPP</CODE> only on files with a <TT>.c</TT>, <TT>.C</TT>, <TT>.cc</TT>, or <TT>.cpp</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_CXX_C_O"> <prototype> </prototype> <synopsis> Test whether the C++ compiler accepts the options <samp>-c</samp> and <samp>-o</samp> simultaneously, and define <CODE>CXX_NO_MINUS_C_MINUS_O</CODE>, if it does not. </synopsis> </macro> <macro id="AC_PROG_OBJC"> <prototype> <parameter content="[compiler-search-list]"/> </prototype> <synopsis> Determine an Objective C compiler to use. If <CODE>OBJC</CODE> is not already set in the environment, check for Objective C compilers. Set output variable <CODE>OBJC</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 blank-separated list of Objective C compilers to search for. This just gives the user an opportunity to specify an alternative search list for the Objective C compiler. For example, if you didn't like the default order, then you could invoke <CODE>AC_PROG_OBJC</CODE> like this:</P><P> <TABLE><tr><td>&nbsp;</td><td class=example><pre> AC_PROG_OBJC([gcc objcc objc]) </pre></td></tr></table></P><P> If using the GNU Objective C compiler, set shell variable <CODE>GOBJC</CODE> to <samp>yes</samp>. If output variable <CODE>OBJCFLAGS</CODE> was not already set, set it to <samp>-g -O2</samp> for the GNU Objective C compiler (<samp>-O2</samp> on systems where <CODE>gcc</CODE> does not accept <samp>-g</samp>), or <samp>-g</samp> for other compilers. </synopsis> </macro> <macro id="AC_PROG_OBJCCPP"> <prototype> </prototype> <synopsis> Set output variable <CODE>OBJCCPP</CODE> to a command that runs the Objective C preprocessor. If <samp>$OBJC -E</samp> doesn't work, <TT>/lib/cpp</TT> is used. </synopsis> </macro> <macro id="AC_ERLANG_PATH_ERLC"> <prototype> <parameter content="[value-if-not-found]"/> <parameter content="[path]"/> </prototype> <synopsis> Determine an Erlang compiler to use. If <CODE>ERLC</CODE> is not already set in the environment, check for <CODE>erlc</CODE>. Set output variable <CODE>ERLC</CODE> to the complete path of the compiler command found. In addition, if <CODE>ERLCFLAGS</CODE> is not set in the environment, set it to an empty value.</P><P> The two optional arguments have the same meaning as the two last arguments of macro <CODE>AC_PROG_PATH</CODE> for looking for the <CODE>erlc</CODE> program. For example, to look for <CODE>erlc</CODE> only in the <TT>/usr/lib/erlang/bin</TT> directory:</P><P> <TABLE><tr><td>&nbsp;</td><td class=example><pre> AC_ERLANG_PATH_ERLC([not found], [/usr/lib/erlang/bin]) </pre></td></tr></table> </synopsis> </macro> <macro id="AC_ERLANG_NEED_ERLC"> <prototype> <parameter content="[path]"/> </prototype> <synopsis> A simplified variant of the <CODE>AC_ERLANG_PATH_ERLC</CODE> macro, that prints an error message and exits the <CODE>configure</CODE> script if the <CODE>erlc</CODE> program is not found. </synopsis> </macro> <macro id="AC_ERLANG_PATH_ERL"> <prototype> <parameter content="[value-if-not-found]"/> <parameter content="[path]"/> </prototype> <synopsis> Determine an Erlang interpreter to use. If <CODE>ERL</CODE> is not already set in the environment, check for <CODE>erl</CODE>. Set output variable <CODE>ERL</CODE> to the complete path of the interpreter command found.</P><P> The two optional arguments have the same meaning as the two last arguments of macro <CODE>AC_PROG_PATH</CODE> for looking for the <CODE>erl</CODE> program. For example, to look for <CODE>erl</CODE> only in the <TT>/usr/lib/erlang/bin</TT> directory:</P><P> <TABLE><tr><td>&nbsp;</td><td class=example><pre> AC_ERLANG_PATH_ERL([not found], [/usr/lib/erlang/bin]) </pre></td></tr></table> </synopsis> </macro> <macro id="AC_ERLANG_NEED_ERL"> <prototype> <parameter content="[path]"/> </prototype> <synopsis> A simplified variant of the <CODE>AC_ERLANG_PATH_ERL</CODE> macro, that prints an error message and exits the <CODE>configure</CODE> script if the <CODE>erl</CODE> program is not found. </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 blank-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 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 blank-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 whether 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 runtime 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 included 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 runtime 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> and <CODE>AC_FC_DUMMY_MAIN</CODE> or <CODE>AC_F77_MAIN</CODE> and <CODE>AC_FC_MAIN</CODE> are probably also 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> and <CODE>AC_FC_DUMMY_MAIN</CODE> or <CODE>AC_F77_MAIN</CODE> and <CODE>AC_FC_MAIN</CODE> macros figure 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. <VAR>action-if-not-found</VAR> 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> and <CODE>AC_FC_MAIN</CODE> macros detect whether it is <EM>possible</EM> to utilize such an alternate main function, and defines <CODE>F77_MAIN</CODE> and <CODE>FC_MAIN</CODE> to the name of the function. (If no alternate main function name is found, <CODE>F77_MAIN</CODE> and <CODE>FC_MAIN</CODE> are 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> or <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>, <CODE>F77_FUNC_(name, NAME)</CODE>, and <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 generates a compile-time error, but some other behavior (e.g., disabling Fortran-related features) can be induced by checking whether <CODE>F77_FUNC</CODE> or <CODE>FC_FUNC</CODE> 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> or <CODE>FC_FUNC_</CODE> instead of <CODE>F77_FUNC</CODE> or <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 is 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 file name 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 file name 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) '$(srcdir)/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 <VAR>action-if-success</VAR> (defaults to nothing). If it fails, and cannot find a way to make the <CODE>FC</CODE> compiler accept such files, it calls <VAR>action-if-failure</VAR> (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> ordinarily succeeds without modifying <CODE>FCFLAGS</CODE>.</P><P> If <CODE>AC_FC_FREEFORM</CODE> succeeds in compiling free-form source, it calls <VAR>action-if-success</VAR> (defaults to nothing). If it fails, it calls <VAR>action-if-failure</VAR> (defaults to exiting with an error message). </synopsis> </macro> <macro id="AC_PATH_X"> <prototype> </prototype> <synopsis> Window System 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.</P><P> If either or both were not given, get the missing values by running <CODE>xmkmf</CODE> (or an executable pointed to by the <CODE>XMKMF</CODE> environment variable) on a trivial <TT>Imakefile</TT> and examining the makefile that it produces. Setting <CODE>XMKMF</CODE> to <samp>false</samp> disables this method.</P><P> If this method fails to find the X Window System, <CODE>configure</CODE> looks 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/sh</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 is 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> file support 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 wider than <CODE>long int</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 int) 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 Systems Corporation Unix, 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.</P><P> This macro is obsolescent, as interactive Unix is obsolete, and Sun dropped support for it on 2006-07-23. New programs need not use this macro. </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_USE_SYSTEM_EXTENSIONS"> <prototype> </prototype> <synopsis> If possible, enable extensions to Posix on hosts that normally disable the extensions, typically due to standards-conformance namespace issues. This may involve defining <CODE>__EXTENSIONS__</CODE> and <CODE>_POSIX_PTHREAD_SEMANTICS</CODE>, which are macros used by Solaris. It also defines <CODE>_TANDEM_SOURCE</CODE> for the HP NonStop platform. This macro also has the combined effects of <CODE>AC_GNU_SOURCE</CODE>, <CODE>AC_AIX</CODE>, and <CODE>AC_MINIX</CODE>. </synopsis> </macro> <macro id="AC_ERLANG_SUBST_ROOT_DIR"> <prototype> </prototype> <synopsis> </P><P> Set the output variable <CODE>ERLANG_ROOT_DIR</CODE> to the path to the base directory in which Erlang/OTP is installed (as returned by Erlang's <CODE>code:root_dir/0</CODE> function). The result of this test is cached if caching is enabled when running <CODE>configure</CODE>. </synopsis> </macro> <macro id="AC_ERLANG_SUBST_LIB_DIR"> <prototype> </prototype> <synopsis> </P><P> Set the output variable <CODE>ERLANG_LIB_DIR</CODE> to the path of the library directory of Erlang/OTP (as returned by Erlang's <CODE>code:lib_dir/0</CODE> function), which subdirectories each contain an installed Erlang/OTP library. The result of this test is cached if caching is enabled when running <CODE>configure</CODE>. </synopsis> </macro> <macro id="AC_ERLANG_CHECK_LIB"> <prototype> <parameter content="library"/> <parameter content="[action-if-found]"/> <parameter content="[action-if-not-found]"/> </prototype> <synopsis> </P><P> Test whether the Erlang/OTP library <VAR>library</VAR> is installed by calling Erlang's <CODE>code:lib_dir/1</CODE> function. The result of this test is cached if caching is enabled when running <CODE>configure</CODE>. <VAR>action-if-found</VAR> is a list of shell commands to run if the library is installed; <VAR>action-if-not-found</VAR> is a list of shell commands to run if it is not. Additionally, if the library is installed, the output variable <samp>ERLANG_LIB_DIR_<VAR>library</VAR></samp> is set to the path to the library installation directory, and the output variable <samp>ERLANG_LIB_VER_<VAR>library</VAR></samp> is set to the version number that is part of the subdirectory name, if it is in the standard form (<CODE><VAR>library</VAR>-<VAR>version</VAR></CODE>). If the directory name does not have a version part, <samp>ERLANG_LIB_VER_<VAR>library</VAR></samp> is set to the empty string. If the library is not installed, <samp>ERLANG_LIB_DIR_<VAR>library</VAR></samp> and <samp>ERLANG_LIB_VER_<VAR>library</VAR></samp> are set to <CODE>"not found"</CODE>. For example, to check if library <CODE>stdlib</CODE> is installed:</P><P> <TABLE><tr><td>&nbsp;</td><td class=example><pre> AC_ERLANG_CHECK_LIB([stdlib], [echo "stdlib version \"$ERLANG_LIB_VER_stdlib\"" echo "is installed in \"$ERLANG_LIB_DIR_stdlib\""], [AC_MSG_ERROR([stdlib was not found!])]) </pre></td></tr></table> </synopsis> </macro> <macro id="AC_ERLANG_SUBST_INSTALL_LIB_DIR"> <prototype> </prototype> <synopsis> </P><P> Set the <CODE>ERLANG_INSTALL_LIB_DIR</CODE> output variable to the directory into which every built Erlang library should be installed in a separate subdirectory. If this variable is not set in the environment when <CODE>configure</CODE> runs, its default value is <CODE>$ERLANG_LIB_DIR</CODE>, which value is set by the <CODE>AC_ERLANG_SUBST_LIB_DIR</CODE> macro. </synopsis> </macro> <macro id="AC_ERLANG_SUBST_INSTALL_LIB_SUBDIR"> <prototype> <parameter content="library"/> <parameter content="version"/> </prototype> <synopsis> </P><P> Set the <samp>ERLANG_INSTALL_LIB_DIR_<VAR>library</VAR></samp> output variable to the directory into which the built Erlang library <VAR>library</VAR> version <VAR>version</VAR> should be installed. If this variable is not set in the environment when <CODE>configure</CODE> runs, its default value is <samp>$ERLANG_INSTALL_LIB_DIR/<VAR>library</VAR>-<VAR>version</VAR></samp>, the value of the <CODE>ERLANG_INSTALL_LIB_DIR</CODE> variable being set by the <CODE>AC_ERLANG_SUBST_INSTALL_LIB_DIR</CODE> macro. </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>.</P><P> <DT>'<SAMP>Erlang</SAMP>' <DD> Compile and execute tests using <CODE>ERLC</CODE> and <CODE>ERL</CODE> and use extension <TT>.erl</TT> for test Erlang modules. Use compilation flags: <CODE>ERLCFLAGS</CODE>.</P><P> <DT>'<SAMP>Objective C</SAMP>' <DD> Do compilation tests using <CODE>OBJC</CODE> and <CODE>OBJCCPP</CODE> and use extension <TT>.m</TT> for test programs. Use compilation flags: <CODE>CPPFLAGS</CODE> with <CODE>OBJCPP</CODE>, and both <CODE>CPPFLAGS</CODE> and <CODE>OBJCFLAGS</CODE> with <CODE>OBJC</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 detects 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> and <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<small>...</small> </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 features 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_PROGRAM</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.</P><P> This macro cannot be used for Erlang tests. </synopsis> </macro> <macro id="AC_LANG_FUNC_LINK_TRY"> <prototype> <parameter content="function"/> </prototype> <synopsis> Expands into a source file which uses the <VAR>function</VAR> in the body of the main function (e.g., <CODE>main</CODE> in C). Since it uses <CODE>AC_LANG_PROGRAM</CODE>, the features 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).</P><P> This macro cannot be used for Erlang tests. </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-true]"/> <parameter content="[action-if-false]"/> </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-true]"/> <parameter content="[action-if-false]"/> </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 (Runtime). </synopsis> </macro> <macro id="AC_RUN_IFELSE"> <prototype> <parameter content="input"/> <parameter content="[action-if-true]"/> <parameter content="[action-if-false]"/> <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 failing exit status is available in the shell variable <samp>$?</samp>. This exit status might be that of a failed compilation, or it might be that of a failed program execution.</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, 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"], [Equation string.]) </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.</P><P> If the <VAR>variable</VAR> is a literal string, it is passed to <CODE>m4_pattern_allow</CODE> (Forbidden Patterns). </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"], [Configuration machine file.]) AC_DEFINE_UNQUOTED([GETGROUPS_T], [$ac_cv_type_getgroups], [getgroups return type.]) AC_DEFINE_UNQUOTED([$ac_tr_hdr], [1], [Translated header name.]) </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 makefiles). This means that <CODE>AC_OUTPUT</CODE> replaces 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. The value can contain newlines. The substituted value is not rescanned for more output variables; occurrences of <samp>@@<VAR>variable</VAR>@@</samp> in the value are inserted literally into the output file. (The algorithm uses the special marker <CODE>|#_!!_#|</CODE> internally, so the substituted value cannot contain <CODE>|#_!!_#|</CODE>.)</P><P> If <VAR>value</VAR> is given, in addition assign it to <VAR>variable</VAR>.</P><P> The string <VAR>variable</VAR> is passed to <CODE>m4_pattern_allow</CODE> (Forbidden Patterns). </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> replaces 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. This substitution occurs only when the <samp>@@<VAR>variable</VAR>@@</samp> is on a line by itself, optionally surrounded by spaces and tabs. The substitution replaces the whole line, including the spaces, tabs, and the terminating newline.</P><P> This macro is useful for inserting makefile fragments containing special dependencies or other <CODE>make</CODE> directives for particular host or target types into makefiles. 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></P><P> The string <VAR>variable</VAR> is passed to <CODE>m4_pattern_allow</CODE> (Forbidden Patterns). </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 substituted via <CODE>AC_SUBST</CODE>.</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 different things.</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 CONFIG_SHELL=/bin/sh /bin/sh ./configure undeclared_var=raboof \ 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 is 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> Unlike 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_include"> <prototype> <parameter content="file"/> </prototype> <prototype> <parameter content="file"/> </prototype> <synopsis> Like the M4 builtins, but warn against multiple inclusions of <VAR>file</VAR>. </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> Unlike 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> Posix requires arguments of multiple <CODE>m4wrap</CODE> calls to be reprocessed at EOF in the same order as the original calls. GNU M4 versions through 1.4.x, however, reprocess them in reverse order. Your code should not depend on the order.</P><P> Also, Posix requires <CODE>m4wrap</CODE> to ignore its second and succeeding arguments, but GNU M4 versions through 1.4.x concatenate the arguments with intervening spaces. Your code should not pass more than one argument.</P><P> You are encouraged to end <VAR>text</VAR> with <samp>[]</samp>, to avoid unexpected token pasting between consecutive invocations of <CODE>m4_wrap</CODE>, as in:</P><P> <TABLE><tr><td>&nbsp;</td><td class=example><pre> m4_define([foo], [bar]) m4_define([foofoo], [OUCH]) m4_wrap([foo]) m4_wrap([foo]) OUCH </pre></td></tr></table> </synopsis> </macro> <macro id="m4_undefine"> <prototype> <parameter content="macro"/> </prototype> <synopsis> Unlike 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_maketemp"> <prototype> <parameter content="template"/> </prototype> <prototype> <parameter content="template"/> </prototype> <synopsis> Posix requires <CODE>maketemp</CODE> to replace the trailing <samp>X</samp> characters in <VAR>template</VAR> with the process id, without regards to the existence of a file by that name, but this a security hole. When this was pointed out to the Posix folks, they agreed to invent a new macro <CODE>mkstemp</CODE> that always creates a uniquely named file, but not all versions of GNU M4 support the new macro. In M4sugar, <CODE>m4_maketemp</CODE> and <CODE>m4_mkstemp</CODE> are synonyms for each other, and both have the secure semantics regardless of which macro the underlying M4 provides. </synopsis> </macro> <macro id="m4_for"> <prototype> <parameter content="var"/> <parameter content="first"/> <parameter content="last"/> <parameter content="[step]"/> <parameter content="expression"/> </prototype> <synopsis> Loop over the numeric values between <VAR>first</VAR> and <VAR>last</VAR> including bounds by increments of <VAR>step</VAR>. For each iteration, expand <VAR>expression</VAR> with the numeric value assigned to <VAR>var</VAR>. If <VAR>step</VAR> is omitted, it defaults to <samp>1</samp> or <samp>-1</samp> depending on the order of the limits. If given, <VAR>step</VAR> has to match this order. </synopsis> </macro> <macro id="m4_foreach"> <prototype> <parameter content="var"/> <parameter content="list"/> <parameter content="expression"/> </prototype> <synopsis> Loop over the comma-separated M4 list <VAR>list</VAR>, assigning each value to <VAR>var</VAR>, and expand <VAR>expression</VAR>. The following example outputs two lines:</P><P> <TABLE><tr><td>&nbsp;</td><td class=example><pre> m4_foreach([myvar], [[foo], [bar, baz]], [echo myvar ])</P><P> </pre></td></tr></table> </synopsis> </macro> <macro id="m4_foreach_w"> <prototype> <parameter content="var"/> <parameter content="list"/> <parameter content="expression"/> </prototype> <synopsis> Loop over the white-space-separated list <VAR>list</VAR>, assigning each value to <VAR>var</VAR>, and expand <VAR>expression</VAR>.</P><P> The deprecated macro <CODE>AC_FOREACH</CODE> is an alias of <CODE>m4_foreach_w</CODE>. </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_re_escape"> <prototype> <parameter content="string"/> </prototype> <synopsis> Backslash-escape all characters in <VAR>string</VAR> that are active in regexps. </synopsis> </macro> <macro id="m4_tolower"> <prototype> <parameter content="string"/> </prototype> <prototype> <parameter content="string"/> </prototype> <synopsis> Return <VAR>string</VAR> with letters converted to upper or lower case, respectively. </synopsis> </macro> <macro id="m4_split"> <prototype> <parameter content="string"/> <parameter content="[regexp]"/> </prototype> <synopsis> Split <VAR>string</VAR> into an M4 list of elements quoted by <samp>[</samp> and <samp>]</samp>, while keeping white space at the beginning and at the end. If <VAR>regexp</VAR> is given, use it instead of <samp>[\t ]+</samp> for splitting. If <VAR>string</VAR> is empty, the result is an empty list. </synopsis> </macro> <macro id="m4_normalize"> <prototype> <parameter content="string"/> </prototype> <synopsis> Remove leading and trailing spaces and tabs, sequences of backslash-then-newline, and replace multiple spaces and tabs with a single space. </synopsis> </macro> <macro id="m4_append"> <prototype> <parameter content="macro-name"/> <parameter content="string"/> <parameter content="[separator]"/> </prototype> <prototype> <parameter content="macro-name"/> <parameter content="string"/> <parameter content="[separator]"/> </prototype> <synopsis> Redefine <VAR>macro-name</VAR> to its former contents with <VAR>separator</VAR> and <VAR>string</VAR> added at the end. If <VAR>macro-name</VAR> was undefined before (but not if it was defined but empty), then no <VAR>separator</VAR> is added. <CODE>m4_append</CODE> can be used to grow strings, and <CODE>m4_append_uniq</CODE> to grow strings without duplicating substrings. </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 make 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_BASENAME"> <prototype> <parameter content="file-name"/> </prototype> <synopsis> Output the non-directory portion of <VAR>file-name</VAR>. For example, if <CODE>$file</CODE> is <samp>/one/two/three</samp>, the command <CODE>base=`AS_BASENAME(["$file"])`</CODE> sets <CODE>base</CODE> to <samp>three</samp>. </synopsis> </macro> <macro id="AS_BOURNE_COMPATIBLE"> <prototype> </prototype> <synopsis> Set up the shell to be more compatible with the Bourne shell as standardized by Posix, if possible. This may involve setting environment variables, or setting options, or similar implementation-specific actions. </synopsis> </macro> <macro id="AS_CASE"> <prototype> <parameter content="word"/> <parameter content="[pattern1]"/> <parameter content="[if-matched1]"/> <parameter content="..."/> <parameter content="[default]"/> </prototype> <synopsis> Expand into a shell <samp>case</samp> statement, where <VAR>word</VAR> is matched against one or more patterns. <VAR>if-matched</VAR> is run if the corresponding pattern matched <VAR>word</VAR>, else <VAR>default</VAR> is run. </synopsis> </macro> <macro id="AS_DIRNAME"> <prototype> <parameter content="file-name"/> </prototype> <synopsis> Output the directory portion of <VAR>file-name</VAR>. For example, if <CODE>$file</CODE> is <samp>/one/two/three</samp>, the command <CODE>dir=`AS_DIRNAME(["$file"])`</CODE> sets <CODE>dir</CODE> to <samp>/one/two</samp>. </synopsis> </macro> <macro id="AS_IF"> <prototype> <parameter content="test1"/> <parameter content="[run-if-true1]"/> <parameter content="..."/> <parameter content="[run-if-false]"/> </prototype> <synopsis> Run shell code <VAR>test1</VAR>. If <VAR>test1</VAR> exits with a zero status then run shell code <VAR>run-if-true1</VAR>, else examine further tests. If no test exits with a zero status, run shell code <VAR>run-if-false</VAR>, with simplifications if either <VAR>run-if-true1</VAR> or <VAR>run-if-false1</VAR> is empty. For example,</P><P> <TABLE><tr><td>&nbsp;</td><td class=example><pre> AS_IF([test "$foo" = yes], [HANDLE_FOO([yes])], [test "$foo" != no], [HANDLE_FOO([maybe])], [echo foo not specified]) </pre></td></tr></table></P><P> ensures any required macros of <CODE>HANDLE_FOO</CODE> are expanded before the first test. </synopsis> </macro> <macro id="AS_MKDIR_P"> <prototype> <parameter content="file-name"/> </prototype> <synopsis> Make the directory <VAR>file-name</VAR>, including intervening directories as necessary. This is equivalent to <samp>mkdir -p <VAR>file-name</VAR></samp>, except that it is portable to older versions of <CODE>mkdir</CODE> that lack support for the <samp>-p</samp> option. Also, <CODE>AS_MKDIR_P</CODE> succeeds if <VAR>file-name</VAR> is a symbolic link to an existing directory, even though Posix is unclear whether <samp>mkdir -p</samp> should succeed in that case. If creation of <VAR>file-name</VAR> fails, exit the script.</P><P> Also see the <CODE>AC_PROG_MKDIR_P</CODE> macro (Particular Programs). </synopsis> </macro> <macro id="AS_SHELL_SANITIZE"> <prototype> </prototype> <synopsis> Initialize the shell suitably for <CODE>configure</CODE> scripts. This has the effect of <CODE>AS_BOURNE_COMPATIBLE</CODE>, and sets some other environment variables for predictable results from configuration tests. For example, it sets LC_ALL to change to the default C locale. . </synopsis> </macro> <macro id="AS_TR_CPP"> <prototype> <parameter content="expression"/> </prototype> <synopsis> Transform <VAR>expression</VAR> into a valid right-hand side for a C <CODE>#define</CODE>. For example:</P><P> <TABLE><tr><td>&nbsp;</td><td class=example><pre> # This outputs "#define HAVE_CHAR_P 1". type="char *" echo "#define AS_TR_CPP([HAVE_$type]) 1" </pre></td></tr></table> </synopsis> </macro> <macro id="AS_TR_SH"> <prototype> <parameter content="expression"/> </prototype> <synopsis> Transform <VAR>expression</VAR> into a valid shell variable name. For example:</P><P> <TABLE><tr><td>&nbsp;</td><td class=example><pre> # This outputs "Have it!". header="sys/some file.h" AS_TR_SH([HAVE_$header])=yes if test "$HAVE_sys_some_file_h" = yes; then echo "Have it!"; fi </pre></td></tr></table> </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="AS_MESSAGE_FD"> <prototype> </prototype> <synopsis> The file descriptor for <samp>checking for...</samp> messages and results. Normally this directs messages to the standard output, however when <CODE>configure</CODE> is run with the <samp>-q</samp> option, messages sent to <CODE>AS_MESSAGE_FD</CODE> are discarded.</P><P> If you want to display some messages, consider using one of the printing macros (Printing Messages) instead. Copies of messages output via these macros are also recorded in <TT>config.log</TT>. </synopsis> </macro> <macro id="AS_MESSAGE_LOG_FD"> <prototype> </prototype> <synopsis> </P><P> The file descriptor for messages logged to <TT>config.log</TT>. Macros that run tools, like <CODE>AC_COMPILE_IFELSE</CODE> (Running the Compiler), redirect all output to this descriptor. You may want to do so if you develop such a low-level macro. </synopsis> </macro> <macro id="AS_ORIGINAL_STDIN_FD"> <prototype> </prototype> <synopsis> The file descriptor for the original standard input.</P><P> When <CODE>configure</CODE> runs, it may accidentally execute an interactive command that has the same name as the non-interactive meant to be used or checked. If the standard input was the terminal, such interactive programs would cause <CODE>configure</CODE> to stop, pending some user input. Therefore <CODE>configure</CODE> redirects its standard input from <TT>/dev/null</TT> during its initialization. This is not normally a problem, since <CODE>configure</CODE> normally does not need user input.</P><P> In the extreme case where your <TT>configure</TT> script really needs to obtain some values from the original standard input, you can read them explicitly from <CODE>AS_ORIGINAL_STDIN_FD</CODE>. </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 a macro defined by <CODE>AC_DEFUN</CODE>; 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="AC_DEFUN_ONCE"> <prototype> <parameter content="macro-name"/> <parameter content="macro-body"/> </prototype> <synopsis> </P><P> Declare macro <VAR>macro-name</VAR> like <CODE>AC_DEFUN</CODE> would (Macro Definitions), and emit a warning any time the macro is called more than once. </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 is 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> is replaced by the modern <VAR>implementation</VAR>. <VAR>message</VAR> should include information on what to do after running <CODE>autoupdate</CODE>; <CODE>autoupdate</CODE> prints it as a warning, and includes it in the updated <TT>configure.ac</TT> file.</P><P> The details of this macro are hairy: if <CODE>autoconf</CODE> encounters an <CODE>AU_DEFUN</CODE>ed macro, all macros inside its second argument are expanded as usual. However, when <CODE>autoupdate</CODE> is run, only M4 and M4sugar macros are expanded here, while all other macros are disabled and appear literally in the updated <TT>configure.ac</TT>. </synopsis> </macro> <macro id="AU_ALIAS"> <prototype> <parameter content="old-name"/> <parameter content="new-name"/> </prototype> <synopsis> Used if the <VAR>old-name</VAR> is to be replaced by a call to <VAR>new-macro</VAR> with the same parameters. This happens for example if the macro was renamed. </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_PRESERVE_HELP_ORDER"> <prototype> </prototype> <synopsis> </P><P> Request an alternate <samp>--help</samp> format, in which options of all types appear together, in the order defined. Call this macro before any <CODE>AC_ARG_ENABLE</CODE> or <CODE>AC_ARG_WITH</CODE>.</P><P> <TABLE><tr><td>&nbsp;</td><td class=example><pre> Optional Features and Packages: <small>...</small> --enable-bar include bar --with-foo use foo </pre></td></tr></table></P><P> </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, dashes, and dots.</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 non-alphanumeric 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 blanks.</P><P> You should format your <VAR>help-string</VAR> with the macro <CODE>AS_HELP_STRING</CODE> (Pretty Help Strings).</P><P> The following example shows how to use the <CODE>AC_ARG_WITH</CODE> macro in a common situation. You want to let the user decide whether to enable support for an external library (e.g., the readline library); if the user specified neither <samp>--with-readline</samp> nor <samp>--without-readline</samp>, you want to enable support for readline only if the library is available on the system.</P><P> <TABLE><tr><td>&nbsp;</td><td class=example><pre> AC_ARG_WITH([readline], [AS_HELP_STRING([--with-readline], [support fancy command line editing @@<:@@default=check@@:>@@])], [], [with_readline=check])</P><P> LIBREADLINE= AS_IF([test "x$with_readline" != xno], [AC_CHECK_LIB([readline], [main], [AC_SUBST([LIBREADLINE], ["-lreadline -lncurses"]) AC_DEFINE([HAVE_LIBREADLINE], [1], [Define if you have libreadline]) ], [if test "x$with_readline" != xcheck; then AC_MSG_FAILURE( [--with-readline was given, but test for readline failed]) fi ], -lncurses)]) </pre></td></tr></table></P><P> The next example shows how to use <CODE>AC_ARG_WITH</CODE> to give the user the possibility to enable support for the readline library, in case it is still experimental and not well tested, and is therefore disabled by default.</P><P> <TABLE><tr><td>&nbsp;</td><td class=example><pre> AC_ARG_WITH([readline], [AS_HELP_STRING([--with-readline], [enable experimental support for readline])], [], [with_readline=no])</P><P> LIBREADLINE= AS_IF([test "x$with_readline" != xno], [AC_CHECK_LIB([readline], [main], [AC_SUBST([LIBREADLINE], ["-lreadline -lncurses"]) AC_DEFINE([HAVE_LIBREADLINE], [1], [Define if you have libreadline]) ], [AC_MSG_FAILURE( [--with-readline was given, but test for readline failed])], [-lncurses])]) </pre></td></tr></table></P><P> The last example shows how to use <CODE>AC_ARG_WITH</CODE> to give the user the possibility to disable support for the readline library, given that it is an important feature and that it should be enabled by default.</P><P> <TABLE><tr><td>&nbsp;</td><td class=example><pre> AC_ARG_WITH([readline], [AS_HELP_STRING([--without-readline], [disable support for readline])], [], [with_readline=yes])</P><P> LIBREADLINE= AS_IF([test "x$with_readline" != xno], [AC_CHECK_LIB([readline], [main], [AC_SUBST([LIBREADLINE], ["-lreadline -lncurses"]) AC_DEFINE([HAVE_LIBREADLINE], [1], [Define if you have libreadline]) ], [AC_MSG_FAILURE( [readline test failed (--without-readline to disable)])], [-lncurses])]) </pre></td></tr></table></P><P> These three examples can be easily adapted to the case where <CODE>AC_ARG_ENABLE</CODE> should be preferred to <CODE>AC_ARG_WITH</CODE> (see Package Options). </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, dashes, and dots.</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 non-alphanumeric 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).</P><P> See the examples suggested with the definition of <CODE>AC_ARG_WITH</CODE> (External Software) to get an idea of possible applications of <CODE>AC_ARG_ENABLE</CODE>. </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 makes this clearer.</P><P> <TABLE><tr><td>&nbsp;</td><td class=example><pre> AC_ARG_WITH([foo], [AS_HELP_STRING([--with-foo], [use foo (default is no)])], [use_foo=$withval], [use_foo=no]) </pre></td></tr></table></P><P> The second argument of <CODE>AS_HELP_STRING</CODE> is not a literal, and should not be double quoted. , for a more detailed explanation. Then the last few lines of <samp>configure --help</samp> 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)])], [use_[]$1=$withval], [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_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>.</P><P> You should use <CODE>AC_TYPE_LONG_DOUBLE</CODE> or <CODE>AC_TYPE_LONG_DOUBLE_WIDER</CODE> instead. . </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-true"/> <parameter content="[action-if-false]"/> </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 special meaning when running Cygwin, 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. */ #ifdef 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 Posix and <samp>.exe</samp> if a DOS variant. </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_FOREACH"> <prototype> </prototype> <synopsis> <CODE>m4_foreach_w</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> has been removed from 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> 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>.</P><P> You should use <CODE>AC_TYPE_LONG_DOUBLE</CODE> or <CODE>AC_TYPE_LONG_DOUBLE_WIDER</CODE> instead. . </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 MinGW 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 Posix, <samp>obj</samp> if a DOS variant. 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_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 do this:</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 whether system calls are restarted in general---it checks whether a signal handler installed with <CODE>signal</CODE> (but not <CODE>sigaction</CODE>) causes system calls to be restarted. It does not check whether 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-true]"/> <parameter content="[action-if-false]"/> </prototype> <synopsis> Same as:</P><P> <TABLE><tr><td>&nbsp;</td><td class=example><pre> AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[<VAR>includes</VAR>]], [[<VAR>function-body</VAR>]])], [<VAR>action-if-true</VAR>], [<VAR>action-if-false</VAR>]) </pre></td></tr></table></P><P> .</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> is 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:</P><P> <TABLE><tr><td>&nbsp;</td><td class=example><pre> AC_PREPROC_IFELSE( [AC_LANG_SOURCE([[<VAR>input</VAR>]])], [<VAR>action-if-true</VAR>], [<VAR>action-if-false</VAR>]) </pre></td></tr></table></P><P> .</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-true]"/> <parameter content="[action-if-false]"/> </prototype> <synopsis> Same as:</P><P> <TABLE><tr><td>&nbsp;</td><td class=example><pre> AC_LINK_IFELSE( [AC_LANG_PROGRAM([[<VAR>includes</VAR>]], [[<VAR>function-body</VAR>]])], [<VAR>action-if-true</VAR>], [<VAR>action-if-false</VAR>]) </pre></td></tr></table></P><P> .</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> is 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>function</VAR>])], [<VAR>action-if-found</VAR>], [<VAR>action-if-not-found</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:</P><P> <TABLE><tr><td>&nbsp;</td><td class=example><pre> 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>]) </pre></td></tr></table></P><P> . </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_COPYRIGHT"> <prototype> <parameter content="copyright-notice"/> </prototype> <synopsis> Notice State that, in addition to the Free Software Foundation's copyright on the Autotest macros, parts of your test suite are covered by <VAR>copyright-notice</VAR>.</P><P> The <VAR>copyright-notice</VAR> shows up in both the head of <CODE>testsuite</CODE> and in <samp>testsuite --version</samp>. </synopsis> </macro> <macro id="AT_TESTED"> <prototype> <parameter content="executables"/> </prototype> <synopsis> Log the file name 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 the same keyword several times in a test group. </synopsis> </macro> <macro id="AT_CAPTURE_FILE"> <prototype> <parameter content="file"/> </prototype> <synopsis> If the current test group fails, log the contents of <VAR>file</VAR>. Several identical calls within one test group have no additional effect. </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 is 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= 0]"/> <parameter content="[stdout= ]"/> <parameter content="[stderr= ]"/> <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>experr</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>