From 980f56ed05fe6665e73d130cc99de6390095c2d7 Mon Sep 17 00:00:00 2001 From: simonmar Date: Thu, 11 Nov 2004 09:46:57 +0000 Subject: [PATCH] [project @ 2004-11-11 09:46:54 by simonmar] Get rawSystem from Compat.RawSystem in libghccompat. --- ghc/compiler/Makefile | 10 +++++++++- ghc/compiler/main/SysTools.lhs | 16 ++-------------- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/ghc/compiler/Makefile b/ghc/compiler/Makefile index 6169091..1cf49d9 100644 --- a/ghc/compiler/Makefile +++ b/ghc/compiler/Makefile @@ -235,7 +235,7 @@ CLEAN_FILES += $(CONFIG_HS) ALL_DIRS = \ utils basicTypes types hsSyn prelude rename typecheck deSugar coreSyn \ specialise simplCore stranal stgSyn simplStg codeGen main \ - profiling parser cprAnalysis compMan ndpFlatten cbits iface cmm + profiling parser cprAnalysis compMan ndpFlatten iface cmm # Make sure we include Config.hs even if it doesn't exist yet... ALL_SRCS += $(CONFIG_HS) @@ -507,6 +507,14 @@ primop-usage.hs-incl: prelude/primops.txt #----------------------------------------------------------------------------- # Linking +# Include libghccompat in stage1. In stage2 onwards, all these libraries +# will be available from the main libraries. +ifeq "$(stage)" "1" +SRC_HC_OPTS += -i$(GHC_LIB_COMPAT_DIR) +SRC_LD_OPTS += -L$(GHC_LIB_COMPAT_DIR) -lghccompat +SRC_MKDEPENDHS_OPTS += -optdep--exclude-module=Compat.RawSystem +endif + SRC_LD_OPTS += -no-link-chk # ----------------------------------------------------------------------------- diff --git a/ghc/compiler/main/SysTools.lhs b/ghc/compiler/main/SysTools.lhs index f673c98..06850ef 100644 --- a/ghc/compiler/main/SysTools.lhs +++ b/ghc/compiler/main/SysTools.lhs @@ -106,8 +106,8 @@ import CString ( CString, peekCString ) #endif #if __GLASGOW_HASKELL__ < 603 -import Foreign ( withMany, withArray0, nullPtr, Ptr ) -import CForeign ( CString, withCString, throwErrnoIfMinus1 ) +-- rawSystem comes from libghccompat.a in stage1 +import Compat.RawSystem ( rawSystem ) #else import System.Cmd ( rawSystem ) #endif @@ -774,18 +774,6 @@ traceCmd phase_name cmd_line action handle_exn verb exn = do { when (verb >= 2) (hPutStr stderr "\n") ; when (verb >= 3) (hPutStrLn stderr ("Failed: " ++ cmd_line ++ (show exn))) ; throwDyn (PhaseFailed phase_name (ExitFailure 1)) } - --- ----------------------------------------------------------------------------- --- rawSystem: run an external command --- --- In GHC 6.2.1 there's a correct implementation of rawSystem in the --- library System.Cmd. If we are compiling with an earlier version of --- GHC than this, we'd better have a copy of the correct implementation --- right here. - -#if __GLASGOW_HASKELL__ < 603 -#include "../../libraries/base/System/RawSystem.hs-inc" -#endif \end{code} -- 1.7.10.4