]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
The --help message should have paragraphs starting with a title,
authorAkim Demaille <akim@epita.fr>
Wed, 19 Jul 2000 09:08:13 +0000 (09:08 +0000)
committerAkim Demaille <akim@epita.fr>
Wed, 19 Jul 2000 09:08:13 +0000 (09:08 +0000)
the options, and then optionally a small paragraph.

* acgeneral.m4 (AC_DIVERT_ONCE): New macro.
(HELP_VAR_END): New diversion.
(AC_ARG_ENABLE, AC_ARG_WITH, AC_ARG_VAR): Use AC_DIVERT_ONCE.
(AC_ARG_VAR): Follow the --help style.
* acspecific.m4 (AC_PATH_X): Use AC_DIVERT_ONCE.

ChangeLog
acgeneral.m4
acspecific.m4
lib/autoconf/general.m4
lib/autoconf/specific.m4

index 9c506358b8fd00856a3a79b2ed0477f92daa7dd5..2bab8e6b34cfc8acdda7a35d6228a8498dce4cbc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2000-07-19  Akim Demaille  <akim@epita.fr>
+
+       The --help message should have paragraphs starting with a title,
+       the options, and then optionally a small paragraph.
+
+       * acgeneral.m4 (AC_DIVERT_ONCE): New macro.
+       (HELP_VAR_END): New diversion.
+       (AC_ARG_ENABLE, AC_ARG_WITH, AC_ARG_VAR): Use AC_DIVERT_ONCE.
+       (AC_ARG_VAR): Follow the --help style.
+       * acspecific.m4 (AC_PATH_X): Use AC_DIVERT_ONCE.
+
 2000-07-19  Akim Demaille  <akim@epita.fr>
 
        * aclang.m4 (AC_PROG_CC): Don't require AC_PROG_F77, require
index f835aecf286974801504fbb951148166dd0e9bf5..dde15acb3d32dd93ebecd5f2031925f9a55c7aa3 100644 (file)
@@ -88,6 +88,8 @@ define([sinclude], [builtin([sinclude], $@)])
 #   Help msg from AC_ARG_WITH.
 # - HELP_VAR
 #   Help msg from AC_ARG_VAR.
+# - HELP_VAR_END
+#   A small paragraph on the use of the variables.
 # - HELP_END
 #   Tail of the handling of --help.
 #
@@ -137,7 +139,8 @@ define([_AC_DIVERT(HELP_CANON)],     11)
 define([_AC_DIVERT(HELP_ENABLE)],    12)
 define([_AC_DIVERT(HELP_WITH)],      13)
 define([_AC_DIVERT(HELP_VAR)],       14)
-define([_AC_DIVERT(HELP_END)],       15)
+define([_AC_DIVERT(HELP_VAR_END)],   15)
+define([_AC_DIVERT(HELP_END)],       16)
 
 define([_AC_DIVERT(VERSION_BEGIN)],  20)
 define([_AC_DIVERT(VERSION_END)],    21)
@@ -184,6 +187,14 @@ AC_DIVERT_POP()dnl
 ])
 
 
+# AC_DIVERT_ONCE(DIVERSION-NAME, CONTENT)
+# ---------------------------------------
+# Output once CONTENT into DIVERSION-NAME (which may be a number
+# actually).  An end of line is appended for free to CONTENT.
+define([AC_DIVERT_ONCE],
+[AC_EXPAND_ONCE([AC_DIVERT([$1], [$2])])])
+
+
 # Initialize the diversion setup.
 define([_AC_DIVERT_DIVERSION], _AC_DIVERT([BODY]))
 # Throw away output until AC_INIT is called.
