[C2hs] c2hs on CygWin

Manuel M T Chakravarty chak at cse.unsw.edu.au
Mon May 1 20:10:59 EDT 2006


Rich Fought:
> Attached are two bz2 files, the first one (GnuTLS.i.bz2) captures the
> __attribute__ error.
> The second (GnuTLS2.i.bz2) captures the signal.h error that follows after
> getting around the attribute error as described previously in this thread.
> If there is anything else I can provide please let me know.

Thanks for those.

> Also, c2hs generally does not play nice in Cygwin.  The post-install script
> does not
> run correctly, and must be run by hand.  Even then, there are problems with
> paths (/ vs \) so the script must be edited by hand for it to run correctly.

To be honest, I am not sure how to write shell scripts with portable
file name conventions.  Do you know what the Right Thing is?  Or Duncan?

Incidentally, the latest version of Cabal, shipped with GHC 6.4.2 seems
to no longer require the post-install script (ie, it should now be
possible to add the functionality to Setup.hs) - script was always a
kludge to get around a shortcoming in Cabal's API.  Maybe the easiest
thing to do is to just to get rid of that script now (but that will mean
you need at least GHC 6.4.2).

> When installing other packages (such as hsgnutls) using Cabal, Cabal looks
> for c2hs.exe installed on the system, not the script in /usr/local/bin.  So
> you have to add c2hs.exe to the path to get configured, but then the build
> fails because it is missing the flags in the script.  So you have to call
> c2hs by hand.  I only had 3 files to process, but for many files this could
> quicky become a pain.

This would be a bug in Cabal, wouldn't it?  If so, I 'd be happy to
contact Issac about fixing this - just want to make sure I am on the
right track.

Sorry for being so tentative.  I am keen to get c2hs work smoothly for
windows users, but I lack the expertise to do so without some
assistance.

Manuel

> > -----Original Message-----
> > From: Manuel M T Chakravarty [mailto:chak at cse.unsw.edu.au] 
> > Sent: Friday, April 28, 2006 7:26 PM
> > To: Duncan Coutts
> > Cc: Rich Fought; c2hs at haskell.org
> > Subject: Re: [C2hs] c2hs on CygWin
> > 
> > Duncan Coutts:
> > > On Wed, 2006-04-12 at 16:40 -0500, Rich Fought wrote:
> > > > Hello,
> > > > 
> > > > I'm trying to use c2hs on Cygwin to build hsgnutls and am running 
> > > > into some problems.
> > > >  
> > > > I get the following error:
> > > >  
> > > > c2hs.exe: Error in C header file.
> > > > 
> > > > /usr/include/sys/reent.h:182: (column 12) [FATAL]
> > > >   >>> Syntax error!
> > > >   The symbol '__attribute__' does not fit here.
> > > >  
> > > > I see nothing like this in reent.h
> > > >  
> > > > Any ideas/tips?
> > > 
> > > Re-run your c2hs command and add this flag "--keep". Then 
> > send in the 
> > > .i file that this command produces.
> > > 
> > > By looking at this .i file it should be possible for a c2hs 
> > expert to 
> > > identify the problem.
> > > 
> > > (The file may well be quite large so it'd be helpful to 
> > compress it.)
> > 
> > As Duncan wrote it would be very helpful if you could provide 
> > that information.  Then, we can reproduce the problem much 
> > more easily.
> > 
> > Cheers,
> > Manuel
> > 
> > 
> > 
> > 
> > 



More information about the C2hs mailing list