Install `ghc-gmp.h` C include header file (#9281)
ClosedPublic

Authored by hvr on Nov 23 2014, 3:32 AM.

Details

Summary

This is mostly interesting when using the in-tree GMP, as there's
no way otherwise to access the in-tree gmp.h header file after installation.

In case integer-gmp2 was build against a system-installed GMP library,
ghc-gmp.h simply contains #include <gmp.h> for convenience.

Diff Detail

Repository
rGHC Glasgow Haskell Compiler
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
hvr updated this revision to Diff 1684.Nov 23 2014, 3:32 AM
hvr retitled this revision from to Install `ghc-gmp.h` C include header file (#9281).
hvr updated this object.
hvr added reviewers: ekmett, austin.
hvr updated this revision to Diff 1685.Nov 23 2014, 5:27 AM

Persist build-time GMP ver to HsIntegerGmp.h

This creates the additional macro definitions in HsIntegerGmp.h which
are useful for 3rd party integer-gmp-addon libraries.

Here's an example for the definitions created for the in-tree GMP:

#define GHC_GMP_INTREE     1
#define GHC_GMP_VERSION_MJ 5
#define GHC_GMP_VERSION_MI 0
#define GHC_GMP_VERSION_PL 4
#define GHC_GMP_VERSION   (5 * 10000 + 0 * 100 + 4)

And here's an example for a system-installed GMP:

#define GHC_GMP_INTREE     0
#define GHC_GMP_VERSION_MJ 6
#define GHC_GMP_VERSION_MI 0
#define GHC_GMP_VERSION_PL 0
#define GHC_GMP_VERSION   (6 * 10000 + 0 * 100 + 0)
ekmett accepted this revision.Nov 23 2014, 1:28 PM
ekmett edited edge metadata.

I've needed this header in the past, quite badly.

LGTM

This revision is now accepted and ready to land.Nov 23 2014, 1:28 PM
This revision was automatically updated to reflect the committed changes.