ANN: C->Haskell version 0.14.3 "Travelling Lightly"

I like to announce version 0.14.3 of C->Haskell, which brings the following advances over 0.14.1: * gcc's asm construct is supported, which is apparently important for some libraries on Mac OS X (thanks to Duncan Coutts for the patch); * C->Haskell supports cross compilation (see details below); [NB: C->Haskell now generates completely portable Haskell code (needs only H98 + FFI) and can target C compilers on platforms that cannot build C->Haskell itself; eg, PalmOS. In particular, C->Haskell generated bindings are suitable for nhc98 and Hugs, too.] * hierarchical modules syntax can be used in import hooks (again thanks to Duncan for the patch); and * two new built-in translation functions "upcaseFirstLetter" and "downcaseFirstLetter" are supported to generated suitable Haskell names from C names (eg, for variants of enums). Source code is available as a tar ball from http://www.cse.unsw.edu.au/~chak/haskell/c2hs/ or via Darcs (binary packages may appear later). Happy Hacking, Manuel -=- Cross compilation -=- C->Haskell needs to take system-specific parameters of the C compiler used to compile the libraries for which an interface is generated into account (most notably when bitfields are used in this library). By default C->Haskell uses the conventions of the C compiler that was used to build C->Haskell itself. From this version, C->Haskell accepts the --platform=PLATFORM flag that enables the explicit specification of the target platform. This works only for platforms that are in C->Haskell's platform specification database. At the moment, that's only i686-pc-linux-gnu and m68k-palmos. However, it is very easy to determine the platform specification for any platform on which you can build C->Haskell: Just invoke it as `c2hs --version' and it will tell you. If you send me the output of `c2hs --version', I'll happily add it to the database. (If you'd like to target a platform on which you cannot build C->Haskell, such as an embedded system, let me know.)

Manuel M T Chakravarty (chak@cse.unsw.edu.au) wrote: Hi Manuel!
Happy Hacking,
Attempt to build c2hs on amd64 gives: gour@gaura-nitai ~/tmp/c2hs-0.14.3 $ ./Setup.hs configure Configuring c2hs-0.14.3... configure: Using install prefix: /usr/local configure: Using compiler: /usr/bin/ghc configure: Compiler flavor: GHC configure: Compiler version: 6.4.1.20050801 configure: Using package tool: /usr/bin/ghc-pkg configure: Using haddock: /usr/bin/haddock configure: Using happy: /usr/bin/happy configure: Using alex: /usr/bin/alex configure: Using hsc2hs: /usr/bin/hsc2hs configure: Using c2hs: /usr/bin/c2hs configure: No cpphs found configure: No greencard found gour@gaura-nitai ~/tmp/c2hs-0.14.3 $ ./Setup.hs build Preprocessing executables for c2hs-0.14.3... Setup.hs: can't find source for C2HSConfig in ["base/admin","base/errors","base/general","base/graphs","base/state","base/syms","base/syntax","c2hs/c","c2hs/chs","c2hs/gen","c2hs/state","c2hs/toplevel"] Sincerely, Gour -- Registered Linux User | #278493 GPG Public Key | 8C44EDCD

Gour:
Manuel M T Chakravarty (chak@cse.unsw.edu.au) wrote:
Hi Manuel!
Happy Hacking,
Attempt to build c2hs on amd64 gives:
gour@gaura-nitai ~/tmp/c2hs-0.14.3 $ ./Setup.hs configure Configuring c2hs-0.14.3... configure: Using install prefix: /usr/local configure: Using compiler: /usr/bin/ghc configure: Compiler flavor: GHC configure: Compiler version: 6.4.1.20050801 configure: Using package tool: /usr/bin/ghc-pkg configure: Using haddock: /usr/bin/haddock configure: Using happy: /usr/bin/happy configure: Using alex: /usr/bin/alex configure: Using hsc2hs: /usr/bin/hsc2hs configure: Using c2hs: /usr/bin/c2hs configure: No cpphs found configure: No greencard found gour@gaura-nitai ~/tmp/c2hs-0.14.3 $ ./Setup.hs build Preprocessing executables for c2hs-0.14.3... Setup.hs: can't find source for C2HSConfig in ["base/admin","base/errors","base/general","base/graphs","base/state","base/syms","base/syntax","c2hs/c","c2hs/chs","c2hs/gen","c2hs/state","c2hs/toplevel"]
It appears as if you got the sources via Dracs and forgot to run "autoconf" (which means that there woulnd't be a "configure") script in the toplevel directory. (See also the INSTALL file.) Manuel

Manuel M T Chakravarty (chak@cse.unsw.edu.au) wrote:
It appears as if you got the sources via Dracs and forgot to run "autoconf" (which means that there woulnd't be a "configure") script in the toplevel directory. (See also the INSTALL file.)
True. At 1şt I attempted to build via ebuild script bit ebuild looked for a c2hs-1.0.0 tarball (automatically built with cabal2ebuild program). Then I produced tarball from the darcs repo. However, there is still a problem: [...] config.status: creating c2hs/toplevel/Version.hs config.status: creating c2hs/toplevel/C2HSConfig.hs config.status: creating c2hs/c2hs-inplace config.status: creating c2hs/c2hs config.status: creating postInst.sh config.status: creating c2hs.spec config.status: creating doc/c2hs/Makefile config.status: executing default commands Preprocessing executables for c2hs-0.14.3... Building c2hs-0.14.3... hsSourceDirs: ["base/admin","base/errors","base/general","base/graphs","base/state","base/syms","base/syntax","c2hs/c","c2hs/chs","c2hs/gen","c2hs/state","c2hs/toplevel"] Chasing modules from: c2hs/toplevel/Main.hs Could not find module `CForeign': use -v to see a list of the files searched for (imported from c2hs/toplevel/C2HSConfig.hs) Sincerely, Gour -- Registered Linux User | #278493 GPG Public Key | 8C44EDCD

