manpagez: man pages & more
info autoconf
Home | html | info | man

File: autoconf.info,  Node: Input,  Next: Output,  Prev: Notices,  Up: Setup

4.4 Configure Input: Source Code, Macros, and Auxiliary Files
=============================================================

The following macros help you manage the contents of your source tree.

 -- Macro: AC_CONFIG_SRCDIR (UNIQUE-FILE-IN-SOURCE-DIR)
     Distinguish this package's source directory from other source
     directories that might happen to exist in the file system.
     UNIQUE-FILE-IN-SOURCE-DIR should name a file that is unique to this
     package.  ‘configure’ will verify that this file exists in
     ‘SRCDIR’, before it runs any other checks.

     Use of this macro is strongly recommended.  It protects against
     people accidentally specifying the wrong directory with ‘--srcdir’.
     *Note configure Invocation::, for more information.

   Packages that use ‘aclocal’ to generate ‘aclocal.m4’ should declare
where local macros can be found using ‘AC_CONFIG_MACRO_DIRS’.

 -- Macro: AC_CONFIG_MACRO_DIRS (DIR1 [DIR2 ... DIRN])
 -- Macro: AC_CONFIG_MACRO_DIR (DIR)
     Specify the given directories as the location of additional local
     Autoconf macros.  These macros are intended for use by commands
     like ‘autoreconf’ or ‘aclocal’ that trace macro calls; they should
     be called directly from ‘configure.ac’ so that tools that install
     macros for ‘aclocal’ can find the macros' declarations.  Tools that
     want to learn which directories have been selected should trace
     ‘AC_CONFIG_MACRO_DIR_TRACE’, which will be called once per
     directory.

     AC_CONFIG_MACRO_DIRS is the preferred form, and can be called
     multiple times and with multiple arguments; in such cases,
     directories in earlier calls are expected to be searched before
     directories in later calls, and directories appearing in the same
     call are expected to be searched in the order in which they appear
     in the call.  For historical reasons, the macro AC_CONFIG_MACRO_DIR
     can also be used once, if it appears first, for tools such as older
     ‘libtool’ that weren't prepared to handle multiple directories.
     For example, a usage like

          AC_CONFIG_MACRO_DIR([dir1])
          AC_CONFIG_MACRO_DIRS([dir2])
          AC_CONFIG_MACRO_DIRS([dir3 dir4])

     will cause the trace of AC_CONFIG_MACRO_DIR_TRACE to appear four
     times, and should cause the directories to be searched in this
     order: ‘dir1 dir2 dir3 dir4’.

     Note that if you use ‘aclocal’ from an Automake release prior to
     1.13 to generate ‘aclocal.m4’, you must also set ‘ACLOCAL_AMFLAGS =
     -I DIR1 [-I DIR2 ... -I DIRN]’ in your top-level ‘Makefile.am’.
     Due to a limitation in the Autoconf implementation of ‘autoreconf’,
     these include directives currently must be set on a single line in
     ‘Makefile.am’, without any backslash-newlines.

   Some Autoconf macros require auxiliary scripts.  ‘AC_PROG_INSTALL’
(*note Particular Programs::) requires a fallback implementation of
‘install’ called ‘install-sh’, and the ‘AC_CANONICAL’ macros (*note
Manual Configuration::) require the system-identification scripts
‘config.sub’ and ‘config.guess’.  Third-party tools, such as Automake
and Libtool, may require additional auxiliary scripts.

   By default, ‘configure’ looks for these scripts next to itself, in
‘SRCDIR’.  For convenience when working with subdirectories with their
own configure scripts (*note Subdirectories::), if the scripts are not
in ‘SRCDIR’ it will also look in ‘SRCDIR/..’ and ‘SRCDIR/../..’.  All of
the scripts must be found in the same directory.

   If these default locations are not adequate, or simply to reduce
clutter at the top level of the source tree, packages can use
‘AC_CONFIG_AUX_DIR’ to declare where to look for auxiliary scripts.

 -- Macro: AC_CONFIG_AUX_DIR (DIR)
     Look for auxiliary scripts in DIR.  Normally, DIR should be a
     relative path, which is taken as relative to ‘SRCDIR’.  If DIR is
     an absolute path or contains shell variables, however, it is used
     as-is.

     When the goal of using ‘AC_CONFIG_AUX_DIR’ is to reduce clutter at
     the top level of the source tree, the conventional name for DIR is
     ‘build-aux’.  If you need portability to DOS variants, do not name
     the auxiliary directory ‘aux’.  *Note File System Conventions::.

 -- Macro: AC_REQUIRE_AUX_FILE (FILE)
     Declare that FILE is an auxiliary script needed by this configure
     script, and set the shell variable ‘ac_aux_dir’ to the directory
     where it can be found.  The value of ‘ac_aux_dir’ is guaranteed to
     end with a ‘/’.

     Macros that need auxiliary scripts must use this macro to register
     each script they need.

   ‘configure’ checks for all the auxiliary scripts it needs on startup,
and exits with an error if any are missing.

   ‘autoreconf’ also detects missing auxiliary scripts.  When used with
the ‘--install’ option, ‘autoreconf’ will try to add missing scripts to
the directory specified by ‘AC_CONFIG_AUX_DIR’, or to the top level of
the source tree if ‘AC_CONFIG_AUX_DIR’ was not used.  It can always do
this for the scripts needed by Autoconf core macros: ‘install-sh’,
‘config.sub’, and ‘config.guess’.  Many other commonly-needed scripts
are installed by the third-party tools that ‘autoreconf’ knows how to
run, such as ‘missing’ for Automake and ‘ltmain.sh’ for Libtool.

   If you are using Automake, auxiliary scripts will automatically be
included in the tarball created by ‘make dist’.  If you are not using
Automake you will need to arrange for auxiliary scripts to be included
in tarballs yourself.  Auxiliary scripts should normally _not_ be
checked into a version control system, for the same reasons that
‘configure’ shouldn't be.

   The scripts needed by Autoconf core macros can be found in
‘$(datadir)/autoconf/build-aux’ of the Autoconf installation (*note
Installation Directory Variables::).  ‘install-sh’ can be downloaded
from
.
‘config.sub’ and ‘config.guess’ can be downloaded from
.

© manpagez.com 2000-2025
Individual documents may contain additional copyright information.