Make and use AR_STAGE[0123] makefile vars
authorIan Lynagh <igloo@earth.li>
Sat, 23 Apr 2011 16:21:59 +0000 (17:21 +0100)
committerIan Lynagh <igloo@earth.li>
Sat, 23 Apr 2011 16:21:59 +0000 (17:21 +0100)
libffi/ghc.mk
mk/config.mk.in
rts/ghc.mk
rules/build-package-way.mk
rules/package-config.mk

index 46400ab..f7caeda 100644 (file)
@@ -116,7 +116,7 @@ $(libffi_STAMP_CONFIGURE):
            cd build && \
            CC=$(CC_STAGE1) \
            LD=$(LD) \
-           AR=$(AR) \
+           AR=$(AR_STAGE1) \
            NM=$(NM) \
         CFLAGS="$(SRC_CC_OPTS) $(CONF_CC_OPTS_STAGE1) -w" \
         LDFLAGS="$(SRC_LD_OPTS) $(CONF_GCC_LINKER_OPTS_STAGE1) -w" \
index 4d61a35..0a803f0 100644 (file)
@@ -599,6 +599,12 @@ AR                 = @ArCmd@
 AR_OPTS                        = @ArArgs@
 ArSupportsInput                = @ArSupportsInput@
 ArSupportsAtFile = @ArSupportsAtFile@
+
+AR_STAGE0 = $(AR)
+AR_STAGE1 = $(AR)
+AR_STAGE2 = $(AR)
+AR_STAGE3 = $(AR)
+
 # Yuckage: for ghc/utils/parallel -- todo: nuke this dependency!!
 BASH                    = /usr/local/bin/bash
 
index 53bb72c..8925ff9 100644 (file)
@@ -194,7 +194,7 @@ endif
 else
 $$(rts_$1_LIB) : $$(rts_$1_OBJS) $$(rts_$1_DTRACE_OBJS)
        "$$(RM)" $$(RM_OPTS) $$@
-       echo $$(rts_$1_OBJS) $$(rts_$1_DTRACE_OBJS) | "$$(XARGS)" $$(XARGS_OPTS) "$$(AR)" \
+       echo $$(rts_$1_OBJS) $$(rts_$1_DTRACE_OBJS) | "$$(XARGS)" $$(XARGS_OPTS) "$$(AR_STAGE1)" \
                $$(AR_OPTS) $$(EXTRA_AR_ARGS) $$@
 endif
 
@@ -499,7 +499,7 @@ endif
 ifneq "$(BINDIST)" "YES"
 rts/dist/build/libHSrtsmain.a : rts/dist/build/Main.o
        "$(RM)" $(RM_OPTS) $@
-       "$(AR)" $(AR_OPTS) $(EXTRA_AR_ARGS) $@ $<
+       "$(AR_STAGE1)" $(AR_OPTS) $(EXTRA_AR_ARGS) $@ $<
 endif
 
 # -----------------------------------------------------------------------------
index d6c1560..9f69536 100644 (file)
@@ -88,9 +88,9 @@ else
        echo $$($1_$2_$3_ALL_OBJS) >> $$@.contents
 endif
 ifeq "$$(ArSupportsAtFile)" "YES"
-       "$$(AR)" $$(AR_OPTS) $$(EXTRA_AR_ARGS) $$@ @$$@.contents
+       "$$($1_$2_AR)" $$(AR_OPTS) $$(EXTRA_AR_ARGS) $$@ @$$@.contents
 else
-       "$$(XARGS)" $$(XARGS_OPTS) "$$(AR)" $$(AR_OPTS) $$(EXTRA_AR_ARGS) $$@ < $$@.contents
+       "$$(XARGS)" $$(XARGS_OPTS) "$$($1_$2_AR)" $$(AR_OPTS) $$(EXTRA_AR_ARGS) $$@ < $$@.contents
 endif
        "$$(RM)" $$(RM_OPTS) $$@.contents
 endif
index 65df6bf..dcfc26e 100644 (file)
@@ -17,6 +17,7 @@ $(call profStart, package-config($1,$2,$3))
 
 $1_$2_HC = $$(GHC_STAGE$3)
 $1_$2_CC = $$(CC_STAGE$3)
+$1_$2_AR = $$(AR_STAGE$3)
 
 # configuration stuff that depends on which GHC we're building with
 ifeq "$3" "0"