i386-unknown-freebsd x86_64-unknown-freebsd \
i386-unknown-openbsd x86_64-unknown-openbsd \
i386-unknown-mingw32 \
+ i386-unknown-solaris2 \
i386-apple-darwin powerpc-apple-darwin),YES,NO)
# Build a compiler that will build *unregisterised* libraries and
$(if $(filter YESYESNO,\
$(OsSupportsNCG)$(ArchSupportsNCG)$(GhcUnregisterised)),YES,NO))
-# Build a compiler with the llvm code generator backend
-GhcWithLlvmCodeGen=NO
-
HaveLibDL = @HaveLibDL@
# ArchSupportsSMP should be set iff there is support for that arch in
UseLibFFIForAdjustors=YES
endif
-ifeq "$(findstring $(HostOS_CPP), darwin)" ""
-UseArchivesForGhci = NO
-else
-UseArchivesForGhci = YES
-endif
-
# On Windows we normally want to make a relocatable bindist, to we
# ignore flags like libdir
ifeq "$(Windows)" "YES"
# doing object-file splitting
ArchSupportsSplitObjs=$(strip $(if $(filter $(TargetArch_CPP),i386 x86_64 powerpc sparc),YES,NO))
-# Object splitting is disabled on darwin due to #4013
-OsSupportsSplitObjs=$(strip $(if $(filter $(TargetOS_CPP),mingw32 cygwin32 linux solaris2 freebsd dragonfly netbsd openbsd),YES,NO))
+OsSupportsSplitObjs=$(strip $(if $(filter $(TargetOS_CPP),mingw32 cygwin32 linux darwin solaris2 freebsd dragonfly netbsd openbsd),YES,NO))
+SplitObjsBroken = @SplitObjsBroken@
# lazy test, so that $(GhcUnregisterised) can be set in build.mk
SupportsSplitObjs=$(strip \
$(if $(and $(filter YES,$(ArchSupportsSplitObjs)),\
$(filter YES,$(OsSupportsSplitObjs)),\
+ $(filter NO,$(SplitObjsBroken)),\
$(filter NO,$(BootingFromHc)),\
$(filter NO,$(GhcUnregisterised))),\
YES,NO))
#
# SRC_HC_OPTS += -O
+
+# SRC_HC_OPTS includes flags to be added to *every* Haskell
+# compilation. Setting SRC_HC_OPTS is a good way to set the default
+# optimisation level (-O) and heap size (-H<size>).
+#
+# SRC_HC_OPTS is *not* for adding flags that are required to make your
+# build work. Examples:
+#
+# - instead of using -pgmc/-pgma-/-pgml, use the --with-gcc option to configure
+#
+# - if you need -optc, -opta, or -optl flags, the CONF_CC_* and CONF_LD_*
+# variables are more appropriate (set via configure)
+#
+# Note that SRC_HC_OPTS are added to every Haskell compilation,
+# including when using the bootstrapping compiler (stage 0), So don't
+# put options here that are only supported by very recent GHCs.
+#
SRC_HC_OPTS += -H32m -O
# These flags make flex 8-bit
GHC_LTX_PGM = ltx$(exeext)
GHC_MKDIRHIER_PGM = mkdirhier
GHC_LNDIR_PGM = lndir
-GHC_DUMMY_GHC_PGM = dummy-ghc$(exeext)
ifeq "$(TARGETPLATFORM)" "i386-unknown-mingw32"
GHC_CP = "xcopy /y"
GHCTAGS_INPLACE = $(INPLACE_BIN)/$(GHC_GHCTAGS_PGM)
HSC2HS_INPLACE = $(INPLACE_BIN)/$(GHC_HSC2HS_PGM)
GENPRIMOP_INPLACE = $(INPLACE_BIN)/$(GHC_GENPRIMOP_PGM)
-DUMMY_GHC_INPLACE = $(INPLACE_BIN)/$(GHC_DUMMY_GHC_PGM)
GENERATED_FILE = chmod a-w
EXECUTABLE_FILE = chmod +x
#-----------------------------------------------------------------------------
-# Haskell compilers and mkdependHS
+# Installed GHC
-# $(GHC), $(HBC) and $(NHC) point to installed versions of the relevant
-# compilers, if available.
-#
-# $(HC) is a generic Haskell 98 compiler, set to $(GHC) by default.
-# $(MKDEPENDHS) is the Haskell dependency generator (ghc -M).
+# $(GHC) points to installed version of the compiler.
#
# NOTE: Don't override $(GHC) in build.mk, use configure --with-ghc instead
# (because the version numbers have to be calculated).
GHC := $(GHC).exe
endif
-GhcDir = $(dir $(GHC))
-
-# Set to YES if $(GHC) has the editline package installed
-GhcHasEditline = @GhcHasEditline@
-
-HBC = @HBC@
-NHC = @NHC@
-
# Sometimes we want to invoke ghc from the build tree in different
# places (eg. it's handy to have a nofib & a ghc build in the same
# tree). We can refer to "this ghc" as $(GHC_INPLACE):
GhcMinVersion = @GhcMinVersion@
# Keep this in sync with the variables in package-config.mk
-ghc_ge_6102 = @ghc_ge_6102@
-ghc_ge_611 = @ghc_ge_611@
ghc_ge_613 = @ghc_ge_613@
# Canonicalised ghc version number, used for easy (integer) version
CONF_CC_OPTS_STAGE0 = @CONF_CC_OPTS_STAGE0@
CONF_CC_OPTS_STAGE1 = @CONF_CC_OPTS_STAGE1@
CONF_CC_OPTS_STAGE2 = @CONF_CC_OPTS_STAGE2@
-CONF_LD_OPTS_STAGE0 = @CONF_LD_OPTS_STAGE0@
-CONF_LD_OPTS_STAGE1 = @CONF_LD_OPTS_STAGE1@
-CONF_LD_OPTS_STAGE2 = @CONF_LD_OPTS_STAGE2@
+CONF_GCC_LINKER_OPTS_STAGE0 = @CONF_GCC_LINKER_OPTS_STAGE0@
+CONF_GCC_LINKER_OPTS_STAGE1 = @CONF_GCC_LINKER_OPTS_STAGE1@
+CONF_GCC_LINKER_OPTS_STAGE2 = @CONF_GCC_LINKER_OPTS_STAGE2@
+CONF_LD_LINKER_OPTS_STAGE0 = @CONF_LD_LINKER_OPTS_STAGE0@
+CONF_LD_LINKER_OPTS_STAGE1 = @CONF_LD_LINKER_OPTS_STAGE1@
+CONF_LD_LINKER_OPTS_STAGE2 = @CONF_LD_LINKER_OPTS_STAGE2@
+CONF_CPP_OPTS_STAGE0 = @CONF_CPP_OPTS_STAGE0@
+CONF_CPP_OPTS_STAGE1 = @CONF_CPP_OPTS_STAGE1@
+CONF_CPP_OPTS_STAGE2 = @CONF_CPP_OPTS_STAGE2@
ifeq "$(TARGETPLATFORM)" "ia64-unknown-linux"
CONF_CC_OPTS += -G0
endif
+# The .hsc files aren't currently safe for cross-compilation on Windows:
+# libraries\haskeline\.\System\Console\Haskeline\Backend\Win32.hsc:160
+# directive "let" is not safe for cross-compilation
+ifneq "$(Windows)" "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))
RAWCPP_FLAGS = -undef -traditional
FIND = @FindCmd@
SORT = @SortCmd@
-INSTALL = @INSTALL@
+
#
# Sigh - the autoconf macro for INSTALL will subst a relative path to the fallback
# install-sh script (if chosen). This not terribly useful to us, so we convert
# it into an abs. path.
#
+INSTALL = @INSTALL@
INSTALL := $(subst .././install-sh,$(TOP)/install-sh,$(INSTALL))
+
LATEX = latex
-PDFLATEX = pdflatex
-BIBTEX = bibtex
+PDFLATEX = pdflatex
+BIBTEX = bibtex
LN_S = @LN_S@
MV = mv
NROFF = nroff
SHELL = /bin/sh
HaveDtrace = @HaveDtrace@
+USE_DTRACE = $(HaveDtrace)
DTRACE = @DtraceCmd@
LD = @LdCmd@
#
SRC_HAPPY_OPTS = -agc --strict
-# Temp. to work around performance problems in the HEAD around 8/12/2003,
-# A Happy compiled with this compiler needs more stack.
-SRC_HAPPY_OPTS += +RTS -K2m -RTS
-
#
# Alex
#