2
This package provides one command for the management of
3
package-specific, i.e. developer-specified custom build configuration
6
[list_begin definitions]
8
[comment ---------------------------------------------------------------------]
9
[call [cmd ::critcl::userconfig] [method define] [arg name] [arg description] [arg type] [opt [arg default]]]
11
This command defines custom build configuration option, with
12
[arg description], [arg type] and optional [arg default] value.
14
[para] The type can be either [const bool], or a list of values.
16
[list_begin enumerated]
17
[enum] For [const bool] the default value, if specified, must be a
18
boolean. If it is not specified it defaults to [const true].
20
[enum] For a list of values the default value, if specified, must be a
21
value found in this list. If it is not specified it defaults to the
22
first value of the list.
26
[para] The [arg description] serves as in-code documentation of the
27
meaning of the option and is otherwise ignored. When generating a TEA
28
wrapper the description is used for the [syscmd configure] option
29
derived from the option declared by the command.
31
[para] A boolean option [var FOO] are translated into a pair of
32
configure options, [option --enable-[var FOO]] and
33
[option --disable-[var FOO]], whereas an option whose [arg type] is a
34
list of values is translated into a single configure option
35
[option --with-[var FOO]].
37
[comment ---------------------------------------------------------------------]
38
[call [cmd ::critcl::userconfig] [method query] [arg name]]
40
This command queries the database of custom build configuration option
41
for the current [file .critcl] file and returns the chosen value.
42
This may be the default if no value was set via
43
[cmd {::critcl::userconfig set}].
45
[para] It is at this point that definitions and set values are brought
46
together, with the latter validated against the definition.
48
[comment ---------------------------------------------------------------------]
49
[call [cmd ::critcl::userconfig] [method set] [arg name] [arg value]]
51
This command is for use by a tool, like the [syscmd critcl] application,
52
to specify values for custom build configuration options.
54
[para] At the time this command is used only the association between
55
option name and value is recorded, and nothing else is done. This
56
behaviour is necessary as the system may not know if an option of the
57
specified name exists when the command is invoked, nor its type.
59
[para] Any and all validation is defered to when the value of an
60
option is asked for via [cmd {::critcl::userconfig query}].
62
[para] This means that it is possible to set values for any option we
63
like, and the value will take effect only if such an option is both
64
defined and used later on.