[MLton] mingwows

skaller skaller@users.sourceforge.net
Fri, 11 Nov 2005 05:31:17 +1100


On Thu, 2005-11-10 at 09:38 -0800, Stephen Weeks wrote:

> I'm wondering what advantage the bat script has over the standard
> MLton script that can be run in MSYS?  Would there really be people
> who have MinGW but not MSYS, 

Absolutely. Me.

> and so would prefer to run MLton from a
> DOS shell?

Don't be silly :) And don't confuse the DOS shell 
COMMAND.EXE with the Windows console CMD.EXE.

I think you're misunderstanding the situation:
MinGW is just gcc. There's no environment.

I have MinGW on BOTH Cygwin AND Linux! I can generate
Win32 executable both ways -- but I don't use MSYS.

Under Cygwin .. which is the preferred way of using
MinGW, you just say:

gcc -mno-cygwin ...

and that's a MinGW executable or dll. It is nothing
more or less than a native Windows executable or dll,
compiled with gcc. The ABI is the same as that used
by MSVC++ -- for C code. The ABI is different for C++ ;(

On Linux, I have the same version of gcc, configured
as a cross compiler so it makes i586 executables and
dlls for Win32. (Use Debian package 'mingw32')
It's called: i586-mingw32msvc-gcc

The point is -- there is no MSYS and no issue of
using a DOS shell either. You execute the binaries
the same way as under Windows because they ARE
native Windows binaries.

BTW: the MinGW version of Ocaml is built with,
and requires, Cygwin's version of gcc/mingw, INRIA claims
the MSYS version is broken (something about
not accepting long command lines ..)

BTW2: For Felix, I supply *.bat scripts for MSVC++
builds, and bash for Cygwin or MinGW builds.
However the way to RUN the built executables is
with Windows batch files.

You should not install in C:\MinGW,
you must NOT mention any specific drive letter
or top level directory: that would never work
on a networked system.

I'm under Linux at the moment, so I can't check the
details, but the correct place to install is in
something like:

%Program Root%\mlton

or something; that will be filled in automatically by the
Windows shell from the registry/system paths, with the
correct place to put packages, usually, but not always,
this will be

C:\Program Files

Your PATH should be extended the same way.

All this stuff is driven by installing bat scripts ..
in %Windows% which is usually C:\Windows .. but again,
not always. That directory is ALWAYS on the PATH :)

With some fiddling, this means you can run everything
without setting up any environment (the bat script
for each command does that each time).

[unfortunately, sorry, I am dual booting at the moment
so I cannot check details and email at the same time ;[

-- 
John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net