Personal tools

HSFFIG

From HaskellWiki

(Difference between revisions)
Jump to: navigation, search
(Building from source: clarified on modern way of building)
(Purpose: Updated current version number)
 
Line 2: Line 2:
 
== Purpose ==
 
== Purpose ==
   
'''Hsffig''' is a tool to convert a '''C''' header file (.h) into Haskell code containing FFI import statements for all entities whose declarations are found in the header file. Current release version of '''hsffig''' is 1.0 (release date 07/30/2005).
+
'''Hsffig''' is a tool to convert a '''C''' header file (.h) into Haskell code containing FFI import statements for all entities whose declarations are found in the header file. Current release version of '''hsffig''' is 1.1.2 (release date 10/15/2009).
   
 
== Getting HSFFIG ==
 
== Getting HSFFIG ==

Latest revision as of 00:39, 16 October 2009

Contents

[edit] 1 Purpose

Hsffig is a tool to convert a C header file (.h) into Haskell code containing FFI import statements for all entities whose declarations are found in the header file. Current release version of hsffig is 1.1.2 (release date 10/15/2009).

[edit] 2 Getting HSFFIG

[edit] 2.1 Downloading

Hsffig has been released on Hackage under the name HSFFIG. Also, the working repository is available:

darcs get http://code.haskell.org/hsffig

When downloading from the working repository, run make first, then cabal install.

[edit] 2.2 Building from source

This is a pre-cabal-install way to build from source. See the Downloading section

Hsffig has been released as a Cabalized package. The distribution tarball file contains a minimal version of Cabal setup program, so it is not necessary to have Cabal installed in order to install hsffig. Even more, it is advised to use the Cabal setup program (further referred to as cabal-setup) as it was slightly tailored to the details of hsffig installation.

  1. After unpacking the tarball, go to the root directory of the distibution and run make. This builds the cabal-setup executable necessary for proper package build and installation.
  2. Run ./cabal-setup configure. Alex is required to compile hsffig, so it is necessary to provide path to Alex executable (the --with-alex= option of ./cabal-setup configure). This creates the package build configuration file.
  3. Run ./cabal-setup build. This builds the hsffig library, and all executables.
  4. Run ./cabal-setup install. This installs the library and the executables, and registers the package with GHC.

At this point, hsffig is ready to use.

[edit] 3 See also

Please see HSFFIG/Tutorial for how to use the program. There are other examples and a separate discussion page. Finally, there is a page describing linkage optimization