From: rrt Date: Wed, 19 Jul 2000 10:07:29 +0000 (+0000) Subject: [project @ 2000-07-19 10:07:29 by rrt] X-Git-Tag: Approximately_9120_patches~3970 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=8239d074412691baee386950a377fdcc0dbb58aa;p=ghc-hetmet.git [project @ 2000-07-19 10:07:29 by rrt] Gave driver access to bash for running system calls under Windows by writing command out to a temp file, then sending that as the argument to "sh -". Sigh. This is #ifdefed on mingw32_TARGET_OS; saner OSs just use system as normal. --- diff --git a/ghc/driver/Main.hs b/ghc/driver/Main.hs index 7bcb9d0..45c5fee 100644 --- a/ghc/driver/Main.hs +++ b/ghc/driver/Main.hs @@ -1690,8 +1690,18 @@ run_something phase_name cmd unless n $ do -- and run it! +#ifndef mingw32_TARGET_OS exit_code <- system cmd `catchAllIO` (\e -> throwDyn (PhaseFailed phase_name (ExitFailure 1))) +#else + tmp <- newTempName "sh" + h <- openFile tmp WriteMode + hPutStrLn h cmd + hClose h + exit_code <- system ("sh - " ++ tmp) `catchAllIO` + (\e -> throwDyn (PhaseFailed phase_name (ExitFailure 1))) + removeFile tmp +#endif if exit_code /= ExitSuccess then throwDyn (PhaseFailed phase_name exit_code)