Repository : ssh://darcs.haskell.org//srv/darcs/ghc On branch : ghc-7.4
http://hackage.haskell.org/trac/ghc/changeset/c5f7ebd133ad51ccaf743af34c786d38d577976c >--------------------------------------------------------------- commit c5f7ebd133ad51ccaf743af34c786d38d577976c Author: PHO <[email protected]> Date: Tue Dec 6 23:15:35 2011 +0900 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. >--------------------------------------------------------------- compiler/ghc.mk | 2 +- ghc.mk | 8 +++++--- libffi/ghc.mk | 8 ++++---- rts/ghc.mk | 9 ++++++++- rts/package.conf.in | 2 +- 5 files changed, 19 insertions(+), 10 deletions(-) diff --git a/compiler/ghc.mk b/compiler/ghc.mk index 95cd45b..a78255f 100644 --- a/compiler/ghc.mk +++ b/compiler/ghc.mk @@ -497,7 +497,7 @@ compiler/hsSyn/HsLit_HC_OPTS += -fomit-interface-pragmas endif # LibFFI.hs #includes ffi.h -compiler/stage2/build/LibFFI.hs : $(ffi_HEADER) +compiler/stage2/build/LibFFI.hs : $(libffi_HEADERS) # On Windows it seems we also need to link directly to libffi ifeq "$(HOSTPLATFORM)" "i386-unknown-mingw32" define windowsDynLinkToFfi diff --git a/ghc.mk b/ghc.mk index 3dfb03f..a2941d4 100644 --- a/ghc.mk +++ b/ghc.mk @@ -929,6 +929,7 @@ $(eval $(call bindist,.,\ $(includes_H_FILES) \ $(includes_DERIVEDCONSTANTS) \ $(includes_GHCCONSTANTS) \ + $(libffi_HEADERS) \ $(INSTALL_LIBEXECS) \ $(INSTALL_LIBEXEC_SCRIPTS) \ $(INSTALL_TOPDIRS) \ @@ -1207,9 +1208,10 @@ maintainer-clean : distclean .PHONY: all_libraries .PHONY: bootstrapping-files -bootstrapping-files: includes/ghcautoconf.h -bootstrapping-files: includes/DerivedConstants.h -bootstrapping-files: includes/GHCConstants.h +bootstrapping-files: $(includes_H_CONFIG) +bootstrapping-files: $(includes_DERIVEDCONSTANTS) +bootstrapping-files: $(includes_GHCCONSTANTS) +bootstrapping-files: $(libffi_HEADERS) .DELETE_ON_ERROR: diff --git a/libffi/ghc.mk b/libffi/ghc.mk index 85a2822..d922410 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)) diff --git a/rts/ghc.mk b/rts/ghc.mk index a18bec9..e2e00c6 100644 --- a/rts/ghc.mk +++ b/rts/ghc.mk @@ -455,7 +455,7 @@ endif $(eval $(call dependencies,rts,dist,1)) -$(rts_dist_depfile_c_asm) : $(ffi_HEADER) $(DTRACEPROBES_H) +$(rts_dist_depfile_c_asm) : $(libffi_HEADERS) $(DTRACEPROBES_H) # ----------------------------------------------------------------------------- # compile dtrace probes if dtrace is supported @@ -507,6 +507,13 @@ INSTALL_LIBS += $(ALL_RTS_LIBS) INSTALL_LIBS += $(wildcard rts/dist/build/libffi$(soext)*) INSTALL_LIBS += $(wildcard rts/dist/build/libffi-5.dll) +install: install_libffi_headers + +.PHONY: install_libffi_headers +install_libffi_headers : + $(call INSTALL_DIR,"$(DESTDIR)$(ghcheaderdir)") + $(call INSTALL_HEADER,$(INSTALL_OPTS),$(libffi_HEADERS),"$(DESTDIR)$(ghcheaderdir)/") + # ----------------------------------------------------------------------------- # cleaning diff --git a/rts/package.conf.in b/rts/package.conf.in index 477c59f..6651e5e 100644 --- a/rts/package.conf.in +++ b/rts/package.conf.in @@ -51,7 +51,7 @@ extra-libraries: #ifdef INSTALLING include-dirs: INCLUDE_DIR PAPI_INCLUDE_DIR #else /* !INSTALLING */ -include-dirs: TOP"/includes" TOP"/includes/dist-ghcconstants/header" TOP"/includes/dist-derivedconstants/header" +include-dirs: TOP"/rts/dist/build" TOP"/includes" TOP"/includes/dist-ghcconstants/header" TOP"/includes/dist-derivedconstants/header" #endif includes: Stg.h _______________________________________________ Cvs-ghc mailing list [email protected] http://www.haskell.org/mailman/listinfo/cvs-ghc
