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 yourreference while reading this book. The descriptions are only brief; seethe appropriate reference manual for a complete description.
-
This macro allows the maintainer to specify additional package optionsaccepted by
`configure'--for example,
`--enable-zlib'. Theaction shell code may access any arguments to the option in the shellvariable
enableval
. For example, `--enable-buffers=128'would cause `configure' to setenableval
to `128'. -
This macro places a
sed
transformation program into the outputvariableprogram_transform_name
that can be used to transform thefilenames of installed programs. If the `--program-prefix', `--program-suffix' or
`--program-transform-name' optionsare passed to `configure', an appropriate transformation programwill be generated. If no options are given, but the type of the hostsystem differs from the type of the target system, program names aretransformed by prefixing them with the type of the target(eg.arm-elf-gcc
). -
This macro allows the maintainer to specify additional packages thatthis package should work with (for example, a library to manipulateshadow passwords). The user indicates this preference by invoking
`configure' with an option such as
`--with-shadow'. If anoptional argument is given, this value is available to shell code in theshell variable
withval
. -
This macro is a convenient front-end to the
AC_CACHE_VAL
macrothat takes care of printing messages to the user, including whether ornot the result was found in the cache. It should be used in preferencetoAC_CACHE_VAL
. - 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 readfrom `config.cache'), then this macro does nothing. Otherwise, itruns the shell code in commands, which is assumed to set the cachevariable.
- This macro determines the type of the host system and sets the outputvariable `host', as well as other more obscure variables.
- This macro determines the type of the build, host and target systems andsets the output variables `build', `host' and `target',amongst other more obscure variables.
- This macro tests for the existence of a file in the file system of thebuild system, and runs the appropriate shell code depending on whetheror not the file is found.
-
This looks for a series of functions. If the function
quux
isfound, the C preprocessor macroHAVE_QUUX
will be defined. Inaddition, if the if-found argument is given, it will be run (asshell code) when a function is found -- this code can use thesh
break
command to preventAC_CHECK_FUNCS
from looking forthe remaining functions in the list. The shell code in if-not-found is run if a function is 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.
-
This looks for a series of headers. If the header
quux.h
isfound, the C preprocessor macroHAVE_QUUX_H
will be defined. Inaddition, if the if-found argument is given, it will be run (asshell code) when a header is found -- this code can use thesh
break
command to preventAC_CHECK_HEADERS
from looking forthe remaining headers in the list. The shell code in if-not-foundis run if a header is not found. -
This looks for the named function in the named library specified by itsbase name. For instance the math library,
`libm.a', would be namedsimply
`m'. If the function is found in the library
`foo',then the C preprocessor macro
HAVE_LIBFOO
is defined. - Checks to see if the program named by program-name exists in thepath path. If found, it sets the shell variable variable tothe 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.
-
This macro determines the size of C and C++ built-in types and defines
SIZEOF_type
to the size, wheretype
is transformed--allcharacters 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 tocross-compile without this default size. - This macro allows an alternative directory to be specified for thelocation of auxiliary scripts such as `config.guess', `config.sub' and `install-sh'. By default, `$srcdir', `$srcdir/..' and `$srcdir/../..' are searched for these files.
-
This indicates that you want to use a config header, as opposed tohaving all the C preprocessor macros defined via
-D
options intheDEFS
`Makefile' variable. Each header named in header-list is created at runtime by `configure' (viaAC_OUTPUT
). There are a variety of optional features for usewith config headers (different naming schemes and so forth); see thereference manual for more information. -
This macro defines the C preprocessor macro
const
to the stringconst
if the C compiler supports theconst
keyword.Otherwise it is defined to be the empty string. -
This macro tests if the C compiler can accept the
inline
keyword.It defines the C preprocessor macroinline
to be the keywordaccepted by the compiler or the empty string if it is not accepted atall. - This is used to define C preprocessor macros. The first argument is thename of the macro to define. The value argument, if given, is thevalue of the macro. The final argument can be used to avoid adding an `#undef' for the macro to `acconfig.h'.
-
This is like
AC_DEFINE
, but it handles the quoting of valuedifferently. This macro is used when you want to compute the valueinstead of having it used verbatim. -
This macro is used to define new macros. It is similar to M4's
define
macro, except that it performs additional internalfunctions. - This macro can be used to disable Libtool's `fast install' feature.
-
This macro changes the default behavior of
AC_PROG_LIBTOOL
sothat shared libraries will not be built by default. The user can stilloverride this new default by using `--enable-shared'. -
This macro changes the default behavior of
AC_PROG_LIBTOOL
sothat static libraries will not be built by default. The user can stilloverride this new default by using `--enable-static'. -
Sets the output variable
EXEEXT
to the extension of executablesproduced by the compiler. It is usually set to the empty string on Unixsystems and `.exe' on Windows. -
This macro defines the C preprocessor macro
HAVE_ALLOCA
if thevarious tests indicate that the C compiler has built-inalloca
support. If there is an `alloca.h' header file, this macro definesHAVE_ALLOCA_H
. If, instead, thealloca
function is foundin the standard C library, this macro definesC_ALLOCA
and setsthe output variableALLOCA
toalloca.o
. -
This macro tests if the
getpgrp
function takes a process ID as anargument or not. If it does not, the C preprocessor macroGETPGRP_VOID
is defined. -
This macro tests for a working version of the
memcmp
function.If absent, or it does not work correctly, `memcmp.o' is added totheLIBOBJS
output variable. -
Defines the C preprocessor macro
HAVE_MMAP
if themmap
function exists and works. -
On some systems, the order of the
mode
andbuf
argumentsis reversed with respect to the ANSI C standard. If so, this macrodefines the C preprocessor macroSETVBUF_REVERSED
. -
Defines the C preprocessor macro
HAVE_UTIME_NULL
if a call toutime
with a NULLutimbuf
pointer sets the file'stimestamp to the current time. -
Defines the C preprocessor macro
HAVE_VPRINTF
if thevprintf
function is available. If not and the_doprnt
function is available instead, this macro definesHAVE_DOPRNT
. -
This macro searches a number of specific header files for a declarationof the C type
DIR
. Depending on which header file thedeclaration is found in, this macro may define one of the C preprocessormacrosHAVE_DIRENT_H
,HAVE_SYS_NDIR_H
,HAVE_SYS_DIR_H
orHAVE_NDIR_H
. Refer to the Autoconfmanual for an example of how these macros should be used in your sourcecode. -
This macro defines the C preprocessor macro
STDC_HEADERS
if thesystem has the ANSI standard C header files. It determines this bytesting 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 asisdigit
work with8-bit characters. - This macro performs essential initialization for the generated `configure' script. An optional argument may provide the name of afile from the source directory to ensure that the directory has beenspecified correctly.
-
Call this macro before
AC_PROG_LIBTOOL
to indicate that yourpackage wants to use Libtool's support fordlopen
ed modules. -
Call this macro before
AC_PROG_LIBTOOL
to indicate that yourpackage has been written to build DLLs on Windows. If this macrois not called, Libtool will only build static libraries on Windows. -
This macro does the
configure
-time checks needed to cause `ltdl.c' to be compiled correctly. That is, this is used to enabledynamic loading vialibltdl
. - 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 thefirst element of source-list.
-
This macro outputs a message to the user in the usual style of
`configure' scripts: leading with the word
`checking' andending in
`...'. This message gives the user an indication thatthe
`configure' script is still working. A subsequent invocationof
AC_MSG_RESULT
should be used to output the result of a test. - This macro outputs an error message to standard error and aborts the `configure' script. It should only be used for fatal errorconditions.
-
This macro should be invoked after a corresponding invocation of
AC_MSG_CHECKING
with the result of a test. Often the resultstring can be as simple as `yes' or `no'. - This macro outputs a warning to standard error, but allows the `configure' script to continue. It should be used to notify theuser of abnormal, but non-fatal, conditions.
-
Sets the output variable
OBJEXT
to the extension of object filesproduced by the compiler. Usually, it is set to `.o' on Unixsystems and `.obj' on Windows. -
This macro must be called at the end of every
`configure.in'. Itcreates each file listed in
files. For a given file, by default,
configure
reads the template file whose name is the name of theinput file with `.in' appended -- for instance, `Makefile' isgenerated from `Makefile.in'. This default can be overridden byusing a special naming convention for the file.For each name `foo' given as an argument to
AC_SUBST
,configure
will replace any occurrence of `@foo@' in thetemplate file with the value of the shell variable `foo' in thegenerated file. This macro also generates the config header, ifAC_CONFIG_HEADER
was called, and any links, ifAC_LINK_FILES
was called. The additional arguments can be usedto further tailor the output processing. -
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 remainmodular.) See the reference manual for the precise definition of thismacro. -
This macro searches for an
awk
program and sets the outputvariableAWK
to be the best one it finds. -
This checks for the C compiler to use and sets the shell variable
CC
to the value. If the GNU C compiler is being used, thissets the shell variableGCC
to `yes'. This macro sets theshell variableCFLAGS
if it has not already been set. It alsocallsAC_SUBST
onCC
andCFLAGS
. -
This macro attempts to discover a necessary command line option to havethe 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 acceptANSI, the shell variableac_cv_prog_cc_stdc
will be set to `no'. -
This macro sets the output variable
CPP
to a command that runsthe C preprocessor. If `$CC -E' does not work, it will set thevariable to `/lib/cpp'. -
This is like
AC_PROG_CC
, but it checks for the C++ compiler, andsets the variablesCXX
,GXX
andCXXFLAGS
. -
This macro determines if GCC requires the
`-traditional'option in order to compile code that uses
ioctl
and, if so, adds `-traditional' to theCC
output variable. This condition israrely encountered, thought mostly on old systems. -
This looks for an
install
program and sets the output variablesINSTALL
,INSTALL_DATA
,INSTALL_PROGRAM
, andINSTALL_SCRIPT
. This macro assumes that if aninstall
program cannot be found on the system, your package will have `install-sh' available in the directory chosen byAC_CONFIG_AUX_DIR
. -
This looks for a
lex
-like program and sets the `Makefile'variableLEX
to the result. It also setsLEXLIB
towhatever might be needed to link againstlex
output. -
This macro is the primary way to integrate Libtool support into
`configure'. If you are using Libtool, you should call this macroin
`configure.in'. Among other things, it adds support for the
`--enable-shared'
configure
flag. -
This sets the
`Makefile' variable
LN_S
to `ln -s' ifsymbolic links work in the current working directory. Otherwise it setsLN_S
to just `ln'. -
Some versions of
make
need to have the `Makefile' variableMAKE
set in `Makefile' in order for recursive builds towork. This macro checks whether this is needed, and, if so, it sets the `Makefile' variableSET_MAKE
to the result.AM_INIT_AUTOMAKE
calls this macro, so if you are using Automake,you don't need to call it or useSET_MAKE
in `Makefile.am'. -
This searches for the
ranlib
program. It sets the `Makefile' variableRANLIB
to the result. Ifranlib
isnot found, or not needed on the system, then the result is:
. -
This searches for the
yacc
program -- it triesbison
,byacc
, andyacc
. It sets the `Makefile' variableYACC
to the result. -
This macro takes a single argument, which is a list of functions. For agiven function
`func',
`configure' will do a link test to tryto find it. If the function cannot be found, then
`func.o' will beadded to
LIBOBJS
. If function can be found, then `configure' will define the C preprocessor symbolHAVE_FUNC
. -
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)
isnot.) If the named macro has already been invoked, thenAC_REQUIRE
does nothing. Otherwise, it invokes the named macrowith no arguments. - This macro takes a single argument, a version string. Autoconf willcopy this string into the generated `configure' file.
-
Defines the C preprocessor macro
HAVE_ST_BLKSIZE
ifstructstat
has anst_blksize
member. -
Defines the C preprocessor macro
HAVE_ST_BLOCKS
ifstructstat
has anst_blocks
member. -
Defines the C preprocessor macro
HAVE_ST_RDEV
ifstructstat
has anst_rdev
member. -
This macro looks for
struct tm
in `time.h' and definesTM_IN_SYS_TIME
if it is not found there. -
This macro takes a single argument, which is the name of a shellvariable. When
configure
generates the files listed inAC_OUTPUT
(e.g., `Makefile'), it will substitute thevariable's value (at the end of theconfigure
run -- the valuecan be changed afterAC_SUBST
is called) anywhere a string of theform `@name@' is seen. - This macro is used to try to compile a given function, whose body isgiven in body. includes lists any `#include'statements needed to compile the function. If the code compilescorrectly, the shell commands in if-ok are run; if not, if-not-ok is run. Note that this macro will not try to link thetest program -- it will only try to compile it.
-
This is used like
AC_TRY_COMPILE
, but it tries to link theresulting program. The libraries and options in theLIBS
shellvariable are passed to the link. - 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, theshell code if-cross-compiling is run.
-
This macro defines the C preprocessor macro
RETSIGTYPE
to be thecorrect return type of signal handlers. For instance, it might be `void' or `int'. -
This macro looks for the type
size_t
. If not defined on thesystem, it defines it (as a macro) to be `unsigned'. - This Automake macro takes two arguments: the name of a conditional and ashell statement that is used to determine whether the conditional shouldbe 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.
-
This is just like
AC_CONFIG_HEADER
, but does some additionalsetup required by Automake. If you are using Automake, use this macro.Otherwise, useAC_CONFIG_HEADER
. -
This macro is used to do all the standard initialization required byAutomake. It has two required arguments: the package name and theversion number. This macro sets and calls
AC_SUBST
on the shellvariablesPACKAGE
andVERSION
. By default it also definesthese variables (viaAC_DEFINE_UNQUOTED
). However, this macroalso accepts an optional third argument which, if not empty, means thattheAC_DEFINE_UNQUOTED
calls forPACKAGE
andVERSION
should be suppressed. - This macro is used to enable a special Automake feature, maintainermode, which we've documented elsewhere (see section 5.3 Maintaining Input Files).
- This macro takes no arguments. It is used to try to get the C compilerto be ANSI compatible. It does this by adding different optionsknown to work with various system compilers. This macro is mosttypically used in conjunction with Automake when you want to use theautomatic de-ANSI-fication feature.
-
This is like
AC_PROG_LEX
, but it does some additional processingused 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_LEX
calls). -
This macro adds support for the
`--with-dmalloc' flag to
configure
. If the user chooses to enabledmalloc
support,then this macro will define the preprocessor symbol `WITH_DMALLOC'and will add `-ldmalloc' to the `Makefile' variable `LIBS'.
AC_ARG_ENABLE(feature, help-text, [if-given], [if-not-given])
AC_ARG_PROGRAM
AC_ARG_WITH(package, help-text, [if-given], [if-not-given])
AC_CACHE_CHECK(message, cache-variable, commands)
AC_CACHE_VAL(cache-variable, commands)
AC_CANONICAL_HOST
AC_CANONICAL_SYSTEM
AC_CHECK_FILE(file, [if-found], [if-not-found])
AC_CHECK_FUNCS(function-list, [if-found], [if-not-found])
AC_CHECK_HEADER(header, [if-found], [if-not-found])
AC_CHECK_HEADERS(header-list, [if-found], [if-not-found])
AC_CHECK_LIB(library, function, [if-found], [if-not-found], [other-libraries])
AC_CHECK_PROG(variable, program-name, value-if-found, [value-if-not-found], [path], [reject])
AC_CHECK_SIZEOF(type, [size-if-cross-compiling])
AC_CONFIG_AUX_DIR(directory)
AC_CONFIG_HEADER(header-list)
AC_C_CONST
AC_C_INLINE
AC_DEFINE(variable, [value], [description])
AC_DEFINE_UNQUOTED(variable, [value], [description])
AC_DEFUN(name, body)
AC_DISABLE_FAST_INSTALL
AC_DISABLE_SHARED
AC_DISABLE_STATIC
AC_EXEEXT
AC_FUNC_ALLOCA
AC_FUNC_GETPGRP
AC_FUNC_MEMCMP
AC_FUNC_MMAP
AC_FUNC_SETVBUF_REVERSED
AC_FUNC_UTIME_NULL
AC_FUNC_VPRINTF
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_INIT(filename)
AC_LIBTOOL_DLOPEN
AC_LIBTOOL_WIN32_DLL
AC_LIB_LTDL
AC_LINK_FILES(source-list, dest-list)
AC_MSG_CHECKING(message)
AC_MSG_ERROR(message)
AC_MSG_RESULT(message)
AC_MSG_WARN(message)
AC_OBJEXT
AC_OUTPUT(files, [extra-commands], [init-commands])
AC_OUTPUT_COMMANDS(extra-commands, [init-commands])
AC_PROG_AWK
AC_PROG_CC
AC_PROG_CC_STDC
AC_PROG_CPP
AC_PROG_CXX
AC_PROG_GCC_TRADITIONAL
AC_PROG_INSTALL
AC_PROG_LEX
AC_PROG_LIBTOOL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_RANLIB
AC_PROG_YACC
AC_REPLACE_FUNCS(function list)
AC_REQUIRE(macro-name)
AC_REVISION(revision)
AC_STRUCT_ST_BLKSIZE
AC_STRUCT_ST_BLOCKS
AC_STRUCT_ST_RDEV
AC_STRUCT_TM
AC_SUBST(name)
AC_TRY_COMPILE(includes, body, [if-ok], [if-not-ok])
AC_TRY_LINK(includes, body, [if-found], [if-not-found])
AC_TRY_RUN(program, [if-true, [if-false], [if-cross-compiling])
AC_TYPE_SIGNAL
AC_TYPE_SIZE_T
AM_CONDITIONAL(name, testcode)
AM_CONFIG_HEADER(header)
AM_INIT_AUTOMAKE(package, version, [nodefine])
AM_MAINTAINER_MODE
AM_PROG_CC_STDC
AM_PROG_LEX
AM_WITH_DMALLOC