summaryrefslogtreecommitdiff
path: root/libffi
diff options
context:
space:
mode:
authorPHO <pho@cielonegro.org>2011-12-06 23:15:35 +0900
committerPHO <pho@cielonegro.org>2011-12-08 10:57:28 +0900
commit616b669738e6ddaf0588957ad974b91944420983 (patch)
treeda71167eaa72a4649246e74a39908fc2a8b1140c /libffi
parent3640d374f3501c0addb1be273ecc0f10f93be10d (diff)
downloadhaskell-616b669738e6ddaf0588957ad974b91944420983.tar.gz
Resurrect UseLibFFIForAdjustors from bitrot.
* Pass -Irts/dist/build to the C preprocessor to expose libffi headers (ffi.h and ffitarget.h) to foreign import wrappers during the building process of GHC itself. * Install libffi headers into $(ghcheaderdir) just like any other C headers. Otherwise an installed GHC can't find them when it wants to compile foreign import wrappers. * Include libffi headers in the bindist for the same reason.
Diffstat (limited to 'libffi')
-rw-r--r--libffi/ghc.mk8
1 files changed, 4 insertions, 4 deletions
diff --git a/libffi/ghc.mk b/libffi/ghc.mk
index 85a2822ab2..d9224108b4 100644
--- a/libffi/ghc.mk
+++ b/libffi/ghc.mk
@@ -32,7 +32,8 @@ libffi_EnableShared = no
endif
libffi_STATIC_LIB = libffi/build/inst/lib/libffi.a
-ffi_HEADER = rts/dist/build/ffi.h
+libffi_HEADERS = rts/dist/build/ffi.h \
+ rts/dist/build/ffitarget.h
ifeq "$(OSTYPE)" "cygwin"
LIBFFI_PATH_MANGLE = PATH=$$(cygpath "$(TOP)")/libffi:$$PATH; export PATH;
@@ -101,9 +102,8 @@ $(libffi_STAMP_INSTALL): $(libffi_STAMP_BUILD) $(TOUCH_DEP)
$(libffi_STATIC_LIB): $(libffi_STAMP_INSTALL)
@test -f $@ || { echo "$< exists, but $@ does not."; echo "Suggest removing $<."; exit 1; }
-$(ffi_HEADER): $(libffi_STAMP_INSTALL) | $$(dir $$@)/.
- cp libffi/build/inst/lib/libffi-*/include/ffitarget.h $(dir $@)
- cp libffi/build/inst/lib/libffi-*/include/ffi.h $@
+$(libffi_HEADERS): $(libffi_STAMP_INSTALL) | $$(dir $$@)/.
+ cp -f libffi/build/inst/lib/libffi-*/include/$(notdir $@) $@
$(eval $(call clean-target,libffi,, \
libffi/build $(wildcard libffi/stamp.ffi.*) libffi/dist-install))