------------------------------------------------------------------------
--- $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.
--
-- 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)
# -----------------------------------------------------------------------------
-# $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
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>'