autoconf-patches
[Top][All Lists]
Advanced

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

Re: FYI: autotest --help output improvement


From: Eric Blake
Subject: Re: FYI: autotest --help output improvement
Date: Thu, 27 Sep 2007 19:44:21 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070728 Thunderbird/2.0.0.6 Mnenhy/0.7.5.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Eric Blake on 9/27/2007 10:33 AM:
> Checking this in.  Autotest was outputting raw TAB characters in its --help 
> output (generally something to be avoided on terminals).  Also a micro-
> optimization in computing the PATH.

./configure and ./config.status were also affected.  And in the process of
fixing config.status, I bit the bullet and corrected the brokenness of
AS_HELP_STRING - before my fix, you had to use quadrigraphs in the lhs
argument or else go for: AS_HELP_STRING([[[[--option[=value]]]]], [text])
- - two extra levels of quoting required - yuck.

2007-09-27  Eric Blake  <address@hidden>

        Configure whitespace touchups.
        * lib/autoconf/general.m4 (_AC_INIT_HELP): Fix alignment of
        installation directories, and avoid TAB, in configure --help
        output.
        * configure.ac: Avoid extra trailing newline.
        * lib/m4sugar/m4sh.m4 (_AS_DETECT_BETTER_SHELL): Avoid space-tab.
        * lib/autoconf/status.m4 (_AC_OUTPUT_CONFIG_STATUS): Avoid TAB in
        config.status --help output.
        * configure: Regenerate.

        Fix underquotation in AS_HELP_STRING.
        * lib/m4sugar/m4sh.m4 (AS_HELP_STRING): Don't underquote lhs
        argument.
        * lib/m4sugar/m4sugar.m4 (m4_text_wrap): Don't underquote
        first-prefix argument.
        * tests/m4sh.at (AS@&address@hidden): Test this fix.
        * NEWS: Document AS_HELP_STRING fix.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFG/Fxu84KuGfSFAYARAiNzAKDJHz/kv93UGjZSK3VBqR2QTPfL5gCgnAsV
9ohSI5UTJ1Qfe2exolVaIUQ=
=8Y//
-----END PGP SIGNATURE-----
>From f444a9fa8e1cef9a7aa3c1ff85ebdf869c5a3c30 Mon Sep 17 00:00:00 2001
From: Eric Blake <address@hidden>
Date: Thu, 27 Sep 2007 19:16:51 -0600
Subject: [PATCH] Fix underquotation in AS_HELP_STRING.

* lib/m4sugar/m4sh.m4 (AS_HELP_STRING): Don't underquote lhs
argument.
* lib/m4sugar/m4sugar.m4 (m4_text_wrap): Don't underquote
first-prefix argument.
* tests/m4sh.at (AS@&address@hidden): Test this fix.
* NEWS: Document AS_HELP_STRING fix.

Signed-off-by: Eric Blake <address@hidden>
---
 ChangeLog              |    8 ++++++++
 NEWS                   |    2 ++
 lib/m4sugar/m4sh.m4    |    2 +-
 lib/m4sugar/m4sugar.m4 |   10 +++++-----
 tests/m4sh.at          |   27 ++++++++++++++++++++++++++-
 5 files changed, 42 insertions(+), 7 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 772a777..6904952 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2007-09-27  Eric Blake  <address@hidden>
 
+       Fix underquotation in AS_HELP_STRING.
+       * lib/m4sugar/m4sh.m4 (AS_HELP_STRING): Don't underquote lhs
+       argument.
+       * lib/m4sugar/m4sugar.m4 (m4_text_wrap): Don't underquote
+       first-prefix argument.
+       * tests/m4sh.at (AS@&address@hidden): Test this fix.
+       * NEWS: Document AS_HELP_STRING fix.
+
        Autotest formatting touchups.
        * lib/autotest/general.m4 (HELP_TUNING): Avoid TAB in terminal
        output.
diff --git a/NEWS b/NEWS
index 73ee6e9..73dc8f7 100644
--- a/NEWS
+++ b/NEWS
@@ -38,6 +38,8 @@ GNU Autoconf NEWS - User visible changes.
 
 ** AC_USE_SYSTEM_EXTENSIONS now defines _ALL_SOURCE for Interix platforms.
 
+** AS_HELP_STRING no longer underquotes its first argument.
+
 ** The command 'autoconf -' now correctly processes a file from stdin.
 
 ** Autotest now determines $srcdir correctly.
