Paul Eggert wrote:
> > May I make this doc change, or are the quadrigraphs still important
> > for some reason?
> 
> Sure, please go ahead; I did it that way only because I was copying the 
> example from coreutils configure.ac.

OK. Done as follows.

A long time ago, people used AC_HELP_STRING, and it expected a literal
string enclosed in [ ... ]. Now (since around Autoconf 2.62) we use
AS_HELP_STRING, and it expects a literal string enclosed in [[ ... ]]
— or less quoting if macro expansion is desired.

When underquoting AS_HELP_STRING's first argument, nearly everyone at
some point makes the mistake to change
  [--enable-foo]
to
  [--enable-foo[=VALUE]]
— which does not produce the expected output in `configure --help`.


2023-04-23  Bruno Haible  <br...@clisp.org>

        Improve quoting of AS_HELP_STRING's first argument.
        * m4/acl.m4 (gl_FUNC_ACL_ARG): Don't underquote AS_HELP_STRING's first
        argument.
        * m4/assert.m4 (gl_ASSERT): Likewise.
        * m4/gc.m4 (gl_GC): Likewise.
        * m4/gnulib-common.m4 (gl_COMMON_BODY): Likewise.
        * m4/ld-version-script.m4 (gl_LD_VERSION_SCRIPT): Likewise.
        * m4/lib-ld.m4 (AC_LIB_PROG_LD): Likewise.
        * m4/libgmp.m4 (gl_LIBGMP): Likewise.
        * m4/regex.m4 (gl_REGEX): Likewise.
        * m4/relocatable-lib.m4 (gl_RELOCATABLE_NOP): Likewise.
        * m4/selinux-selinux-h.m4 (gl_LIBSELINUX): Likewise.
        * m4/sigsegv.m4 (gl_SIGSEGV): Likewise.
        * m4/threadlib.m4 (gl_THREADLIB_EARLY_BODY): Likewise.
        * m4/valgrind-tests.m4 (gl_VALGRIND_TESTS): Likewise.
        * m4/version-etc.m4 (gl_VERSION_ETC_FLAG): Likewise.
        * m4/xattr.m4 (gl_FUNC_XATTR): Likewise.
        * doc/manywarnings.texi (manywarnings): Likewise. This avoids the use of
        quadrigraphs.

