Mac Port

Wolfgang Thaller wolfgang.thaller@gmx.net
Mon, 2 Jun 2003 01:36:31 +0200


> Dear Wolfgang,
>
> I maintain the Hugs port for the darwinports system (a cousin of fink 
> and
> perhaps the successor to the *bsd ports system). I'd like to add a port
> for ghc-6.0. I tried to build it but ran into some problems.
>
> 1. configure doesn't pass the CPPFLAGS and LDFLAGS environment 
> variables
> to the haskell build. This means you can't have libreadline and libdl 
> in
> non-standard locations.

Grmpf... I know I don't like configure scripts. I prefer IDEs. Do you 
know how to fix it/have time to do it?
If not, would somebody else _PLEASE_ do that for us? (It wouldn't enjoy 
digging into the build system code to fix that; in fact, I would 
positively hate it).

> This is a problem for darwinports and fink because of their automatic 
> dependency
> management.

> 2. Even if I put symlinks to the above libraries in the standard 
> locations,
> I still get a build failure. This is building 6.0 using 5.04.3. 
> (5.04.3 was
> built from source successfully using your 5.04.2 binary.) The build 
> ends with
> [...]

Ahem, yes. I didn't have a chance to test GHC 6 in the last five days 
before the release, and, of course, the last commit broke the Mac OS X 
build. I have meanwhile committed a fix to CVS, but that was a day 
after the official relase for 6.0. If you check out the newest stable 
branch from CVS (or ask me to send you diffs tomorrow), it should work.
(That last commit made GHC quote all arguments it passes on to GHC; for 
Mac OS X, it passed "-framework HaskellSupport" instead of "-framework" 
"HaskellSupport". GCC doesn't report an error but it just ignores the 
former. Strange.)

The "HaskellSupport" framework (which is not used if it's not detected 
at configure time; there should really be a configure switch for that) 
is just an aggregation of libgmp and libdl packaged as a framework. I 
figured that would be easier for end users of Haskell programs, as 
libgmp is required for all Haskell programs, and libdl is used by the 
Posix library (and how do you install a dylib using the Finder?). For 
something like darwinports, it might be better to just rely on the gmp 
and dl libraries installed with darwinports, but that makes programs 
compiled using ghc dependent on darwinports, too.

And you just reminded me that I still haven't uploaded the 10 line 
shell script for creating the HaskellSupport.framework anywhere, 
because I could never figure out the appropriate place in CVS:

#!/bin/sh
cd dlcompat-20020413
cp dlfcn.o ../
make
cd ../gmp-4.0.1
./configure
make
ld -r -d ./libs/libgmp.a -o ../libgmp.o
cd ..
ld -dylib -o HaskellSupport.framework/Versions/A/HaskellSupport 
libgmp.o dlfcn.o /usr/lib/dylib1.o -lSystem


OK, that's all for now...

Cheers,

	Wolfgang