[m-rev.] diff: add option --mercury-standard-library-directory
Simon Taylor
stayl at cs.mu.OZ.AU
Tue Nov 13 01:35:21 AEDT 2001
On 12-Nov-2001, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> Simon Taylor, you wrote:
> >
> > compiler/options.m:
> > doc/user_guide.texi:
> > Add an option `--mercury-standard-library-directory',
> > which can be used to override the standard library
> > directory without setting environment variables.
>
> Why? What's the rationale for that change?
I'm trying to reduce the special-case handling of the standard
library in the build system. Currently, the standard library
search directories are set using a bunch of different environment
variables, which result in different mmc, ml, mgnuc, etc. options
being set. I want to use a single `--mercury-library-directory'
option to set all those other options, as happens with user libraries.
The `--mercury-standard-library-directory' option is needed
in addition to `--mercury-library-directory' because the standard
library is included by default. We need a way to stop it being
included, for example when compiling the compiler, for which the
library directories are set up manually.
I'll also be adding an environment variable MERCURY_STDLIB_DIR, which
will be used to set the default standard library directory passed
to mercury_compile by the `mmc' script. If MERCURY_STDLIB_DIR is unset,
the default directory set at configuration time will be used. If it
is set to a directory, that directory tree will be searched
for the standard library files. If it is set to "none",
`--no-standard-library-directory' will be passed to mercury_compile.
> What happens if you both set the environment variable
> *and* use the option?
The `--mercury-standard-library-directory' option will override
the environment variable. The MERCURY_INT_DIR, MERCURY_C_INCL_DIR, etc.
environment variables will behave as before, even if MERCURY_STDLIB_DIR
is not "none".
> What's wrong with using environment variables?
> Do we really need two ways of doing this?
I would argue that as a general rule anything that can be done
using environment variables should also be doable using options.
With `mmake' the environment variables method was necessary because
otherwise `--search-directory', `--c-include-directory', etc. options
would need to be passed to all of the various programs in the Mercury
build system to change the location of the standard library. With
`mmc --make', the options need only be passed to `mmc', which can
pass them on to the other programs.
Simon.
--------------------------------------------------------------------------
mercury-reviews mailing list
post: mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------
More information about the reviews
mailing list