[Hat] Hat on Cygwin
Malcolm Wallace
hat@haskell.org
Thu, 19 Jun 2003 11:36:14 +0100
Andy Fugard <andyfugard@eircom.net> writes:
> Currently having fun trying to install Hat on Cygwin. So far I have got
> hmake and glib built okay. However on trying to do a "make" on hat, I
> get the result attached at the bottom. The problem /seems/ to be with glib.
>
> ghc -fglasgow-exts -package lang -package util -o HatTrail *.o
> -L/usr/local/lib -lglib
> c:\ghc\ghc-5.04.3\gcc-lib\ld.exe: cannot find -lglib
OK, the symptom of the problem is that 'glib' has installed itself in
a Cygwin directory /usr/local/lib but ghc necessarily interprets
the directory flag as windows-absolute, rather than relative to the
Cygwin home.
But the actual cause is a small bug in hmake, which is supposed to
translate directory options to make them suitable for the underlying
compiler. It works in most cases, but I simply forgot about the
-L option. A patch (for script/hmake.inst in the hmake distribution)
is attached.
After applying it, you should only need to 'make install' for hmake
- no rebuilding should be necessary. Then you can try again with
the hat-tools:
make hat-tools
make install
The other problem is this:
> > ghc -c -package hat -o Hat/sort.o Hat/sort.hs
> > c:\ghc\ghc-5.04.3\bin\ghc.exe: unknown package name: hat
It looks like installation of the Hat library package inside the
ghc directories has failed. Did you install ghc with adminstrator
privileges, but Hat as an ordinary user? That might account for it.
You need to have sufficient permissions to copy the Hat library into
the ghc directory, and for ghc-pkg to overwrite its global config file
(package.conf).
If it still fails, then look for the message
Installing hat package for ghc under $libdir
in the installation log, and send us the output immediately following.
Regards,
Malcolm
---- patch for hmake ----
diff -u -r1.32 script/hmake.inst
--- script/hmake.inst 27 May 2003 09:58:08 -0000 1.32
+++ script/hmake.inst 19 Jun 2003 10:28:38 -0000
@@ -144,7 +144,7 @@
# -U*) cppflags=$cppflags" $1"; ;;
# Link flags
- -L*) LDFLAGS=$LDFLAGS" $1" ;;
+ -L*) LDFLAGS=$LDFLAGS" `filepath $1`" ;;
-l*) LDFLAGS=$LDFLAGS" $1" ;;
# tracing and profiling flags - mainly nhc98, some hat-trans