Commit c793cc35 authored by ian@well-typed.com's avatar ian@well-typed.com
Browse files

libffi build system tweaks

parent 3005e909
...@@ -500,7 +500,10 @@ $(foreach way,$$(compiler_stage3_WAYS),\ ...@@ -500,7 +500,10 @@ $(foreach way,$$(compiler_stage3_WAYS),\
compiler/prelude/PrimOp_HC_OPTS += -fforce-recomp compiler/prelude/PrimOp_HC_OPTS += -fforce-recomp
# LibFFI.hs #includes ffi.h # LibFFI.hs #includes ffi.h
ifneq "$(UseSystemLibFFI)" "YES"
compiler/stage2/build/LibFFI.hs : $(libffi_HEADERS) compiler/stage2/build/LibFFI.hs : $(libffi_HEADERS)
endif
# On Windows it seems we also need to link directly to libffi # On Windows it seems we also need to link directly to libffi
ifeq "$(HostOS_CPP)" "mingw32" ifeq "$(HostOS_CPP)" "mingw32"
define windowsDynLinkToFfi define windowsDynLinkToFfi
......
...@@ -137,7 +137,7 @@ AS_IF([test "$UseSystemLibFFI" = "YES"], [ ...@@ -137,7 +137,7 @@ AS_IF([test "$UseSystemLibFFI" = "YES"], [
AC_CHECK_LIB(ffi, ffi_call, AC_CHECK_LIB(ffi, ffi_call,
[AC_CHECK_HEADERS([ffi.h], [break], []) [AC_CHECK_HEADERS([ffi.h], [break], [])
AC_DEFINE([HAVE_LIBFFI], [1], [Define to 1 if you have libffi.])], AC_DEFINE([HAVE_LIBFFI], [1], [Define to 1 if you have libffi.])],
[UseSystemLibFFI="NO"]) [AC_MSG_ERROR([Cannot find system libffi])])
CFLAGS="$CFLAGS2" CFLAGS="$CFLAGS2"
LDFLAGS="$LDFLAGS2" LDFLAGS="$LDFLAGS2"
]) ])
......
...@@ -618,18 +618,12 @@ else ...@@ -618,18 +618,12 @@ else
MAYBE_GHCI=driver/ghci MAYBE_GHCI=driver/ghci
endif endif
ifeq "$(UseSystemLibFFI)" "YES"
MAYBE_LIBFFI=
else
MAYBE_LIBFFI=libffi
endif
BUILD_DIRS += \ BUILD_DIRS += \
driver \ driver \
$(MAYBE_GHCI) \ $(MAYBE_GHCI) \
driver/ghc \ driver/ghc \
driver/haddock \ driver/haddock \
$(MAYBE_LIBFFI) \ libffi \
includes \ includes \
rts rts
......
...@@ -44,6 +44,7 @@ endif ...@@ -44,6 +44,7 @@ endif
ifneq "$(BINDIST)" "YES" ifneq "$(BINDIST)" "YES"
$(libffi_STAMP_CONFIGURE): $(TOUCH_DEP) $(libffi_STAMP_CONFIGURE): $(TOUCH_DEP)
false ffi
$(call removeFiles,$(libffi_STAMP_STATIC_CONFIGURE)) $(call removeFiles,$(libffi_STAMP_STATIC_CONFIGURE))
$(call removeFiles,$(libffi_STAMP_STATIC_BUILD)) $(call removeFiles,$(libffi_STAMP_STATIC_BUILD))
$(call removeFiles,$(libffi_STAMP_STATIC_INSTALL)) $(call removeFiles,$(libffi_STAMP_STATIC_INSTALL))
......
...@@ -493,7 +493,10 @@ endif ...@@ -493,7 +493,10 @@ endif
$(eval $(call dependencies,rts,dist,1)) $(eval $(call dependencies,rts,dist,1))
$(rts_dist_depfile_c_asm) : $(libffi_HEADERS) $(DTRACEPROBES_H) $(rts_dist_depfile_c_asm) : $(DTRACEPROBES_H)
ifneq "$(UseSystemLibFFI)" "YES"
$(rts_dist_depfile_c_asm) : $(libffi_HEADERS)
endif
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
# compile dtrace probes if dtrace is supported # compile dtrace probes if dtrace is supported
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment