Next: , Previous: , Up: Basic Autoconf macros   [Contents][Index] Finding configure Input

Macro: AC_CONFIG_SRCDIR (unique-file-in-source-dir)

unique-file-in-source-dir is some file that is in the package’s source directory; configure 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 --srcdir; this is a safety check. See configure Invocation, for more information.

Packages that do manual configuration or use the install program might need to tell configure where to find some other shell scripts by calling AC_CONFIG_AUX_DIR, though the default places it looks are correct for most cases.

Macro: AC_CONFIG_AUX_DIR (dir)

Use the auxiliary build tools (e.g., install-sh, config.sub, config.guess, Cygnus configure, Automake and Libtool scripts, etc.) that are in directory dir. These are auxiliary files used in configuration. dir can be either absolute or relative to srcdir. The default is srcdir or srcdir/.. or srcdir/../.., whichever is the first that contains install-sh. The other files are not checked for, so that using AC_PROG_INSTALL does not automatically require distributing the other auxiliary files. It checks for also, but that name is obsolete because some make have a rule that creates install from it if there is no makefile.

The auxiliary directory is commonly named build-aux. If you need portability to DOS variants, do not name the auxiliary directory aux. See File System Conventions.


Declares that file 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 AC_PROG_INSTALL (see Particular Programs) or AC_CANONICAL_BUILD (see Canonicalizing) to register the auxiliary files they need.

Similarly, packages that use aclocal should declare where local macros can be found using AC_CONFIG_MACRO_DIRS.

Macro: AC_CONFIG_MACRO_DIRS (dir1 [dir2 ... dirN])

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 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


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 Due to a limitation in the Autoconf implementation of autoreconf, these include directives currently must be set on a single line in, without any backslash-newlines.

Next: , Previous: , Up: Basic Autoconf macros   [Contents][Index]