Alexandre Oliva wrote:
>
> On Aug 26, 2000, Harlan Stenn <[EMAIL PROTECTED]> wrote:
>
> > So who can recommend a package that can be used as an example of a *good*
> > way to handle runtime configuration
>
> I had meant to add it to my message, and ended up forgetting to do so.
>
> I think GCC is a good example of that, in the way it looks for the
> `specs' file and helper executables. It uses paths relative to the
> one in which the executable was installed, falling back to a
> hard-coded prefix, that can be overridden by GCC_EXEC_PREFIX or by -B
> switches in the command line.
You *could* consider my AutoOpts package. It does all of these things
automatically.
Here are the program attribute names that control where RC initialization
takes place:
`environrc'
Indicates looking in the environment for values of variables named
PROGRAM_OPTNAME.
`exerc'
Its presence indicates searching the executable directory for an rc
file. The directory path in `argv[0]' will be used, if possible.
Otherwise, `pathfind(3)' will be used to locate your program.
`homerc'
Specifies either a directory or a file using a specific path (like
`.' or `/usr/local/share/progname') or an environment variable
(like `$HOME/rc/' or `$PREFIX/share/progname') to use to try to
find the rcfile. Use as many as you like. The presence of this
attribute activates the `SAVE_OPTS' and `LOAD_OPTS' options.
See: http://AutoGen.sourceforge.net/autoopts and
http://AutoGen.sourceforge.net/doc/autogen_toc.html