[m-users.] Path independence?

Mark Green mgreen at brookes.ac.uk
Sat Jul 27 03:52:01 AEST 2013


Hi Julien,

Thanks for your reply. Is there a particular reason why it's done this way?
Eg, why it couldn't be changed to `dirname $0` on bash or %~dp0 in Windows
to calculate the path relative to where the mmc/mercury script is running
from? Is there any security or similar issue involved in this?

The main reason I'm asking is that I'm trying to get Mercury deployed at my
University, but they use a dynamic application loader which puts the files
in a uniquely numbered path that may vary each time.

Mark


On 26 July 2013 17:28, Julien Fischer <jfischer at opturion.com> wrote:

>
>
> On Fri, Jul 26, 2013 at 6:05 PM, Julien Fischer <jfischer at opturion.com>wrote:
>
>>
>> The paths are not hard-wired into the executable.  They are set by
>> various shell scripts (or batch files) plus a configuration file.
>>
>> On Unix-like system the mmc batch file (the actual compiler exectuable
>> is called mercury_compile), sets the following environment variables:
>>
>>     MERCURY_COMPILER
>>     MERCURY_CONFIG_DIR
>>
>> The former says where to find the mercury_compile executable; the latter
>> specifies the location of the file Mercury.config whose contents
>> describe the other details of the installation.  You can override these
>> settings in the environment if you wish.
>>
>> The mercury.bat file does a similar thing to the mmc script on Windows.
>> (You'll have to edit that file to change the settings though.)
>>
>> The Mercury.config files resides in <INSTALL-PREFIX>/lib/mercury/**conf.
>> Some of the setting therein can be overridden in the environment, the
>> main one of interest being MERCURY_STDLIB_DIR, which tells the compiler
>> where to find the standard library.
>>
>
> It's probably also worth pointing out that this is covered in the
> ``Environment variables''
> chapter of the user's guide.
>
> Cheers,
> Julien.
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurylang.org/archives/users/attachments/20130726/d11239d4/attachment.html>


More information about the users mailing list