Bootstrapping fixes
authorIan Lynagh <igloo@earth.li>
Sun, 17 May 2009 13:05:58 +0000 (13:05 +0000)
committerIan Lynagh <igloo@earth.li>
Sun, 17 May 2009 13:05:58 +0000 (13:05 +0000)
ghc.mk
ghc/ghc.mk
rules/build-package-way.mk
rules/build-prog.mk
rules/hs-suffix-rules-srcdir.mk

diff --git a/ghc.mk b/ghc.mk
index b12583a..2bea829 100644 (file)
--- a/ghc.mk
+++ b/ghc.mk
@@ -929,7 +929,7 @@ maintainer-clean : distclean
 .PHONY: all_libraries
 
 .PHONY: bootstrapping-files
-bootstrapping-files: $(GMP_LIB)
+bootstrapping-files: $(OTHER_LIBS)
 bootstrapping-files: includes/ghcautoconf.h
 bootstrapping-files: includes/DerivedConstants.h
 bootstrapping-files: includes/GHCConstants.h
index 103c590..1115946 100644 (file)
@@ -137,7 +137,8 @@ $(GHC_STAGE3) : $(TOUCHY) $(INPLACE)/stamp-mingw $(INPLACE_LIB)/perl.exe
 endif
 
 ifeq "$(BootingFromHc)" "YES"
-ghc_stage2_OTHER_OBJS += $(compiler_stage2_v_LIB) $(ALL_LIBS) $(ALL_LIBS) $(ALL_LIBS) $(ALL_RTS_LIBS) -lgmp $(libffi_STATIC_LIB) -lm -lutil -lrt
+$(GHC_STAGE2) : $(ALL_STAGE1_LIBS)
+ghc_stage2_OTHER_OBJS += $(compiler_stage2_v_LIB) $(ALL_STAGE1_LIBS) $(ALL_STAGE1_LIBS) $(ALL_STAGE1_LIBS) $(ALL_RTS_LIBS) $(libffi_STATIC_LIB)
 endif
 
 endif
index 06e432a..636f641 100644 (file)
@@ -29,9 +29,14 @@ $$($1_PACKAGE)-$($1_$2_VERSION)_$2_$3_LIB = $$($1_$2_$3_LIB)
 # All the .a/.so library file dependencies for this library
 $1_$2_$3_DEPS_LIBS=$$(foreach dep,$$($1_$2_DEPS),$$($$(dep)_$2_$3_LIB))
 
+ifneq "$$(BootingFromHc)" "YES"
 $1_$2_$3_MKSTUBOBJS = find $1/$2/build -name "*_stub.$$($3_osuf)" -print
 # HACK ^^^ we tried to use $(wildcard), but apparently it fails due to
 # make using cached directory contents, or something.
+else
+$1_$2_$3_MKSTUBOBJS = true
+$1_$2_v_C_OBJS += $$(shell find $1/$2/build -name "*_stub.c" -print | sed 's/c$$$$/o/')
+endif
 
 ifeq "$3" "dyn"
 # Link a dynamic library
index 20cf46f..1bb9028 100644 (file)
@@ -104,7 +104,7 @@ $1/$2/build/tmp/$$($1_$2_PROG) : $$($1_$2_v_HS_OBJS) $$($1_$2_v_C_OBJS) $$($1_$2
 else
 $1/$2/build/tmp/$$($1_$2_PROG) : $$($1_$2_v_HS_OBJS) $$($1_$2_v_C_OBJS) $$($1_$2_v_S_OBJS) $$($1_$2_OTHER_OBJS)
        $$(MKDIRHIER) $$(dir $$@)
-       $$(CC) -o $$@ $$($1_$2_v_ALL_CC_OPTS) $$(LD_OPTS) $$($1_$2_v_HS_OBJS) $$($1_$2_v_C_OBJS) $$($1_$2_v_S_OBJS) $$($1_$2_OTHER_OBJS)
+       $$(CC) -o $$@ $$($1_$2_v_ALL_CC_OPTS) $$(LD_OPTS) $$($1_$2_v_HS_OBJS) $$($1_$2_v_C_OBJS) $$($1_$2_v_S_OBJS) $$($1_$2_OTHER_OBJS) $$($1_$2_v_EXTRA_CC_OPTS)
 endif
 
 # Note [lib-depends] if this program is built with stage1 or greater, we
index 4aa7b7e..ceeede8 100644 (file)
@@ -84,10 +84,12 @@ $1/$2/build/%.$$($3_way_)o-boot : $1/$4/%.hs-boot $$($1_$2_HC_DEP)
 $1/$2/build/%.$$($3_way_)o-boot : $1/$4/%.lhs-boot $$($1_$2_HC_DEP)
        $$($1_$2_HC) $$($1_$2_$3_ALL_HC_OPTS) -c $$< -o $$@
 
+ifneq "$$(BootingFromHc)" "YES"
 # stubs are automatically generated and compiled by GHC
 
 $1/$2/build/%_stub.$$($3_osuf): $1/$2/build/%.$$($3_osuf)
        @:
+endif
 
 endef