]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* lib/autoconf/general.m4 (AC_ARG_VAR): Use AS_HELP_STRING instead of
authorDerek Price <derek@ximbiot.com>
Thu, 27 Mar 2003 13:18:34 +0000 (13:18 +0000)
committerDerek Price <derek@ximbiot.com>
Thu, 27 Mar 2003 13:18:34 +0000 (13:18 +0000)
obsolete AC_HELP_STRING.
(AC_HELP_STRING): AU_DEFUN to...
* lib/m4sugar/m4sh.m4 (AS_HELP_STRING): ...here.
* tests/m4sh.at (AS_HELP_STRING): New test.

* tests/acgeneral.at: Regenerated.

ChangeLog
lib/autoconf/general.m4
lib/m4sugar/m4sh.m4
tests/acgeneral.at
tests/m4sh.at

index 8a7c7aa2904316852693c57a3180fa5bb9a1edb0..e76ab3909c6fd861095c5e537f07b43c16e57c92 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2003-03-26  Derek Price  <derek@ximbiot.com>
+
+       * lib/autoconf/general.m4 (AC_ARG_VAR): Use AS_HELP_STRING instead of
+       obsolete AC_HELP_STRING.
+       (AC_HELP_STRING): AU_DEFUN to...
+       * lib/m4sugar/m4sh.m4 (AS_HELP_STRING): ...here.
+       * tests/m4sh.at (AS_HELP_STRING): New test.
+
+       * tests/acgeneral.at: Regenerated.
+
 2003-03-26  Derek Price  <derek@ximbiot.com>
 
        * lib/autotest/general.m4: s/DEFAULT/DEFAULTS/ since it makes more
