Difference between revisions of "HSFFIG"

From HaskellWiki
Jump to navigation Jump to search
(Add links to new subpages.)
(→‎Purpose: Added remark about not compiling on Windows or with modern GHC)
 
(5 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
[[Category:Tools]]
 
[[Category:Tools]]
== Purpose ==
+
== Introduction ==
   
'''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. As the package depends on the package <code>unix</code>, it will not compile on Windows (without Cygwin); as it has not been updated for a long time, it will probably not compile with modern GHC.
   
 
== Getting HSFFIG ==
 
== Getting HSFFIG ==
Line 8: Line 8:
 
=== Downloading ===
 
=== Downloading ===
   
  +
'''Hsffig''' has been [http://hackage.haskell.org/cgi-bin/hackage-scripts/package/HSFFIG released] on Hackage under the name <tt>HSFFIG</tt>. Also, the working repository is available:
The project homepage is located at http://hsffig.sourceforge.net. '''Hsffig''' source code may be downloaded from the "File Releases" section of the web page http://www.sourceforge.net/projects/hsffig. Source tarball file name is <tt>hsffig-1.0.tar.gz</tt>. [http://www.darcs.net Darcs] users may check out from the repos at:
 
   
* darcs get http://hsffig.sourceforge.net/repos/hsffig-1.0 ("stable" snapshot)
+
darcs get http://code.haskell.org/hsffig
   
  +
When downloading from the working repository, run <tt>make</tt> first, then <tt>cabal install</tt>.
* darcs get http://www.golubovsky.org/repos/hsffig-1.0 ("unstable" snapshot)
 
   
 
=== Building from source ===
 
=== Building from source ===
  +
  +
<small>This is a pre-cabal-install way to build from source. See the [[#Downloading | Downloading]] section</small>
   
 
'''Hsffig''' has been released as a [http://www.haskell.org/cabal 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.
 
'''Hsffig''' has been released as a [http://www.haskell.org/cabal 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.
Line 24: Line 26:
   
 
At this point, '''hsffig''' is ready to use.
 
At this point, '''hsffig''' is ready to use.
  +
 
==See also==
 
==See also==
Please see [[HSFFIG/Tutorial]] for how to use the program. There are other [[HSFFIG/Examples | examples]] and a separate [[HSFFIG/Discussion | discussion page]].
+
Please see [[HSFFIG/Tutorial]] for how to use the program. There are other [[HSFFIG/Examples | examples]] and a separate [[HSFFIG/Discussion | discussion page]]. Finally, there is a page describing [[/Linkage optimization |linkage optimization]]

Latest revision as of 21:10, 17 February 2015

Introduction

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. As the package depends on the package unix, it will not compile on Windows (without Cygwin); as it has not been updated for a long time, it will probably not compile with modern GHC.

Getting HSFFIG

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.

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.

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