64-bit windows version?

skaller skaller at users.sourceforge.net
Mon Jun 25 15:34:58 EDT 2007

On Mon, 2007-06-25 at 13:35 -0400, Peter Tanski wrote:

> > Maybe some gcc mimicing cl wrapper tailored specifically for GHC  
> > building system could help? One more layer of indirection, but  
> > could leave ghc driver relatively intact.
> That's a good idea!  Do you know if or how the mingw-gcc is able to  
> do that?  Does mingw-gcc wrap link.exe?  

There's more to portable building than the build system.
For example, for C code, you need a system of macros to support

	void MYLIB_EXTERN f();

where MYLIB_EXTERN can be empty, say  __declspec(dllexport)
on Windows when building a DLL, and  __declspec(dllimport)
when using it. This is *mandatory*.

The build system controls the command line switches that
turn on "We're building a DLL" flag. A distinct macro is needed
for every DLL.

In Felix, there is another switch which tells the source
if the code is being built for static linkage or not:
some macros change when you're linking symbols statically
compared to using dlsym().. it's messy: the build system
manages that too. 

Building Ocaml, you have a choice of native or bytecode,
and there are some differences. Probably many such things
for each and every language and variation of just about
anything .. eg OSX supports two kinds of dynamic libraries.

The point is that a 'Unix' oriented build script probably
can't be adapted: Unix is different to Windows. The best
way to adapt to Windows is to use Cygwin.. if you want
a Windows native system, you have to build in the Windows 
way and make Windows choices. A silly example of that
is that (at least in the past) Unix lets you link at
link time against a shared library, whereas Windows
requires to link against a static thunk ..
so building a shared library produces TWO outputs
on Windows.

OTOH, Unix has this woeful habit of naming shared libraries
like libxxx.so.1.2 which really makes a complete mess
of build systems.

What I'm saying is you just can't wrap Windows tools
inside a Unix build script.

You have to write an abstract script, and implement
the abstractions for each platform.

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

More information about the Glasgow-haskell-users mailing list