Build fixes for OS X amd64 following libffi update
authorIan Lynagh <igloo@earth.li>
Thu, 6 Oct 2011 15:27:37 +0000 (16:27 +0100)
committerIan Lynagh <igloo@earth.li>
Thu, 6 Oct 2011 15:27:37 +0000 (16:27 +0100)
compiler/ghc.mk
libffi/ghc.mk
rts/ghc.mk

index 24d14e7..4b84924 100644 (file)
@@ -265,6 +265,8 @@ PRIMOP_BITS = compiler/primop-data-decl.hs-incl        \
 compiler_CPP_OPTS += -I$(GHC_INCLUDE_DIR)
 compiler_CPP_OPTS += ${GhcCppOpts}
 
+compiler/stage2/build/LibFFI.hs : libffi/dist-install/build/ffi.h
+
 $(PRIMOPS_TXT) compiler/parser/Parser.y: %: %.pp compiler/stage1/$(PLATFORM_H)
        $(CPP) $(RAWCPP_FLAGS) -P $(compiler_CPP_OPTS) -x c $< | grep -v '^#pragma GCC' > $@
 
index 9dcf2c5..3aa1cbc 100644 (file)
@@ -137,6 +137,11 @@ $(libffi_STAMP_CONFIGURE):
          "$(CP)" build/libtool build/libtool.orig && \
          sed -e s/dlname=\'\$$tdlname\'/dlname=\'\$$dlname\'/ build/libtool.orig > build/libtool
 
+       # wc on OS X has spaces in its output, which libffi's Makefile
+       # doesn't expect, so we tweak it to sed them out
+       mv libffi/build/Makefile libffi/build/Makefile.orig
+       sed "s#wc -w#wc -w | sed 's/ //g'#" < libffi/build/Makefile.orig > libffi/build/Makefile
+
        touch $@
 
 libffi/dist-install/build/ffi.h: $(libffi_STAMP_CONFIGURE) libffi/dist-install/build/ffitarget.h | $$(dir $$@)/.
index 5ae873a..9f3680d 100644 (file)
@@ -460,10 +460,10 @@ $(rts_dist_depfile_c_asm) : libffi/dist-install/build/ffi.h $(DTRACEPROBES_H)
 #-----------------------------------------------------------------------------
 # libffi stuff
 
-rts_CC_OPTS     += -Ilibffi/build/include
-rts_HC_OPTS     += -Ilibffi/build/include
-rts_HSC2HS_OPTS += -Ilibffi/build/include
-rts_LD_OPTS     += -Llibffi/build/include
+rts_CC_OPTS     += -Ilibffi/dist-install/build
+rts_HC_OPTS     += -Ilibffi/dist-install/build
+rts_HSC2HS_OPTS += -Ilibffi/dist-install/build
+rts_LD_OPTS     += -Llibffi/dist-install/build
 
 # -----------------------------------------------------------------------------
 # compile dtrace probes if dtrace is supported