What Cabal stuff is permanent?
simonmar at microsoft.com
Wed Jun 8 04:23:34 EDT 2005
On 07 June 2005 16:54, Isaac Jones wrote:
> John Goerzen <jgoerzen at complete.org> writes:
>> On Tue, Jun 07, 2005 at 04:04:12PM +0100, Simon Marlow wrote:
>>> However, if you attach includes to foreign import declarations,
>>> like this:
>>> foreign import ccall "foo.h bar" bar :: ...
>>> then GHC will currently not inline bar in another module. This is a
>>> missing feature, and we might fix it at some point.
>> Ah ha. That is the only style I've ever used, and is also what WASH
>> uses. So I guess I get out of jail free.
>>> I don't think Cabal currently has support for installing .h files, I
>>> guess that's something we need to look into (Isaac?).
>> Sounds like it.
> How would this look? Let's say that include-dirs=./includes or
> something relative to the top of the source tree while building. This
> is so that ghc can find the "includes" while building.
> include-dirs gets put into ghc's package.conf file, correct? But then
> will the installed package need an absolute path for include-dirs? Or
> can it be relative to ghc's library directory or the package root? If
> the later, it sounds like no big deal, just create the directory and
> put anything from the "includes" field into it while installing.
> But then sometimes the include dirs might be an absolute path, maybe?
> To indicate a .h file that this package is build-depending on? In
> which case, we might assume that the include files in there are not a
> part of the package, so we don't try to install them, but they are a
> dependency and they should be installed on the target system already.
> If ghc's package.conf file doesn't allow relative paths, then we have
> to do something a little tricky when generating the package.conf file,
> which is make up the location that the includes will go.
> Sounds a little harry, but doable. Does anyone have better ideas?
That does sound a little harry, you're right (sorry :-).
I suggest adding a couple of new fields to .cabal. eg:
The purpose of local-include-dirs is that it adds -I flags to the ghc
command line for building (only).
The purpose of install-includes is:
- it lists header files to install
- they get installed in location specified by the
--includedir option to ./setup configure, or otherwise
a defaulit -- perhaps /usr/include/<package>, or maybe
$libdir? C code that needs to include these headers can
be compiled with "ghc -package P" and get the right -I
- the package.conf we generate for GHC will contain
$includedir in include-dirs, iff install-includes is non-empty.
More information about the Libraries