Skip to content
Ian Ross edited this page Aug 10, 2013 · 3 revisions

There follows a brief discussion of the installation from source. There is, however, a file INSTALL in the source distribution, which is more frequently updated and should be consulted in any case.

The following material assumes that you are installing from source, but there are a number of pre-compiled binary packages of c2hs available for different operating systems:

What Do I Need?

Apart from the source code (available from this GitHub repository), you need a Haskell system supported by c2hs. Currently, this is only the Glasgow Haskell Compiler (GHC), which you can obtain from http://haskell.org/ghc/. Furthermore, you need the Haskell package system Cabal. See the INSTALL file for details on supported versions.

To build the documentation, you will also need the SGML Tools, which you find at your nearest sunsite or Linux mirror or at ftp://ftp.lip6.fr/pub/sgml-tools/. On an up-to-date Linux system, the tools are probably already installed.

I Got Everything, and Now?

The short answer is

$ tar -xzf package.tar.gz      # unpack the sources
$ cd package                   # change to the toplevel directory
$ runghc Setup.hs configure    # configure the build system
$ runghc Setup.hs build        # build everything
[ Become root if necessary ]
$ runghc Setup.hs install      # install c2hs

where package is something like c2hs-0.16.4.tar.gz.

The INSTALL file in the distribution has more details.

Optionally, you can build the documentation by issuing make doc and install it with make install-doc.

Clone this wiki locally