10.5. Setup of a global configuration file

As has already been explained, all ComPact programs read one central configuration file, which is either called compactrc or .compactrc (if it is placed in your home directory). As there are literally dozens of variables, we will only have a look at some important ones right now. A comprehensive list can be found in Section A.1 in Elego ComPact Manual Appendices.

Variable definitions in the configuration files are very simple: They consist of a variable name followed by a value. If the values contains white space, it must be surrounded by double quotes or quotes. Values may contain references to other variables, which come in three kinds:

optional variables: {?name}
mandatory variables: {:name}
mandatory non-empty variables: {!name}
You may reference any variable you have defined before plus some pre-defined ones, like
HOME USER  


To be able to use any version control operation, you need to define the value of

repository

It may also be a good idea to tell ComPact exactly which cvs to call by defining the

cvspath



Building and shipping is only possible if the target platform configuration is defined by

configuration

and/or a pkgkind-tpc-mapping. A target-platform-configuration or short TPC is a tuple of processor type, operating system, object format, and compiler, followed by an possibly empty sequence of options, like debug or optimized. A typical target-platform-configuration looks like

i386-freebsd2-aout-gcc-debug

ComPact uses all of these information to select the appropriate tools and parameters to build the package, and to store the derived files for different TPCs in different directories. The elements of a TPC are defined by the variables

tpc-hosttype tpc-ostype tpc-variant tpc-compiler tpc-options

and their values are usually concatenated by a `-'. Multiple option values are separated by comma.

As you probably want to use different TPCs for different kinds of packages, you can define a mapping of package kinds to TPCs like this:

    pkgkind-tpc-mapping  ComPac[Tt]_CC => {!tpc-hosttype}-{!tpc-ostype}-{!tpc-variant}-gcc{?tpc-options}
    pkgkind-tpc-mapping  ComPac[Tt]_JAVA => {!tpc-hosttype}-{!tpc-ostype}-{!tpc-variant}-{!tpc-compiler}{?tpc-options}
    pkgkind-tpc-mapping  COMPACT_SIMPLE => {!tpc-hosttype}-{!tpc-ostype}-{!tpc-variant}-{!tpc-compiler}{?tpc-options}


For shipping to any pool, its location must of course be defined via

localpool projectpool globalpool

Also, directories for executable programs and documents should be defined via

bindir docdir



It is always a good idea to specify the editor you want to use and the root of your package and project collections (the default values for ComPactHTTPd) by the following variables:

editor package-collection project-collection