home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 10
/
Fresh_Fish_10_2352.bin
/
useful
/
util
/
edit
/
mg
/
docs
/
config
< prev
next >
Wrap
Text File
|
1990-06-02
|
28KB
|
671 lines
CONFIG USERS MANUAL
0. TABLE OF CONTENTS
0. TABLE OF CONTENTS
1. INTRODUCTION
1.1 Description
1.2 Overview
1.3 Conventions
2. PREPARING A CONFIGURATION
2.1 Syntax
2.2 Options Files
2.3 Configuration Files
3. PREPARING OPTIONS FILES
3.1 Value Options
3.2 Option Options
3.3 Required Options
3.4 Action Options
3.5 Names To Avoid
4. PROGRAMMING FOR CONFIG
4.1 Starting Out
4.2 Required Options
4.3 Option Options
4.4 Value Options
4.5 The "Appropriate" Options File
4.6 Converting a Program for Config
1. INTRODUCTION
This section describes config, gives an overview of this manual, and
introduces the user to the conventions and terminology of config.
1.1 Description
Config is a tool that makes configuring a certain type of large
program much easier for anyone not intimately familiar with the
details of the program. It also makes keeping multiple different
configurations of such programs easier - even though they may run on
different machines, or under different operating systems.
The programs in question all use numerous symbols to control the
conditional compilation of features in the program, or to control
which code is compiled for what system. These programs need to run on
multiple different machines or operating systems, or run in an
environment where having all the features of a program enabled entails
an unacceptable performance cost, or makes running the program
impossible.
The two normal approaches to this type of program both have problems.
One approach is to change the compile commands to enable and disable
features. The other approach is to keep a large file which defines all
the features, and have all other files depend on that. The first can
quickly generate unwieldy command lines. Both require recompiling the
entire program after a change of one option, unless that option only
effects one file, and the automatic building facility used for that
program is defeated. Config provides an alternative that avoids both
of these problems.
1.2 Overview
This config users manual has the following four sections:
Section 1 states what config is used for, describes this manual, and
explains some conventions and terminology used throughout the manual.
It should be read by anyone not already partly familiar with config.
Section 2 explains how, if you have a program already prepared for use
with config and all the appropriate files set up, you would go about
preparing a new configuration of that program. It should be read by
everyone who wishes to rebuild a config-supported program.
Section 3 explains the meaning of the options files in terms of the
program. It should be read by all those who are adding features to a
config-supported program.
Section 4 describes what form a program must be in before it can be
supported by config, and how to set up the initial configuration files
for a program. It should be read by anyone who has a program they
would like config to support.
1.3 Conventions
There are several conventions associated with the use of config that
are assumed to be true throughout this manual. The first is that
config is being used to configure a program, referred to as "the
program." The second is that all the files needed by config are in one
directory, near the top of the source tree for the program. The third
is that that directory is called "conf". It will hereinafter be
referred to as "the conf directory", or just "conf". Config assumes
that at the same level as the conf directory there will be one
directory for every configuration that can currently be built. These
will be called "configuration directories", or "the configuration
directory". The names of these directories are usually in upper case.
In the conf directory, there are two types of files which config cares
about. The first are those with the extension ".options". These are
"options files". The second are conventionally in upper case, and
represent different configurations of the program. For each of these,
there should be a configuration directory with the same name. These
are "configuration files" or "config files". Configuration files and
options files contain lines, each of which is either a comment, or
describes some symbol the programmer uses to control compilation of
the program. These symbols are called options. Currently, config only
supports the configuration of C programs. It could easily support
others, but this document assumes the program is written in C.
2. PREPARING A CONFIGURATION
This section describes the steps necessary to prepare a configuration
file for use in building a configuration of a config-supported
program.
2.1 Syntax
In the conf directory, you should find a collection of options files.
These list all the options that can be used in all configurations of
the program. Some options are required; some can be toggled on or off;
others allow you to change values used by the compiler. The form of
each line in an option file indicates which it is.
The most important rule about options files is that it's line based.
The end of a line is the end of an option. The second thing to know is
that a "#" character followed by a space starts a comment. Everything
after that will be ignored by config, and is for the benefit of the
reader. The meaning of the option is given in the comment. The third
rule is that the first word on the line is the "name" for the option
this line describes, and that everything from the end of the name to
the start of any comment or the end of the line, ignoring any leading
or trailing whitespace, is the "value" for the option this line
describes.
There are two special values for options in the options files. The
first is "required". This means any config file that uses options in
that options file must specify a value for that option (explained
in a later section). The second special value is "option". This
means that the named option is a toggle, and is normally off. It also
changes the format used in the configuration file for that option.
Finally, there is one special name for options: "action". You should
ignore any option lines with that name. All other options allow you to
specify a value for the named option, and list the default value if
you don't specify one.
A required option could look like this, with comments:
system required # which system we're compiling it for
# currently supported: amiga, vms, bsd
A toggle option might look like this, with comments.
no_metakey option # disables the use of "meta" keys as modifiers
# instead of prefacing commands sequences with
# an ESC character
This option, according to the comments, says that "meta" keys are supported
for all configurations unless their config file specifies
"no_metakey".
A non-required value option could look like this:
metabit 0x80 # what bit in a char is the metabit
which says that metabit is normally "0x80", unless the config file
changes it.
2.2 Options Files
Now that you know the syntax for an options file, you can start
reading them. The first one to read is always "config.options". It
describes the options that exist in every configuration of the
program. You should read through config.options, reading the comments
that describe each option (if there are no such comments, you should
find the author of the program or options file and insist that they be
added), and considering what values you would like those options to
have.
First, decide what values the required options should have. These
values will be limited to a small set, and should be listed in the
comments. For example, according to the comments:
system required # which system we're compiling it for
# currently supported: amiga, vms, bsd
the required option "system" can be set to amiga, vms or bsd.
After you've decided what values you want the required options to
have, you should look for options files with the first part of the
names being the values you've chosen. For example, if you wanted
system to be "amiga", you would look for "amiga.options". This file
will list more options that are available for the program if it's
configured with "system" as "amiga". You should read through that file
in the sa