itchconfig Documentation
Macros: Substitution
Macro IC_SUBSTITUTE
- Macro name: IC_SUBSTITUTE
- Available since version 0.0.1
- Level: configure
- Parameters:
- id - an identifier
- value (optional) - a value (default: empty - substitute with an empty
string)
- behavior (optional) - identifier substitution behavior (default: empty -
apply the behavior defined by IC_BEGIN)
- Examples:
- IC_SUBSTITUTE(FOO)
- IC_SUBSTITUTE(BAR, helloworld)
- IC_SUBSTITUTE(BAZ0, blah, 10)
Substitutes the identifier id with the given value as defined
by the behavior. The id should only consist of upper-case
letters, numbers and underscore characters, and the first character should be a
letter. IC_SUBSTITUTE has an immediate effect, so executing it twice with the
same id in the same execution path probably won't do what you want
because the effect of the first execution isn't undone.
The behavior is a number which is interpreted as a bitwise-or
combination of the following:
- 1 - set id to value internally in the configure script; if
you use this behavior with IC_BEGIN,
it will only concern the VERSION identifiers mentioned there; otherwise,
id must begin with "ICV_" to avoid problems
- 2 - substitute "@id@" with "value" in all relevant .in files
(see IC_INFILE_ADD)
- 4 - write "id=value" to the Makefile
- 8 - write "#define id value" to config.h; if value
isn't an integer number, it will be quoted ("...") in order to avoid problems
with the C compiler
- 16 - this behavior is only considered in IC_BEGIN and only concerns the VERSION
identifiers mentioned there; it puts "tpn_" in front of the id
name; tpn is the transformed package name: all lower-case letters are
converted to their upper-case equivalents, and all non-alphanumeric characters
are replaced with underscores; e.g. if the package name is "helloworld", the
version identifiers will be named "HELLOWORLD_VERSION..."; this behavior is
useful for packages which contain sub-packages (e.g. freeware compression
libraries) where all the VERSION identifiers could cause name-space
clashes.
Macro IC_SUBSTITUTE_OUTPUT
- Macro name: IC_SUBSTITUTE_OUTPUT
- Available since version 0.0.1
- Level: configure
- Parameters:
- command - command-line to execute a program
- id - an identifier
- behavior (optional) - identifier substitution behavior
- flags (optional) - some flags (default: empty - 1)
Executes the command and substitutes id with the resulting
output string. You can execute "normal" programs like echo or sed, but you can
also e.g. run a config.guess
script (with a command like "./config.guess") if you add one to the
software package.
If flags & 1, the output of stdout is considered. If flags &
2, the output of stderr is considered. If flags & 4, an extra identifier
exitcode_id will be created and contain the exit code of the command;
you can use this e.g. to find out whether the output was valid. The name of the
exitcode_id is constructed by appending "_E" to id; e.g. if
id is "FOO", exitcode_id will be named "FOO_E".
Macro IC_SUBSTITUTE_BEGIN
- Macro name: IC_SUBSTITUTE_BEGIN
- Available since version 0.0.3
- Level: configure
- Parameters: none
If you have a series of substitution commands in your configure.base file,
you can put them into an IC_SUBSTITUTE_BEGIN ... IC_SUBSTITUTE_END block. This
causes a little optimization of the generated shell script code in the
configure script. - The block may only contain IC_SUBSTITUTE, IC_OPTION_ENABLE and IC_OPTION_SET commands, anything else
could result in a buggy script.
Macro IC_SUBSTITUTE_END
- Macro name: IC_SUBSTITUTE_END
- Available since version 0.0.3
- Level: configure
- Parameters: none
See IC_SUBSTITUTE_BEGIN.
Macro IC_SUBSTITUTE_BEHAVIOR
- Macro name: IC_SUBSTITUTE_BEHAVIOR
- Available since version 0.0.1
- Level: configure.pl
- Parameters:
- behavior - standard identifier substitution behavior
Changes the standard identifier substitution behavior (the value which was
initialized with IC_BEGIN).
Macro
IC_META_SUBSTITUTE_PREFIX
- Macro name: IC_META_SUBSTITUTE_PREFIX
- Available since version 0.0.3
- Level: configure.pl
- Parameters:
- kinds - a list of prefix/suffix kinds
- prefix - the desired prefix/suffix
- Example:
- IC_META_SUBSTITUTE_PREFIX(have-c-function, HCF_)
This is a special command for packages which need more flexible
auto-constructed substitution identifiers. By default, some commands use
standard identifier prefix and suffix values; for example, IC_OPTION_ENABLE uses the prefix
"OPTION_", IC_C_HEADERS uses the prefix
"HAVE_", and IC_C_RUN uses the suffix "_O"
for extra output identifiers. In rare cases, this might lead to name-space
clashes; e.g. if IC_C_FUNCTIONS and IC_C_LIBRARY test for a function/library
with the same name foo, they create the same test-result identifier
HAVE_FOO. To solve this unlikely problem, this command allows you to change any
standard prefix and suffix values; the following list shows "kind - standard
value - information":
This documentation file is part of version 0.0.4 of itchconfig, a configuration tool
created by Arne Thomaßen. itchconfig is basically
released under certain versions of the GNU General Public License and WITHOUT
ANY WARRANTY. Copyright (C) 2002 Arne Thomaßen.