[m-rev.] for review: move mmc configuration into options file

Fergus Henderson fjh at cs.mu.OZ.AU
Sat Mar 1 04:38:26 AEDT 2003


On 01-Mar-2003, Simon Taylor <stayl at cs.mu.OZ.AU> wrote:
> 
> Index: Mmake.workspace
> ===================================================================
> RCS file: /home/mercury1/repository/mercury/Mmake.workspace,v
> retrieving revision 1.12
> diff -u -u -r1.12 Mmake.workspace
> --- Mmake.workspace	13 Feb 2003 08:28:42 -0000	1.12
> +++ Mmake.workspace	17 Feb 2003 08:35:03 -0000
> @@ -98,6 +98,8 @@
>  
>  VPATH =		$(LIBRARY_DIR)
>  
> +MCFLAGS +=	--config-file $(SCRIPTS_DIR)/Mercury.config

That should be commented out, as you said in the log message.

> Index: Mmakefile
> ===================================================================
> RCS file: /home/mercury1/repository/mercury/Mmakefile,v
> retrieving revision 1.97
> diff -u -u -r1.97 Mmakefile
> --- Mmakefile	6 Feb 2003 17:05:02 -0000	1.97
> +++ Mmakefile	28 Feb 2003 13:47:19 -0000
> @@ -609,7 +609,9 @@
>  .PHONY : bindist
>  bindist: WORK_IN_PROGRESS TODO
>  	cd bindist; \
> -		PATH="$(INSTALL_PREFIX)/bin:$$PATH" mmake binary_distribution
> +		PATH="$(INSTALL_PREFIX)/bin:$$PATH" \
> +		MMAKE_DIR="$(INSTALL_MMAKE_DIR)" \
> +		mmake -v binary_distribution

That one is not mentioned in the log message.

> Index: bindist/Mmakefile
> ===================================================================
> RCS file: /home/mercury1/repository/mercury/bindist/Mmakefile,v
> retrieving revision 1.38
> diff -u -u -r1.38 Mmakefile
> --- bindist/Mmakefile	24 Jan 2003 07:17:06 -0000	1.38
> +++ bindist/Mmakefile	28 Feb 2003 15:19:29 -0000
> @@ -8,6 +8,9 @@
>  # You need to have already installed the Mercury compiler.
>  
>  MERCURY_DIR=..
> +# Make sure we get a version of Mmake.vars with INSTALL_PREFIX
> +# pointing to the configured installation directory.
> +include $(MERCURY_DIR)/scripts/Mmake.vars
>  include $(MERCURY_DIR)/Mmake.common

I think we should just set INSTALL_PREFIX in Mmake.common,
like we used to do (as well as setting it in Mmake.vars).

Otherwise you run into similar problems if you try to do
`cd compiler; mmake install' -- it will install into
the prefix used for the mmake in your PATH, rather than
into the directory for which this workspace has been configured.

> Index: compiler/make.util.m
> +	% build_with_module_options(ModuleName, ExtraArgs, Builder,
> +	%	Succeeded, Info0, Info).
> +	%
>  	% Perform the given closure after updating the option_table in
>  	% the globals in the io__state to contain the module-specific
> -	% options for the specified module.
> +	% options for the specified module and the extra options given
> +	% in the ExtraArgs.
> +	% Adds `--invoked-by-mmc-make' and `--use-subdirs' to the option
> +	% list.
>  :- pred build_with_module_options(module_name::in,
>  	list(string)::in, build(list(string))::in(build), bool::out,
>  	make_info::in, make_info::out, io__state::di, io__state::uo) is det.
>  
> +	% build_with_module_options(ModuleName, OptionsVariables,
> +	%	OptionArgs, ExtraArgs, Builder, Succeeded, Info0, Info).
> +	%
> +	% Perform the given closure after updating the option_table in
> +	% the globals in the io__state to contain the module-specific
> +	% options for the specified module and the extra options given
> +	% in ExtraArgs and OptionArgs 
> +	% Does not add `--invoked-by-mmc-make' and `--use-subdirs'
> +	% to the option list.
> +:- pred build_with_module_options(module_name::in, options_variables::in,
> +	list(string)::in, list(string)::in,
> +	build(list(string), Info)::in(build),
> +	bool::out, Info::in, Info::out, io__state::di, io__state::uo) is det.

The documentation for these two leaves it unclear as to whether or
not the option_table in the final io__state returned from build_*
is the same as in the initial io__state or not.

> Index: compiler/options.m
> ===================================================================
> RCS file: /home/mercury1/repository/mercury/compiler/options.m,v
> retrieving revision 1.406
> diff -u -u -r1.406 options.m
> --- compiler/options.m	21 Feb 2003 01:54:38 -0000	1.406
> +++ compiler/options.m	21 Feb 2003 02:57:37 -0000
> @@ -1890,6 +1890,8 @@
>  long_option("extra-init-command",	extra_init_command).
>  long_option("mercury-configuration-directory",
>  				mercury_configuration_directory_special).
> +long_option("mercury-config-dir",
> +				mercury_configuration_directory_special).
>  long_option("install-prefix",		install_prefix).
>  long_option("install-command",		install_command).
>  long_option("library-grade",		libgrades).

The diff there doesn't match the log message.

> Index: doc/user_guide.texi
> ===================================================================
> RCS file: /home/mercury1/repository/mercury/doc/user_guide.texi,v
> retrieving revision 1.355
> diff -u -u -r1.355 user_guide.texi
> --- doc/user_guide.texi	21 Feb 2003 01:57:23 -0000	1.355
> +++ doc/user_guide.texi	21 Feb 2003 02:57:43 -0000
> @@ -6320,6 +6320,12 @@
>  standard input.  By default the file @file{Mercury.options}
>  in the current directory will be read.
>  
> + at item --config-file @var{file}
> + at findex --config-file
> +Read the Mercury compiler's configuration information from @var{file}.
> +If the @samp{--config-file} option is not set, a default configuration
> +will be used, unless @samp{--no-mercury-stdlib-dir} is passed to mmc.

There should be a cross-reference here to the place where the
configuration file syntax is documented.

Otherwise that change looks fine.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
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