diff --git a/lib/m4sugar/m4sh.m4 b/lib/m4sugar/m4sh.m4
index 7004754..c03995b 100644
--- a/lib/m4sugar/m4sh.m4
+++ b/lib/m4sugar/m4sh.m4
@@ -1205,7 +1205,7 @@ m4_define([AS_HELP_STRING],
 [m4_pushdef([AS_Prefix], m4_default([$3], [                          ]))dnl
 m4_pushdef([AS_Prefix_Format],
           [  %-]m4_eval(m4_len(AS_Prefix) - 3)[s ])dnl [  %-23s ]
-m4_text_wrap([$2], AS_Prefix, m4_format(AS_Prefix_Format, [$1]))dnl
+m4_text_wrap([$2], AS_Prefix, m4_format(AS_Prefix_Format, [[$1]]))dnl
 m4_popdef([AS_Prefix_Format])dnl
 m4_popdef([AS_Prefix])dnl
 ])# AS_HELP_STRING
diff --git a/lib/m4sugar/m4sugar.m4 b/lib/m4sugar/m4sugar.m4
index 72c896c..cd05ab4 100644
--- a/lib/m4sugar/m4sugar.m4
+++ b/lib/m4sugar/m4sugar.m4
@@ -1576,16 +1576,16 @@ m4_define([m4_text_wrap],
 [m4_pushdef([m4_Prefix], [$2])dnl
 m4_pushdef([m4_Prefix1], m4_default([$3], [m4_Prefix]))dnl
 m4_pushdef([m4_Width], m4_default([$4], 79))dnl
-m4_pushdef([m4_Cursor], m4_qlen(m4_Prefix1))dnl
+m4_pushdef([m4_Cursor], m4_qlen(m4_defn([m4_Prefix1])))dnl
 m4_pushdef([m4_Separator], [])dnl
-m4_Prefix1[]dnl
-m4_if(m4_eval(m4_qlen(m4_Prefix1) > m4_len(m4_Prefix)),
+m4_defn([m4_Prefix1])[]dnl
+m4_if(m4_eval(m4_qlen(m4_defn([m4_Prefix1])) > m4_len(m4_Prefix)),
       1, [m4_define([m4_Cursor], m4_len(m4_Prefix))
 m4_Prefix],
-      m4_if(m4_eval(m4_qlen(m4_Prefix1) < m4_len(m4_Prefix)),
+      m4_if(m4_eval(m4_qlen(m4_defn([m4_Prefix1])) < m4_len(m4_Prefix)),
            [0], [],
            [m4_define([m4_Cursor], m4_len(m4_Prefix))[]dnl
-m4_for(m4_Space, m4_qlen(m4_Prefix1), m4_eval(m4_len(m4_Prefix) - 1),
+m4_for(m4_Space, m4_qlen(m4_defn([m4_Prefix1])), m4_eval(m4_len(m4_Prefix) - 
1),
                    [], [ ])])[]dnl
 )[]dnl
 m4_foreach_w([m4_Word], [$1],
diff --git a/tests/m4sh.at b/tests/m4sh.at
index 41885cd..a523785 100644
--- a/tests/m4sh.at
+++ b/tests/m4sh.at
@@ -2,7 +2,7 @@
 
 AT_BANNER([M4sh.])
 
-# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software
+# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software
 # Foundation, Inc.
 #
 # This program is free software: you can redistribute it and/or modify
@@ -533,6 +533,18 @@ echo "AS_HELP_STRING([--foo@<][:@=bar@:][>@123456789012],
 [some other @<][:@ex@:][>@ which should wrap at our default of 80 
characters.])"
 echo "AS_HELP_STRING([--foo@<][:@=bar@:][>@1234567890123],
 [some other @<][:@ex@:][>@ which should wrap at our default of 80 
characters.])"
+echo "AS_HELP_STRING([[--foo[=bar]]],
+[some other t[]t which should wrap at our default of 80 characters.])"
+echo "AS_HELP_STRING([[--foo[=bar]123456789]],
+[some other t[]t which should wrap at our default of 80 characters.])"
+echo "AS_HELP_STRING([[--foo[=bar]1234567890]],
+[some other t[]t which should wrap at our default of 80 characters.])"
+echo "AS_HELP_STRING([[--foo[=bar]12345678901]],
+[some other t[]t which should wrap at our default of 80 characters.])"
+echo "AS_HELP_STRING([[--foo[=bar]123456789012]],
+[some other t[]t which should wrap at our default of 80 characters.])"
+echo "AS_HELP_STRING([[--foo[=bar]1234567890123]],
+[some other t[]t which should wrap at our default of 80 characters.])"
 ]])
 
 AT_CHECK_M4SH
