pexports Was: Re: [Haskell-cafe] binding to C libraries on Windows was Low Level Audio - Writing bytes to the sound card?

Hi All, Would a pure Haskell version of pexports be useful to the Haskell community? For a Sunday afternoon hack that turned out to take a bit more effort (its now Wednesday), I thought I'd code up a tool that extracts function symbols from .dll's (also when I first looked at the C pexports it seemed somewhat unadopted, though checking today it appears to in MinGW, so my local MinGW must be out-of-date). If there are compelling uses that aren't covered by pexports and would ease Haskell C binding problems on Windows, I don't mind polishing up my tool, but otherwise I've exhausted my natural interest. Best wishes Stephen

Stephen Tetley wrote:
If there are compelling uses that aren't covered by pexports and would ease Haskell C binding problems on Windows, I don't mind polishing up my tool, but otherwise I've exhausted my natural interest.
I think the main problem you'll face is that pexports is a windows only tool. If cabal can be made to use pexports on windows and something else on Unix then that should be ok. If you expect people writing Haskell bindings in Unix to jump though hoops to hook pexports into a windows specific build, you are heading for disappointment :-). Erik -- ---------------------------------------------------------------------- Erik de Castro Lopo http://www.mega-nerd.com/

Hi Erik
I'm neither expecting nor obliging Unix users to do anything...
pexports (the C tool) extracts function names from dlls. In one of the
messages on the PortAudio thread [1], John Lask explained how to get
from a standard Windows .dll to an .a file suitable for GHC (which is
bundled with a MinGW gcc). Before John's explanation I thought you had
to build the .a file yourself - or do some magic with GreenCard which
is now quite antiquated, but with pexports you can do the missing step
(I almost feel a commuting diagram coming on at this point...).
When I looked for pexports on Sunday it seem rather abandoned (it
didn't seem to be included in MinGW, M Xyz's tutorial points to a very
old version...) so I thought I'd see if I could do the job myself in
Haskell. Anyway it was a bit more work that I imagined and when I was
web-searching for pexports today I found that it was included in
MinGW. So my Haskell version is redundant - but pexports isn't quite
the full story, seemingly people often have to hand-edit the .def file
it produces. If someone else has a use compelling enough that it would
benefit the Haskell community on Windows, I don't mind extending and
polishing my version so it can do a bit more than pexports; but I get
by with cygwin and MinGW myself, so I've no personal inclination to
spend any more time on it (and of course it is no help whatsoever for
includes files and related problems...).
Best wishes
Stephen
[1] http://www.haskell.org/pipermail/haskell-cafe/2009-December/070293.html
2009/12/9 Erik de Castro Lopo
Stephen Tetley wrote:
If there are compelling uses that aren't covered by pexports and would ease Haskell C binding problems on Windows, I don't mind polishing up my tool, but otherwise I've exhausted my natural interest.
I think the main problem you'll face is that pexports is a windows only tool. If cabal can be made to use pexports on windows and something else on Unix then that should be ok.
If you expect people writing Haskell bindings in Unix to jump though hoops to hook pexports into a windows specific build, you are heading for disappointment :-).
Erik -- ---------------------------------------------------------------------- Erik de Castro Lopo http://www.mega-nerd.com/ _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

I think it would be a usefull addition to the haskell windows tool chain, and help facilitate the creation of bindings to libraries on windows where no appropriate import library exists. I am sure if you put it "out there" in whatever form, someone will find a use for it and perhaps build upon it. jvl Stephen Tetley wrote:
Hi All,
Would a pure Haskell version of pexports be useful to the Haskell community?
For a Sunday afternoon hack that turned out to take a bit more effort (its now Wednesday), I thought I'd code up a tool that extracts function symbols from .dll's (also when I first looked at the C pexports it seemed somewhat unadopted, though checking today it appears to in MinGW, so my local MinGW must be out-of-date).
If there are compelling uses that aren't covered by pexports and would ease Haskell C binding problems on Windows, I don't mind polishing up my tool, but otherwise I've exhausted my natural interest.
Best wishes
Stephen _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
participants (3)
-
Erik de Castro Lopo
-
John Lask
-
Stephen Tetley