autoconf: Pretty Help Strings
1
1 15.4 Making Your Help Strings Look Pretty
1 =========================================
1
1 Properly formatting the `help strings' which are used in `AC_ARG_WITH'
DONTPRINTYET 1 (⇒External Software) and `AC_ARG_ENABLE' (*notePackage
1DONTPRINTYET 1 (⇒External Software) and `AC_ARG_ENABLE' (⇒Package
Options) can be challenging. Specifically, you want your own `help
1 strings' to line up in the appropriate columns of `configure --help'
1 just like the standard Autoconf `help strings' do. This is the purpose
1 of the `AS_HELP_STRING' macro.
1
1 -- Macro: AS_HELP_STRING (LEFT-HAND-SIDE, RIGHT-HAND-SIDE
1 [INDENT-COLUMN = `26'], [WRAP-COLUMN = `79'])
1 Expands into a help string that looks pretty when the user executes
11 `configure --help'. It is typically used in `AC_ARG_WITH' (⇒
External Software) or `AC_ARG_ENABLE' (⇒Package Options).
1 The following example makes this clearer.
1
1 AC_ARG_WITH([foo],
1 [AS_HELP_STRING([--with-foo],
1 [use foo (default is no)])],
1 [use_foo=$withval],
1 [use_foo=no])
1
1 Then the last few lines of `configure --help' appear like this:
1
1 --enable and --with options recognized:
1 --with-foo use foo (default is no)
1
1 Macro expansion is performed on the first argument. However, the
1 second argument of `AS_HELP_STRING' is treated as a whitespace
1 separated list of text to be reformatted, and is not subject to
1 macro expansion. Since it is not expanded, it should not be
1 double quoted. ⇒Autoconf Language, for a more detailed
1 explanation.
1
1 The `AS_HELP_STRING' macro is particularly helpful when the
1 LEFT-HAND-SIDE and/or RIGHT-HAND-SIDE are composed of macro
1 arguments, as shown in the following example. Be aware that
1 LEFT-HAND-SIDE may not expand to unbalanced quotes, although
1 quadrigraphs can be used.
1
1 AC_DEFUN([MY_ARG_WITH],
1 [AC_ARG_WITH(m4_translit([[$1]], [_], [-]),
1 [AS_HELP_STRING([--with-m4_translit([$1], [_], [-])],
1 [use $1 (default is $2)])],
1 [use_[]$1=$withval],
1 [use_[]$1=$2])])
1 MY_ARG_WITH([a_b], [no])
1 Here, the last few lines of `configure --help' will include:
1
1 --enable and --with options recognized:
1 --with-a-b use a_b (default is no)
1
1 The parameters INDENT-COLUMN and WRAP-COLUMN were introduced in
1 Autoconf 2.62. Generally, they should not be specified; they exist
1 for fine-tuning of the wrapping.
1 AS_HELP_STRING([--option], [description of option])
1 => --option description of option
1 AS_HELP_STRING([--option], [description of option], [15], [30])
1 => --option description of
1 => option
1