-----------------------------------------------------------------------------
--- $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
-----------------------------------------------------------------------------
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,
# -----------------------------------------------------------------------------
-# $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
# -----------------------------------------------------------------------------
# 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)
-----------------------------------------------------------------------------
--- $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.
-----------------------------------------------------------------------------
#endif
#ifdef WANT_PRETTY
+#if __GLASGOW_HASKELL__ >= 504
+import Text.PrettyPrint
+#else
import Pretty
#endif
+#endif
data PackageConfig
= Package {