|  |  D. Autoconf Macro Reference 
This is an alphabetical list of each Autoconf macro used in this book,
along with a description of what each does.  They are provided for your
reference while reading this book.  The descriptions are only brief; see
the appropriate reference manual for a complete description.
 
 
AC_ARG_ENABLE(feature, help-text, [if-given], [if-not-given])This macro allows the maintainer to specify additional package options
accepted by `configure'--for example, `--enable-zlib'.  The
action shell code may access any arguments to the option in the shell
variable enableval.  For example, `--enable-buffers=128'
would cause `configure' to setenablevalto `128'.
AC_ARG_PROGRAMThis macro places a sedtransformation program into the output
variableprogram_transform_namethat can be used to transform the
filenames of installed programs.  If the `--program-prefix',
`--program-suffix' or`--program-transform-name' options
are passed to `configure', an appropriate transformation program
will be generated.  If no options are given, but the type of the host
system differs from the type of the target system, program names are
transformed by prefixing them with the type of the target
(eg.
 arm-elf-gcc).
AC_ARG_WITH(package, help-text, [if-given], [if-not-given])This macro allows the maintainer to specify additional packages that
this package should work with (for example, a library to manipulate
shadow passwords).  The user indicates this preference by invoking
`configure' with an option such as `--with-shadow'.  If an
optional argument is given, this value is available to shell code in the
shell variable withval.
AC_CACHE_CHECK(message, cache-variable, commands)This macro is a convenient front-end to the AC_CACHE_VALmacro
that takes care of printing messages to the user, including whether or
not the result was found in the cache.  It should be used in preference
toAC_CACHE_VAL.
AC_CACHE_VAL(cache-variable, commands)This is a low-level macro which implements the Autoconf cache feature.
If the named variable is set at runtime (for instance, if it was read
from `config.cache'), then this macro does nothing.  Otherwise, it
runs the shell code in commands, which is assumed to set the cache
variable.
AC_CANONICAL_HOSTThis macro determines the type of the host system and sets the output
variable `host', as well as other more obscure variables.
AC_CANONICAL_SYSTEMThis macro determines the type of the build, host and target systems and
sets the output variables `build', `host' and `target',
amongst other more obscure variables.
AC_CHECK_FILE(file, [if-found], [if-not-found])This macro tests for the existence of a file in the file system of the
build system, and runs the appropriate shell code depending on whether
or not the file is found.
AC_CHECK_FUNCS(function-list, [if-found], [if-not-found])This looks for a series of functions.  If the function quuxis
found, the C preprocessor macroHAVE_QUUXwill be defined.  In
addition, if the if-found argument is given, it will be run (as
shell code) when a function is found -- this code can use theshbreakcommand to preventAC_CHECK_FUNCSfrom looking for
the remaining functions in the list.  The shell code in
if-not-found is run if a function is not found.
AC_CHECK_HEADER(header, [if-found], [if-not-found])This macro executes some specified shell code if a header file exists.
If it is not present, alternative shell code is executed instead.
AC_CHECK_HEADERS(header-list, [if-found], [if-not-found])This looks for a series of headers.  If the header quux.his
found, the C preprocessor macroHAVE_QUUX_Hwill be defined.  In
addition, if the if-found argument is given, it will be run (as
shell code) when a header is found -- this code can use theshbreakcommand to preventAC_CHECK_HEADERSfrom looking for
the remaining headers in the list.  The shell code in if-not-found
is run if a header is not found.
AC_CHECK_LIB(library, function, [if-found], [if-not-found], [other-libraries])This looks for the named function in the named library specified by its
base name.  For instance the math library, `libm.a', would be named
simply `m'.  If the function is found in the library `foo',
then the C preprocessor macro HAVE_LIBFOOis defined.
AC_CHECK_PROG(variable, program-name, value-if-found, [value-if-not-found], [path], [reject])Checks to see if the program named by program-name exists in the
path path.  If found, it sets the shell variable variable to
the value value-if-found; if not it uses the value
value-if-not-found.  If variable is already set at runtime,
this macro does nothing.
AC_CHECK_SIZEOF(type, [size-if-cross-compiling])This macro determines the size of C and C++ built-in types and defines
SIZEOF_typeto the size, wheretypeis transformed--all
characters to upper case, spaces to underscores and `*' to
`P'.  If the type is unknown to the compiler, the size is set to 0.
An optional argument specifies a default size when cross-compiling.  The
`configure' script will abort with an error message if it tries to
cross-compile without this default size.
AC_CONFIG_AUX_DIR(directory)This macro allows an alternative directory to be specified for the
location of auxiliary scripts such as `config.guess',
`config.sub' and `install-sh'.  By default, `$srcdir',
`$srcdir/..' and `$srcdir/../..' are searched for these files.
AC_CONFIG_HEADER(header-list)This indicates that you want to use a config header, as opposed to
having all the C preprocessor macros defined via -Doptions in
theDEFS`Makefile' variable.  Each header named in
header-list is created at runtime by `configure' (viaAC_OUTPUT).  There are a variety of optional features for use
with config headers (different naming schemes and so forth); see the
reference manual for more information.
AC_C_CONSTThis macro defines the C preprocessor macro constto the stringconstif the C compiler supports theconstkeyword.
Otherwise it is defined to be the empty string.
AC_C_INLINEThis macro tests if the C compiler can accept the inlinekeyword.
It defines the C preprocessor macroinlineto be the keyword
accepted by the compiler or the empty string if it is not accepted at
all.
AC_DEFINE(variable, [value], [description])This is used to define C preprocessor macros.  The first argument is the
name of the macro to define.  The value argument, if given, is the
value of the macro.  The final argument can be used to avoid adding an
`#undef' for the macro to `acconfig.h'.
AC_DEFINE_UNQUOTED(variable, [value], [description])This is like AC_DEFINE, but it handles the quoting of value
differently.  This macro is used when you want to compute the value
instead of having it used verbatim.
AC_DEFUN(name, body)This macro is used to define new macros.  It is similar to M4's
definemacro, except that it performs additional internal
functions.
AC_DISABLE_FAST_INSTALLThis macro can be used to disable Libtool's `fast install' feature.
AC_DISABLE_SHAREDThis macro changes the default behavior of AC_PROG_LIBTOOLso
that shared libraries will not be built by default.  The user can still
override this new default by using `--enable-shared'.
AC_DISABLE_STATICThis macro changes the default behavior of AC_PROG_LIBTOOLso
that static libraries will not be built by default.  The user can still
override this new default by using `--enable-static'.
AC_EXEEXTSets the output variable EXEEXTto the extension of executables
produced by the compiler.  It is usually set to the empty string on Unix
systems and `.exe' on Windows.
AC_FUNC_ALLOCAThis macro defines the C preprocessor macro HAVE_ALLOCAif the
various tests indicate that the C compiler has built-inallocasupport.  If there is an `alloca.h' header file, this macro definesHAVE_ALLOCA_H.  If, instead, theallocafunction is found
in the standard C library, this macro definesC_ALLOCAand sets
the output variableALLOCAtoalloca.o.
AC_FUNC_GETPGRPThis macro tests if the getpgrpfunction takes a process ID as an
argument or not.  If it does not, the C preprocessor macroGETPGRP_VOIDis defined.
AC_FUNC_MEMCMPThis macro tests for a working version of the memcmpfunction.
If absent, or it does not work correctly, `memcmp.o' is added to
theLIBOBJSoutput variable.
AC_FUNC_MMAPDefines the C preprocessor macro HAVE_MMAPif themmapfunction exists and works.
AC_FUNC_SETVBUF_REVERSEDOn some systems, the order of the modeandbufarguments
is reversed with respect to the ANSI C standard.  If so, this macro
defines the C preprocessor macroSETVBUF_REVERSED.
AC_FUNC_UTIME_NULLDefines the C preprocessor macro HAVE_UTIME_NULLif a call toutimewith a NULLutimbufpointer sets the file's
timestamp to the current time.
AC_FUNC_VPRINTFDefines the C preprocessor macro HAVE_VPRINTFif thevprintffunction is available.  If not and the_doprntfunction is available instead, this macro definesHAVE_DOPRNT.
AC_HEADER_DIRENTThis macro searches a number of specific header files for a declaration
of the C type DIR.  Depending on which header file the
declaration is found in, this macro may define one of the C preprocessor
macrosHAVE_DIRENT_H,HAVE_SYS_NDIR_H,HAVE_SYS_DIR_HorHAVE_NDIR_H.  Refer to the Autoconf
manual for an example of how these macros should be used in your source
code.
AC_HEADER_STDCThis macro defines the C preprocessor macro STDC_HEADERSif the
system has the ANSI standard C header files.  It determines this by
testing for the existence of the `stdlib.h', `stdarg.h',
`string.h' and `float.h' header files and testing if
`string.h' declaresmemchr, `stdlib.h' declaresfree, and `ctype.h' macros such asisdigitwork with
8-bit characters.
AC_INIT(filename)This macro performs essential initialization for the generated
`configure' script.  An optional argument may provide the name of a
file from the source directory to ensure that the directory has been
specified correctly.
AC_LIBTOOL_DLOPENCall this macro before AC_PROG_LIBTOOLto indicate that your
package wants to use Libtool's support fordlopened modules.
AC_LIBTOOL_WIN32_DLLCall this macro before AC_PROG_LIBTOOLto indicate that your
package has been written to build DLLs on Windows.  If this macro
is not called, Libtool will only build static libraries on Windows.
AC_LIB_LTDLThis macro does the configure-time checks needed to cause
`ltdl.c' to be compiled correctly.  That is, this is used to enable
dynamic loading vialibltdl.
AC_LINK_FILES(source-list, dest-list)Use this macro to create a set of links; if possible, symlinks are made.
The two arguments are parallel lists: the first element of
dest-list is the name of a to-be-created link whose target is the
first element of source-list.
AC_MSG_CHECKING(message)This macro outputs a message to the user in the usual style of
`configure' scripts: leading with the word `checking' and
ending in `...'.  This message gives the user an indication that
the `configure' script is still working.  A subsequent invocation
of AC_MSG_RESULTshould be used to output the result of a test.
AC_MSG_ERROR(message)This macro outputs an error message to standard error and aborts the
`configure' script.  It should only be used for fatal error
conditions.
AC_MSG_RESULT(message)This macro should be invoked after a corresponding invocation of
AC_MSG_CHECKINGwith the result of a test.  Often the result
string can be as simple as `yes' or `no'.
AC_MSG_WARN(message)This macro outputs a warning to standard error, but allows the
`configure' script to continue.  It should be used to notify the
user of abnormal, but non-fatal, conditions.
AC_OBJEXTSets the output variable OBJEXTto the extension of object files
produced by the compiler.  Usually, it is set to `.o' on Unix
systems and `.obj' on Windows.
AC_OUTPUT(files, [extra-commands], [init-commands])This macro must be called at the end of every `configure.in'.  It
creates each file listed in files.  For a given file, by default,
configurereads the template file whose name is the name of the
input file with `.in' appended -- for instance, `Makefile' is
generated from `Makefile.in'.  This default can be overridden by
using a special naming convention for the file.
For each name `foo' given as an argument to AC_SUBST,configurewill replace any occurrence of `@foo@' in the
template file with the value of the shell variable `foo' in the
generated file.  This macro also generates the config header, ifAC_CONFIG_HEADERwas called, and any links, ifAC_LINK_FILESwas called.  The additional arguments can be used
to further tailor the output processing. 
AC_OUTPUT_COMMANDS(extra-commands, [init-commands])This macro works like the optional final arguments of AC_OUTPUT,
except that it can be called more than once from `configure.in'.
(This makes it possible for macros to use this feature and yet remain
modular.)  See the reference manual for the precise definition of this
macro.
AC_PROG_AWKThis macro searches for an awkprogram and sets the output
variableAWKto be the best one it finds.
AC_PROG_CCThis checks for the C compiler to use and sets the shell variable
CCto the value.  If the GNU C compiler is being used, this
sets the shell variableGCCto `yes'.  This macro sets the
shell variableCFLAGSif it has not already been set.  It also
callsAC_SUBSTonCCandCFLAGS.
AC_PROG_CC_STDCThis macro attempts to discover a necessary command line option to have
the C compiler accept ANSI C.  If so, it adds the option to the
CC.  If it were not possible to get the C compiler to accept
ANSI, the shell variableac_cv_prog_cc_stdcwill be set to
`no'.
AC_PROG_CPPThis macro sets the output variable CPPto a command that runs
the C preprocessor.  If `$CC -E' does not work, it will set the
variable to `/lib/cpp'.
AC_PROG_CXXThis is like AC_PROG_CC, but it checks for the C++ compiler, and
sets the variablesCXX,GXXandCXXFLAGS.
AC_PROG_GCC_TRADITIONALThis macro determines if GCC requires the `-traditional'
option in order to compile code that uses ioctland, if so, adds
`-traditional' to theCCoutput variable.  This condition is
rarely encountered, thought mostly on old systems.
AC_PROG_INSTALLThis looks for an installprogram and sets the output variablesINSTALL,INSTALL_DATA,INSTALL_PROGRAM, andINSTALL_SCRIPT.  This macro assumes that if aninstallprogram cannot be found on the system, your package will have
`install-sh' available in the directory chosen byAC_CONFIG_AUX_DIR.
AC_PROG_LEXThis looks for a lex-like program and sets the `Makefile'
variableLEXto the result.  It also setsLEXLIBto
whatever might be needed to link againstlexoutput.
AC_PROG_LIBTOOLThis macro is the primary way to integrate Libtool support into
`configure'.  If you are using Libtool, you should call this macro
in `configure.in'.  Among other things, it adds support for the
`--enable-shared' configureflag.
AC_PROG_LN_SThis sets the `Makefile' variable LN_Sto `ln -s' if
symbolic links work in the current working directory.  Otherwise it setsLN_Sto just `ln'.
AC_PROG_MAKE_SETSome versions of makeneed to have the `Makefile' variableMAKEset in `Makefile' in order for recursive builds to
work.  This macro checks whether this is needed, and, if so, it sets the
`Makefile' variableSET_MAKEto the result.AM_INIT_AUTOMAKEcalls this macro, so if you are using Automake,
you don't need to call it or useSET_MAKEin `Makefile.am'.
AC_PROG_RANLIBThis searches for the ranlibprogram.  It sets the
`Makefile' variableRANLIBto the result.  Ifranlibis
not found, or not needed on the system, then the result is:.
AC_PROG_YACCThis searches for the yaccprogram -- it triesbison,byacc, andyacc.  It sets the `Makefile' variableYACCto the result.
AC_REPLACE_FUNCS(function list)This macro takes a single argument, which is a list of functions.  For a
given function `func', `configure' will do a link test to try
to find it.  If the function cannot be found, then `func.o' will be
added to LIBOBJS.  If function can be found, then
`configure' will define the C preprocessor symbolHAVE_FUNC.
AC_REQUIRE(macro-name)This macro takes a single argument, which is the name of another macro.
(Note that you must quote the argument correctly:
AC_REQUIRE([FOO])is correct, whileAC_REQUIRE(FOO)is
not.)  If the named macro has already been invoked, thenAC_REQUIREdoes nothing.  Otherwise, it invokes the named macro
with no arguments.
AC_REVISION(revision)This macro takes a single argument, a version string.  Autoconf will
copy this string into the generated `configure' file.
AC_STRUCT_ST_BLKSIZEDefines the C preprocessor macro HAVE_ST_BLKSIZEifstruct
stathas anst_blksizemember.
AC_STRUCT_ST_BLOCKSDefines the C preprocessor macro HAVE_ST_BLOCKSifstruct
stathas anst_blocksmember.
AC_STRUCT_ST_RDEVDefines the C preprocessor macro HAVE_ST_RDEVifstruct
stathas anst_rdevmember.
AC_STRUCT_TMThis macro looks for struct tmin `time.h' and definesTM_IN_SYS_TIMEif it is not found there.
AC_SUBST(name)This macro takes a single argument, which is the name of a shell
variable.  When configuregenerates the files listed inAC_OUTPUT(e.g., `Makefile'), it will substitute the
variable's value (at the end of theconfigurerun -- the value
can be changed afterAC_SUBSTis called) anywhere a string of the
form `@name@' is seen.
AC_TRY_COMPILE(includes, body, [if-ok], [if-not-ok])This macro is used to try to compile a given function, whose body is
given in body.  includes lists any `#include'
statements needed to compile the function.  If the code compiles
correctly, the shell commands in if-ok are run; if not,
if-not-ok is run.  Note that this macro will not try to link the
test program -- it will only try to compile it.
AC_TRY_LINK(includes, body, [if-found], [if-not-found])This is used like AC_TRY_COMPILE, but it tries to link the
resulting program.  The libraries and options in theLIBSshell
variable are passed to the link.
AC_TRY_RUN(program, [if-true, [if-false], [if-cross-compiling])This macro tries to compile and link the program whose text is in
program.  If the program compiles, links, and runs successfully,
the shell code if-true is run.  Otherwise, the shell code
if-false is run.  If the current configure is a cross-configure,
then the program is not run, and on a successful compile and link, the
shell code if-cross-compiling is run.
AC_TYPE_SIGNALThis macro defines the C preprocessor macro RETSIGTYPEto be the
correct return type of signal handlers.  For instance, it might be
`void' or `int'.
AC_TYPE_SIZE_TThis macro looks for the type size_t.  If not defined on the
system, it defines it (as a macro) to be `unsigned'.
AM_CONDITIONAL(name, testcode)This Automake macro takes two arguments: the name of a conditional and a
shell statement that is used to determine whether the conditional should
be true or false.  If the shell code returns a successful (0) status,
then the conditional will be true.  Any conditional in your
`configure.in' is automatically available for use in any
`Makefile.am' in that project.
AM_CONFIG_HEADER(header)This is just like AC_CONFIG_HEADER, but does some additional
setup required by Automake.  If you are using Automake, use this macro.
Otherwise, useAC_CONFIG_HEADER.
AM_INIT_AUTOMAKE(package, version, [nodefine])This macro is used to do all the standard initialization required by
Automake.  It has two required arguments: the package name and the
version number.  This macro sets and calls AC_SUBSTon the shell
variablesPACKAGEandVERSION.  By default it also defines
these variables (viaAC_DEFINE_UNQUOTED).  However, this macro
also accepts an optional third argument which, if not empty, means that
theAC_DEFINE_UNQUOTEDcalls forPACKAGEandVERSIONshould be suppressed.
AM_MAINTAINER_MODEThis macro is used to enable a special Automake feature, maintainer
mode, which we've documented elsewhere (see section 5.3 Maintaining Input Files).
AM_PROG_CC_STDCThis macro takes no arguments.  It is used to try to get the C compiler
to be ANSI compatible.  It does this by adding different options
known to work with various system compilers.  This macro is most
typically used in conjunction with Automake when you want to use the
automatic de-ANSI-fication feature.
AM_PROG_LEXThis is like AC_PROG_LEX, but it does some additional processing
used by Automake-generated `Makefile's.  If you are using Automake,
then you should use this.  Otherwise, you should useAC_PROG_LEX(and perhapsAC_DECL_YYTEXT, whichAM_PROG_LEXcalls).
AM_WITH_DMALLOCThis macro adds support for the `--with-dmalloc' flag to
configure.  If the user chooses to enabledmallocsupport,
then this macro will define the preprocessor symbol `WITH_DMALLOC'
and will add `-ldmalloc' to the `Makefile' variable
`LIBS'.
 
 |