comparison man/internals/internals.texi @ 3147:971e3c687f18

[xemacs-hg @ 2005-12-18 12:21:49 by malcolmp] Improvements to configure's complex option processing.
author malcolmp
date Sun, 18 Dec 2005 12:22:03 +0000
parents ad2f4ae9895b
children cf02a1da936a
comparison
equal deleted inserted replaced
3146:7c45a748ff54 3147:971e3c687f18
4693 [XE_COMPLEX_OPTION([native],[""]), 4693 [XE_COMPLEX_OPTION([native],[""]),
4694 XE_COMPLEX_OPTION([nas],[""]), 4694 XE_COMPLEX_OPTION([nas],[""]),
4695 XE_COMPLEX_OPTION([esd],[no])]) 4695 XE_COMPLEX_OPTION([esd],[no])])
4696 @end example 4696 @end example
4697 4697
4698 @c #### verify for INSTALL and xemacs Texinfo. 4698 @c #### verify xemacs Texinfo.
4699 Each option is interpreted as a separate feature to be enabled or 4699 Each option is interpreted as a separate feature to be enabled or
4700 disabled. As usual, the distinction between ``with'' and ``enable'' is 4700 disabled. In keeping with @samp{XE_MERGED_ARG}, option values are
4701 that ``with'' features require specific support from the system, usually 4701 stored in the variables @code{with_@var{package}_@var{component}} and
4702 one or more optional libraries, and ``enable'' features are supported 4702 @code{enable_@var{feature}_@var{component}} (@i{e.g.}
4703 entirely by code in XEmacs, but the user might want to switch it off for 4703 @code{with_sound_native} and @code{enable_sound_native}).
4704 some reason. Option values are stored in the variables
4705 @code{with_@var{package}_@var{component}} or
4706 @code{enable_@var{feature}_@var{component}} (@i{e.g.}
4707 @code{enable_sound_native}).
4708 4704
4709 The user of @code{configure} specifies the configuration by providing a 4705 The user of @code{configure} specifies the configuration by providing a
4710 list of components. The special components @samp{all} and @samp{none} 4706 list of components. The special components @samp{all} and @samp{none}
4711 may occur first in the list, setting the defaults for all components to 4707 may occur first in the list, setting the defaults for all components to
4712 @samp{yes} or @samp{no} respectively. 4708 @samp{yes} or @samp{no} respectively. Prefixing a component with
4709 @samp{no} (eg @samp{nofoo}) disables the component.
4713 4710
4714 In @file{configure.ac}, default values of option values may be 4711 In @file{configure.ac}, default values of option values may be
4715 @samp{yes} which means that the option must be used and an error must 4712 @samp{yes} which means that the option must be used and an error must
4716 occur if there is a configuration problems (such as a missing library) 4713 occur if there is a configuration problems (such as a missing library)
4717 or @samp{no} which means that the option must not be used. The default 4714 or @samp{no} which means that the option must not be used. The default
4729 and each is supported by a corresponding library. The other is a single 4726 and each is supported by a corresponding library. The other is a single
4730 library which may or may not be supported by multiple components of 4727 library which may or may not be supported by multiple components of
4731 XEmacs, as exemplified by Xft. This latter usage may be more common 4728 XEmacs, as exemplified by Xft. This latter usage may be more common
4732 during development of a feature. Perhaps specialized APIs should be 4729 during development of a feature. Perhaps specialized APIs should be
4733 provided, see comment on @code{XE_COMPLEX_OPTION_HELP_STRING} below. 4730 provided, see comment on @code{XE_COMPLEX_OPTION_HELP_STRING} below.
4731
4732 @subheading Examples
4733
4734 Given a complex option @code{--with-quux} with three values: @samp{foo},
4735 @samp{bar} and @samp{baz} that have defaults of @samp{yes}, @samp{no} and "" the
4736 corresponding shell variables under different conditions are:
4737
4738 @example
4739 $ configure
4740 with_quux_foo=yes
4741 with_quux_bar=no
4742 with_quux_baz=""
4743
4744 $ configure --with-quux
4745 with_quux_foo=yes
4746 with_quux_bar=no
4747 with_quux_baz=""
4748
4749 $ configure --without-quux
4750 with_quux_foo=no
4751 with_quux_bar=no
4752 with_quux_baz=no
4753
4754 $ configure --with-quux=bar
4755 with_quux_foo=yes
4756 with_quux_bar=yes
4757 with_quux_baz=no
4758
4759 $ configure --with-quux=all
4760 with_quux_foo=yes
4761 with_quux_bar=yes
4762 with_quux_baz=yes
4763
4764 $ configure --with-quux=none,bar
4765 with_quux_foo=no
4766 with_quux_bar=yes
4767 with_quux_baz=no
4768
4769 $ configure --with-quux=all,nofoo
4770 with_quux_foo=no
4771 with_quux_bar=yes
4772 with_quux_baz=yes
4773 @end example
4734 4774
4735 @table @code 4775 @table @code
4736 @item XE_COMPLEX_OPTION(option, yesno) 4776 @item XE_COMPLEX_OPTION(option, yesno)
4737 Declare a complex option and its default value. The value @strong{must} 4777 Declare a complex option and its default value. The value @strong{must}
4738 be either @samp{yes} or @samp{no} or the null string @samp{""}. The 4778 be either @samp{yes} or @samp{no} or the null string @samp{""}. The