From e85530a315276826e6552611d400b6e969828ca7 Mon Sep 17 00:00:00 2001 From: malcolm Date: Thu, 6 Jan 2005 14:54:17 +0000 Subject: [PATCH] [project @ 2005-01-06 14:54:15 by malcolm] When built as a ghc utility, Compat.RawSystem is always available. When built as an nhc98 utility, -DBUILD_NHC symbol allows for getting the best otherwise-available version of rawSystem. --- ghc/utils/hsc2hs/Main.hs | 6 ++++-- ghc/utils/hsc2hs/Makefile.nhc98 | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ghc/utils/hsc2hs/Main.hs b/ghc/utils/hsc2hs/Main.hs index b93728b..aefd3f2 100644 --- a/ghc/utils/hsc2hs/Main.hs +++ b/ghc/utils/hsc2hs/Main.hs @@ -1,7 +1,7 @@ {-# OPTIONS -fffi -cpp #-} ------------------------------------------------------------------------ --- $Id: Main.hs,v 1.64 2005/01/06 10:44:14 malcolm Exp $ +-- $Id: Main.hs,v 1.65 2005/01/06 14:54:15 malcolm 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. @@ -34,10 +34,12 @@ import CString #endif -#if __GLASGOW_HASKELL__ >= 603 +#if defined(__GLASGOW_HASKELL__) && !defined(BUILD_NHC) import Compat.RawSystem ( rawSystem ) #elif __HUGS__ || __NHC__ >= 117 || __GLASGOW_HASKELL__ >= 600 import System.Cmd ( rawSystem ) +#elif BUILD_NHC && __GLASGOW_HASKELL__ >= 603 +import Compat.RawSystem ( rawSystem ) #else rawSystem prog args = system (prog++" "++unwords args) #endif diff --git a/ghc/utils/hsc2hs/Makefile.nhc98 b/ghc/utils/hsc2hs/Makefile.nhc98 index a6879cb..d853584 100644 --- a/ghc/utils/hsc2hs/Makefile.nhc98 +++ b/ghc/utils/hsc2hs/Makefile.nhc98 @@ -33,7 +33,7 @@ realclean: clean cleanC -rm -f $(OBJDIR)/Main$(EXE) $(TARGET): $(OBJDIR) $(SRCS) - $(HMAKE) -hc=$(HC) Main -d$(OBJDIR) \ + $(HMAKE) -hc=$(HC) Main -d$(OBJDIR) -DBUILD_NHC \ $(shell echo "${BUILDOPTS}") $(HFLAGS) mv $(OBJDIR)/Main$(EXE) $(TARGET) $(STRIP) $(TARGET) -- 1.7.10.4