> While your patch should work, I remember seeing C code that uses
> function names like "foo" and "_foo" in the same way that a Haskell
> programmer might use foo and foo', so I had a bad feeling about
> automatically trying both.

Could I recommend that you use or adapt the autoconf test HUGS_TRY_DYNLINK
(hugs98/src/unic/aclocal.m4 in the same cvs repository that has ghc).

This test generates a C object file to be loaded then tries to load the object 
file using one of dlopen, LoadLibrary, NSCreateObjectFileImageFromFile and 
shl_load then tries looking up both the symbol '_test' and 'test' in the 
file.  It sets the linker flags to use to build dynamically loadable object 
files and whether or not to use an underscore when doing the lookup and it 
works on HPUX, Mac, Win32 and most mainstream unix variants. (Bug reports and 
improvements are, of course, welcome.)

--
Alastair Reid

_______________________________________________
Glasgow-haskell-bugs mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to