[project @ 2002-09-09 11:32:37 by simonmar]
authorsimonmar <unknown>
Mon, 9 Sep 2002 11:32:38 +0000 (11:32 +0000)
committersimonmar <unknown>
Mon, 9 Sep 2002 11:32:38 +0000 (11:32 +0000)
Build without hslibs on GHC >= 5.04

ghc/utils/ghc-pkg/Main.hs
ghc/utils/ghc-pkg/Makefile
ghc/utils/ghc-pkg/Package.hs

index 538955c..afd1561 100644 (file)
@@ -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, 
index ba72ce1..896742e 100644 (file)
@@ -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)
index b4df186..85855b7 100644 (file)
@@ -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 {