2. Build information

The following fields may be optionally present in any stanza, and give information for the building of the corresponding library or executable. See also Section 2.2 for a way to supply system-dependent values for these fields.

buildable: Boolean (default: True)

Is the component buildable? Like some of the other fields below, this field is more useful with the slightly more elaborate form of the simple build infrastructure described in Section 2.2.

other-modules: identifier list

A list of modules used by the component but not exposed to users. For a library component, these would be hidden modules of the library. For an executable, these would be auxiliary modules to be linked with the file named in the main-is field.

hs-source-dir: directory (default: ".")

The name of root directory of the module hierarchy.

extensions: identifier list

A list of Haskell extensions used by every module. Extension names are the constructors of the Extension type. These determine corresponding compiler options. In particular, CPP specifies that Haskell source files are to be preprocessed with a C preprocessor.

Extensions used only by one module may be specified by placing a LANGUAGE pragma in the source file affected, e.g.:

{-# LANGUAGE CPP, MultiParamTypeClasses #-}
ghc-options: token list

Additional options for GHC. You can often achieve the same effect using the extensions field, which is preferred.

Options required only by one module may be specified by placing an OPTIONS_GHC pragma in the source file affected.

hugs-options: token list

Additional options for Hugs. You can often achieve the same effect using the extensions field, which is preferred.

Options required only by one module may be specified by placing an OPTIONS_HUGS pragma in the source file affected.

nhc-options: token list

Additional options for nhc98. You can often achieve the same effect using the extensions field, which is preferred.

Options required only by one module may be specified by placing an OPTIONS_NHC pragma in the source file affected.

includes: filename list

A list of header files from standard include directories or those listed in include-dirs, to be included in any compilations via C. These files typically contain function prototypes for foreign imports used by the package.

include-dirs: directory list

A list of directories to search for header files, both when using a C preprocessor and when compiling via C.

c-sources: filename list

A list of C source files to be compiled and linked with the Haskell files.

If you use this field, you should also name the C files in CFILES pragmas in the Haskell source files that use them, e.g.:

{-# CFILES dir/file1.c dir/file2.c #-}
These are ignored by the compilers, but needed by Hugs.

extra-libraries: token list

A list of extra libraries to link with.

extra-lib-dirs: directory list

A list of directories to search for libraries.

cc-options: token list

Command-line arguments to be passed to the C compiler. Since the arguments are compiler-dependent, this field is more useful with the setup described in Section 2.2.

ld-options: token list

Command-line arguments to be passed to the linker. Since the arguments are compiler-dependent, this field is more useful with the setup described in Section 2.2.

frameworks: token list

On Darwin/MacOS X, a list of frameworks to link to. See Apple's developer documentation for more details on frameworks. This entry is ignored on all other platforms.