[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Automake scans the package's `configure.in' to determine certain
information about the package. Some autoconf
macros are required
and some variables must be defined in `configure.in'. Automake
will also use information from `configure.in' to further tailor its
output.
Automake also supplies some Autoconf macros to make the maintenance
easier. These macros can automatically be put into your
`aclocal.m4' using the aclocal
program.
5.1 Configuration requirements 5.2 Other things Automake recognizes 5.3 Auto-generating aclocal.m4 5.4 Autoconf macros supplied with Automake 5.5 Writing your own aclocal macros
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The one real requirement of Automake is that your `configure.in'
call AM_INIT_AUTOMAKE
. This macro does several things which are
required for proper Automake operation (see section 5.4 Autoconf macros supplied with Automake).
Here are the other macros which Automake requires but which are not run
by AM_INIT_AUTOMAKE
:
AC_CONFIG_FILES
AC_OUTPUT
AC_CONFIG_FILES([foo/Makefile])
will cause Automake to
generate `foo/Makefile.in' if `foo/Makefile.am' exists.
Other listed files are treated differently. Currently the only
difference is that an Automake `Makefile' is removed by make
distclean
, while other files are removed by make clean
.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Automake will also recognize the use of certain macros and tailor the generated `Makefile.in' appropriately. Currently recognized macros and their effects are:
AC_CONFIG_HEADER
AM_CONFIG_HEADER
(see section 5.4 Autoconf macros supplied with Automake),
which is similar to AC_CONFIG_HEADER
(see section `Configuration Header Files' in The Autoconf Manual),
but does some useful Automake-specific work.
AC_CONFIG_AUX_DIR
AC_PATH_XTRA
AC_PATH_XTRA
into each `Makefile.in' that builds a C program
or library. See section `System Services' in The Autoconf Manual.
AC_CANONICAL_HOST
AC_CANONICAL_SYSTEM
AC_CANONICAL_HOST
, but also defines the
`Makefile' variables `build_alias' and `target_alias'.
See section `Getting the Canonical System Type' in The Autoconf Manual.
AC_FUNC_ALLOCA
AC_FUNC_ERROR_AT_LINE
AC_FUNC_FNMATCH
AC_FUNC_GETLOADAVG
AC_FUNC_MEMCMP
AC_FUNC_MKTIME
AC_FUNC_OBSTACK
AC_FUNC_STRTOD
AC_REPLACE_FUNCS
AC_REPLACE_GNU_GETOPT
AC_STRUCT_ST_BLOCKS
AM_WITH_REGEX
automake -a
will not install the sources.
See section 9.2 Building a library, for more information. Also, see section `Particular Function Checks' in The Autoconf Manual.
AC_LIBOBJ
LIBOBJS
AC_LIBSOURCE
AC_LIBSOURCES
LIBOBJS
, or pass `.o' files to AC_LIBOBJ
, and will
treat these additional files as if they were discovered via
AC_REPLACE_FUNCS
. Similarly, Automake will also distribute file
listed in AC_LIBSOURCE
and AC_LIBSOURCES
.
Note that assignments to LIBOBJS
is a construct which is being
phased out; they will be ignored in a future release of Automake. You
should call the AC_LIBOBJ
macro instead. See section `Generic Function Checks' in The Autoconf Manual.
AC_PROG_RANLIB
AC_PROG_CXX
AC_PROG_F77
AC_F77_LIBRARY_LDFLAGS
AC_PROG_LIBTOOL
libtool
(see section `Introduction' in The Libtool Manual).
AC_PROG_YACC
AC_PROG_LEX
AM_C_PROTOTYPES
AM_GNU_GETTEXT
AM_MAINTAINER_MODE
configure
. If this is used, automake
will cause
`maintainer-only' rules to be turned off by default in the
generated `Makefile.in's. This macro is disallowed in `Gnits'
mode (see section 21. The effect of --gnu
and --gnits
). This macro defines the `MAINTAINER_MODE'
conditional, which you can use in your own `Makefile.am'.
AC_SUBST
AC_CHECK_TOOL
AC_CHECK_PROG
AC_CHECK_PROGS
AC_PATH_PROG
AC_PATH_PROGS
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Automake includes a number of Autoconf macros which can be used in your
package; some of them are actually required by Automake in certain
situations. These macros must be defined in your `aclocal.m4';
otherwise they will not be seen by autoconf
.
The aclocal
program will automatically generate `aclocal.m4'
files based on the contents of `configure.in'. This provides a
convenient way to get Automake-provided macros, without having to
search around. Also, the aclocal
mechanism allows other packages
to supply their own macros.
At startup, aclocal
scans all the `.m4' files it can find,
looking for macro definitions. Then it scans `configure.in'. Any
mention of one of the macros found in the first step causes that macro,
and any macros it in turn requires, to be put into `aclocal.m4'.
The contents of `acinclude.m4', if it exists, are also automatically included in `aclocal.m4'. This is useful for incorporating local macros into `configure'.
aclocal
tries to be smart about looking for new AC_DEFUN
s
in the files it scans. It also
tries to copy the full text of the scanned file into `aclocal.m4',
including both `#' and `dnl' comments. If you want to make a
comment which will be completely ignored by aclocal
, use
`##' as the comment leader.
aclocal
accepts the following options:
--acdir=dir
--help
-I dir
--output=file
--print-ac-dir
aclocal
will search to
find third-party `.m4' files. When this option is given, normal
processing is suppressed. This option can be used by a package to
determine where to install a macro file.
--verbose
--version
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Automake ships with several Autoconf macros that you can use from your
`configure.in'. When you use one of them it will be included by
aclocal
in `aclocal.m4'.
5.4.1 Public macros Macros that you can use. 5.4.2 Private macros Macros that you should not use.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
AM_CONFIG_HEADER
AM_ENABLE_MULTILIB
AM_C_PROTOTYPES
AM_HEADER_TIOCGWINSZ_NEEDS_SYS_IOCTL
TIOCGWINSZ
requires `<sys/ioctl.h>', then
define GWINSZ_IN_SYS_IOCTL
. Otherwise TIOCGWINSZ
can be
found in `<termios.h>'.
AM_INIT_AUTOMAKE([OPTIONS])
AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
This macro has two forms, the second of which has two required
arguments: the package and the version number. This latter form is
obsolete because the package and version can be obtained
from Autoconf's AC_INIT
macro (which itself has an old and a new
form).
If your `configure.in' has:
AC_INIT(src/foo.c) AM_INIT_AUTOMAKE(mumble, 1.5) |
AC_INIT(mumble, 1.5) AC_CONFIG_SRCDIR(src/foo.c) AM_INIT_AUTOMAKE |
Note that if you're upgrading your `configure.in' from an earlier
version of Automake, it is not always correct to simply move the package
and version arguments from AM_INIT_AUTOMAKE
directly to
AC_INIT
, as in the example above. The first argument of
AC_INIT
is the name of your package (e.g. `GNU Automake'),
not the tarball name (e.g. `automake') you used to pass to
AM_INIT_AUTOMAKE
. Autoconf's rule to derive a tarball name from
the package name should work for most but not all packages. Especially,
if your tarball name is not all lower case, you will have to use the
four-argument form of AC_INIT
(supported in Autoconf versions
greater than 2.52g).
When AM_INIT_AUTOMAKE
is called with a single argument, it is
interpreted as a space-separated list of Automake options which should
be applied to every `Makefile.am' in the tree. The effect is as if
each option were listed in AUTOMAKE_OPTIONS
.
By default this macro AC_DEFINE
's `PACKAGE' and
`VERSION'. This can be avoided by passing the `no-define'
option, as in:
AM_INIT_AUTOMAKE([gnits 1.5 no-define dist-bzip2]) |
AM_PATH_LISPDIR
emacs
, and, if found, sets the output
variable lispdir
to the full path to Emacs' site-lisp directory.
Note that this test assumes the emacs
found to be a version that
supports Emacs Lisp (such as GNU Emacs or XEmacs). Other emacsen
can cause this test to hang (some, like old versions of MicroEmacs,
start up in interactive mode, requiring `C-x C-c' to exit, which
is hardly obvious for a non-emacs user). In most cases, however, you
should be able to use `C-c' to kill the test. In order to avoid
problems, you can set EMACS
to "no" in the environment, or
use the `--with-lispdir' option to configure
to
explictly set the correct path (if you're sure you have an emacs
that supports Emacs Lisp.
AM_PROG_AS
CCAS
, and will also set CCASFLAGS
if required.
AM_PROG_CC_C_O
AC_PROG_CC_C_O
, but it generates its results in the
manner required by automake. You must use this instead of
AC_PROG_CC_C_O
when you need this functionality.
AM_PROG_CC_STDC
CC
to make it so. This macro tries various
options that select ANSI C on some system or another. It considers the
compiler to be in ANSI C mode if it handles function prototypes correctly.
If you use this macro, you should check after calling it whether the C
compiler has been set to accept ANSI C; if not, the shell variable
am_cv_prog_cc_stdc
is set to `no'. If you wrote your source
code in ANSI C, you can make an un-ANSIfied copy of it by using the
ansi2knr
option (see section 9.13 Automatic de-ANSI-fication).
AM_PROG_LEX
AC_PROG_LEX
(see section `Particular Program Checks' in The Autoconf Manual), but uses the
missing
script on systems that do not have lex
.
`HP-UX 10' is one such system.
AM_PROG_GCJ
gcj
program or causes an error. It sets
`GCJ' and `GCJFLAGS'. gcj
is the Java front-end to the
GNU Compiler Collection.
AM_SYS_POSIX_TERMIOS
am_cv_sys_posix_termios
to
`yes'. If not, set the variable to `no'.
AM_WITH_DMALLOC
WITH_DMALLOC
and add `-ldmalloc' to LIBS
.
AM_WITH_REGEX
configure
command line. If
specified (the default), then the `regex' regular expression
library is used, `regex.o' is put into `LIBOBJS', and
`WITH_REGEX' is defined. If `--without-regex' is given, then
the `rx' regular expression library is used, and `rx.o' is put
into `LIBOBJS'.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The following macros are private macros you should not call directly. They are called by the other public macros when appropriate. Do not rely on them, as they might be changed in a future version. Consider them as implementation details; or better, do not consider them at all: skip this section!
_AM_DEPENDENCIES
AM_SET_DEPDIR
AM_DEP_TRACK
AM_OUTPUT_DEPENDENCY_COMMANDS
AM_MAKE_INCLUDE
make
handles
include
statements. This macro is automatically invoked when
needed; there should be no need to invoke it manually.
AM_PROG_INSTALL_STRIP
install
which can be used to
strip
a program at installation time. This macro is
automatically included when required.
AM_SANITY_CHECK
AM_INIT_AUTOMAKE
.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The aclocal
program doesn't have any built-in knowledge of any
macros, so it is easy to extend it with your own macros.
This is mostly used for libraries which want to supply their own
Autoconf macros for use by other programs. For instance the
gettext
library supplies a macro AM_GNU_GETTEXT
which
should be used by any package using gettext
. When the library is
installed, it installs this macro so that aclocal
will find it.
A file of macros should be a series of AC_DEFUN
's. The
aclocal
programs also understands AC_REQUIRE
, so it is
safe to put each macro in a separate file. See section `Prerequisite Macros' in The Autoconf Manual, and section `Macro Definitions' in The Autoconf Manual.
A macro file's name should end in `.m4'. Such files should be
installed in `aclocal --print-ac-dir`
(which usually happens to
be `$(datadir)/aclocal').
[ << ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |