[m-rev.] for review: new options for specifying the environment type

Mark Brown mark at csse.unimelb.edu.au
Wed Dec 22 12:43:00 AEDT 2010


Hi,

On 17-Dec-2010, Julien Fischer <juliensf at csse.unimelb.edu.au> wrote:
>
> For review by anyone.
>
> Branches: main
>
> Add new command line options for specifying the environment type(s) to the
> compiler.  (By environment type, we mean the type of the shell, plus 
> various
> system utilities that may be invoked by the compiler.)
>
> One new option, --host-env-type, specifies the environment under which the
> compiler will be invoked; the other, --target-env-type, specifies the
> environment under which a generated executable will be run.  (In the case,
> where they are the same, a third new option, --env-type, can be used to set
> both.)

It's probably worth pointing out (in the code comments) that the reason
the host-env-type is needed is because the one Mercury install can be
called from more than one environment (e.g., windows vs msys).


> Index: compiler/globals.m
> ===================================================================
> RCS file: /home/mercury/mercury1/repository/mercury/compiler/globals.m,v
> retrieving revision 1.97
> diff -u -r1.97 globals.m
> --- compiler/globals.m	15 Dec 2010 06:29:36 -0000	1.97
> +++ compiler/globals.m	17 Dec 2010 06:39:45 -0000
> @@ -154,6 +154,26 @@
>      --->    same_cons_id
>      ;       within_n_cells_difference(int).
>
> +    % The env_type specifies the environment in which the compiler is 
> either
> +    % running or targeting (in the case where we are cross-compiling),
> +    % i.e. the shell and system utilities.

This isn't really about cross-compiling -- you can meaningfully set the
target option when compiling on windows, for windows.  It would be better
to say something like:

    % The env_type specifies the environment in which a Mercury program
    % is being run or is expected to be run.  This is used both for the
    % compiler itself, via the --host-env-type option, and for the program
    % being compiled, via the --target-env-type option.  Note that users
    % need to be able to specify the former because one Mercury install
    % (e.g., on Windows) can be called from different environments.

This looks fine otherwise.

Cheers,
Mark.

--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list