X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=mk%2Fconfig.mk.in;h=3fc0853ecb885752c84f23e62477d9612b31b820;hp=697bf51d9b51e835ed75e0f814c1c83a887aa5e1;hb=a3be88fd60cc63b97ec8509f46a8d93025760792;hpb=88223168614ea60a5d76a264f6c11837b6c5a443 diff --git a/mk/config.mk.in b/mk/config.mk.in index 697bf51..3fc0853 100644 --- a/mk/config.mk.in +++ b/mk/config.mk.in @@ -97,13 +97,20 @@ GhcStage1HcOpts= GhcStage2HcOpts=-O2 GhcStage3HcOpts=-O2 -GhcProfiled=NO GhcDebugged=NO GhcDynamic=NO -GhcLibProfiled=$(if $(filter p,$(GhcLibWays)),YES,NO) + +# GhcProfiled=YES means compile a profiled stage-2 compiler +GhcProfiled=NO # Do we support shared libs? -PlatformSupportsSharedLibs = $(if $(filter $(TARGETPLATFORM),i386-unknown-linux x86_64-unknown-linux i386-unknown-freebsd x86_64-unknown-freebsd i386-unknown-mingw32 i386-apple-darwin),YES,NO) +PlatformSupportsSharedLibs = $(if $(filter $(TARGETPLATFORM),\ + i386-unknown-linux x86_64-unknown-linux \ + 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 # binaries by default. Unregisterised code is supposed to compile and @@ -174,7 +181,7 @@ endif # Whether to use libffi for adjustors (foreign import "wrapper") or # not. If we have built-in support (rts/Adjustor.c) then we use that, # otherwise we fall back on libffi, which is slightly slower. -ArchHasAdjustorSupport=$(strip $(if $(findstring $(HostArch_CPP),i386 x86_64 alpha powerpc ia64,),YES,NO)) +ArchHasAdjustorSupport = $(if $(findstring $(HostArch_CPP),i386 x86_64),YES,NO) ifeq "$(ArchHasAdjustorSupport)" "YES" UseLibFFIForAdjustors=NO else @@ -287,15 +294,16 @@ PackageSourceURL = http://darcs.haskell.org/packages/$(PACKAGE)/%{FILE} # 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)) # lazy test, so that $(GhcUnregisterised) can be set in build.mk -SupportsSplitObjs=$(strip $(if $(filter YES,$(ArchSupportsSplitObjs)),\ - $(if $(filter NO,$(BootingFromHc)),\ - $(if $(filter NO,$(GhcUnregisterised)),\ - YES,\ - NO),\ - NO),\ - NO)) +SupportsSplitObjs=$(strip \ + $(if $(and $(filter YES,$(ArchSupportsSplitObjs)),\ + $(filter YES,$(OsSupportsSplitObjs)),\ + $(filter NO,$(BootingFromHc)),\ + $(filter NO,$(GhcUnregisterised))),\ + YES,NO)) # By default, enable SplitObjs for the libraries if this build supports it SplitObjs=$(SupportsSplitObjs) @@ -376,6 +384,23 @@ WINDOWS_INSTALLER = $(WINDOWS_INSTALLER_BASE)$(exeext) # # 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). +# +# 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 @@ -409,7 +434,6 @@ GHC_PKG_PGM = ghc-pkg$(exeext) 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" @@ -435,19 +459,14 @@ GHC_PKG_INPLACE = $(INPLACE_BIN)/$(GHC_PKG_PGM) 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). @@ -460,14 +479,6 @@ ifneq "$(wildcard $(GHC).exe)" "" 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): @@ -497,8 +508,6 @@ GhcMajVersion = @GhcMajVersion@ 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 @@ -531,15 +540,23 @@ endif endif # C compiler and linker flags from configure (e.g. -m to select -# correct C compiler backend). -CONF_CC_OPTS = @CONF_CC_OPTS@ -CONF_LD_OPTS = @CONF_LD_OPTS@ +# correct C compiler backend). The stage number is the stage of GHC +# that is being used to compile with. +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_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 -SRC_HSC2HS_OPTS += $(addprefix --cflag=,$(filter-out -O,$(SRC_CC_OPTS) $(CONF_CC_OPTS))) +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)) #----------------------------------------------------------------------------- @@ -589,11 +606,7 @@ INSTALL := $(subst .././install-sh,$(TOP)/install-sh,$(INSTALL)) LATEX = latex PDFLATEX = pdflatex BIBTEX = bibtex -HEVEA = hevea -HACHA = hacha LN_S = @LN_S@ -MANMACROS = -man -MSMACROS = -ms MV = mv NROFF = nroff PERL = @PerlCmd@ @@ -623,10 +636,12 @@ LdIsGNULd = @LdIsGNULd@ # On MSYS, building with SplitObjs=YES fails with # ar: Bad file number # see #3201. We need to specify a smaller max command-line size -# to work around it. 32767 doesn't work; 30000 does. +# to work around it. 32767 doesn't work; 30000 does, but says +# xargs: value for -s option should be < 28153 +# so we now use 20000 to be comfortably below this bound XARGS = xargs ifeq "$(Windows)" "YES" -XARGS_OPTS = -s 30000 +XARGS_OPTS = -s 20000 endif # @@ -651,37 +666,24 @@ endif # with REAL_SHELL set to something else than /bin/sh, for instance, your favourite # command shell. # -REAL_SHELL=$(SHELL) -SIZE = size -STRIP = strip -PATCH = @PatchCmd@ -TAR = @TarCmd@ -BZIP2 = bzip2 -GZIP = gzip -ZIP = zip +REAL_SHELL = $(SHELL) -HSCOLOUR = @HSCOLOUR@ +STRIP_CMD = strip +PATCH_CMD = @PatchCmd@ +TAR_CMD = @TarCmd@ +BZIP2_CMD = bzip2 +GZIP_CMD = gzip -# -# This is special to literate/, ToDo: add literate-specific -# configure setup to literate/. -# -TBL = tbl -TEX = tex -TGRIND = tgrind -TGRIND_HELPER = /usr/local/lib/tgrind/tfontedpr # XXX -TIB = tib +HSCOLOUR_CMD = @HSCOLOUR@ -TIME = @TimeCmd@ -TROFF = troff -UNAME = uname +TIME_CMD = @TimeCmd@ # GTK+ -GTK_CONFIG = @GTK_CONFIG@ +GTK_CONFIG_CMD = @GTK_CONFIG@ # Set this if you want to use Inno Setup to build a Windows installer # when you make a bindist -ISCC = +ISCC_CMD = #----------------------------------------------------------------------------- # DocBook XML stuff @@ -709,12 +711,6 @@ BLD_DLL = dllwrap GHC_PKG = @GhcPkgCmd@ # -# GreenCard -# -GREENCARD = @GreenCardCmd@ -GREENCARD_VERSION = @GreenCardVersion@ - -# # Happy # HAPPY = @HappyCmd@ @@ -724,10 +720,6 @@ HAPPY_VERSION = @HappyVersion@ # 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 # @@ -741,9 +733,9 @@ SRC_ALEX_OPTS = -g HSTAGS = @HstagsCmd@ # Should we build haddock docs? -HADDOCK_DOCS = $(GhcWithInterpreter) +HADDOCK_DOCS = YES # And HsColour the sources? -ifeq "$(HSCOLOUR)" "" +ifeq "$(HSCOLOUR_CMD)" "" HSCOLOUR_SRCS = NO else HSCOLOUR_SRCS = YES