SRC_HC_OPTS += $(patsubst %, -i$(odir)/%, $(ALL_DIRS))
-ifneq "$(stage)" "1"
SRC_HC_OPTS += -Wall -fno-warn-name-shadowing
+# Turn off orphan warnings, but only if the flag exists (i.e. not if we
+# are building stage 1 and using GHC < 6.3).
+ifneq "$(stage) $(ghc_ge_603)" "1 NO"
+SRC_HC_OPTS += -fno-warn-orphans
endif
HS_OBJS = $(patsubst %, $(odir)/%, $(addsuffix .$(way_)o,$(basename $(HS_SRCS))))
INPLACE_PROG = $(odir)/ghc-inplace$(exeext)
EXCLUDED_C_SRCS += ghc-inplace.c
-# FPTOOLS_TOP_ABS platform uses backslashes, at least on Cygwin, but that
-# will go wrong when we use it in a Haskell string below.
-TOP_ABS=$(subst \\,/,$(FPTOOLS_TOP_ABS_PLATFORM))
-
-GHC_PATH=$(TOP_ABS)/$(GHC_COMPILER_DIR_REL)/$(GHC_PROG)$(exeext)
+GHC_PATH=$(FPTOOLS_TOP_ABS)/$(GHC_COMPILER_DIR_REL)/$(GHC_PROG)$(exeext)
ifeq "$(HOSTPLATFORM)" "i386-unknown-mingw32"
INPLACE_EXTRA_FLAGS = -optc-DWINDOWS
endif
$(INPLACE_PROG): ghc-inplace.c
- $(HC) -cpp -optc-DGHC_PATH=$(DQ)$(GHC_PATH)$(DQ) -optc-DTOP_ABS=$(DQ)$(TOP_ABS)$(DQ) $(INPLACE_EXTRA_FLAGS) $< -o $@
+ $(HC) -cpp -optc-DGHC_PATH=$(DQ)$(GHC_PATH)$(DQ) -optc-DTOP_ABS=$(DQ)$(FPTOOLS_TOP_ABS)$(DQ) $(INPLACE_EXTRA_FLAGS) $< -o $@
all :: $(INPLACE_PROG)
HS_IFACES = $(addsuffix .$(way_)hi,$(basename $(HS_OBJS)))
# Haddock can't handle recursive modules currently, so we disable it for now.
-HADDOCK_DOCS = NO
+override HADDOCK_DOCS = NO
# Tell package.mk not to set $(HC)
NO_SET_HC = YES