<A name="MARKSEC27"></A>
<A name="MARKSEC28"></A>
The configuration files are Tcl source files which are read by Aida during
startup. They can contain any valid Tcl code. There are two configuration
directories :
a site configuration directory located on the host
machine and specified using the AIDA_SITE_CONFIG
environment variable.
a user configuration directory .aidarc located in the current user's home
directory.
Each directory can contain the following files:
config.tcl which stores configuration settings.
default.tcl which stores processing options and parameters.
convert.tcl* which stores Tcl procs.
When one of these files needs to be sourced, the site configuration
directory (if any) is always visited before the user config directory, so
that user settings can override site wide settings.
The exact order in which all the files are sourced is detailed in the
Startup section below.
For the site-wide directory to be taken into account, one must
define the AIDA_SITE_CONFIG
environment variable. How to do this
depends on the shell which is used to execute the command. For instance, in
the case of the bash shell, one can invoke the aida command in one
of the following ways:
AIDA_SITE_CONFIG=/path/to/dir aida convert somefile.aida
or
export AIDA_SITE_CONFIG=/path/to/dir aida convert somefile.aida
The config.tcl files are designed to contain early
configuration options. This is the proper location, for instance, to modify
the aida_path variable or to define a default target. For instance,
it might contain instructions like this:
lappend aida_path [file normalize ~/library/AidaLocalLib] set aida_head(DefaultTarget) "latex"
<A name="MARKSEC29"></A>
Aida supports environment variables which can be used to define default
settings from the shell environment.
The AIDA_SITE_CONFIG
environment variable
defines the location of a system-wide (as opposed to user-defined)
location for configuration files.
It is explained in the Configuration of the Aida system section.
The AIDA_TARGET
environment variable specifies the default
target to use with the aida convert
and the aida split
commands. The value defined by this variable is overridden by the -target option (if any).
The AIDA_INPUT_ENCODING
and AIDA_OUTPUT_ENCODING
environment variables specify a default input and output encoding
respectively. See the section Input and output encodings for more
information about them. These variables are read early during startup and
can be overridden by the -from or the -to options, or by a
call to the aida::inputEncoding
or aida::outputEncoding
core commands.
<A name="MARKSEC30"></A>
When the aida command is invoked, the following startup sequence is
executed:
the global options are parsed;
the Tcl interpreter is created. During the initialization of the
interpreter,
- global variables (aida_version, aida_library, aida_verbosity)
are created and set with default values;
- an init.tcl script is sourced if it is found;
- the configuration files config.tcl are sourced if they exist;
- finally, the basic core library is sourced (the file core.tcl).
the code to execute the subcommand is invoked. For the convert
and the split subcommands, the command specific options are first parsed,
then several files are sourced:
- the basic files default.tcl and convert.tcl located in
$aida_library/base;
- the target specific files default.tcl and convert.tcl;
- site specific files default.tcl and convert.tcl if
they are found;
- user files default.tcl and convert.tcl if they are
found. then, just before
parsing, if a preConvertHook hook exists, it is executed;
Here is the exact order in which files are sourced when converting an Aida
file to a particular target, i-e when executing the aida convert or
the aida split command:
1. init.tcl
1. config_dir/config.tcl
1. ~/.aidarc/config.tcl
1. aida_library/core.tcl
1. aida_library/base/default.tcl
1. aida_library/base/convert.tcl
1. aida_library/<target>/default.tcl
1. aida_library/<target>/convert.tcl
1. config_dir/default.tcl
1. ~/.aidarc/default.tcl
1. config_dir/convert.tcl
1. ~/.aidarc/convert.tcl
where config_dir designates the site-wide configuration directory (if any)
and aida_library is the directory containing the Aida library (which can
be obtained with the command aida info library).
When a command like aida help or aida info is executed, only the
following files are sourced (since there is no target in that case):
1. init.tcl
1. config_dir/config.tcl
1. ~/.aidarc/config.tcl
1. aida_library/core.tcl
1. aida_library/base/default.tcl
1. config_dir/default.tcl
1. ~/.aidarc/default.tcl