| [ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
6.2 Other things Automake recognizes
Every time Automake is run it calls Autoconf to trace ‘configure.ac’. This way it can recognize the use of certain macros and tailor the generated ‘Makefile.in’ appropriately. Currently recognized macros and their effects are:
AC_CANONICAL_BUILDAC_CANONICAL_HOSTAC_CANONICAL_TARGET-
Automake will ensure that ‘config.guess’ and ‘config.sub’ exist. Also, the ‘Makefile’ variables
build_triplet,host_tripletandtarget_tripletare introduced. See Getting the Canonical System Type in The Autoconf Manual. AC_CONFIG_AUX_DIRAutomake will look for various helper scripts, such as ‘install-sh’, in the directory named in this macro invocation. (The full list of scripts is: ‘ar-lib’, ‘config.guess’, ‘config.sub’, ‘depcomp’, ‘elisp-comp’, ‘compile’, ‘install-sh’, ‘ltmain.sh’, ‘mdate-sh’, ‘missing’, ‘mkinstalldirs’, ‘py-compile’, ‘texinfo.tex’, and ‘ylwrap’.) Not all scripts are always searched for; some scripts will only be sought if the generated ‘Makefile.in’ requires them.
If
AC_CONFIG_AUX_DIRis not given, the scripts are looked for in their standard locations. For ‘mdate-sh’, ‘texinfo.tex’, and ‘ylwrap’, the standard location is the source directory corresponding to the current ‘Makefile.am’. For the rest, the standard location is the first one of ‘.’, ‘..’, or ‘../..’ (relative to the top source directory) that provides any one of the helper scripts. See Finding ‘configure’ Input in The Autoconf Manual.Required files from
AC_CONFIG_AUX_DIRare automatically distributed, even if there is no ‘Makefile.am’ in this directory.AC_CONFIG_LIBOBJ_DIRAutomake will require the sources file declared with
AC_LIBSOURCE(see below) in the directory specified by this macro.AC_CONFIG_HEADERSAutomake will generate rules to rebuild these headers. Older versions of Automake required the use of
AM_CONFIG_HEADER(see section Autoconf macros supplied with Automake); this is no longer the case.As with
AC_CONFIG_FILES(see section Configuration requirements), parts of the specification using shell variables will be ignored as far as cleaning, distributing, and rebuilding is concerned.AC_CONFIG_LINKSAutomake will generate rules to remove ‘configure’ generated links on ‘make distclean’ and to distribute named source files as part of ‘make dist’.
As for
AC_CONFIG_FILES(see section Configuration requirements), parts of the specification using shell variables will be ignored as far as cleaning and distributing is concerned. (There are no rebuild rules for links.)AC_LIBOBJAC_LIBSOURCEAC_LIBSOURCES-
Automake will automatically distribute any file listed in
AC_LIBSOURCEorAC_LIBSOURCES.Note that the
AC_LIBOBJmacro callsAC_LIBSOURCE. So if an Autoconf macro is documented to call ‘AC_LIBOBJ([file])’, then ‘file.c’ will be distributed automatically by Automake. This encompasses many macros likeAC_FUNC_ALLOCA,AC_FUNC_MEMCMP,AC_REPLACE_FUNCS, and others.By the way, direct assignments to
LIBOBJSare no longer supported. You should always useAC_LIBOBJfor this purpose. SeeAC_LIBOBJvs.LIBOBJSin The Autoconf Manual. AC_PROG_RANLIBThis is required if any libraries are built in the package. See Particular Program Checks in The Autoconf Manual.
AC_PROG_CXXThis is required if any C++ source is included. See Particular Program Checks in The Autoconf Manual.
AC_PROG_OBJCThis is required if any Objective C source is included. See Particular Program Checks in The Autoconf Manual.
AC_PROG_F77This is required if any Fortran 77 source is included. This macro is distributed with Autoconf version 2.13 and later. See Particular Program Checks in The Autoconf Manual.
AC_F77_LIBRARY_LDFLAGSThis is required for programs and shared libraries that are a mixture of languages that include Fortran 77 (see section Mixing Fortran 77 With C and C++). See section Autoconf macros supplied with Automake.
AC_FC_SRCEXTAutomake will add the flags computed by
AC_FC_SRCEXTto compilation of files with the respective source extension (see Fortran Compiler Characteristics in The Autoconf Manual).AC_PROG_FCThis is required if any Fortran 90/95 source is included. This macro is distributed with Autoconf version 2.58 and later. See Particular Program Checks in The Autoconf Manual.
AC_PROG_LIBTOOLAutomake will turn on processing for
libtool(see Introduction in The Libtool Manual).AC_PROG_YACC-
If a Yacc source file is seen, then you must either use this macro or define the variable
YACCin ‘configure.ac’. The former is preferred (see Particular Program Checks in The Autoconf Manual). AC_PROG_LEXIf a Lex source file is seen, then this macro must be used. See Particular Program Checks in The Autoconf Manual.
AC_REQUIRE_AUX_FILEFor each
AC_REQUIRE_AUX_FILE([file]),automakewill ensure that ‘file’ exists in the aux directory, and will complain otherwise. It will also automatically distribute the file. This macro should be used by third-party Autoconf macros that require some supporting files in the aux directory specified withAC_CONFIG_AUX_DIRabove. See FindingconfigureInput in The Autoconf Manual.AC_SUBSTThe first argument is automatically defined as a variable in each generated ‘Makefile.in’, unless
AM_SUBST_NOTMAKEis also used for this variable. See Setting Output Variables in The Autoconf Manual.For every substituted variable var,
automakewill add a linevar = valueto each ‘Makefile.in’ file. Many Autoconf macros invokeAC_SUBSTto set output variables this way, e.g.,AC_PATH_XTRAdefinesX_CFLAGSandX_LIBS. Thus, you can access these variables as$(X_CFLAGS)and$(X_LIBS)in any ‘Makefile.am’ ifAC_PATH_XTRAis called.AM_C_PROTOTYPESThis is required when using the deprecated de-ANSI-fication feature; see section Automatic de-ANSI-fication (deprecated, soon to be removed). It will be removed in the next major Automake release.
AM_CONDITIONALThis introduces an Automake conditional (see section Conditionals).
AM_COND_IFThis macro allows
automaketo detect subsequent access within ‘configure.ac’ to a conditional previously introduced withAM_CONDITIONAL, thus enabling conditionalAC_CONFIG_FILES(see section Usage of Conditionals).AM_GNU_GETTEXTThis macro is required for packages that use GNU gettext (see section Gettext). It is distributed with gettext. If Automake sees this macro it ensures that the package meets some of gettext’s requirements.
AM_GNU_GETTEXT_INTL_SUBDIRThis macro specifies that the ‘intl/’ subdirectory is to be built, even if the
AM_GNU_GETTEXTmacro was invoked with a first argument of ‘external’.AM_MAINTAINER_MODE([default-mode])-
This macro adds an ‘--enable-maintainer-mode’ option to
configure. If this is used,automakewill cause “maintainer-only” rules to be turned off by default in the generated ‘Makefile.in’s, unless default-mode is ‘enable’. This macro defines theMAINTAINER_MODEconditional, which you can use in your own ‘Makefile.am’. See sectionmissingandAM_MAINTAINER_MODE. AM_SUBST_NOTMAKE(var)Prevent Automake from defining a variable var, even if it is substituted by
config.status. Normally, Automake defines amakevariable for eachconfiguresubstitution, i.e., for eachAC_SUBST([var]). This macro prevents that definition from Automake. IfAC_SUBSThas not been called for this variable, thenAM_SUBST_NOTMAKEhas no effects. Preventing variable definitions may be useful for substitution of multi-line values, wherevar = @value@might yield unintended results.m4_includeFiles included by ‘configure.ac’ using this macro will be detected by Automake and automatically distributed. They will also appear as dependencies in ‘Makefile’ rules.
m4_includeis seldom used by ‘configure.ac’ authors, but can appear in ‘aclocal.m4’ whenaclocaldetects that some required macros come from files local to your package (as opposed to macros installed in a system-wide directory, see section Auto-generating aclocal.m4).
| [ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This document was generated on February 3, 2012 using texi2html 5.0.
