Go to the first, previous, next, last section, table of contents.


Macro Definitions

Autoconf macros are defined using the AC_DEFUN macro, which is similar to the m4 builtin 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:

AC_DEFUN(macro-name, [macro-body])

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 m4 builtin 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 m4 macros.


Go to the first, previous, next, last section, table of contents.