[commit: ghc] master: Install `ghc-gmp.h` C include header file (#9281) (a9a0dd3)
git at git.haskell.org
git at git.haskell.org
Sun Nov 23 21:42:02 UTC 2014
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/a9a0dd34dcdfb7309f57bda88435acca14ec54d5/ghc
>---------------------------------------------------------------
commit a9a0dd34dcdfb7309f57bda88435acca14ec54d5
Author: Herbert Valerio Riedel <hvr at gnu.org>
Date: Sun Nov 23 10:27:13 2014 +0100
Install `ghc-gmp.h` C include header file (#9281)
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.
Reviewed By: ekmett
Differential Revision: https://phabricator.haskell.org/D522
>---------------------------------------------------------------
a9a0dd34dcdfb7309f57bda88435acca14ec54d5
libraries/integer-gmp2/.gitignore | 1 +
libraries/integer-gmp2/gmp/ghc-gmp.h | 1 +
libraries/integer-gmp2/gmp/ghc.mk | 14 +++++++++++++-
libraries/integer-gmp2/integer-gmp.buildinfo.in | 2 +-
4 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/libraries/integer-gmp2/.gitignore b/libraries/integer-gmp2/.gitignore
index 98b7b18..3f3fc66 100644
--- a/libraries/integer-gmp2/.gitignore
+++ b/libraries/integer-gmp2/.gitignore
@@ -11,3 +11,4 @@
/gmp/gmp.h
/gmp/gmpbuild
+/include/ghc-gmp.h
diff --git a/libraries/integer-gmp2/gmp/ghc-gmp.h b/libraries/integer-gmp2/gmp/ghc-gmp.h
new file mode 100644
index 0000000..3fdb398
--- /dev/null
+++ b/libraries/integer-gmp2/gmp/ghc-gmp.h
@@ -0,0 +1 @@
+#include <gmp.h>
diff --git a/libraries/integer-gmp2/gmp/ghc.mk b/libraries/integer-gmp2/gmp/ghc.mk
index 298005f..5685917 100644
--- a/libraries/integer-gmp2/gmp/ghc.mk
+++ b/libraries/integer-gmp2/gmp/ghc.mk
@@ -20,6 +20,7 @@ GMP_DIR := $(patsubst libraries/integer-gmp/gmp/tarball/%-nodoc-patched.tar.bz2,
ifneq "$(NO_CLEAN_GMP)" "YES"
$(eval $(call clean-target,gmp,,\
+ libraries/integer-gmp2/include/ghc-gmp.h \
libraries/integer-gmp2/gmp/config.mk \
libraries/integer-gmp2/gmp/libgmp.a \
libraries/integer-gmp2/gmp/gmp.h \
@@ -75,14 +76,24 @@ HaveFrameworkGMP = NO
endif
endif
+UseIntreeGmp = NO
ifneq "$(HaveLibGmp)" "YES"
ifneq "$(HaveFrameworkGMP)" "YES"
+UseIntreeGmp = YES
+endif
+endif
+
+ifeq "$(UseIntreeGmp)" "YES"
$(libraries/integer-gmp2_dist-install_depfile_c_asm): libraries/integer-gmp2/gmp/gmp.h
gmp_CC_OPTS += -Ilibraries/integer-gmp2/gmp
libraries/integer-gmp2_dist-install_EXTRA_OBJS += libraries/integer-gmp2/gmp/objs/*.o
-endif
+else
+$(libraries/integer-gmp2_dist-install_depfile_c_asm): libraries/integer-gmp2/include/ghc-gmp.h
+
+libraries/integer-gmp2/include/ghc-gmp.h: libraries/integer-gmp2/gmp/ghc-gmp.h
+ $(CP) $< $@
endif
libraries/integer-gmp2_dist-install_EXTRA_CC_OPTS += $(gmp_CC_OPTS)
@@ -116,6 +127,7 @@ libraries/integer-gmp2/gmp/libgmp.a libraries/integer-gmp2/gmp/gmp.h:
--host=$(HOSTPLATFORM) --build=$(BUILDPLATFORM)
$(MAKE) -C libraries/integer-gmp2/gmp/gmpbuild MAKEFLAGS=
$(CP) libraries/integer-gmp2/gmp/gmpbuild/gmp.h libraries/integer-gmp2/gmp/
+ $(CP) libraries/integer-gmp2/gmp/gmpbuild/gmp.h libraries/integer-gmp2/include/ghc-gmp.h
$(CP) libraries/integer-gmp2/gmp/gmpbuild/.libs/libgmp.a libraries/integer-gmp2/gmp/
$(MKDIRHIER) libraries/integer-gmp2/gmp/objs
cd libraries/integer-gmp2/gmp/objs && $(AR_STAGE1) x ../libgmp.a
diff --git a/libraries/integer-gmp2/integer-gmp.buildinfo.in b/libraries/integer-gmp2/integer-gmp.buildinfo.in
index 91b4313..805a425 100644
--- a/libraries/integer-gmp2/integer-gmp.buildinfo.in
+++ b/libraries/integer-gmp2/integer-gmp.buildinfo.in
@@ -2,4 +2,4 @@ include-dirs: @GMP_INCLUDE_DIRS@
extra-lib-dirs: @GMP_LIB_DIRS@
extra-libraries: @GMP_LIBS@
frameworks: @GMP_FRAMEWORK@
-install-includes: HsIntegerGmp.h
+install-includes: HsIntegerGmp.h ghc-gmp.h
More information about the ghc-commits
mailing list