automake: aclocal Invocation
1
1 6.3 Auto-generating aclocal.m4
1 ==============================
1
1 Automake includes a number of Autoconf macros that can be used in your
1 package (⇒Macros); some of them are actually required by Automake
1 in certain situations. These macros must be defined in your
1 ‘aclocal.m4’; otherwise they will not be seen by ‘autoconf’.
1
1 The ‘aclocal’ program will automatically generate ‘aclocal.m4’ files
1 based on the contents of ‘configure.ac’. This provides a convenient way
1 to get Automake-provided macros, without having to search around. The
1 ‘aclocal’ mechanism allows other packages to supply their own macros
1 (⇒Extending aclocal). You can also use it to maintain your own
1 set of custom macros (⇒Local Macros).
1
1 At startup, ‘aclocal’ scans all the ‘.m4’ files it can find, looking
1 for macro definitions (⇒Macro Search Path). Then it scans
1 ‘configure.ac’. Any mention of one of the macros found in the first
1 step causes that macro, and any macros it in turn requires, to be put
1 into ‘aclocal.m4’.
1
1 _Putting_ the file that contains the macro definition into
1 ‘aclocal.m4’ is usually done by copying the entire text of this file,
1 including unused macro definitions as well as both ‘#’ and ‘dnl’
1 comments. If you want to make a comment that will be completely ignored
1 by ‘aclocal’, use ‘##’ as the comment leader.
1
1 When a file selected by ‘aclocal’ is located in a subdirectory
1 specified as a relative search path with ‘aclocal’’s ‘-I’ argument,
1 ‘aclocal’ assumes the file belongs to the package and uses ‘m4_include’
1 instead of copying it into ‘aclocal.m4’. This makes the package
1 smaller, eases dependency tracking, and cause the file to be distributed
1 automatically. (⇒Local Macros, for an example.) Any macro that
1 is found in a system-wide directory, or via an absolute search path will
1 be copied. So use ‘-I `pwd`/reldir’ instead of ‘-I reldir’ whenever
1 some relative directory should be considered outside the package.
1
1 The contents of ‘acinclude.m4’, if this file exists, are also
1 automatically included in ‘aclocal.m4’. We recommend against using
1 ‘acinclude.m4’ in new packages (⇒Local Macros).
1
11 While computing ‘aclocal.m4’, ‘aclocal’ runs ‘autom4te’ (⇒Using
‘Autom4te’ (autoconf)Using autom4te.) in order to trace the macros that
1 are really used, and omit from ‘aclocal.m4’ all macros that are
1 mentioned but otherwise unexpanded (this can happen when a macro is
1 called conditionally). ‘autom4te’ is expected to be in the ‘PATH’, just
1 as ‘autoconf’. Its location can be overridden using the ‘AUTOM4TE’
1 environment variable.
1
Menu