Gour:
Manuel M T Chakravarty (chak@cse.unsw.edu.au) wrote: However, there is still a problem:
[...] config.status: creating c2hs/toplevel/Version.hs config.status: creating c2hs/toplevel/C2HSConfig.hs config.status: creating c2hs/c2hs-inplace config.status: creating c2hs/c2hs config.status: creating postInst.sh config.status: creating c2hs.spec config.status: creating doc/c2hs/Makefile config.status: executing default commands Preprocessing executables for c2hs-0.14.3... Building c2hs-0.14.3... hsSourceDirs: ["base/admin","base/errors","base/general","base/graphs","base/state","base/syms","base/syntax","c2hs/c","c2hs/chs","c2hs/gen","c2hs/state","c2hs/toplevel"] Chasing modules from: c2hs/toplevel/Main.hs Could not find module `CForeign': use -v to see a list of the files searched for (imported from c2hs/toplevel/C2HSConfig.hs)
CForeign is a module from the FFI standard. What version of GHC are you using? Manuel

Manuel M T Chakravarty (chak@cse.unsw.edu.au) wrote:
CForeign is a module from the FFI standard. What version of GHC are you using?
The Glorious Glasgow Haskell Compilation System, version 6.4.1.20050801 Sincerely, Gour -- Registered Linux User | #278493 GPG Public Key | 8C44EDCD

Gour:
Manuel M T Chakravarty (chak@cse.unsw.edu.au) wrote:
CForeign is a module from the FFI standard. What version of GHC are you using?
The Glorious Glasgow Haskell Compilation System, version 6.4.1.20050801
This must be a 6.4.1 issue. In 6.4, CForeign is visible, but in 6.4.1. it doesn't seem to be visible anymore. Hmm, shoudln't patchlevel releases not change the interface? Manuel
participants (2)
-
Gour
-
Manuel M T Chakravarty