Commit f1fcfff5 authored by ian@well-typed.com's avatar ian@well-typed.com

Give hsc2hs different options in different stages; fixes #7705

Based on patch from Stephen Blackheath.
parent f92a6eef
......@@ -587,10 +587,20 @@ endif
ifneq "$(Windows_Host)" "YES"
SRC_HSC2HS_OPTS += --cross-safe
endif
SRC_HSC2HS_OPTS += $(addprefix --cflag=,$(filter-out -O,$(SRC_CC_OPTS) $(CONF_CC_OPTS_STAGE0)))
SRC_HSC2HS_OPTS += $(foreach d,$(GMP_INCLUDE_DIRS),-I$(d))
define set_stage_HSC2HS_OPTS
# $1 = stage
SRC_HSC2HS_OPTS_STAGE$1 += $$(addprefix --cflag=,$$(filter-out -O,$$(SRC_CC_OPTS) $$(CONF_CC_OPTS_STAGE$1)))
SRC_HSC2HS_OPTS_STAGE$1 += $$(addprefix --cflag=,$$(CONF_CPP_OPTS_STAGE$1))
SRC_HSC2HS_OPTS_STAGE$1 += $$(addprefix --lflag=,$$(CONF_GCC_LINKER_OPTS_STAGE$1))
endef
$(eval $(call set_stage_HSC2HS_OPTS,0))
$(eval $(call set_stage_HSC2HS_OPTS,1))
$(eval $(call set_stage_HSC2HS_OPTS,2))
ifeq "$(CrossCompiling)" "YES"
SRC_HSC2HS_OPTS += --cross-compile
SRC_HSC2HS_OPTS_STAGE1 += --cross-compile
SRC_HSC2HS_OPTS_STAGE2 += --cross-compile
endif
ifeq "$(TARGETPLATFORM)" "i386-unknown-mingw32"
......
......@@ -79,10 +79,11 @@ $1_$2_HSC2HS_LD_OPTS:=$$(shell for i in $$($1_$2_DIST_LD_OPTS); do echo \'--lfla
endif
$1_$2_ALL_HSC2HS_OPTS = \
--cc=$$(WhatGccIsCalled) \
--ld=$$(WhatGccIsCalled) \
--cc=$$(CC_STAGE$3) \
--ld=$$(CC_STAGE$3) \
$$(CONF_HSC2HS_OPTS) \
$$(SRC_HSC2HS_OPTS) \
$$(SRC_HSC2HS_OPTS_STAGE$3) \
--cflag=-D__GLASGOW_HASKELL__=$$(if $$(filter 0,$3),$$(GhcCanonVersion),$$(ProjectVersionInt)) \
--cflag=-D$$(HostArch_CPP)_HOST_ARCH=1 \
--cflag=-D$$(HostOS_CPP)_HOST_OS=1 \
......
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