autoconf-patches
[Top][All Lists]
Advanced

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

Re: [Fwd: libtool AC_ARG_WITH and autoconf 2.59]


From: Noah Misch
Subject: Re: [Fwd: libtool AC_ARG_WITH and autoconf 2.59]
Date: Wed, 5 Apr 2006 15:42:14 -0700
User-agent: Mutt/1.5.6i

On Tue, Apr 04, 2006 at 12:16:36PM -0700, Paul Eggert wrote:
> Noah Misch <address@hidden> writes:
> 
> > Should we install this?
> 
> Yes, let's please do that (assuming you document it).

I installed this:

2006-04-05  Howard Chu  <address@hidden>  (trivial change)
            Noah Misch  <address@hidden>

        * lib/autoconf/general.m4 (AC_PRESERVE_HELP_ORDER): New macro.
        (AC_ARG_ENABLE, AC_ARG_WITH): Adjust.
        * doc/autoconf.texi (Help Formatting): New node.
        * NEWS: Announce AC_PRESERVE_HELP_ORDER.

diff -urp -X dontdiff ac-clean/doc/autoconf.texi 
ac-preserve_help_order/doc/autoconf.texi
--- ac-clean/doc/autoconf.texi  2006-04-03 09:53:04.000000000 -0400
+++ ac-preserve_help_order/doc/autoconf.texi    2006-04-05 18:29:50.000000000 
-0400
@@ -485,6 +485,7 @@ Manual Configuration
 
 Site Configuration
 
+* Help Formatting::             Customizing @samp{configure --help}
 * External Software::           Working with other optional software
 * Package Options::             Selecting optional features
 * Pretty Help Strings::         Formatting help string
@@ -14083,6 +14084,7 @@ under modified names, and set default va
 options.
 
 @menu
+* Help Formatting::             Customizing @samp{configure --help}
 * External Software::           Working with other optional software
 * Package Options::             Selecting optional features
 * Pretty Help Strings::         Formatting help string
@@ -14091,6 +14093,41 @@ options.
 * Site Defaults::               Giving @command{configure} local defaults
 @end menu
 
address@hidden Help Formatting
address@hidden Controlling Help Output
+
+Users will consult @samp{configure --help} to learn of configuration
+decisions specific to your package.  By default, @command{configure}
+breaks this output into sections for each type of option; within each
+section, help strings appear in the order @file{configure.ac} defines
+them:
+
address@hidden
+Optional Features:
+  @dots{}
+  --enable-bar            include bar
+
+Optional Packages:
+  @dots{}
+  --with-foo              use foo
address@hidden example
+
address@hidden AC_PRESERVE_HELP_ORDER
address@hidden
+
+Request an alternate @option{--help} format, in which options of all
+types appear together, in the order defined.  Call this macro before any
address@hidden or @code{AC_ARG_WITH}.
+
address@hidden
+Optional Features and Packages:
+  @dots{}
+  --enable-bar            include bar
+  --with-foo              use foo
address@hidden example
+
address@hidden defmac
+
 @node External Software
 @section Working With External Software
 @cindex External software
diff -urp -X dontdiff ac-clean/lib/autoconf/general.m4 
ac-preserve_help_order/lib/autoconf/general.m4
--- ac-clean/lib/autoconf/general.m4    2006-04-04 15:42:35.000000000 -0400
+++ ac-preserve_help_order/lib/autoconf/general.m4      2006-04-05 
17:57:44.000000000 -0400
@@ -1342,6 +1342,20 @@ AC_LANG_PUSH(C)
 ## Selecting optional features, working with optional software.  ##
 ## ------------------------------------------------------------- ##
 
+# AC_PRESERVE_HELP_ORDER
+# ----------------------
+# Emit help strings in the order given, rather than grouping all --enable-FOO
+# and all --with-BAR.
+AC_DEFUN([AC_PRESERVE_HELP_ORDER],
+[m4_define([_AC_PRESERVE_HELP_ORDER], 1)
+m4_divert_once([HELP_ENABLE], [[
+Optional Features and Packages:
+  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
+  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
+  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
+  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)]])
+m4_define([_m4_divert(HELP_ENABLE)],    _m4_divert(HELP_WITH))
+])# AC_PRESERVE_HELP_ORDER
 
 # _AC_ENABLE_IF(OPTION, FEATURE, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
 # -------------------------------------------------------------------
@@ -1360,10 +1374,11 @@ m4_define([_AC_ENABLE_IF_ACTION],
 # AC_ARG_ENABLE(FEATURE, HELP-STRING, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
 # ------------------------------------------------------------------------
 AC_DEFUN([AC_ARG_ENABLE],
+[m4_ifndef([_AC_PRESERVE_HELP_ORDER],
 [m4_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
+  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]]])])dnl
 m4_divert_once([HELP_ENABLE], [$2])dnl
 _AC_ENABLE_IF([enable], [$1], [$3], [$4])dnl
 ])# AC_ARG_ENABLE
@@ -1376,10 +1391,11 @@ AU_DEFUN([AC_ENABLE],
 # AC_ARG_WITH(PACKAGE, HELP-STRING, ACTION-IF-TRUE, [ACTION-IF-FALSE])
 # --------------------------------------------------------------------
 AC_DEFUN([AC_ARG_WITH],
+[m4_ifndef([_AC_PRESERVE_HELP_ORDER],
 [m4_divert_once([HELP_WITH], [[
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
-  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)]])
+  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)]])])
 m4_divert_once([HELP_WITH], [$2])dnl
 _AC_ENABLE_IF([with], [$1], [$3], [$4])dnl
 ])# AC_ARG_WITH
diff -urp -X dontdiff ac-clean/NEWS ac-preserve_help_order/NEWS
--- ac-clean/NEWS       2006-04-03 09:53:04.000000000 -0400
+++ ac-preserve_help_order/NEWS 2006-04-05 18:26:21.000000000 -0400
@@ -39,6 +39,11 @@
   Now checks for X11/Xlib.h and XrmInitialize (X proper) rather than
   X11/Intrinsic.h and XtMalloc (Xt).
 
+** AC_PRESERVE_HELP_ORDER
+  New macro that causes `configure' to display help strings for AC_ARG_ENABLE
+  and AC_ARG_WITH arguments in one region, in the order defined.  The default
+  behavior is to group options of each classes separately.
+
 ** AC_PROG_CC, AC_PROG_CXX
   No longer automatically arrange to declare the 'exit' function of C,
   when a C++ compiler is used.  Standard Autoconf macros no longer use




reply via email to

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