autoconf: Package Options
1
1 15.3 Choosing Package Options
1 =============================
1
1 If a software package has optional compile-time features, the user can
1 give `configure' command line options to specify whether to compile
1 them. The options have one of these forms:
1
1 --enable-FEATURE[=ARG]
1 --disable-FEATURE
1
1 These options allow users to choose which optional features to build
1 and install. `--enable-FEATURE' options should never make a feature
1 behave differently or cause one feature to replace another. They
1 should only cause parts of the program to be built rather than left out.
1
1 The user can give an argument by following the feature name with `='
1 and the argument. Giving an argument of `no' requests that the feature
1 _not_ be made available. A feature with an argument looks like
1 `--enable-debug=stabs'. If no argument is given, it defaults to `yes'.
1 `--disable-FEATURE' is equivalent to `--enable-FEATURE=no'.
1
1 Normally `configure' scripts complain about `--enable-PACKAGE'
1 options that they do not support. ⇒Option Checking, for
1 details, and for how to override the defaults.
1
1 For each optional feature, `configure.ac' should call
1 `AC_ARG_ENABLE' to detect whether the `configure' user asked to include
1 it. Whether each feature is included or not by default, and which
1 arguments are valid, is up to you.
1
1 -- Macro: AC_ARG_ENABLE (FEATURE, HELP-STRING, [ACTION-IF-GIVEN],
1 [ACTION-IF-NOT-GIVEN])
1 If the user gave `configure' the option `--enable-FEATURE' or
1 `--disable-FEATURE', run shell commands ACTION-IF-GIVEN. If
1 neither option was given, run shell commands ACTION-IF-NOT-GIVEN.
1 The name FEATURE indicates an optional user-level facility. It
1 should consist only of alphanumeric characters, dashes, plus
1 signs, and dots.
1
1 The option's argument is available to the shell commands
1 ACTION-IF-GIVEN in the shell variable `enableval', which is
1 actually just the value of the shell variable named
1 `enable_FEATURE', with any non-alphanumeric characters in FEATURE
1 changed into `_'. You may use that variable instead, if you wish.
11 The HELP-STRING argument is like that of `AC_ARG_WITH' (⇒
External Software).
1
1 You should format your HELP-STRING with the macro `AS_HELP_STRING'
1 (⇒Pretty Help Strings).
1
1 See the examples suggested with the definition of `AC_ARG_WITH'
1 (⇒External Software) to get an idea of possible
1 applications of `AC_ARG_ENABLE'.
1