Follow libffi changes on Windows
authorIan Lynagh <igloo@earth.li>
Fri, 4 May 2012 15:26:59 +0000 (16:26 +0100)
committerIan Lynagh <igloo@earth.li>
Fri, 4 May 2012 15:26:59 +0000 (16:26 +0100)
compiler/ghc.mk
libffi/ghc.mk
rts/ghc.mk

index 505c985..e4a8368 100644 (file)
@@ -497,7 +497,7 @@ ifeq  "$(HOSTPLATFORM)" "i386-unknown-mingw32"
 define windowsDynLinkToFfi
 # $1 = way
 ifneq "$$(findstring dyn, $1)" ""
-compiler_stage2_$1_ALL_HC_OPTS += -lffi-5
+compiler_stage2_$1_ALL_HC_OPTS += -l$$(LIBFFI_WINDOWS_LIB)
 endif
 endef
 $(foreach way,$(GhcLibWays),$(eval $(call windowsDynLinkToFfi,$(way))))
index 879d482..fc474d2 100644 (file)
@@ -35,6 +35,9 @@ libffi_STATIC_LIB  = libffi/build/inst/lib/libffi.a
 libffi_HEADERS     = rts/dist/build/ffi.h \
                      rts/dist/build/ffitarget.h
 
+LIBFFI_WINDOWS_LIB = ffi-6
+LIBFFI_DLL = lib$(LIBFFI_WINDOWS_LIB).dll
+
 ifeq "$(OSTYPE)" "cygwin"
 LIBFFI_PATH_MANGLE = PATH=$$(cygpath "$(TOP)")/libffi:$$PATH; export PATH;
 endif
index 95faea8..6155002 100644 (file)
@@ -116,7 +116,7 @@ $(rts_ffi_objs_stamp): $(libffi_STATIC_LIB) $(TOUCH_DEP) | $$(dir $$@)/.
 rts/dist/build/libffi$(soext): libffi/build/inst/lib/libffi$(soext)
        cp libffi/build/inst/lib/libffi$(soext)* rts/dist/build
 
-rts/dist/build/libffi-5.dll: libffi/build/inst/bin/libffi-5.dll
+rts/dist/build/$(LIBFFI_DLL): libffi/build/inst/bin/$(LIBFFI_DLL)
        cp $< $@
 endif
 
@@ -172,10 +172,10 @@ rts_dist_$1_CC_OPTS += -DRtsWay=\"rts_$1\"
 # Making a shared library for the RTS.
 ifneq "$$(findstring dyn, $1)" ""
 ifeq "$$(HOSTPLATFORM)" "i386-unknown-mingw32"
-$$(rts_$1_LIB) : $$(rts_$1_OBJS) $$(ALL_RTS_DEF_LIBS) rts/libs.depend rts/dist/build/libffi-5.dll
+$$(rts_$1_LIB) : $$(rts_$1_OBJS) $$(ALL_RTS_DEF_LIBS) rts/libs.depend rts/dist/build/$$(LIBFFI_DLL)
        "$$(RM)" $$(RM_OPTS) $$@
        "$$(rts_dist_HC)" -package-name rts -shared -dynamic -dynload deploy \
-         -no-auto-link-packages -Lrts/dist/build -lffi-5 `cat rts/libs.depend` $$(rts_$1_OBJS) $$(ALL_RTS_DEF_LIBS) -o $$@
+         -no-auto-link-packages -Lrts/dist/build -l$(LIBFFI_WINDOWS_LIB) `cat rts/libs.depend` $$(rts_$1_OBJS) $$(ALL_RTS_DEF_LIBS) -o $$@
 else
 $$(rts_$1_LIB) : $$(rts_$1_OBJS) $$(rts_$1_DTRACE_OBJS) rts/libs.depend rts/dist/build/libffi$$(soext)
        "$$(RM)" $$(RM_OPTS) $$@
@@ -510,7 +510,7 @@ endif
 
 INSTALL_LIBS += $(ALL_RTS_LIBS)
 INSTALL_LIBS += $(wildcard rts/dist/build/libffi$(soext)*)
-INSTALL_LIBS += $(wildcard rts/dist/build/libffi-5.dll)
+INSTALL_LIBS += $(wildcard rts/dist/build/$(LIBFFI_DLL))
 
 install: install_libffi_headers