manpagez: man pages & more
info autoconf
Home | html | info | man

File: autoconf.info,  Node: Package Options,  Next: Pretty Help Strings,  Prev: External Software,  Up: Site Configuration

15.3 Choosing Package Options
=============================

If a software package has optional compile-time features, the user can
give ‘configure’ command line options to specify whether to compile
them.  The options have one of these forms:

     --enable-FEATURE[=ARG]
     --disable-FEATURE

   These options allow users to choose which optional features to build
and install.  ‘--enable-FEATURE’ options should never make a feature
behave differently or cause one feature to replace another.  They should
only cause parts of the program to be built rather than left out.

   The user can give an argument by following the feature name with ‘=’
and the argument.  Giving an argument of ‘no’ requests that the feature
_not_ be made available.  A feature with an argument looks like
‘--enable-debug=stabs’.  If no argument is given, it defaults to ‘yes’.
‘--disable-FEATURE’ is equivalent to ‘--enable-FEATURE=no’.

   Normally ‘configure’ scripts complain about ‘--enable-PACKAGE’
options that they do not support.  *Note Option Checking::, for details,
and for how to override the defaults.

   For each optional feature, ‘configure.ac’ should call ‘AC_ARG_ENABLE’
to detect whether the ‘configure’ user asked to include it.  Whether
each feature is included or not by default, and which arguments are
valid, is up to you.

 -- Macro: AC_ARG_ENABLE (FEATURE, HELP-STRING, [ACTION-IF-GIVEN],
          [ACTION-IF-NOT-GIVEN])
     If the user gave ‘configure’ the option ‘--enable-FEATURE’ or
     ‘--disable-FEATURE’, run shell commands ACTION-IF-GIVEN.  If
     neither option was given, run shell commands ACTION-IF-NOT-GIVEN.
     The name FEATURE indicates an optional user-level facility.  It
     should consist only of alphanumeric characters, dashes, plus signs,
     and dots.

     The option's argument is available to the shell commands
     ACTION-IF-GIVEN in the shell variable ‘enableval’, which is
     actually just the value of the shell variable named
     ‘enable_FEATURE’, with any non-alphanumeric characters in FEATURE
     changed into ‘_’.  You may use that variable instead, if you wish.
     The HELP-STRING argument is like that of ‘AC_ARG_WITH’ (*note
     External Software::).

     Note that ACTION-IF-NOT-GIVEN is not expanded until the point that
     ‘AC_ARG_ENABLE’ was expanded.  If you need the value of
     ‘enable_FEATURE’ set to a default value by the time argument
     parsing is completed, use ‘m4_divert_text’ to the ‘DEFAULTS’
     diversion (*note m4_divert_text::) (if done as an argument to
     ‘AC_ARG_ENABLE’, also provide non-diverted text to avoid a shell
     syntax error).

     You should format your HELP-STRING with the macro ‘AS_HELP_STRING’
     (*note Pretty Help Strings::).

     See the examples suggested with the definition of ‘AC_ARG_WITH’
     (*note External Software::) to get an idea of possible applications
     of ‘AC_ARG_ENABLE’.

© manpagez.com 2000-2024
Individual documents may contain additional copyright information.