Skip to content
  • Simon Marlow's avatar
    Better support for packages that need to install header files · dc87abd4
    Simon Marlow authored
    There's a new field for .cabal files: 
    
         install-includes: foo.h bar.h
    
    This means the same as 'includes', except that the files named therein
    will be installed into $libdir/include.  'includes' should only be
    used for headers already installed on the system.
    
    Directories listed in 'include-dirs' still turn into -I options for
    hsc2hs, cpphs, and C compilations.  However, for installation
    purposes, relative directories in 'include-dirs' are now treated
    differently from absolute directories:
    
      - an absolute directory is copied to the include-dirs field
        of the installed package config
    
      - files names in install-includes are assumed to be found in
        one of the *relative* directories listed in include-dirs
    
    So the common pattern for providing a header file that you want to
    be available everywhere including to via-C compilations against this
    package:
    
      include-dirs: myincludes
      install-includes: foo.h
    
    will install the header file myincludes/foo.h in
    $libdir/include/foo.h.
    dc87abd4