Autoconf macros are defined using the
AC_DEFUN macro, which is
similar to the
define macro. In addition to
defining a macro,
AC_DEFUN adds to it some code which is used to
constrain the order in which macros are called (see section Prerequisite Macros).
An Autoconf macro definition looks like this:
The square brackets here do not indicate optional text: they should literally be present in the macro definition to avoid macro expansion problems (see section Quoting). You can refer to any arguments passed to the macro as `$1', `$2', etc.
To introduce comments in
m4, use the
dnl; it causes
m4 to discard the text through the next
newline. It is not needed between macro definitions in `acsite.m4'
and `aclocal.m4', because all output is discarded until
AC_INIT is called.
See section `How to define new macros' in GNU m4, for
more complete information on writing
Go to the first, previous, next, last section, table of contents.