@@ -575,6 +587,19 @@ AT_CHECK([./script], [0],
   --foo[=bar]1234567890123
                           some other [ex] which should wrap at our default of
                           80 characters.
+  --foo[=bar]             some other t[]t which should wrap at our default of
+                          80 characters.
+  --foo[=bar]123456789    some other t[]t which should wrap at our default of
+                          80 characters.
+  --foo[=bar]1234567890   some other t[]t which should wrap at our default of
+                          80 characters.
+  --foo[=bar]12345678901  some other t[]t which should wrap at our default of
+                          80 characters.
+  --foo[=bar]123456789012 some other t[]t which should wrap at our default of
+                          80 characters.
+  --foo[=bar]1234567890123
+                          some other t[]t which should wrap at our default of
+                          80 characters.
 ]])
 
 AT_CLEANUP
-- 
1.5.3.2


>From afdb9d6e9f6f492f042086badbdd954511ea0649 Mon Sep 17 00:00:00 2001
From: Eric Blake <address@hidden>
Date: Thu, 27 Sep 2007 19:35:55 -0600
Subject: [PATCH] Configure whitespace touchups.

* lib/autoconf/general.m4 (_AC_INIT_HELP): Fix alignment of
installation directories, and avoid TAB, in configure --help
output.
* configure.ac: Avoid extra trailing newline.
* lib/m4sugar/m4sh.m4 (_AS_DETECT_BETTER_SHELL): Avoid space-tab.
* lib/autoconf/status.m4 (_AC_OUTPUT_CONFIG_STATUS): Avoid TAB in
config.status --help output.
* configure: Regenerate.

Signed-off-by: Eric Blake <address@hidden>
---
 ChangeLog               |   10 +++++++++
 configure               |   47 ++++++++++++++++++++++-----------------------
 configure.ac            |   10 ++++----
 lib/autoconf/general.m4 |   48 ++++++++++++++++++++++++----------------------
 lib/autoconf/status.m4  |   12 +++++-----
 lib/m4sugar/m4sh.m4     |    2 +-
 6 files changed, 70 insertions(+), 59 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 6904952..bb157c7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
 2007-09-27  Eric Blake  <address@hidden>
 
+       Configure whitespace touchups.
+       * lib/autoconf/general.m4 (_AC_INIT_HELP): Fix alignment of
+       installation directories, and avoid TAB, in configure --help
+       output.
+       * configure.ac: Avoid extra trailing newline.
+       * lib/m4sugar/m4sh.m4 (_AS_DETECT_BETTER_SHELL): Avoid space-tab.
+       * lib/autoconf/status.m4 (_AC_OUTPUT_CONFIG_STATUS): Avoid TAB in
+       config.status --help output.
+       * configure: Regenerate.
+
        Fix underquotation in AS_HELP_STRING.
        * lib/m4sugar/m4sh.m4 (AS_HELP_STRING): Don't underquote lhs
        argument.
diff --git a/configure b/configure
index a6f20ac..f0b5215 100755
--- a/configure
+++ b/configure
@@ -190,7 +190,7 @@ else
   as_have_required=no
 fi
 
-  if test $as_have_required = yes &&    (eval ":
+  if test $as_have_required = yes &&    (eval ":
 (as_func_return () {
   (exit \$1)
 }
@@ -1262,9 +1262,9 @@ Configuration:
 
 Installation directories:
   --prefix=PREFIX         install architecture-independent files in PREFIX
-                         [$ac_default_prefix]
+                          [$ac_default_prefix]
   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
-                         [PREFIX]
+                          [PREFIX]
 
 By default, \`make install' will install all the files in
 \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
@@ -1274,25 +1274,25 @@ for instance \`--prefix=\$HOME'.
 For better control, use the options below.
 
 Fine tuning of the installation directories:
-  --bindir=DIR           user executables [EPREFIX/bin]
-  --sbindir=DIR          system admin executables [EPREFIX/sbin]
-  --libexecdir=DIR       program executables [EPREFIX/libexec]
-  --sysconfdir=DIR       read-only single-machine data [PREFIX/etc]
-  --sharedstatedir=DIR   modifiable architecture-independent data [PREFIX/com]
-  --localstatedir=DIR    modifiable single-machine data [PREFIX/var]
-  --libdir=DIR           object code libraries [EPREFIX/lib]
-  --includedir=DIR       C header files [PREFIX/include]
-  --oldincludedir=DIR    C header files for non-gcc [/usr/include]
-  --datarootdir=DIR      read-only arch.-independent data root [PREFIX/share]
-  --datadir=DIR          read-only architecture-independent data [DATAROOTDIR]
-  --infodir=DIR          info documentation [DATAROOTDIR/info]
-  --localedir=DIR        locale-dependent data [DATAROOTDIR/locale]
-  --mandir=DIR           man documentation [DATAROOTDIR/man]
-  --docdir=DIR           documentation root [DATAROOTDIR/doc/autoconf]
-  --htmldir=DIR          html documentation [DOCDIR]
-  --dvidir=DIR           dvi documentation [DOCDIR]
-  --pdfdir=DIR           pdf documentation [DOCDIR]
-  --psdir=DIR            ps documentation [DOCDIR]
+  --bindir=DIR            user executables [EPREFIX/bin]
+  --sbindir=DIR           system admin executables [EPREFIX/sbin]
+  --libexecdir=DIR        program executables [EPREFIX/libexec]
+  --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
+  --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
+  --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
+  --libdir=DIR            object code libraries [EPREFIX/lib]
+  --includedir=DIR        C header files [PREFIX/include]
+  --oldincludedir=DIR     C header files for non-gcc [/usr/include]
+  --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
+  --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
+  --infodir=DIR           info documentation [DATAROOTDIR/info]
+  --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
+  --mandir=DIR            man documentation [DATAROOTDIR/man]
+  --docdir=DIR            documentation root [DATAROOTDIR/doc/autoconf]
+  --htmldir=DIR           html documentation [DOCDIR]
+  --dvidir=DIR            dvi documentation [DOCDIR]
+  --pdfdir=DIR            pdf documentation [DOCDIR]
+  --psdir=DIR             ps documentation [DOCDIR]
 _ACEOF
 
   cat <<\_ACEOF
@@ -3364,7 +3364,7 @@ Usage: $0 [OPTIONS] [FILE]...
   -d, --debug      don't remove temporary files
       --recheck    update $as_me by reconfiguring in the same conditions
   --file=FILE[:TEMPLATE]
-                  instantiate the configuration file FILE
+                   instantiate the configuration file FILE
 
 Configuration files:
 $config_files
@@ -4003,4 +4003,3 @@ Below you will find information on the status of this 
version of Autoconf.
 
 EOF
     sed -n '/^\* Status/,$p' $srcdir/BUGS
-
diff --git a/configure.ac b/configure.ac
index bbb3e87..1a32ea3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -151,10 +151,10 @@ AC_PROG_SED
 ## ------------ ##
 
 AC_CONFIG_FILES([Makefile doc/Makefile
-                 lib/Makefile lib/Autom4te/Makefile lib/autoscan/Makefile
-                 lib/m4sugar/Makefile
-                 lib/autoconf/Makefile lib/autotest/Makefile
-                 bin/Makefile])
+                lib/Makefile lib/Autom4te/Makefile lib/autoscan/Makefile
+                lib/m4sugar/Makefile
+                lib/autoconf/Makefile lib/autotest/Makefile
+                bin/Makefile])
 
 AC_OUTPUT
 # Report the state of this version of Autoconf if this is a beta.
@@ -169,4 +169,4 @@ Below you will find information on the status of this 
version of Autoconf.
 
 EOF
     sed -n '/^\* Status/,$p' $srcdir/BUGS
-])
+])dnl
diff --git a/lib/autoconf/general.m4 b/lib/autoconf/general.m4
index ce3b48e..81f3a95 100644
--- a/lib/autoconf/general.m4
+++ b/lib/autoconf/general.m4
@@ -1012,10 +1012,10 @@ Configuration:
       --srcdir=DIR        find the sources in DIR [configure dir or \`..']
 
 Installation directories:
-  --prefix=PREFIX         install architecture-independent files in PREFIX
-                         [$ac_default_prefix]
-  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
-                         [PREFIX]
+]AS_HELP_STRING([--prefix=PREFIX],
+  [install architecture-independent files in PREFIX [$ac_default_prefix]])
+AS_HELP_STRING([--exec-prefix=EPREFIX],
+  [install architecture-dependent files in EPREFIX [PREFIX]])[
 
 By default, \`make install' will install all the files in
 \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
@@ -1025,25 +1025,27 @@ for instance \`--prefix=\$HOME'.
 For better control, use the options below.
 
 Fine tuning of the installation directories:
-  --bindir=DIR           user executables [EPREFIX/bin]
-  --sbindir=DIR          system admin executables [EPREFIX/sbin]
-  --libexecdir=DIR       program executables [EPREFIX/libexec]
-  --sysconfdir=DIR       read-only single-machine data [PREFIX/etc]
-  --sharedstatedir=DIR   modifiable architecture-independent data [PREFIX/com]
-  --localstatedir=DIR    modifiable single-machine data [PREFIX/var]
-  --libdir=DIR           object code libraries [EPREFIX/lib]
-  --includedir=DIR       C header files [PREFIX/include]
-  --oldincludedir=DIR    C header files for non-gcc [/usr/include]
-  --datarootdir=DIR      read-only arch.-independent data root [PREFIX/share]
-  --datadir=DIR          read-only architecture-independent data [DATAROOTDIR]
-  --infodir=DIR          info documentation [DATAROOTDIR/info]
-  --localedir=DIR        locale-dependent data [DATAROOTDIR/locale]
-  --mandir=DIR           man documentation [DATAROOTDIR/man]
-  --docdir=DIR           documentation root 
]@<:@DATAROOTDIR/doc/m4_ifset([AC_PACKAGE_TARNAME], [AC_PACKAGE_TARNAME], 
[PACKAGE])@:>@[
-  --htmldir=DIR          html documentation [DOCDIR]
-  --dvidir=DIR           dvi documentation [DOCDIR]
-  --pdfdir=DIR           pdf documentation [DOCDIR]
-  --psdir=DIR            ps documentation [DOCDIR]
+  --bindir=DIR            user executables [EPREFIX/bin]
+  --sbindir=DIR           system admin executables [EPREFIX/sbin]
+  --libexecdir=DIR        program executables [EPREFIX/libexec]
+  --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
+  --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
+  --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
+  --libdir=DIR            object code libraries [EPREFIX/lib]
+  --includedir=DIR        C header files [PREFIX/include]
+  --oldincludedir=DIR     C header files for non-gcc [/usr/include]
+  --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
+  --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
+  --infodir=DIR           info documentation [DATAROOTDIR/info]
+  --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
+  --mandir=DIR            man documentation [DATAROOTDIR/man]
+]AS_HELP_STRING([--docdir=DIR],
+  [documentation root ]@<:@DATAROOTDIR/doc/m4_ifset([AC_PACKAGE_TARNAME],
+    [AC_PACKAGE_TARNAME], [PACKAGE])@:>@)[
+  --htmldir=DIR           html documentation [DOCDIR]
+  --dvidir=DIR            dvi documentation [DOCDIR]
+  --pdfdir=DIR            pdf documentation [DOCDIR]
+  --psdir=DIR             ps documentation [DOCDIR]
 _ACEOF
 
   cat <<\_ACEOF]
diff --git a/lib/autoconf/status.m4 b/lib/autoconf/status.m4
index 5b43e11..6364629 100644
--- a/lib/autoconf/status.m4
+++ b/lib/autoconf/status.m4
@@ -1293,13 +1293,13 @@ Usage: $[0] [[OPTIONS]] [[FILE]]...
   -d, --debug      don't remove temporary files
       --recheck    update $as_me by reconfiguring in the same conditions
 m4_ifdef([_AC_SEEN_CONFIG(FILES)],
-[[  --file=FILE[:TEMPLATE]
-                  instantiate the configuration file FILE
-]])dnl
+  [AS_HELP_STRING([[--file=FILE[:TEMPLATE]]],
+    [instantiate the configuration file FILE], [                   ])
+])dnl
 m4_ifdef([_AC_SEEN_CONFIG(HEADERS)],
-[[  --header=FILE[:TEMPLATE]
-                  instantiate the configuration header FILE
-]])dnl
+  [AS_HELP_STRING([[--header=FILE[:TEMPLATE]]],
+    [instantiate the configuration header FILE], [                   ])
+])dnl
 
 m4_ifdef([_AC_SEEN_CONFIG(FILES)],
 [Configuration files:
diff --git a/lib/m4sugar/m4sh.m4 b/lib/m4sugar/m4sh.m4
index c03995b..3334bdd 100644
--- a/lib/m4sugar/m4sh.m4
+++ b/lib/m4sugar/m4sh.m4
@@ -243,7 +243,7 @@ if test "x$CONFIG_SHELL" = x; then
   AS_IF([_AS_RUN([_AS_DETECT_REQUIRED_BODY]) 2>/dev/null],
         [as_have_required=yes],
        [as_have_required=no])
-  AS_IF([test $as_have_required = yes && dnl
+  AS_IF([test $as_have_required = yes &&dnl
         _AS_RUN([_AS_DETECT_SUGGESTED_BODY]) 2> /dev/null],
     [],
     [as_candidate_shells=
-- 
1.5.3.2


reply via email to

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