From: sof Date: Fri, 9 Nov 2001 18:17:48 +0000 (+0000) Subject: [project @ 2001-11-09 18:17:48 by sof] X-Git-Tag: Approximately_9120_patches~586 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=579b46fe35098fc4c934e279db7323e3786cde19;p=ghc-hetmet.git [project @ 2001-11-09 18:17:48 by sof] * Moved CANON_HC_VERSION out of ghc/compiler/Makefile and into mk/config.mk.in (and renamed it as GhcCanonVersion). * Have ghc/driver/Makefile use it; cheaper and more robust than the version testing it was already doing. --- diff --git a/ghc/compiler/Makefile b/ghc/compiler/Makefile index 011a607..739b7c2 100644 --- a/ghc/compiler/Makefile +++ b/ghc/compiler/Makefile @@ -1,5 +1,5 @@ # ----------------------------------------------------------------------------- -# $Id: Makefile,v 1.200 2001/11/09 17:39:45 sof Exp $ +# $Id: Makefile,v 1.201 2001/11/09 18:17:48 sof Exp $ TOP = .. include $(TOP)/mk/boilerplate.mk @@ -108,19 +108,14 @@ DIRS += javaGen SRC_HC_OPTS += -DJAVA endif -# -# Canonicalized GHC version number for easy version comparisons. -# -CANON_HC_VERSION=$(GhcMajVersion)$(GhcMinVersion)$(GhcPatchLevel) - ifeq "$(BootingFromHc)" "YES" # HC files are always from a self-booted compiler bootstrapped = YES compiling_with_4xx=NO else -bootstrapped = $(shell if (test $(CANON_HC_VERSION) -ge $(ProjectVersionInt)0); then echo YES; else echo NO; fi) -compiling_with_4xx = $(shell if (test $(CANON_HC_VERSION) -lt 5000); then echo YES; else echo NO; fi) -ghc_502_at_least = $(shell if (test $(CANON_HC_VERSION) -ge 5020); then echo YES; else echo NO; fi) +bootstrapped = $(shell if (test $(GhcCanonVersion) -ge $(ProjectVersionInt)0); then echo YES; else echo NO; fi) +compiling_with_4xx = $(shell if (test $(GhcCanonVersion) -lt 5000); then echo YES; else echo NO; fi) +ghc_502_at_least = $(shell if (test $(GhcCanonVersion) -ge 5020); then echo YES; else echo NO; fi) endif # Only include GHCi if we're bootstrapping with at least version 411 @@ -138,7 +133,7 @@ HS_SRCS += $(CONFIG_HS) # Enable code that assumes a MSDOSish subshell. See mk/config.mk.in # for explanatory comment as to what this does. ifeq "$(TARGETPLATFORM)" "i386-unknown-mingw32" -ghc_501_at_least = $(shell if (test $(CANON_HC_VERSION) -ge 5010); then echo YES; else echo NO; fi) +ghc_501_at_least = $(shell if (test $(GhcVanonVersion) -ge 5010); then echo YES; else echo NO; fi) # ----------------------------------------------- # GHCi calls the C procedure 'rawSystem'; but alas GHC 4.08 diff --git a/ghc/driver/Makefile b/ghc/driver/Makefile index b0c4b63..445ad74 100644 --- a/ghc/driver/Makefile +++ b/ghc/driver/Makefile @@ -1,5 +1,4 @@ #----------------------------------------------------------------------------- -# $Id: Makefile,v 1.68 2001/08/04 06:09:24 ken Exp $ # TOP=.. @@ -25,15 +24,17 @@ PKGCONF_OPTS = "$(TARGETPLATFORM)" \ "$(GHC_UTILS_DIR)" \ "$(GHC_INCLUDE_DIR)" -ghc_407_at_least = $(shell expr "$(GhcVersion)" \>= 4.07) -ifeq "$(ghc_407_at_least)" "1" +SRC_HC_OPTS += -fglasgow-exts -cpp + +ghc_407_at_least = $(shell if (test $(GhcCanonVersion) -ge 4070); then echo YES; else echo NO; fi) + +ifeq "$(ghc_407_at_least)" "YES" +SRC_HC_OPTS += -package concurrent -package text ifneq "$(mingw32_TARGET_OS)" "1" -SRC_HC_OPTS += -fglasgow-exts -cpp -package concurrent -package posix -package text -else -SRC_HC_OPTS += -fglasgow-exts -cpp -package concurrent -package text +SRC_HC_OPTS += -package posix endif else -SRC_HC_OPTS += -fglasgow-exts -cpp -syslib concurrent -syslib posix -syslib misc +SRC_HC_OPTS += -syslib concurrent -syslib posix -syslib misc endif SRC_HC_OPTS += -DWANT_PRETTY diff --git a/mk/config.mk.in b/mk/config.mk.in index fd34c2d..4ab6e35 100644 --- a/mk/config.mk.in +++ b/mk/config.mk.in @@ -614,6 +614,8 @@ GhcVersion = @GhcVersion@ GhcMajVersion = @GhcMajVersion@ GhcMinVersion = @GhcMinVersion@ GhcPatchLevel = @GhcPatchLevel@ +# Canonicalised ghc version number, used for easy (integer) version comparisons. +GhcCanonVersion = $(GhcMajVersion)$(GhcMinVersion)$(GhcPatchLevel) HBC = @HBC@ NHC = @NHC@