X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=libffi%2Fghc.mk;h=12a67dbe3f8852efdc118ddbb5e72773d942455d;hb=630cff0df4289e44404428ec679777cd422273bb;hp=7104d046b9e1691f2ef94f7651516789190f20ee;hpb=191fd267d54d633b14f26b3788f2811d40e33e9a;p=ghc-hetmet.git diff --git a/libffi/ghc.mk b/libffi/ghc.mk index 7104d04..12a67db 100644 --- a/libffi/ghc.mk +++ b/libffi/ghc.mk @@ -66,7 +66,8 @@ endif BINDIST_STAMPS = libffi/stamp.ffi.build libfii/stamp.ffi.configure -INSTALL_HEADERS += libffi/dist-install/build/ffi.h +INSTALL_HEADERS += libffi/dist-install/build/ffi.h \ + libffi/dist-install/build/ffitarget.h libffi_STATIC_LIB = libffi/dist-install/build/libffi.a INSTALL_LIBS += libffi/dist-install/build/libHSffi.a \ libffi/dist-install/build/libHSffi_p.a \ @@ -84,9 +85,12 @@ libffi_DYNAMIC_PROG = $(libffi_HS_DYN_LIB).a libffi_DYNAMIC_LIBS = $(libffi_HS_DYN_LIB) else libffi_DYNAMIC_PROG = +ifeq "$(darwin_TARGET_OS)" "1" +libffi_DYNAMIC_LIBS = libffi/dist-install/build/libffi$(soext) libffi/dist-install/build/libffi.5$(soext) libffi/dist-install/build/libffi.5.0.9$(soext) +else libffi_DYNAMIC_LIBS = libffi/dist-install/build/libffi.so \ - libffi/dist-install/build/libffi.so.5 \ - libffi/dist-install/build/libffi.so.5.0.9 + libffi/dist-install/build/libffi.so.5 +endif endif ifeq "$(BuildSharedLibs)" "YES" @@ -109,14 +113,10 @@ endif ifneq "$(BINDIST)" "YES" $(libffi_STAMP_CONFIGURE): - "$(RM)" $(RM_OPTS) -r $(LIBFFI_DIR) libffi/build - cd libffi && $(TAR) -zxf ../ghc-tarballs/libffi/libffi*.tar.gz + "$(RM)" $(RM_OPTS_REC) $(LIBFFI_DIR) libffi/build + cat ghc-tarballs/libffi/libffi*.tar.gz | $(GZIP) -d | { cd libffi && $(TAR) -xf - ; } mv libffi/libffi-* libffi/build chmod +x libffi/ln - cd libffi/build && "$(PATCH)" -p1 < ../libffi.dllize-3.0.8.patch - # This patch is just the resulting delta from running - # automake && autoreconf && libtoolize --force --copy - cd libffi/build && "$(PATCH)" -p1 < ../libffi.autotools-update-3.0.8.patch # Because -Werror may be in SRC_CC_OPTS/SRC_LD_OPTS, we need to turn # warnings off or the compilation of libffi might fail due to warnings @@ -150,6 +150,8 @@ $(libffi_STAMP_CONFIGURE): libffi/dist-install/build/ffi.h: $(libffi_STAMP_CONFIGURE) | $$(dir $$@)/. "$(CP)" libffi/build/include/ffi.h $@ +libffi/dist-install/build/ffitarget.h: $(libffi_STAMP_CONFIGURE) | $$(dir $$@)/. + "$(CP)" libffi/build/include/ffitarget.h $@ $(libffi_STAMP_BUILD): $(libffi_STAMP_CONFIGURE) | libffi/dist-install/build/. $(MAKE) -C libffi/build MAKEFLAGS= @@ -200,6 +202,10 @@ $(libffi_DYNAMIC_LIBS): $(libffi_STAMP_BUILD) # Rename libffi.so to libHSffi...so $(libffi_HS_DYN_LIB): $(libffi_DYNAMIC_LIBS) | $$(dir $$@)/. "$(CP)" $(word 1,$(libffi_DYNAMIC_LIBS)) $(libffi_HS_DYN_LIB) +ifeq "$(darwin_TARGET_OS)" "1" + # Ensure library's install name is correct before anyone links with it. + install_name_tool -id $(ghclibdir)/$(libffi_HS_DYN_LIB_NAME) $(libffi_HS_DYN_LIB) +endif $(eval $(call all-target,libffi,$(libffi_HS_DYN_LIB))) endif