1 {-# OPTIONS -cpp -fglasgow-exts #-}
2 -----------------------------------------------------------------------------
3 -- $Id: KludgedSystem.hs,v 1.2 2001/02/13 15:53:10 qrczak Exp $
5 -- system that works feasibly under Windows (i.e. passes the command line to sh,
6 -- because system() under Windows doesn't look at SHELL, and always uses CMD.EXE)
8 module KludgedSystem (system, defaultCompiler) where
10 #include "../../includes/config.h"
12 #ifndef mingw32_TARGET_OS
14 import System (system)
16 defaultCompiler :: String
17 defaultCompiler = "gcc"
21 import qualified System
22 import System (ExitCode)
24 import Directory (removeFile)
26 system :: String -> IO ExitCode
29 let tmp = "/tmp/sh"++show pid
30 writeFile tmp (cmd++"\n")
31 bracket_ (return tmp) removeFile $ System.system ("sh - "++tmp)
33 foreign import "_getpid" unsafe getProcessID :: IO Int
35 defaultCompiler :: String
36 defaultCompiler = "gcc -mno-cygwin"
38 #endif /* mingw32_TARGET_OS */