Commit 3c2d0881 authored by Mikhail Glushenkov's avatar Mikhail Glushenkov
Browse files

Document the '.buildinfo'/'install-includes' interaction.

Fixes #1557.
parent 29598183
......@@ -1906,22 +1906,34 @@ cc-options: -I/usr/X11R6/include
ld-options: -L/usr/X11R6/lib
~~~~~~~~~~~~~~~~
The `configure` script also generates a header file
`include/HsX11Config.h` containing C preprocessor defines recording the
results of various tests. This file may be included by C source files
and preprocessed Haskell source files in the package.
Note: Packages using these features will also need to list
additional files such as `configure`,
templates for `.buildinfo` files, files named
only in `.buildinfo` files, header files and
so on in the `extra-source-files` field,
and extra documentation resources in the `extra-html-files` field,
to ensure that they are included in source distributions.
They should also list files and directories generated by
`configure` in the
`extra-tmp-files` field to ensure that they
are removed by `setup clean`.
The `configure` script also generates a header file `include/HsX11Config.h`
containing C preprocessor defines recording the results of various tests. This
file may be included by C source files and preprocessed Haskell source files in
the package.
Note: Packages using these features will also need to list additional files such
as `configure`, templates for `.buildinfo` files, files named only in
`.buildinfo` files, header files and so on in the `extra-source-files` field to
ensure that they are included in source distributions. They should also list
files and directories generated by `configure` in the `extra-tmp-files` field to
ensure that they are removed by `setup clean`.
Quite often the files generated by `configure` need to be listed somewhere in
the package description (for example, in the `install-includes` field). However,
we usually don't want generated files to be included in the source tarball. The
solution is again provided by the `.buildinfo` file. In the above example, the
following line should be added to `X11.buildinfo`:
~~~~~~~~~~~~~~~~
install-includes: HsX11Config.h
~~~~~~~~~~~~~~~~
In this way, the generated `HsX11Config.h` file won't be included in the source
tarball in addition to `HsX11Config.h.in`, but it will be copied to the right
location during the install process. Packages that use custom `Setup.hs` scripts
can update the necessary fields programmatically instead of using the
`.buildinfo` file.
## Conditional compilation ##
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment