{-# OPTIONS -cpp -fglasgow-exts #-}
-----------------------------------------------------------------------------
--- $Id: KludgedSystem.hs,v 1.1 2001/02/10 10:43:25 qrczak Exp $
+-- $Id: KludgedSystem.hs,v 1.2 2001/02/13 15:53:10 qrczak Exp $
-- system that works feasibly under Windows (i.e. passes the command line to sh,
-- because system() under Windows doesn't look at SHELL, and always uses CMD.EXE)
-module KludgedSystem (system) where
+module KludgedSystem (system, defaultCompiler) where
#include "../../includes/config.h"
#ifndef mingw32_TARGET_OS
+
import System (system)
+
+defaultCompiler :: String
+defaultCompiler = "gcc"
+
#else
import qualified System
foreign import "_getpid" unsafe getProcessID :: IO Int
+defaultCompiler :: String
+defaultCompiler = "gcc -mno-cygwin"
+
#endif /* mingw32_TARGET_OS */
-----------------------------------------------------------------------------
--- $Id: Main.hs,v 1.18 2001/02/13 15:09:02 rrt Exp $
+-- $Id: Main.hs,v 1.19 2001/02/13 15:53:10 qrczak Exp $
--
-- (originally "GlueHsc.hs" by Marcin 'Qrczak' Kowalczyk)
--
import GetOpt
import System (getProgName, getArgs, ExitCode(..), exitWith, exitFailure)
-import KludgedSystem (system)
+import KludgedSystem (system, defaultCompiler)
import Directory (removeFile)
import Parsec
import ParsecError
[c] -> return c
_ -> onlyOne "compiler"
linker <- case [l | Linker l <- flags] of
-#ifndef mingw32_TARGET_OS
- [] -> return "gcc"
-#else
- [] -> return "gcc -mno-cygwin"
-#endif
+ [] -> return defaultCompiler
[l] -> return l
_ -> onlyOne "linker"