darcs patch: added cppOptions and c2hsOptions

Vivian McPhail vivian.mcphail at paradise.net.nz
Fri Apr 20 02:38:49 EDT 2007


Hi:

Here is what Cabal does:

$ ./Setup.lhs -v build
C:\DOCUME~1\vivian\LOCALS~1\Temp\ghc139100_0\ghc139100_0.hc:8:37:
../src/Matlab/C/CMatrix.h: No such file or directory
Reading parameters from
D:\Apps\MSYS\1.0\local\src\MatlabCompiling\matlab.buildinfo
Preprocessing library Matlab-0.0.1...
D:\Apps\MSYS\1.0\local\bin\c2hs.exe -C -D__GLASGOW_HASKELL__=606 -C
-Ic:\Apps\MATLAB704\bin\win32\..\..\extern\include -o
src\Matlab\C\CMatrix.hs src\Matlab\C\CMatrix.chs
D:\Apps\MSYS\1.0\local\bin\c2hs.exe -C -D__GLASGOW_HASKELL__=606 -C
-Ic:\Apps\MATLAB704\bin\win32\..\..\extern\include -o src\Matlab\C\CMat.hs
src\Matlab\C\CMat.chs
c2hs.exe: Matlab/C/CMatrix.chi not found in:
.

Setup.lhs: got error code while preprocessing: Matlab.C.CMat

Here is my command that works (from MatlabCompiling/test)

$ c2hs --cppopts=-I/c/Apps/MATLAB704/extern/include --include=../src
../src/Matlab/C/CMatrix.chs

Here is the addition to matlab.buildinfo which makes Cabal work:

c2hs-options: --cppopts=-I/c/Apps/MATLAB704/bin/win32/../../extern/include
--include=src

I'm also attaching a file which should recreate all the errors that I've
found on MinGW/WinXP.  Note that there are files outside the cabal hierarchy
to simulate headers/library which are already on the system and outside the
packager's control.

Cheers,

Vivian 

> -----Original Message-----
> From: Duncan Coutts [mailto:duncan.coutts at worc.ox.ac.uk] 
> Sent: Friday, 20 April 2007 6:10 p.m.
> To: Vivian McPhail
> Cc: cabal-devel at haskell.org
> Subject: RE: darcs patch: added cppOptions and c2hsOptions
> 
> On Fri, 2007-04-20 at 16:32 +1200, Vivian McPhail wrote:
> > Hi Duncan,
> > 
> > I added cppOptions because in the Cabal.cabal file there 
> was a comment 
> > to add cppOptions and so I did it.
> 
> Ok.
> 
> > With respect to c2hsOptions, the problem is that c2hs 
> passes options 
> > to the CPP nonstandardly (with --cppopts=), so even if I 
> have an -I* 
> > option in my ccOptions that gets passed to c2hs, this works 
> for c2hs, 
> > but doesn't get passed to the cpp that c2hs uses.
> 
> Sorry, I still don't see it fully. Could you say exactly what 
> the c2hs command line is that you use when it works and what 
> command line cabal uses that does not work (and that your 
> patch solves).
> 
> > I've sent a message to the c2hs/cabal mailing list with a dummy 
> > package that recreates all the problems I had on mingw/WinXP.
> 
> I'm not sure that we got this. Could you send it again, 
> perhaps ccing it to me directly.
> 
> Duncan
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mingw-c2hs-cabal-test.zip
Type: application/x-zip-compressed
Size: 9471 bytes
Desc: not available
Url : http://www.haskell.org/pipermail/cabal-devel/attachments/20070420/1415308a/mingw-c2hs-cabal-test.bin


More information about the cabal-devel mailing list