Graphics with XDarwin on Mac OS X
Alastair Reid
reid@cs.utah.edu
10 Jun 2002 13:32:56 +0100
> Does anybody know how to install the hugs graphics library with Mac
> OS X using XDarwin? I tried a couple of things that didn't work and
> figured that somebody has probably sorted this out.
I'm afraid I don't know of anyone having done this but maybe it'd help
if we narrowed down which bit is causing problems.
1) Is Hugs working ok?
Probably yes or you'd have said.
2) Is the GreenCard processor working ok?
Probably yes but probably irrelevant since the HGL ships with copies
of the files generated by GreenCard.
3) Are the GreenCard-generated C files in the HGL compiling and linking ok?
The answer to this is often "no". The instructions for building the
object files vary a bit from one platform to another and we haven't
got a complete list of the instructions for each.
This is probably the problem though it can be confused with the next
problem.
4) Is Hugs correctly loading the compiler and linked .c files from the HGL?
IIRC, Hugs uses one of libdl, libdld, libshl or <some Win32 library
whose name I forget> to load these files. Hugs also has to work
around a curious feature of Unix compilers/linkers: some like to
prefix C function names with underscores and some don't. Hugs
tries to determine which to do when it is configured.
If the configuration process can't detect the library Hugs needs or
if it misdetects the need for an underscore, loading will not work.
--
Alastair Reid
ps In my spare time I'm trying to improve Hugs' foreign function
interface (ffi). As part of this, I'm hoping to cleanup problems 3
and 4 by having Hugs distributions include a script which builds the
.o correctly and by extending the test suite to check that this part
of the ffi is working ok.
The move towards the new hierarchial libraries will also help in a way
- the libraries include so much ffi-dependent code that we simply
won't be able to build a Hugs distribution without getting the ffi
working either in dynamic linking mode (readily implemented on many
platforms, what I describe above) or in the more rarely used static
linking mode (less flexible but very portable, used in systems that
lack dynamic linking).