diff --git a/doc/manywarnings.texi b/doc/manywarnings.texi
index ea1b758cc0..01e23116cc 100644
--- a/doc/manywarnings.texi
+++ b/doc/manywarnings.texi
@@ -6,7 +6,7 @@
 
 @smallexample
 AC_ARG_ENABLE([gcc-warnings],
-  [AS_HELP_STRING([--enable-gcc-warnings@@<:@@=TYPE@@:>@@],
+  [AS_HELP_STRING([[--enable-gcc-warnings[=TYPE]]],
     [control generation of GCC warnings.  The TYPE 'no' disables
      warnings; 'yes' (default) generates cheap warnings;
      'expensive' in addition generates expensive warnings.])])
diff --git a/m4/acl.m4 b/m4/acl.m4
index dc9853a156..c2f3e2c995 100644
--- a/m4/acl.m4
+++ b/m4/acl.m4
@@ -1,5 +1,5 @@
 # acl.m4 - check for access control list (ACL) primitives
-# serial 27
+# serial 28
 
 # Copyright (C) 2002, 2004-2023 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
@@ -12,7 +12,7 @@ AC_DEFUN([gl_FUNC_ACL_ARG]
 [
   gl_need_lib_has_acl=
   AC_ARG_ENABLE([acl],
-    AS_HELP_STRING([--disable-acl], [do not support ACLs]),
+    AS_HELP_STRING([[--disable-acl]], [do not support ACLs]),
     , [enable_acl=auto])
 ])
 
diff --git a/m4/assert.m4 b/m4/assert.m4
index deeac708fd..5ba2b92ac1 100644
--- a/m4/assert.m4
+++ b/m4/assert.m4
@@ -1,4 +1,4 @@
-#serial 7
+#serial 8
 
 # Copyright (C) 1998-1999, 2001, 2004, 2008-2023 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
@@ -12,7 +12,7 @@ AC_DEFUN([gl_ASSERT]
 [
   AC_MSG_CHECKING([whether to enable assertions])
   AC_ARG_ENABLE([assert],
-    [AS_HELP_STRING([--disable-assert], [turn off assertions])],
+    [AS_HELP_STRING([[--disable-assert]], [turn off assertions])],
     [AS_IF([test "x$enableval" = xno],
       [AC_DEFINE([NDEBUG], [1],
         [Define to 1 if assertions should be disabled.])],
diff --git a/m4/gc.m4 b/m4/gc.m4
index 9733a0b857..0d0b65b444 100644
--- a/m4/gc.m4
+++ b/m4/gc.m4
@@ -1,4 +1,4 @@
-# gc.m4 serial 13
+# gc.m4 serial 14
 dnl Copyright (C) 2005-2023 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -7,7 +7,7 @@
 AC_DEFUN([gl_GC],
 [
   AC_ARG_WITH([libgcrypt],
-    AS_HELP_STRING([--with-libgcrypt], [use libgcrypt for low-level crypto]),
+    AS_HELP_STRING([[--with-libgcrypt]], [use libgcrypt for low-level crypto]),
     libgcrypt=$withval, libgcrypt=no)
   if test "$libgcrypt" != no; then
     # gc-libgcrypt.c will fail on startup if we don't have
diff --git a/m4/gnulib-common.m4 b/m4/gnulib-common.m4
index 8116804574..edb8572da2 100644
--- a/m4/gnulib-common.m4
+++ b/m4/gnulib-common.m4
@@ -1,4 +1,4 @@
-# gnulib-common.m4 serial 85
+# gnulib-common.m4 serial 86
 dnl Copyright (C) 2007-2023 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -619,7 +619,7 @@ AC_DEFUN([gl_COMMON_BODY]
   dnl gl_cross_guess_normal    (to be used when 'yes' is good and 'no' is bad),
   dnl gl_cross_guess_inverted  (to be used when 'no' is good and 'yes' is bad).
   AC_ARG_ENABLE([cross-guesses],
-    [AS_HELP_STRING([--enable-cross-guesses={conservative|risky}],
+    [AS_HELP_STRING([[--enable-cross-guesses={conservative|risky}]],
        [specify policy for cross-compilation guesses])],
     [if test "x$enableval" != xconservative && test "x$enableval" != xrisky; 
then
        AC_MSG_WARN([invalid argument supplied to --enable-cross-guesses])
diff --git a/m4/ld-version-script.m4 b/m4/ld-version-script.m4
index 6c1de28c8b..a186cfab50 100644
--- a/m4/ld-version-script.m4
+++ b/m4/ld-version-script.m4
@@ -1,4 +1,4 @@
-# ld-version-script.m4 serial 5
+# ld-version-script.m4 serial 6
 dnl Copyright (C) 2008-2023 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -18,7 +18,7 @@
 AC_DEFUN([gl_LD_VERSION_SCRIPT],
 [
   AC_ARG_ENABLE([ld-version-script],
-    [AS_HELP_STRING([--enable-ld-version-script],
+    [AS_HELP_STRING([[--enable-ld-version-script]],
        [enable linker version script (default is enabled when possible)])],
     [have_ld_version_script=$enableval],
     [AC_CACHE_CHECK([if LD -Wl,--version-script works],
diff --git a/m4/lib-ld.m4 b/m4/lib-ld.m4
index 6bc1886f53..acc6127435 100644
--- a/m4/lib-ld.m4
+++ b/m4/lib-ld.m4
@@ -1,4 +1,4 @@
-# lib-ld.m4 serial 10
+# lib-ld.m4 serial 11
 dnl Copyright (C) 1996-2003, 2009-2023 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -29,7 +29,7 @@ AC_DEFUN([AC_LIB_PROG_LD]
 AC_REQUIRE([AC_CANONICAL_HOST])dnl
 
 AC_ARG_WITH([gnu-ld],
-    [AS_HELP_STRING([--with-gnu-ld],
+    [AS_HELP_STRING([[--with-gnu-ld]],
         [assume the C compiler uses GNU ld [default=no]])],
     [test "$withval" = no || with_gnu_ld=yes],
     [with_gnu_ld=no])dnl
diff --git a/m4/libgmp.m4 b/m4/libgmp.m4
index 58576c4d0c..eb20ada0fa 100644
--- a/m4/libgmp.m4
+++ b/m4/libgmp.m4
@@ -1,4 +1,4 @@
-# libgmp.m4 serial 7
+# libgmp.m4 serial 8
 # Configure the GMP library or a replacement.
 dnl Copyright 2020-2023 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
@@ -15,7 +15,7 @@
 AC_DEFUN([gl_LIBGMP],
 [
   AC_ARG_WITH([libgmp],
-    [AS_HELP_STRING([--without-libgmp],
+    [AS_HELP_STRING([[--without-libgmp]],
        [do not use the GNU Multiple Precision (GMP) library;
         this is the default on systems lacking libgmp.])])
   HAVE_LIBGMP=no
diff --git a/m4/regex.m4 b/m4/regex.m4
index c89a1432a7..7acadc4834 100644
--- a/m4/regex.m4
+++ b/m4/regex.m4
@@ -1,4 +1,4 @@
-# serial 73
+# serial 74
 
 # Copyright (C) 1996-2001, 2003-2023 Free Software Foundation, Inc.
 #
@@ -15,7 +15,7 @@ AC_DEFUN([gl_REGEX]
 [
   AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
   AC_ARG_WITH([included-regex],
-    [AS_HELP_STRING([--without-included-regex],
+    [AS_HELP_STRING([[--without-included-regex]],
                     [don't compile regex; this is the default on systems
                      with recent-enough versions of the GNU C Library
                      (use with caution on other systems).])])
diff --git a/m4/relocatable-lib.m4 b/m4/relocatable-lib.m4
index dfde981e51..99b2f4579e 100644
--- a/m4/relocatable-lib.m4
+++ b/m4/relocatable-lib.m4
@@ -1,4 +1,4 @@
-# relocatable-lib.m4 serial 6
+# relocatable-lib.m4 serial 7
 dnl Copyright (C) 2003, 2005-2007, 2009-2023 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -34,7 +34,7 @@ AC_DEFUN([gl_RELOCATABLE_NOP]
 [
   AC_MSG_CHECKING([whether to activate relocatable installation])
   AC_ARG_ENABLE([relocatable],
-    [AS_HELP_STRING([--enable-relocatable],
+    [AS_HELP_STRING([[--enable-relocatable]],
       [install a package that can be moved in the file system])],
     [if test "$enableval" != no; then
        RELOCATABLE=yes
diff --git a/m4/selinux-selinux-h.m4 b/m4/selinux-selinux-h.m4
index 734924cc0d..2c943f1606 100644
--- a/m4/selinux-selinux-h.m4
+++ b/m4/selinux-selinux-h.m4
@@ -1,4 +1,4 @@
-# serial 6   -*- Autoconf -*-
+# serial 7   -*- Autoconf -*-
 # Copyright (C) 2006-2007, 2009-2023 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -54,7 +54,7 @@ AC_DEFUN([gl_LIBSELINUX]
   AC_REQUIRE([AC_CANONICAL_BUILD])
 
   AC_ARG_WITH([selinux],
-    AS_HELP_STRING([--without-selinux], [do not use SELinux, even on systems 
with SELinux]),
+    AS_HELP_STRING([[--without-selinux]], [do not use SELinux, even on systems 
with SELinux]),
     [], [with_selinux=maybe])
 
   LIB_SELINUX=
diff --git a/m4/sigsegv.m4 b/m4/sigsegv.m4
index 4dec708b7e..b576bb018a 100644
--- a/m4/sigsegv.m4
+++ b/m4/sigsegv.m4
@@ -1,4 +1,4 @@
-# sigsegv.m4 serial 1
+# sigsegv.m4 serial 2
 dnl Copyright (C) 2021-2023 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -9,7 +9,7 @@
 AC_DEFUN_ONCE([gl_SIGSEGV],
 [
   AC_ARG_WITH([libsigsegv],
-    [AS_HELP_STRING([--with-libsigsegv],
+    [AS_HELP_STRING([[--with-libsigsegv]],
        [use the GNU libsigsegv library, when present, instead of the gnulib 
module 'sigsegv'])])
   if test "$with_libsigsegv" = yes; then
     gl_LIBSIGSEGV
diff --git a/m4/threadlib.m4 b/m4/threadlib.m4
index 4348dc3291..1fc5777e97 100644
--- a/m4/threadlib.m4
+++ b/m4/threadlib.m4
@@ -1,4 +1,4 @@
-# threadlib.m4 serial 37
+# threadlib.m4 serial 38
 dnl Copyright (C) 2005-2023 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -443,8 +443,8 @@ AC_DEFUN([gl_THREADLIB_EARLY_BODY]
   dnl in mingw 5, the use of libwinpthread still makes test-pthread-tss crash.
   m4_divert_text([DEFAULTS], [gl_use_winpthreads_default=no])
   AC_ARG_ENABLE([threads],
-AS_HELP_STRING([--enable-threads={isoc|posix|isoc+posix|windows}], [specify 
multithreading API])m4_ifdef([gl_THREADLIB_DEFAULT_NO], [], [
-AS_HELP_STRING([--disable-threads], [build without multithread safety])]),
+AS_HELP_STRING([[--enable-threads={isoc|posix|isoc+posix|windows}]], [specify 
multithreading API])m4_ifdef([gl_THREADLIB_DEFAULT_NO], [], [
+AS_HELP_STRING([[--disable-threads]], [build without multithread safety])]),
     [gl_use_threads=$enableval],
     [if test -n "$gl_use_threads_default"; then
        gl_use_threads="$gl_use_threads_default"
diff --git a/m4/valgrind-tests.m4 b/m4/valgrind-tests.m4
index 0157f7cb8f..5e8d1259e3 100644
--- a/m4/valgrind-tests.m4
+++ b/m4/valgrind-tests.m4
@@ -1,4 +1,4 @@
-# valgrind-tests.m4 serial 8
+# valgrind-tests.m4 serial 9
 dnl Copyright (C) 2008-2023 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -37,7 +37,7 @@ AC_DEFUN([gl_VALGRIND_TESTS_DEFAULT_NO]
 AC_DEFUN_ONCE([gl_VALGRIND_TESTS],
 [
   AC_ARG_ENABLE([valgrind-tests],
-    AS_HELP_STRING([--disable-valgrind-tests],
+    AS_HELP_STRING([[--disable-valgrind-tests]],
                    [don't try to run self tests under valgrind]),
     [opt_valgrind_tests=$enableval], 
[opt_valgrind_tests=${gl_valgrind_tests_default:-yes}])
 
diff --git a/m4/version-etc.m4 b/m4/version-etc.m4
index 76b5d3e88e..a948ef624d 100644
--- a/m4/version-etc.m4
+++ b/m4/version-etc.m4
@@ -1,4 +1,4 @@
-# version-etc.m4 serial 1
+# version-etc.m4 serial 2
 # Copyright (C) 2009-2023 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -8,7 +8,7 @@
 dnl $2 - human readable description
 m4_define([gl_VERSION_ETC_FLAG],
 [dnl
-  AC_ARG_WITH([$1], [AS_HELP_STRING([--with-$1], [$2])],
+  AC_ARG_WITH([$1], [AS_HELP_STRING([[--with-]$1], [$2])],
     [dnl
       case $withval in
         yes|no) ;;
diff --git a/m4/xattr.m4 b/m4/xattr.m4
index 0e179cc0d1..70bf0db441 100644
--- a/m4/xattr.m4
+++ b/m4/xattr.m4
@@ -1,5 +1,5 @@
 # xattr.m4 - check for Extended Attributes (Linux)
-# serial 6
+# serial 7
 
 # Copyright (C) 2003-2023 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
@@ -9,7 +9,7 @@
 AC_DEFUN([gl_FUNC_XATTR],
 [
   AC_ARG_ENABLE([xattr],
-        AS_HELP_STRING([--disable-xattr],
+        AS_HELP_STRING([[--disable-xattr]],
                        [do not support extended attributes]),
         [use_xattr=$enableval], [use_xattr=yes])
 




Reply via email to