index e5d8c49ef4666155fdeeb85c834ce29c10c370f7..ef89a35230510a1899fbead0cc31c36f475f6baa 100644 (file)
@@ -214,54 +214,10 @@ m4_define([AC_FOREACH],
 ## ----------------------------------- ##
 
 
-# AC_HELP_STRING(LHS, RHS, [COLUMN])
+# AU::AC_HELP_STRING(LHS, RHS, [COLUMN])
 # ----------------------------------
-#
-# Format an Autoconf macro's help string so that it looks pretty when
-# the user executes "configure --help".  This macro takes three
-# arguments, a "left hand side" (LHS), a "right hand side" (RHS), and
-# the COLUMN which is a string of white spaces which leads to the
-# the RHS column (default: 26 white spaces).
-#
-# The resulting string is suitable for use in other macros that require
-# a help string (e.g. AC_ARG_WITH).
-#
-# Here is the sample string from the Autoconf manual (Node: External
-# Software) which shows the proper spacing for help strings.
-#
-#    --with-readline         support fancy command line editing
-#  ^ ^                       ^
-#  | |                       |
-#  | column 2                column 26
-#  |
-#  column 0
-#
-# A help string is made up of a "left hand side" (LHS) and a "right
-# hand side" (RHS).  In the example above, the LHS is
-# "--with-readline", while the RHS is "support fancy command line
-# editing".
-#
-# If the LHS extends past column 24, then the LHS is terminated with a
-# newline so that the RHS is on a line of its own beginning in column
-# 26.
-#
-# Therefore, if the LHS were instead "--with-readline-blah-blah-blah",
-# then the AC_HELP_STRING macro would expand into:
-#
-#
-#    --with-readline-blah-blah-blah
-#  ^ ^                       support fancy command line editing
-#  | |                       ^
-#  | column 2                |
-#  column 0                  column 26
-#
-m4_define([AC_HELP_STRING],
-[m4_pushdef([AC_Prefix], m4_default([$3], [                          ]))dnl
-m4_pushdef([AC_Prefix_Format],
-           [  %-]m4_eval(m4_len(AC_Prefix) - 3)[s ])dnl [  %-23s ]
-m4_text_wrap([$2], AC_Prefix, m4_format(AC_Prefix_Format, [$1]))dnl
-m4_popdef([AC_Prefix_Format])dnl
-m4_popdef([AC_Prefix])dnl
+AU_DEFUN([AC_HELP_STRING],
+[AS_HELP_STRING([$@])dnl
 ])
 
 
@@ -1484,7 +1440,7 @@ m4_divert_once([HELP_VAR_END], [[
 Use these variables to override the choices made by `configure' or to help
 it to find libraries and programs with nonstandard names/locations.]])dnl
 m4_expand_once([m4_divert_once([HELP_VAR],
-                               [AC_HELP_STRING([$1], [$2], [              ])])],
+                               [AS_HELP_STRING([$1], [$2], [              ])])],
                [$0($1)])dnl
 _AC_ARG_VAR_PRECIOUS([$1])dnl
 ])# AC_ARG_VAR
index 497775c4545b33374458a02788669dfd0746b07e..ee2cfa7a5c65576dc43bfa90af28e964743d2c43 100644 (file)
@@ -850,6 +850,59 @@ _AS_PATH_WALK([$PATH], [echo "PATH: $as_dir"])
 }])
 
 
+# AS_HELP_STRING(LHS, RHS, [COLUMN])
+# ----------------------------------
+#
+# Format a help string so that it looks pretty when
+# the user executes "script --help".  This macro takes three
+# arguments, a "left hand side" (LHS), a "right hand side" (RHS), and
+# the COLUMN which is a string of white spaces which leads to the
+# the RHS column (default: 26 white spaces).
+#
+# The resulting string is suitable for use in other macros that require
+# a help string (e.g. AC_ARG_WITH).
+#
+# Here is the sample string from the Autoconf manual (Node: External
+# Software) which shows the proper spacing for help strings.
+#
+#    --with-readline         support fancy command line editing
+#  ^ ^                       ^
+#  | |                       |
+#  | column 2                column 26
+#  |
+#  column 0
+#
+# A help string is made up of a "left hand side" (LHS) and a "right
+# hand side" (RHS).  In the example above, the LHS is
+# "--with-readline", while the RHS is "support fancy command line
+# editing".
+#
+# If the LHS is contains more than (COLUMN - 3) characters, then the LHS
+# is terminated with a newline so that the RHS starts on a line of its
+# own beginning with COLUMN.  In the default case, this corresponds to
+# an LHS with more than 23 characters.
+#
+# Therefore, in the example, if the LHS were instead
+# "--with-readline-blah-blah-blah", then the AS_HELP_STRING macro would
+# expand into:
+#
+#
+#    --with-readline-blah-blah-blah
+#  ^ ^                       support fancy command line editing
+#  | |                       ^
+#  | column 2                |
+#  column 0                  column 26
+#
+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_popdef([AS_Prefix_Format])dnl
+m4_popdef([AS_Prefix])dnl
+])
+
+
 
 ## ------------------------------------ ##
 ## Common m4/sh character translation.  ##
index 324d05c72e216bdf1fa838b5d87157f48114afb3..e70f6aa5631aed1b36b4bbcef05433b572a0e3e4 100644 (file)
@@ -16,6 +16,7 @@ AT_CHECK_MACRO([AC_PREFIX_DEFAULT])
 AT_CHECK_AU_MACRO([AC_CHECKING])
 AT_CHECK_AU_MACRO([AC_COMPILE_CHECK])
 AT_CHECK_AU_MACRO([AC_ENABLE])
+AT_CHECK_AU_MACRO([AC_HELP_STRING])
 AT_CHECK_AU_MACRO([AC_TRY_COMPILE])
 AT_CHECK_AU_MACRO([AC_TRY_CPP])
 AT_CHECK_AU_MACRO([AC_TRY_LINK])
index 0bdf57825138d9fa051f184adde5ca34f0f3c8ff..7fbce65037729251fb2432a87fbfafcb0b32282f 100644 (file)
@@ -352,3 +352,31 @@ AT_CHECK_M4SH
 AT_CHECK([./script])
 
 AT_CLEANUP
+
+## -------------- ##
+## AS_HELP_STRING ##
+## -------------- ##
+
+# I'm not totally certain that we want to enforce the defaults here,
+# but at least it is being tested.
+
+AT_SETUP([[AS@&t@_HELP_STRING]])
+
+AT_DATA_M4SH([script.as],
+[[AS_INIT
+_AS_LINENO_PREPARE
+
+echo "AS_HELP_STRING([--an-option],[some text])"
+echo "AS_HELP_STRING([--another-much-longer-option],
+[some other text which should wrap at our default of 80 characters.])"
+]])
+
+AT_CHECK_M4SH
+AT_CHECK([./script], [0],
+[  --an-option             some text
+  --another-much-longer-option
+                          some other text which should wrap at our default of
+                          80 characters.
+])
+
+AT_CLEANUP