summaryrefslogtreecommitdiff
path: root/libraries
diff options
context:
space:
mode:
authorHerbert Valerio Riedel <hvr@gnu.org>2014-11-23 10:27:13 +0100
committerHerbert Valerio Riedel <hvr@gnu.org>2014-11-23 22:41:03 +0100
commita9a0dd34dcdfb7309f57bda88435acca14ec54d5 (patch)
tree06caca7863d22d55a614c7a183f80e1eec12056f /libraries
parentfb061c193947a7096471486faade1d0db30bc588 (diff)
downloadhaskell-a9a0dd34dcdfb7309f57bda88435acca14ec54d5.tar.gz
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
Diffstat (limited to 'libraries')
-rw-r--r--libraries/integer-gmp2/.gitignore1
-rw-r--r--libraries/integer-gmp2/gmp/ghc-gmp.h1
-rw-r--r--libraries/integer-gmp2/gmp/ghc.mk14
-rw-r--r--libraries/integer-gmp2/integer-gmp.buildinfo.in2
4 files changed, 16 insertions, 2 deletions
diff --git a/libraries/integer-gmp2/.gitignore b/libraries/integer-gmp2/.gitignore
index 98b7b18898..3f3fc66144 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 0000000000..3fdb398670
--- /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 298005ff1f..5685917236 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 91b4313226..805a425a19 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