[Redirected to hugs-bugs.]

> The distribution of Hugs that I have came with a faulty ST.hs file.  

Have you tried using the -98 flags to turn off Haskell 98 restrictions?
(See documentation for details.)

> now, I have not divulged all the information involving my problem ... I 
> wanted to see if I could get some real help before I cracked ...
> 
> I'm actually trying to get this to run on BeOS.

That's a very relevant detail you were holding back.

AFAIK, none of the Hugs developers have BeOS installed so all we can
do is offer untried suggestions.

1) If possible, you should try using GreenCard on a Linux box (or
   similar) first so that you know how things work on platforms we
   both have access to.

2) Figure out how to create an object file that can be loaded by
   dlopen or by shload (HPUX only I think) or by LoadLibrary (Win32
   only I think).  (Use man dlopen or equivalent to find out about these.)

   This is not particularily straightforward.  Here's how I've
   done this in the past.

   1) Read the documentation on your linker.
      If BeOS uses something resembling gld (the GNU linker), start by
      looking at the flags used on other systems when using gld (i.e.,
      Linux and FreeBSD)

      This is frequently a waste of time but you might be on one of
      those rare systems that provides linker documentation that is
      both complete and accurate.  

   2) Find a program which uses dlopen and look at how they build the
      object files that it loads.  

      In practice, this means looking at the Perl sourcecode (or
      documentation if you're lucky) paying particular attention to
      descriptions of XS and DynaLoader.

      You might also look at libtool (seems to be part of the binutils
      package) but be warned that I've never managed to find anything
      useful about libtool.

      In both cases, doing make > /tmp/make-log (or equivalent) and
      then searching for gcc, cc or ld invocations might be illuminating.

   Note that you _don't_ need to figure out how to build a "shared library"
   - all you need is that it can be loaded with dlopen (or equivalent).

3) Now do a bunch of experiments linking the .o file with various 
   flags until you find something that works.

4) Finally, and this is most important, mail the magic linkline to the
   GreenCard maintainers, to hugs-bugs and to the BeOS port maintainer
   (is that you?) so that no-one else has to go through this frustrating
   process again.


Hope this is of some help,

Alastair Reid

Reply via email to