A macro that you write might need to use values that have previously
been computed by other macros. For example, AC_DECL_YYTEXT
examines the output of flex
or lex
, so it depends on
AC_PROG_LEX
having been called first to set the shell variable
LEX
.
Rather than forcing the user of the macros to keep track of the
dependencies between them, you can use the AC_REQUIRE
macro to do
it automatically. AC_REQUIRE
can ensure that a macro is only
called if it is needed, and only called once.
m4
macro macro-name has not already been called,
call it (without any arguments). Make sure to quote macro-name
with square brackets. macro-name must have been defined using
AC_DEFUN
or else contain a call to AC_PROVIDE
to indicate
that it has been called.
An alternative to using AC_DEFUN
is to use define
and call
AC_PROVIDE
. Because this technique does not prevent nested
messages, it is considered obsolete.
AC_PROVIDE
. An easy way to get it is from the m4
builtin
variable $0
, like this:
AC_PROVIDE([$0])
Go to the first, previous, next, last section, table of contents.