From: simonmar Date: Mon, 9 Sep 2002 11:32:38 +0000 (+0000) Subject: [project @ 2002-09-09 11:32:37 by simonmar] X-Git-Tag: Approx_11550_changesets_converted~1706 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=86f8ae9a66392beb97b84611e563a6b87bc57c27;p=ghc-hetmet.git [project @ 2002-09-09 11:32:37 by simonmar] Build without hslibs on GHC >= 5.04 --- diff --git a/ghc/utils/ghc-pkg/Main.hs b/ghc/utils/ghc-pkg/Main.hs index 538955c..afd1561 100644 --- a/ghc/utils/ghc-pkg/Main.hs +++ b/ghc/utils/ghc-pkg/Main.hs @@ -1,5 +1,5 @@ ----------------------------------------------------------------------------- --- $Id: Main.hs,v 1.26 2002/07/02 10:31:39 wolfgang Exp $ +-- $Id: Main.hs,v 1.27 2002/09/09 11:32:37 simonmar Exp $ -- -- Package management tool ----------------------------------------------------------------------------- @@ -8,11 +8,16 @@ module Main where import Package -#ifdef __GLASGOW_HASKELL__ -import qualified Exception -#endif +#if __GLASGOW_HASKELL__ >= 504 +import System.Console.GetOpt +import Text.PrettyPrint +import qualified Control.Exception as Exception +#else import GetOpt import Pretty +import qualified Exception +#endif + import Monad import Directory import System ( getEnv, getArgs, diff --git a/ghc/utils/ghc-pkg/Makefile b/ghc/utils/ghc-pkg/Makefile index ba72ce1..896742e 100644 --- a/ghc/utils/ghc-pkg/Makefile +++ b/ghc/utils/ghc-pkg/Makefile @@ -1,5 +1,5 @@ # ----------------------------------------------------------------------------- -# $Id: Makefile,v 1.17 2002/05/29 22:11:59 sof Exp $ +# $Id: Makefile,v 1.18 2002/09/09 11:32:38 simonmar Exp $ TOP=../.. include $(TOP)/mk/boilerplate.mk @@ -10,8 +10,13 @@ INSTALLING=1 # ----------------------------------------------------------------------------- # ghc-pkg.bin -SRC_HC_OPTS += -cpp -DPKG_TOOL -DWANT_PRETTY -package lang \ - -package util -package text +SRC_HC_OPTS += -cpp -DPKG_TOOL -DWANT_PRETTY + +ghc_ge_504 = $(shell if (test $(GhcCanonVersion) -ge 504); then echo YES; else echo NO; fi) + +ifeq "$(ghc_ge_504)" "NO" +SRC_HC_OPTS += -package lang -package util -package text +endif HS_PROG = ghc-pkg.bin INSTALL_LIBEXECS += $(HS_PROG) diff --git a/ghc/utils/ghc-pkg/Package.hs b/ghc/utils/ghc-pkg/Package.hs index b4df186..85855b7 100644 --- a/ghc/utils/ghc-pkg/Package.hs +++ b/ghc/utils/ghc-pkg/Package.hs @@ -1,5 +1,5 @@ ----------------------------------------------------------------------------- --- $Id: Package.hs,v 1.3 2002/06/12 22:04:27 wolfgang Exp $ +-- $Id: Package.hs,v 1.4 2002/09/09 11:32:38 simonmar Exp $ -- -- Package configuration defn. ----------------------------------------------------------------------------- @@ -17,8 +17,12 @@ module Package ( #endif #ifdef WANT_PRETTY +#if __GLASGOW_HASKELL__ >= 504 +import Text.PrettyPrint +#else import Pretty #endif +#endif data PackageConfig = Package {