|
From: Dave T. <duk...@gm...> - 2011-12-19 22:03:10
|
On 14 December 2011 07:16, Dave Tapley <duk...@gm...> wrote: > 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 I've just pushed a bunch of bug fixes to this repo, so if you were having trouble before then hopefully everything will be better now. > > (Please accept my apologies for the record fail, needless to say the > change is split across two patches; I'm not happy either..) > > Dave, |