@@ -1642,7 +1653,7 @@ if test "$ac_init_help" = "long"; then
 Usage: $[0] [[OPTION]]... [[VAR=VALUE]]...
 
 [To assign environment variables (e.g., CC, CFLAGS...), specify them as
-VAR=VALUE.  See below for descriptions of useful variables.
+VAR=VALUE.  See below for descriptions of some of the useful variables.
 
 Defaults for the options are specified in brackets.
 
@@ -1707,6 +1718,8 @@ dnl - HELP_WITH
 dnl
 dnl - HELP_VAR
 dnl
+dnl - HELP_VAR_END
+dnl
 dnl - HELP_END
 dnl   initialized below, in which we dump the trailer (handling of the
 dnl   recursion for instance).
@@ -1976,14 +1989,11 @@ define([AC_PLAIN_SCRIPT],
 # AC_ARG_ENABLE(FEATURE, HELP-STRING, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
 # ------------------------------------------------------------------------
 AC_DEFUN([AC_ARG_ENABLE],
-[AC_DIVERT_PUSH([HELP_ENABLE])dnl
-AC_EXPAND_ONCE([[
+[AC_DIVERT_ONCE([HELP_ENABLE], [[
 Optional Features:
   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
-  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
-]])[]dnl
-$2
-AC_DIVERT_POP()dnl
+  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]]])dnl
+AC_DIVERT_ONCE([HELP_ENABLE], [$2])dnl
 # Check whether --enable-$1 or --disable-$1 was given.
 if test "[${enable_]patsubst([$1], -, _)+set}" = set; then
   enableval="[$enable_]patsubst([$1], -, _)"
@@ -2008,14 +2018,12 @@ AU_DEFUN([AC_ENABLE],
 # AC_ARG_WITH(PACKAGE, HELP-STRING, ACTION-IF-TRUE, [ACTION-IF-FALSE])
 # --------------------------------------------------------------------
 AC_DEFUN([AC_ARG_WITH],
-[AC_DIVERT_PUSH([HELP_WITH])dnl
-AC_EXPAND_ONCE([[
+[AC_DIVERT_ONCE([HELP_WITH], [[
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
-]])[]dnl
-$2
-AC_DIVERT_POP()dnl
+]])
+AC_DIVERT_ONCE([HELP_WITH], [$2])dnl
 # Check whether --with-$1 or --without-$1 was given.
 if test "[${with_]patsubst([$1], -, _)+set}" = set; then
   withval="[$with_]patsubst([$1], -, _)"
@@ -2042,18 +2050,15 @@ AU_DEFUN([AC_WITH],
 # Register VARNAME as a variable configure should remember, and
 # document it in `configure --help' (but only once).
 AC_DEFUN([AC_ARG_VAR],
-[AC_DIVERT_PUSH([HELP_VAR])dnl
-AC_EXPAND_ONCE([
-Some relevant environment variables, which you can use to override the
-choices made by the configure script or to help it to find libraries and
-programs with nonstandard names/locations:
-])[]dnl
-ifdef([AC_ARG_VAR_$1],,[AC_HELP_STRING([$1], [$2], [              ])
-define([AC_ARG_VAR_$1])])dnl
-AC_DIVERT_POP()dnl
-dnl Register if set and not yet registered.
-dnl If there are envvars given as arguments, they are already set,
-dnl therefore they won't be set again, which is the right thing.
+[AC_DIVERT_ONCE([HELP_VAR], [
+Some influential environment variables:])dnl
+AC_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
+AC_DIVERT_ONCE([HELP_VAR], [AC_HELP_STRING([$1], [$2], [              ])])dnl
+# Register if set and not yet registered.
+# If there are envvars given as arguments, they are already set,
+# therefore they won't be set again, which is the right thing.
 case "${$1+set} $ac_configure_args" in
  *" $1="* );;
  "set "*) ac_configure_args="$1='[$]$1' $ac_configure_args";;
index 7079a3252dc1db71317b7b84e532c989fb93d9f3..7b4c6e7b2a2eb0eeb18295c43ed7d145965894f0 100644 (file)
@@ -2418,14 +2418,12 @@ fi
 # --without-x overrides everything else, but does not touch the cache.
 AC_DEFUN([AC_PATH_X],
 [AC_REQUIRE_CPP()dnl Set CPP; we run _AC_PATH_X_DIRECT conditionally.
-AC_MSG_CHECKING(for X)
-
 dnl Document the X abnormal options inherited from history.
-AC_EXPAND_ONCE([AC_DIVERT([HELP_BEGIN],
-[
+AC_DIVERT_ONCE([HELP_BEGIN], [
 X features:
   --x-includes=DIR    X include files are in DIR
-  --x-libraries=DIR   X library files are in DIR])])dnl
+  --x-libraries=DIR   X library files are in DIR])dnl
+AC_MSG_CHECKING(for X)
 
 AC_ARG_WITH(x, [  --with-x                use the X Window System])
 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
index f835aecf286974801504fbb951148166dd0e9bf5..dde15acb3d32dd93ebecd5f2031925f9a55c7aa3 100644 (file)
@@ -88,6 +88,8 @@ define([sinclude], [builtin([sinclude], $@)])
 #   Help msg from AC_ARG_WITH.
 # - HELP_VAR
 #   Help msg from AC_ARG_VAR.
+# - HELP_VAR_END
+#   A small paragraph on the use of the variables.
 # - HELP_END
 #   Tail of the handling of --help.
 #
@@ -137,7 +139,8 @@ define([_AC_DIVERT(HELP_CANON)],     11)
 define([_AC_DIVERT(HELP_ENABLE)],    12)
 define([_AC_DIVERT(HELP_WITH)],      13)
 define([_AC_DIVERT(HELP_VAR)],       14)
-define([_AC_DIVERT(HELP_END)],       15)
+define([_AC_DIVERT(HELP_VAR_END)],   15)
+define([_AC_DIVERT(HELP_END)],       16)
 
 define([_AC_DIVERT(VERSION_BEGIN)],  20)
 define([_AC_DIVERT(VERSION_END)],    21)
@@ -184,6 +187,14 @@ AC_DIVERT_POP()dnl
 ])
 
 
+# AC_DIVERT_ONCE(DIVERSION-NAME, CONTENT)
+# ---------------------------------------
+# Output once CONTENT into DIVERSION-NAME (which may be a number
+# actually).  An end of line is appended for free to CONTENT.
+define([AC_DIVERT_ONCE],
+[AC_EXPAND_ONCE([AC_DIVERT([$1], [$2])])])
+
+
 # Initialize the diversion setup.
 define([_AC_DIVERT_DIVERSION], _AC_DIVERT([BODY]))
 # Throw away output until AC_INIT is called.
@@ -1642,7 +1653,7 @@ if test "$ac_init_help" = "long"; then
 Usage: $[0] [[OPTION]]... [[VAR=VALUE]]...
 
 [To assign environment variables (e.g., CC, CFLAGS...), specify them as
-VAR=VALUE.  See below for descriptions of useful variables.
+VAR=VALUE.  See below for descriptions of some of the useful variables.
 
 Defaults for the options are specified in brackets.
 
@@ -1707,6 +1718,8 @@ dnl - HELP_WITH
 dnl
 dnl - HELP_VAR
 dnl
+dnl - HELP_VAR_END
+dnl
 dnl - HELP_END
 dnl   initialized below, in which we dump the trailer (handling of the
 dnl   recursion for instance).
@@ -1976,14 +1989,11 @@ define([AC_PLAIN_SCRIPT],
 # AC_ARG_ENABLE(FEATURE, HELP-STRING, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
 # ------------------------------------------------------------------------
 AC_DEFUN([AC_ARG_ENABLE],
-[AC_DIVERT_PUSH([HELP_ENABLE])dnl
-AC_EXPAND_ONCE([[
+[AC_DIVERT_ONCE([HELP_ENABLE], [[
 Optional Features:
   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
-  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
-]])[]dnl
-$2
-AC_DIVERT_POP()dnl
+  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]]])dnl
+AC_DIVERT_ONCE([HELP_ENABLE], [$2])dnl
 # Check whether --enable-$1 or --disable-$1 was given.
 if test "[${enable_]patsubst([$1], -, _)+set}" = set; then
   enableval="[$enable_]patsubst([$1], -, _)"
@@ -2008,14 +2018,12 @@ AU_DEFUN([AC_ENABLE],
 # AC_ARG_WITH(PACKAGE, HELP-STRING, ACTION-IF-TRUE, [ACTION-IF-FALSE])
 # --------------------------------------------------------------------
 AC_DEFUN([AC_ARG_WITH],
-[AC_DIVERT_PUSH([HELP_WITH])dnl
-AC_EXPAND_ONCE([[
+[AC_DIVERT_ONCE([HELP_WITH], [[
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
-]])[]dnl
-$2
-AC_DIVERT_POP()dnl
+]])
+AC_DIVERT_ONCE([HELP_WITH], [$2])dnl
 # Check whether --with-$1 or --without-$1 was given.
 if test "[${with_]patsubst([$1], -, _)+set}" = set; then
   withval="[$with_]patsubst([$1], -, _)"
@@ -2042,18 +2050,15 @@ AU_DEFUN([AC_WITH],
 # Register VARNAME as a variable configure should remember, and
 # document it in `configure --help' (but only once).
 AC_DEFUN([AC_ARG_VAR],
-[AC_DIVERT_PUSH([HELP_VAR])dnl
-AC_EXPAND_ONCE([
-Some relevant environment variables, which you can use to override the
-choices made by the configure script or to help it to find libraries and
-programs with nonstandard names/locations:
-])[]dnl
-ifdef([AC_ARG_VAR_$1],,[AC_HELP_STRING([$1], [$2], [              ])
-define([AC_ARG_VAR_$1])])dnl
-AC_DIVERT_POP()dnl
-dnl Register if set and not yet registered.
-dnl If there are envvars given as arguments, they are already set,
-dnl therefore they won't be set again, which is the right thing.
+[AC_DIVERT_ONCE([HELP_VAR], [
+Some influential environment variables:])dnl
+AC_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
+AC_DIVERT_ONCE([HELP_VAR], [AC_HELP_STRING([$1], [$2], [              ])])dnl
+# Register if set and not yet registered.
+# If there are envvars given as arguments, they are already set,
+# therefore they won't be set again, which is the right thing.
 case "${$1+set} $ac_configure_args" in
  *" $1="* );;
  "set "*) ac_configure_args="$1='[$]$1' $ac_configure_args";;
index 7079a3252dc1db71317b7b84e532c989fb93d9f3..7b4c6e7b2a2eb0eeb18295c43ed7d145965894f0 100644 (file)
@@ -2418,14 +2418,12 @@ fi
 # --without-x overrides everything else, but does not touch the cache.
 AC_DEFUN([AC_PATH_X],
 [AC_REQUIRE_CPP()dnl Set CPP; we run _AC_PATH_X_DIRECT conditionally.
-AC_MSG_CHECKING(for X)
-
 dnl Document the X abnormal options inherited from history.
-AC_EXPAND_ONCE([AC_DIVERT([HELP_BEGIN],
-[
+AC_DIVERT_ONCE([HELP_BEGIN], [
 X features:
   --x-includes=DIR    X include files are in DIR
-  --x-libraries=DIR   X library files are in DIR])])dnl
+  --x-libraries=DIR   X library files are in DIR])dnl
+AC_MSG_CHECKING(for X)
 
 AC_ARG_WITH(x, [  --with-x                use the X Window System])
 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.