Follow build system changes in integer-gmp
authorIan Lynagh <ian@well-typed.com>
Sat, 20 Apr 2013 13:17:00 +0000 (14:17 +0100)
committerIan Lynagh <ian@well-typed.com>
Sat, 20 Apr 2013 16:09:00 +0000 (17:09 +0100)
Also a couple of other fixes and sanity checks along the way.

ghc.mk
rts/ghc.mk
rules/build-prog.mk
rules/distdir-opts.mk
rules/distdir-way-opts.mk

diff --git a/ghc.mk b/ghc.mk
index 43e55f3..d873070 100644 (file)
--- a/ghc.mk
+++ b/ghc.mk
@@ -614,8 +614,10 @@ endif
 
 ifeq "$(INTEGER_LIBRARY)" "integer-gmp"
 BUILD_DIRS += libraries/integer-gmp/gmp
+BUILD_DIRS += libraries/integer-gmp/mkGmpDerivedConstants
 else ifneq "$(findstring clean,$(MAKECMDGOALS))" ""
 BUILD_DIRS += libraries/integer-gmp/gmp
+BUILD_DIRS += libraries/integer-gmp/mkGmpDerivedConstants
 endif
 
 ifeq "$(CrossCompiling)-$(phase)" "YES-final"
index b7651b0..b3b51a6 100644 (file)
@@ -220,7 +220,7 @@ endef
 # And expand the above for each way:
 $(foreach way,$(rts_WAYS),$(eval $(call build-rts-way,$(way))))
 
-$(eval $(call distdir-opts,rts,dist))
+$(eval $(call distdir-opts,rts,dist,1))
 
 #-----------------------------------------------------------------------------
 # Flags for compiling every file
index 468fcaf..b788bc1 100644 (file)
@@ -152,7 +152,7 @@ $(call c-sources,$1,$2)
 
 # --- IMPLICIT RULES
 
-$(call distdir-opts,$1,$2,,$3)
+$(call distdir-opts,$1,$2,$3)
 $(call distdir-way-opts,$1,$2,$$($1_$2_PROGRAM_WAY),$3)
 
 ifeq "$3" "0"
@@ -209,7 +209,9 @@ ifeq "$$(TargetOS_CPP)" "darwin"
 ifneq "$3" "0"
 ifeq "$$($1_$2_PROGRAM_WAY)" "dyn"
 # Use relative paths for all the libraries
+ifneq "$$($1_$2_TRANSITIVE_DEP_NAMES)" ""
        install_name_tool $$(foreach d,$$($1_$2_TRANSITIVE_DEP_NAMES), -change $$(TOP)/$$($$($$d_INSTALL_INFO)_dyn_LIB) @loader_path/../$$d-$$($$($$d_INSTALL_INFO)_VERSION)/$$($$($$d_INSTALL_INFO)_dyn_LIB_NAME)) $$@
+endif
 # Use relative paths for the RTS. Rather than try to work out which RTS
 # way is being linked, we just change it for all ways
        install_name_tool $$(foreach w,$$(rts_WAYS), -change $$(TOP)/$$(rts_$$w_LIB) @loader_path/../rts-$$(rts_VERSION)/$$(rts_$$w_LIB_NAME)) $$@
@@ -232,11 +234,11 @@ ifneq "$$($1_$2_HS_SRCS)" ""
 ifeq "$$(strip $$(ALL_STAGE1_LIBS))" ""
 $$(error ordering failure in $1 ($2): ALL_STAGE1_LIBS is empty)
 endif
-endif
 $1/$2/build/tmp/$$($1_$2_PROG) : $$(ALL_STAGE1_LIBS) $$(ALL_RTS_LIBS) $$(OTHER_LIBS)
 endif
 endif
 endif
+endif
 
 ifneq "$$($1_$2_INSTALL_INPLACE)" "NO"
 $(call all-target,$1_$2,$$($1_$2_INPLACE))
index fd415b6..0009f85 100644 (file)
 
 define distdir-opts # args: $1 = dir, $2 = distdir, $3 = stage
 
+ifeq "$3" ""
+$$(error Stage not given for distdir-opts $1 $2)
+endif
+
 ifeq "$3" "0"
 # This is a bit of a hack.
 # If we are compiling something with the bootstrapping compiler on
index 872e527..8d2649f 100644 (file)
@@ -140,6 +140,7 @@ $1_$2_$3_ALL_CC_OPTS = \
  $$($1_$2_DIST_GCC_CC_OPTS) \
  $$($1_$2_$3_CC_OPTS) \
  $$($$(basename $$<)_CC_OPTS) \
+ $$($1_$2_EXTRA_CC_OPTS) \
  $$(EXTRA_CC_OPTS)
 
 $1_$2_$3_GHC_CC_OPTS = \
@@ -148,6 +149,7 @@ $1_$2_$3_GHC_CC_OPTS = \
      $$($1_$2_DIST_CC_OPTS) \
      $$($1_$2_$3_CC_OPTS) \
      $$($$(basename $$<)_CC_OPTS) \
+     $$($1_$2_EXTRA_CC_OPTS) \
      $$(EXTRA_CC_OPTS)) \
  $$($1_$2_$3_MOST_HC_OPTS)