DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH
 

(autoconf.info.gz) Pretty Help Strings

Info Catalog (autoconf.info.gz) Package Options (autoconf.info.gz) Site Configuration (autoconf.info.gz) Site Details
 
 Making Your Help Strings Look Pretty
 ====================================
 
    Properly formatting the `help strings' which are used in
 `AC_ARG_WITH' ( External Software) and `AC_ARG_ENABLE' (
 Package Options) can be challenging.  Specifically, you want your own
 `help strings' to line up in the appropriate columns of `configure
 --help' just like the standard Autoconf `help strings' do.  This is the
 purpose of the `AC_HELP_STRING' macro.
 
  - Macro: AC_HELP_STRING (LEFT-HAND-SIDE, RIGHT-HAND-SIDE)
      Expands into an help string that looks pretty when the user
      executes `configure --help'.  It is typically used in `AC_ARG_WITH'
      ( External Software) or `AC_ARG_ENABLE' ( Package
      Options).  The following example will make this clearer.
 
           AC_DEFUN([TEST_MACRO],
           [AC_ARG_WITH([foo],
                        AC_HELP_STRING([--with-foo],
                                       [use foo (default is NO)]),
                        [ac_cv_use_foo=$withval], [ac_cv_use_foo=no])
           AC_CACHE_CHECK([whether to use foo],
                          [ac_cv_use_foo], [ac_cv_use_foo=no])])
 
      Please note that the call to `AC_HELP_STRING' is *unquoted*.  Then
      the last few lines of `configure --help' will appear like this:
 
           --enable and --with options recognized:
             --with-foo              use foo (default is NO)
 
      The `AC_HELP_STRING' macro is particularly helpful when the
      LEFT-HAND-SIDE and/or RIGHT-HAND-SIDE are composed of macro
      arguments, as shown in the following example.
 
           AC_DEFUN(MY_ARG_WITH,
           [AC_ARG_WITH([$1],
                        AC_HELP_STRING([--with-$1], [use $1 (default is $2)]),
                        ac_cv_use_$1=$withval, ac_cv_use_$1=no),
           AC_CACHE_CHECK(whether to use $1, ac_cv_use_$1, ac_cv_use_$1=$2)])
 
Info Catalog (autoconf.info.gz) Package Options (autoconf.info.gz) Site Configuration (autoconf.info.gz) Site Details
automatically generated byinfo2html