Estimated hours taken: 0.5
Branches: main
Clean up the handling of environment variables.
scripts/Mmake.rules:
scripts/c2init.in:
scripts/mgnuc.in:
scripts/ml.in:
scripts/mmc.in:
scripts/parse_ml_options.sh-subr.in:
scripts/binary_step.in:
Remove support for the environment variables which were
previously used to override the location of the standard
library (MERCURY_ALL_C_INCL_DIRS, MERCURY_ALL_MC_C_INCL_DIRS,
MERCURY_INT_DIR, MERCURY_C_LIB_DIR, MERCURY_MOD_LIB_MODS,
MERCURY_TRACE_LIB_MODS).
scripts/Mercury.config.in:
Fix syntax errors.
Set the DEFAULT_MERCURY_LINKAGE variable here rather
than in the mmc script.
scripts/mmc.in:
Setting DEFAULT_MCFLAGS is no longer required -- mmc
now reads its configuration information from the
Mercury.config file. This also fixes a bug which
caused failures in the `mmc --make' tests in
debugging grades on mundroo -- `mmc --make' wasn't
including /usr/local/lib and /usr/local/include in
the search paths for libraries and headers.
configure.in:
Check that the installed compiler is capable of
reading the Mercury.config file.
Bootstrap tag: bootstrap_20030413_read_config_file.
NEWS:
doc/user_guide.texi:
Document the change.
Estimated hours taken: 20
Branches: main
Allow reconfiguration of existing installations, for example
to use a different C compiler. The reconfiguration works
by making a new copy of the scripts and mercury_conf.h,
and storing them in a partial installation directory tree
which uses the libraries and executables from the existing
installation.
Use this method to configure binary distributions, rather
than using a cut down version of the configuration script,
to avoid code duplication and to handle the case where the
C compiler in use on the installation machine is different
than that used to build the binary distribution.
This is more robust than the previous method of using a different
C compiler, which was to set the MERCURY_C_COMPILER variable and
hope the different C compilers were compatible enough.
Mmakefile:
runtime/Mmakefile:
scripts/Mmakefile:
Modify the `install' targets to store files needed to create
a new configuration in $INSTALL_LIBDIR/reconf.
runtime/Mmakefile:
Install mercury_conf.h in $INSTALL_LIBDIR/conf, rather than
$INSTALL_LIBDIR/inc, so that it can be overridden by a
different configuration.
scripts/mercury_config.in:
Create a new configuration, by creating part of a Mercury
source tree from the files stored in $INSTALL_LIBDIR/reconf,
running configure, then copying the files into a partial
installation tree.
scripts/Mmake.vars.in:
Define ENABLE_DEEP_PROFILER, for use by bindist/bindist.Makefile.
Define variables INSTALL_CONF_DIR (contains the files describing
the configuration) and INSTALL_RECONF_DIR (contains files needed
to reconfigure an installation).
configure.in:
Add an option `--enable-reconfigure', for use by
mercury_config.in.
Don't look for runtime/mercury_wrapper.c when checking
for the sources -- it isn't present when reconfiguring.
Look for scripts/mmc.in instead.
Look for the runtime headers in the installation hierarchy
rather than the `runtime/' and `trace/' directories when
reconfiguring.
Output the help message for the `configure' script to
`configure.help'. This is included in the help message
for `mercury_config'.
Add new configuration variables CONFIG_PREFIX and CONFIG_LIBDIR,
which are like PREFIX and LIBDIR except that they point
to the configuration files, not the library files.
In the normal case PREFIX and CONFIG_PREFIX will be the same.
bindist/bindist.INSTALL.in:
bindist/bindist.Makefile.in:
Use mercury_config to configure binary distributions.
bindist/Mmakefile:
bindist/bindist.configure.in:
bindist/bindist.build_vars.in:
Remove bindist.configure.in and bindist.build_vars.in.
compiler/options.m:
scripts/parse_ml_options.sh-subr.in:
scripts/mgnuc.in:
doc/user_guide.texi:
Add an option `--mercury-config-dir', and an environment
variable MERCURY_CONFIG_DIR, which tell the compiler and
scripts where to find the configuration files for the
installation.
MERCURY_CONFIG_DIR is not documented because it should
only be used by the scripts.
compiler/compile_target_code.m:
Pass `--mercury-config-dir' to the scripts.
compiler/handle_options.m:
Add `--c-include-directory $MERCURY_CONFIG_DIR/conf'.
library/getopt.m:
Handle `maybe_string_special' options.
doc/user_guide.texi:
Update the "Using a different C compiler" chapter.
NEWS:
Document the changes.
Estimated hours taken: 6
Branches: main
Allow alternative locations for the standard library files
to be specified using options to the various Mercury scripts
rather than environment variables. This change is necessary
to allow the compiler to be compiled using `mmc --make', because
`mmc --make' does not support the environment variables.
All of the Mercury scripts now accept an option
`--mercury-standard-library-directory' to specify the installed
library to use, or `--no-mercury-standard-library-directory' to
disable the use of the installed library. The location
of the alternate files to use can then be specified
using ordinary options to the scripts.
There is a new environment variable MERCURY_STDLIB_DIR, which has
the same effect as the `--mercury-standard-library-directory' option.
scripts/parse_ml_options.sh-subr.in:
scripts/mgnuc.in:
scripts/mmc.in:
scripts/mmake.in:
scripts/Mmake.vars.in:
scripts/Mmake.rules:
Handle MERCURY_STDLIB_DIR and `--mercury-standard-library-directory'.
Remove support for the MERCURY_C_INCL_DIR, MERCURY_MOD_LIB_DIRS
and MERCURY_TRACE_LIB_DIRS environment variables -- they aren't
used anywhere. MERCURY_C_INCL_DIR is being removed because the
assumption it makes (that all header files are installed into
a single directory) will not hold for much longer because the
generated header files for hl* grades are grade dependent.
compiler/options.m:
compiler/compile_target_code.m:
Add an option `--trace-init-file', used to specify `.init'
files which should only be used when tracing is enabled,
such as browser/mer_browse.init.
Allow `--mercury-stdlib-dir' as an abbreviation for
`--mercury-standard-library-directory'.
tools/lmc:
Use options rather than environment variables.
doc/user_guide.texi:
Document MERCURY_STDLIB_DIR, MERCURY_TRACE_LIB_MODS
and the `--trace-init-file' mmc option.
Remove documentation for the no longer used MERCURY_C_INCL_DIR,
MERCURY_MOD_LIB_DIRS, MERCURY_TRACE_LIB_DIRS and
MERCURY_NC_BUILTIN environment variables.
Estimated hours taken: 0.5
Fix Mmake's handling of linker options.
scripts/Mmake.vars.in:
Add Mmake variables LDFLAGS, used for linker flags for
executables, and LD_LIBFLAGS, used for linker flags for
shared libraries. The separate variables are need because
on some architectures `ml' invokes the C compiler, but
`ml --make-shared-lib' invokes the linker directly.
Put `--' before CFLAGS in the construction of ALL_MGNUCFLAGS
to avoid confusion between C compiler options and mgnuc
options.
compiler/modules.m:
Pass LDFLAGS and LD_LIBFLAGS to ml.
doc/user_guide.texi:
Document CFLAGS, LDFLAGS and LD_LIBFLAGS.
scripts/parse_ml_options.sh_subr.in:
scripts/ml.in:
Define options `--print-link-command' and
`--print-shared-lib-link-command', which print
the commands ml uses to link executables and
shared libraries.
Estimated hours taken: 1.5
Branches: main
Allow Mercury runtime options to be set at compile time.
scripts/parse_ml_options.sh-subr.in:
Add an initialization option `--runtime-flags'.
runtime/mercury_wrapper.h:
Add a global variable MR_runtime_flags.
util/mkinit.c:
Set MR_runtime_flags.
runtime/mercury_wrapper.c:
Add the value of MR_runtime_flags to the dummy
command line passed to getopt().
tests/hard_coded/Mmakefile:
Use `--runtime-flags' rather than MERCURY_OPTIONS.
Estimated hours taken: 1
Branches: main
Combine the options for ml and c2init. Once mmake has been
altered to pass MLFLAGS to c2init users will be able to
mostly ignore the existence of c2init.
This change requires an installed compiler which uses `--init-c-file'
rather than `-o' to name c2init's output file. This is difficult to
test for in configure.in.
Bootstrap CVS tag: bootstrap_20011203_init_c_file_c2init_option
scripts/parse_ml_options.sh-subr.in:
Parse the combined options for ml and c2init.
The `-o' and `--output' options for c2init have been removed
(`-o' conflicts with a linker option), use `--init-c-file' instead.
configure.in:
Add parse_ml_options.sh-subr.in to the list of files to substitute.
scripts/ml.in:
scripts/c2init.in:
Include parse_ml_options.sh-subr.
scripts/Mmakefile:
ml and c2init depend on parse_ml_options.sh-subr.