autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: style


From: Akim Demaille
Subject: Re: style
Date: Tue, 04 Nov 2003 13:58:01 +0100
User-agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3 (gnu/linux)

 > In the Fine Manual:
 > @node Coding Style
 > @section Coding Style

 > In order to highlight the recommended coding style, here is a macro
 > written the old way:

 > @example
 > dnl Check for EMX on OS/2.
 > dnl _AC_EMXOS2
 > AC_DEFUN(_AC_EMXOS2,
 > ...
 > and the new way:

 > @example
 > # _AC_EMXOS2
 > # ----------
 > # Check for EMX on OS/2.
 > m4_define([_AC_EMXOS2],

 > Why the change AC_DEFUN -> m4_define ?

It is lightweight.  I recommend using m4_define for Autoconf authors
when they can, as it speeds up the process, and in some case, it's
even better for error messages.  Nevertheless, the users should not
care about this possibility.

Of course, if you do use m4_define in an aclocal.m4, then you no
longer run on stock 80286 still running Autoconf 1.x.



 > "Macro Definitions" says:

 > Autoconf macros are defined using the `AC_DEFUN' macro, which is
 > similar to the M4 builtin `m4_define' macro.  In addition to defining a
 > macro, `AC_DEFUN' adds to it some code that is used to constrain the
 > order in which macros are called (*note Prerequisite Macros::).

 >    An Autoconf macro definition looks like this:

 >      AC_DEFUN(MACRO-NAME, MACRO-BODY)

 > and again the example shows:

 >      m4_define([AC_MSG_ERROR],

 > rather than AC_DEFUN. So, what is considered good style?

Maybe this example is wrong, I should read the doc.  It is correct if
it is addressed to contributors.  If it is addressed to novices, then
sticking to AC_DEFUN is safer style.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]