Cabal + WinHugs + Windows + No C Compiler

Ross Paterson ross at soi.city.ac.uk
Tue Nov 7 20:27:44 EST 2006


On Tue, Nov 07, 2006 at 06:55:38PM +0000, Neil Mitchell wrote:
> >> However, I also want to develop Hoogle using WinHugs on Windows on a
> >> computer without a C compiler, and it seems that the generated
> >> Paths_Hoogle module requires FFI on Windows? Is there any way round
> >> this, or am I just out of luck in using Cabal's path feature in this
> >> situation?
> >
> >Perhaps it could call things from the System.Win32 lib instead of doing
> >the FFI directly.
> >
> >Could you investigate what external functions we need exactly and if
> >they're exported from System.Win32.
> 
> foreign import stdcall unsafe "windows.h GetModuleFileNameA"
> getModuleFileName :: Ptr () -> CString -> Int -> IO Int32
> 
> That's the only one. Wouldn't it make more sense to put this FFI call
> in Cabal (which is always there, and always required) instead of
> Win32, which isn't an existing dependancy?

One moment.

There's no point calling GetModuleFileName from runhugs, as the location
of the runhugs binary has nothing to do with the package.  The closest
approximation is getProgName, the location of the source file containing
the Main module.  We'd just need some scheme for directories relative
to that.  Neil, how should be revise section 3.1.2 of the User's Guide
for Hugs on Windows?



More information about the cabal-devel mailing list