[Hat] Compiling Hat on Windows

Neil Mitchell ndmitchell at gmail.com
Sat Sep 17 18:19:59 EDT 2005


Hi,

I decided to try compiling Hat on Windows, just the viewing tools,
using only the standard Windows tools and those things which get
installed by GHC for Windows. It worked with a few tweaks/changes, so
I thought I'd document them here:

cd ...\hattools
gcc -c *.c -DFILEVERSION="\"2.04\"" -DVERSION="\"2.04\""
(hat-anim.c fails totally)
ghc --make HatCover.hs -cpp -fglasgow-exts artutils.o finitemap.o pathutils.o
ghc --make BlackHat.hs -cpp -fglasgow-exts artutils.o finitemap.o
pathutils.o nontermutils.o
gcc hat-check.c

In addition I also commented out the 4th line in finitemap.h, #include
"checkglib.h". Creating an empty checkglib.h would have solved this
one.

I also commented out the signal lines in hat-check.

I also copied art.h into the tools directory, although an -I flag
would have worked here instead.

I also defined ntohl myself, since its not defined in any of the
default C libraries on Windows.

unsigned long ntohl(unsigned long netlong)
{
		return netlong;
}

With these changes I could get compiled versions of most of the tools.

Thanks

Neil


More information about the Hat mailing list