[project @ 2001-04-02 16:10:05 by rrt]
authorrrt <unknown>
Mon, 2 Apr 2001 16:10:05 +0000 (16:10 +0000)
committerrrt <unknown>
Mon, 2 Apr 2001 16:10:05 +0000 (16:10 +0000)
Add .exe to progName on Windows.

ghc/utils/hsc2hs/KludgedSystem.hs
ghc/utils/hsc2hs/Main.hs

index 6f160d7..4036df6 100644 (file)
@@ -1,11 +1,11 @@
 {-# OPTIONS -cpp -fglasgow-exts #-}
 -----------------------------------------------------------------------------
--- $Id: KludgedSystem.hs,v 1.5 2001/03/27 16:33:17 rrt Exp $
+-- $Id: KludgedSystem.hs,v 1.6 2001/04/02 16:10:05 rrt 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, defaultCompiler) where
+module KludgedSystem (system, defaultCompiler, progNameSuffix) where
 
 #include "../../includes/config.h"
 
@@ -15,6 +15,7 @@ import System (system)
 
 defaultCompiler :: String
 defaultCompiler = "gcc"
+progNameSuffix = ""
 
 #else
 
@@ -35,5 +36,6 @@ foreign import "_getpid" unsafe getProcessID :: IO Int
 
 defaultCompiler :: String
 defaultCompiler = "gcc -mno-cygwin -mwin32"
+progNameSuffix = ".exe"
 
 #endif /* mingw32_TARGET_OS */
index b888f33..4827905 100644 (file)
@@ -1,5 +1,5 @@
 ------------------------------------------------------------------------
--- $Id: Main.hs,v 1.29 2001/03/29 17:56:18 qrczak Exp $
+-- $Id: Main.hs,v 1.30 2001/04/02 16:10:05 rrt Exp $
 --
 -- Program for converting .hsc files to .hs files, by converting the
 -- file into a C program which is run to generate the Haskell source.
@@ -11,7 +11,7 @@
 
 import GetOpt
 import System        (getProgName, getArgs, ExitCode(..), exitWith, exitFailure)
-import KludgedSystem (system, defaultCompiler)
+import KludgedSystem
 import Directory     (removeFile)
 import Monad         (MonadPlus(..), liftM, liftM2, when, unless)
 import Char          (isAlpha, isAlphaNum, isSpace, isDigit, toUpper, intToDigit, ord)
@@ -430,7 +430,7 @@ output flags name toks = do
     
     let cProgName    = outDir++outBase++"_hsc_make.c"
         oProgName    = outDir++outBase++"_hsc_make.o"
-        progName     = outDir++outBase++"_hsc_make"
+        progName     = outDir++outBase++"_hsc_make" ++ progNameSuffix
         outHName     = outDir++outBase++"_hsc.h"
         outCName     = outDir++outBase++"_hsc.c"