From: simonmar Date: Mon, 9 Sep 2002 11:39:43 +0000 (+0000) Subject: [project @ 2002-09-09 11:39:42 by simonmar] X-Git-Tag: Approx_11550_changesets_converted~1705 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=394d30831452e862f85e8ea6458351f56130f8ba;p=ghc-hetmet.git [project @ 2002-09-09 11:39:42 by simonmar] Build without hslibs on GHC >= 5.04 --- diff --git a/ghc/utils/hsc2hs/Main.hs b/ghc/utils/hsc2hs/Main.hs index ae71dc9..2527516 100644 --- a/ghc/utils/hsc2hs/Main.hs +++ b/ghc/utils/hsc2hs/Main.hs @@ -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) diff --git a/ghc/utils/hsc2hs/Makefile b/ghc/utils/hsc2hs/Makefile index 23a9b1f..033621d 100644 --- a/ghc/utils/hsc2hs/Makefile +++ b/ghc/utils/hsc2hs/Makefile @@ -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 '