From: simonmar Date: Thu, 6 May 2004 08:53:01 +0000 (+0000) Subject: [project @ 2004-05-06 08:53:01 by simonmar] X-Git-Tag: Initial_conversion_from_CVS_complete~1869 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=44a55ce31d8edd1a0424778fc52e6d55fffe910a;p=ghc-hetmet.git [project @ 2004-05-06 08:53:01 by simonmar] Make this work with GHC 5.04.x, by slurping in rawSystem from the libraries. --- diff --git a/ghc/utils/runghc/Makefile b/ghc/utils/runghc/Makefile index 5792902..dd643db 100644 --- a/ghc/utils/runghc/Makefile +++ b/ghc/utils/runghc/Makefile @@ -4,4 +4,7 @@ include $(TOP)/mk/boilerplate.mk HS_PROG = runghc INSTALL_PROGS += $(HS_PROG) +UseGhcForCc = YES +SRC_MKDEPENDC_OPTS += -I$(GHC_INCLUDE_DIR) + include $(TOP)/mk/target.mk diff --git a/ghc/utils/runghc/rawSystem.c b/ghc/utils/runghc/rawSystem.c new file mode 100644 index 0000000..f35ace3 --- /dev/null +++ b/ghc/utils/runghc/rawSystem.c @@ -0,0 +1,6 @@ +/* Grab rawSystem from the library sources iff we're bootstrapping with an + * old version of GHC. + */ +#if __GLASGOW_HASKELL__ < 601 +#include "../../../libraries/base/cbits/rawSystem.c" +#endif diff --git a/ghc/utils/runghc/runghc.hs b/ghc/utils/runghc/runghc.hs index a79f411..8adf9e9 100644 --- a/ghc/utils/runghc/runghc.hs +++ b/ghc/utils/runghc/runghc.hs @@ -1,4 +1,4 @@ -{-# OPTIONS -cpp #-} +{-# OPTIONS -cpp -fffi #-} #include "config.h" ----------------------------------------------------------------------------- -- @@ -20,12 +20,18 @@ module Main where import System.Environment import System.IO -import System.Cmd import Data.List import System.Directory import System.Exit import Data.Char +#if __GLASGOW_HASKELL__ < 603 +import Foreign ( withMany, withArray0, nullPtr, Ptr ) +import Foreign.C ( CString, withCString, throwErrnoIfMinus1 ) +#else +import System.Cmd ( rawSystem ) +#endif + main = do args <- getArgs case args of @@ -77,3 +83,6 @@ die msg = do hPutStr stderr msg; exitWith (ExitFailure 1) dieProg :: String -> IO a dieProg msg = do p <- getProgName; die (p ++ ": " ++ msg) +#if __GLASGOW_HASKELL__ < 603 +#include "../../../libraries/base/System/RawSystem.hs-inc" +#endif