+2006-02-21 Alexandre Duret-Lutz <adl@gnu.org>
+
+ * doc/automake.texi (Complete, Extending aclocal, Public macros)
+ (Python, Conditionals, API versioning): Always quote macro arguments.
+ Report from Stepan Kasal.
+
2006-02-16 Alexandre Duret-Lutz <adl@gnu.org>
* doc/automake.texi (Python): More examples.
@code{AM_INIT_AUTOMAKE} call just after @code{AC_INIT}:
@example
-AC_INIT(zardoz, 1.0)
+AC_INIT([zardoz], [1.0])
AM_INIT_AUTOMAKE
@dots{}
@end example
should be rewritten as
@example
AC_DEFUN([AX_FOOBAR],
-[AC_PREREQ(2.57)dnl
+[AC_PREREQ([2.57])dnl
AC_REQUIRE([AX_SOMETHING])dnl
AX_FOO
AX_BAR
Autoconf 2.57 will not be required if @code{AX_FOOBAR} is not actually
used. Most importantly, quoting the first argument of @code{AC_DEFUN}
allows the macro to be redefined or included twice (otherwise this
-first argument would be expanded during the second definition).
+first argument would be expanded during the second definition). For
+consistency we like to quote even arguments such as @code{2.57} that
+do not require it.
If you have been directed here by the @command{aclocal} diagnostic but
are not the maintainer of the implicated macro, you will want to
If your @file{configure.ac} has:
@example
-AC_INIT(src/foo.c)
-AM_INIT_AUTOMAKE(mumble, 1.5)
+AC_INIT([src/foo.c])
+AM_INIT_AUTOMAKE([mumble], [1.5])
@end example
@noindent
you can modernize it as follows:
@example
-AC_INIT(mumble, 1.5)
-AC_CONFIG_SRCDIR(src/foo.c)
+AC_INIT([mumble], [1.5])
+AC_CONFIG_SRCDIR([src/foo.c])
AM_INIT_AUTOMAKE
@end example
example, the default is to abort @command{configure}.
@example
-AM_PATH_PYTHON(2.2)
+AM_PATH_PYTHON([2.2])
@end example
@noindent
@code{AM_PATH_PYTHON} could be called as follows.
@example
-AM_PATH_PYTHON(2.2,, :)
+AM_PATH_PYTHON([2.2],, [:])
@end example
@code{AM_PATH_PYTHON} creates the following output variables based on
as follows.
@example
- AM_PATH_PYTHON(,, :)
+ AM_PATH_PYTHON(,, [:])
AM_CONDITIONAL([HAVE_PYTHON], [test "$PYTHON" != :])
@end example
option.
@example
-AC_ARG_ENABLE(debug,
+AC_ARG_ENABLE([debug],
[ --enable-debug Turn on debugging],
[case "$@{enableval@}" in
yes) debug=true ;;
no) debug=false ;;
- *) AC_MSG_ERROR(bad value $@{enableval@} for --enable-debug) ;;
+ *) AC_MSG_ERROR([bad value $@{enableval@} for --enable-debug]) ;;
esac],[debug=false])
-AM_CONDITIONAL(DEBUG, test x$debug = xtrue)
+AM_CONDITIONAL([DEBUG], [test x$debug = xtrue])
@end example
Here is an example of how to use that conditional in @file{Makefile.am}:
@file{configure.ac}:
@example
- AM_INIT_AUTOMAKE(1.6.1) dnl Require Automake 1.6.1 or better.
+ AM_INIT_AUTOMAKE([1.6.1]) dnl Require Automake 1.6.1 or better.
@end example
@noindent
or, in a particular @file{Makefile.am}: