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

ghc/utils/genprimopcode/Main.hs
ghc/utils/genprimopcode/Makefile

index f9306fb..49d3921 100644 (file)
@@ -1,11 +1,16 @@
-
+{-# OPTIONS -cpp #-}
 ------------------------------------------------------------------
 -- A primop-table mangling program                              --
 ------------------------------------------------------------------
 
 module Main where
 
+#if __GLASGOW_HASKELL__ >= 504
+import Text.ParserCombinators.Parsec
+#else
 import Parsec
+#endif
+
 import Monad
 import Char
 import List
index f160024..8c3da0f 100644 (file)
@@ -1,11 +1,16 @@
 # -----------------------------------------------------------------------------
-# $Id: Makefile,v 1.7 2001/08/08 13:21:04 qrczak Exp $
+# $Id: Makefile,v 1.8 2002/09/09 11:44:13 simonmar Exp $
 
 TOP=../..
 include $(TOP)/mk/boilerplate.mk
 
 HS_PROG        = genprimopcode
-SRC_HC_OPTS   += -syslib text
+
+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 text
+endif
 
 # genprimopcode is needed to boot in ghc/compiler...
 ifneq "$(BootingFromHc)" "YES"