Well, after a couple of days' frantic hacking I've made more progress,
and I'd invite anyone to comment on my decisions:

The compilation of the C++ 'wrapper' code has now been moved to a
separate project which I've called wxc.
This will now do the compilation and linking as per Jeremy's gist, and
then install the headers and the shared library (that is, install in
the cabal sense of the word).

Here's the clever part (well, I'm quite pleased with it):
Now wxcore depends on wxc, and during the wxcore configuration hook it
uses cabal to get the install information for wxc, from this it can
obtain the location of the aforementioned headers and shared library,
which can then link against.

The upshot:
1. All the C++ code is now in wxc.
2. Only wxc has to link against the wxWidgets libraries.
3. wxcore only uses the installed headers (to generate Haskell code
using wxdirect) and shared library from wxc (to link against).

The only major problem remaining (aside from the woeful lack of
testing, and support for non-Linux platforms) is you have to pass an
rpath to the linker when compiling; so you get something like this:

samples/wxcore$ ghc --make -package-conf
../../cabal-dev/packages-7.0.3.conf/
-optl-Wl,-rpath,../../cabal-dev/lib/wxc-0.1/ghc-7.0.3 HelloWorld.hs

In any case, I've pushed the changes to my darcden branch, and I
invite you to take a look:
http://darcsden.com/DukeDave/wxhaskell-dev

(Please accept my apologies for the record fail, needless to say the
change is split across two patches; I'm not happy either..)

Dave,

------------------------------------------------------------------------------
Cloud Computing - Latest Buzzword or a Glimpse of the Future?
This paper surveys cloud computing today: What are the benefits? 
Why are businesses embracing it? What are its payoffs and pitfalls?
http://www.accelacomm.com/jaw/sdnl/114/51425149/
_______________________________________________
wxhaskell-devel mailing list
wxhaskell-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxhaskell-devel

Reply via email to