Define _HOST_OS and _HOST_ARCH when calling hsc2hs
authorIan Lynagh <igloo@earth.li>
Tue, 1 May 2012 18:14:05 +0000 (19:14 +0100)
committerIan Lynagh <igloo@earth.li>
Tue, 1 May 2012 18:14:05 +0000 (19:14 +0100)
In particular, old-time assumes that mingw32_HOST_OS is set when
we are on Windows, and was going wrong on Win64 because it wasn't
defined.

rules/distdir-way-opts.mk

index c26bbc7..dcbd9cb 100644 (file)
@@ -189,6 +189,8 @@ $1_$2_$3_ALL_HSC2HS_OPTS = \
  $$(SRC_HSC2HS_OPTS) \
  $$(WAY_$3_HSC2HS_OPTS) \
  --cflag=-D__GLASGOW_HASKELL__=$$(if $$(filter 0,$4),$$(GhcCanonVersion),$$(ProjectVersionInt)) \
+ --cflag=-D$$(HostArch_CPP)_HOST_ARCH=1 \
+ --cflag=-D$$(HostOS_CPP)_HOST_OS=1 \
  $$($1_$2_$3_HSC2HS_CC_OPTS) \
  $$($1_$2_$3_HSC2HS_LD_OPTS) \
  --cflag=-I$1/$2/build/autogen \