~ubuntu-branches/ubuntu/utopic/critcl/utopic

« back to all changes in this revision

Viewing changes to doc/include/api_cbconfig.inc

  • Committer: Package Import Robot
  • Author(s): Andrew Shadura
  • Date: 2013-05-11 00:08:06 UTC
  • Revision ID: package-import@ubuntu.com-20130511000806-7hq1zc3fnn0gat79
Tags: upstream-3.1.9
ImportĀ upstreamĀ versionĀ 3.1.9

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
This package provides one command for the management of
 
3
package-specific, i.e. developer-specified custom build configuration
 
4
options.
 
5
 
 
6
[list_begin definitions]
 
7
 
 
8
[comment ---------------------------------------------------------------------]
 
9
[call [cmd ::critcl::userconfig] [method define] [arg name] [arg description] [arg type] [opt [arg default]]]
 
10
 
 
11
This command defines custom build configuration option, with
 
12
[arg description], [arg type] and optional [arg default] value.
 
13
 
 
14
[para] The type can be either [const bool], or a list of values.
 
15
 
 
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].
 
19
 
 
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.
 
23
 
 
24
[list_end]
 
25
 
 
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.
 
30
 
 
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]].
 
36
 
 
37
[comment ---------------------------------------------------------------------]
 
38
[call [cmd ::critcl::userconfig] [method query] [arg name]]
 
39
 
 
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}].
 
44
 
 
45
[para] It is at this point that definitions and set values are brought
 
46
together, with the latter validated against the definition.
 
47
 
 
48
[comment ---------------------------------------------------------------------]
 
49
[call [cmd ::critcl::userconfig] [method set] [arg name] [arg value]]
 
50
 
 
51
This command is for use by a tool, like the [syscmd critcl] application,
 
52
to specify values for custom build configuration options.
 
53
 
 
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.
 
58
 
 
59
[para] Any and all validation is defered to when the value of an
 
60
option is asked for via [cmd {::critcl::userconfig query}].
 
61
 
 
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.
 
65
 
 
66
[list_end]