install targets on package building infrastructure

Simon Marlow simonmar@microsoft.com
Thu, 5 Jun 2003 14:15:42 +0100


=20
> While working with Jens Petersen to improve the redhat=20
> packages for greencard,=20
> we came across a problem in the standard install targets in makefiles.
>=20
> Normally, we want 'make install' to:
>=20
>   build the library
>   install the library in /usr/lib/whatever (or similar place)
>   invoke ghc-pkg to tell ghc about the package
>=20
> When building a package binary though, we only want to do the=20
> first two steps=20
> and only perform the third step on the users machine.
>=20
> What's the preferred way of doing this?
> (I figure this has already been solved for ghc and for some=20
> non-haskell packages)

You don't want to copy the way we do it for GHC (it's a hack).

The right way is to do exactly what you described above: run ghc-pkg at
install time.  For that, you either need to generate package.conf at
install-time too, with the correct paths in it, or you need to have a
location-independent package.conf using eg. ${libdir}.

Cheers,
	Simon