From: qrczak Date: Tue, 13 Feb 2001 15:53:10 +0000 (+0000) Subject: [project @ 2001-02-13 15:53:10 by qrczak] X-Git-Tag: Approximately_9120_patches~2645 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=443ecdbee2a43b79812fb22ce93337e1991f7200;p=ghc-hetmet.git [project @ 2001-02-13 15:53:10 by qrczak] Main.hs is not passed through cpp, so I moved #ifdefed defaultCompiler to module KludgedSystem which is passed through cpp. --- diff --git a/ghc/utils/hsc2hs/KludgedSystem.hs b/ghc/utils/hsc2hs/KludgedSystem.hs index a33d843..04bbd73 100644 --- a/ghc/utils/hsc2hs/KludgedSystem.hs +++ b/ghc/utils/hsc2hs/KludgedSystem.hs @@ -1,16 +1,21 @@ {-# 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 @@ -27,4 +32,7 @@ system cmd = do foreign import "_getpid" unsafe getProcessID :: IO Int +defaultCompiler :: String +defaultCompiler = "gcc -mno-cygwin" + #endif /* mingw32_TARGET_OS */ diff --git a/ghc/utils/hsc2hs/Main.hs b/ghc/utils/hsc2hs/Main.hs index c677e78..84ed204 100644 --- a/ghc/utils/hsc2hs/Main.hs +++ b/ghc/utils/hsc2hs/Main.hs @@ -1,5 +1,5 @@ ----------------------------------------------------------------------------- --- $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) -- @@ -13,7 +13,7 @@ import GetOpt import System (getProgName, getArgs, ExitCode(..), exitWith, exitFailure) -import KludgedSystem (system) +import KludgedSystem (system, defaultCompiler) import Directory (removeFile) import Parsec import ParsecError @@ -213,11 +213,7 @@ output flags name toks = let [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"