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

ghc/utils/hsc2hs/Main.hs
ghc/utils/hsc2hs/Makefile

index ae71dc9..2527516 100644 (file)
@@ -1,5 +1,5 @@
 ------------------------------------------------------------------------
--- $Id: Main.hs,v 1.39 2002/05/29 22:32:49 sof Exp $
+-- $Id: Main.hs,v 1.40 2002/09/09 11:39:42 simonmar Exp $
 --
 -- Program for converting .hsc files to .hs files, by converting the
 -- file into a C program which is run to generate the Haskell source.
@@ -9,7 +9,12 @@
 --
 -- See the documentation in the Users' Guide for more details.
 
+#if __GLASGOW_HASKELL__ >= 504
+import System.Console.GetOpt
+#else
 import GetOpt
+#endif
+
 import Config
 import System        (getProgName, getArgs, ExitCode(..), exitWith, exitFailure, system)
 import Directory     (removeFile)
index 23a9b1f..033621d 100644 (file)
@@ -1,5 +1,5 @@
 # -----------------------------------------------------------------------------
-# $Id: Makefile,v 1.33 2002/05/29 22:32:50 sof Exp $
+# $Id: Makefile,v 1.34 2002/09/09 11:39:43 simonmar Exp $
 
 TOP=../..
 include $(TOP)/mk/boilerplate.mk
@@ -17,7 +17,13 @@ ifeq "$(HOSTPLATFORM)" "i386-unknown-cygwinw32"
 HS_PROG           = hsc2hs$(exeext)
 endif
 
-SRC_HC_OPTS      += -package util -cpp
+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 util
+endif
+
+SRC_HC_OPTS      += -cpp
 
 ifeq "$(HOSTPLATFORM)" "i386-unknown-mingw32"
 SRC_HC_OPTS      += -package win32 '-\#include <process.h>'