The Autoconf manual states that no space should occur before the opening
parenthesis in a macro call:

       When calling macros that take arguments, there must not be any white
    space between the macro name and the open parenthesis.
    
         AC_INIT ([oops], [1.0]) # incorrect
         AC_INIT([hello], [1.0]) # good

However, the documentation of all the macros has such a space:

    Every ‘configure’ script must call ‘AC_INIT’ before doing anything else
    that produces output.  Calls to silent macros, such as ‘AC_DEFUN’, may
    also occur prior to ‘AC_INIT’, although these are generally used via
    ‘aclocal.m4’, since that is implicitly included before the start of
    ‘configure.ac’.  The only other required macro is ‘AC_OUTPUT’ (*note
    Output::).
    
     -- Macro: AC_INIT (PACKAGE, VERSION, [BUG-REPORT], [TARNAME], [URL])
         Process any command-line arguments and perform initialization and
         verification.

I checked this with the Autoconf Info manual downloaded from
https://www.gnu.org/software/autoconf/.

Arguably, it should look like this instead:

     -- Macro: AC_INIT(PACKAGE, VERSION, [BUG-REPORT], [TARNAME], [URL])

This was due to the output of Texinfo for the definition commands that
are used to document these macros.  However, since Texinfo 7.0, you can
give a command in the Texinfo source which causes no such space to be output.

You can add this to autoconf.texi with a change like the following:

--- autoconf.texi       2025-07-18 16:20:44.248495314 +0100
+++ autoconf.texi-2     2025-07-18 16:20:23.669894776 +0100
@@ -7,6 +7,7 @@
 @documentencoding UTF-8
 @set txicodequoteundirected
 @set txicodequotebacktick
+@set txidefnamenospace
 @setchapternewpage odd
 @finalout

This is backwards-compatible with older versions of Texinfo, which will
ignore this flag.
 
https://www.gnu.org/software/texinfo/manual/texinfo/html_node/No-Space-After-Definition-Name.html

The only downside is that the macro name stands out less in the documentation
so it may be very slightly harder to find a macro when scrolling through
the documentation.  However, I think it's useful to avoid misleading beginners
to Autoconf.


Reply via email to