Commit 6e64c691 authored by krasimir's avatar krasimir
Browse files

[project @ 2005-10-30 19:12:31 by krasimir]

Change the way in which the .exe suffix to the output file is added. The reason
is that "-o main" will generate main.exe on Windows while the doesFileExists "main"
in DriverPipeline.link will return False.
parent 57d26da8
...@@ -1205,7 +1205,14 @@ staticLink dflags o_files dep_packages = do ...@@ -1205,7 +1205,14 @@ staticLink dflags o_files dep_packages = do
exeFileName :: DynFlags -> FilePath exeFileName :: DynFlags -> FilePath
exeFileName dflags exeFileName dflags
| Just s <- outputFile dflags = s | Just s <- outputFile dflags =
#if defined(mingw32_HOST_OS)
if null (suffixOf s)
then s `joinFileExt` "exe"
else s
#else
s
#endif
| otherwise = | otherwise =
#if defined(mingw32_HOST_OS) #if defined(mingw32_HOST_OS)
"main.exe" "main.exe"
......
...@@ -365,11 +365,7 @@ guessOutputFile s = modifySession s $ \env -> ...@@ -365,11 +365,7 @@ guessOutputFile s = modifySession s $ \env ->
let isMain = (== mainModIs dflags) . ms_mod let isMain = (== mainModIs dflags) . ms_mod
[ms] <- return (filter isMain mod_graph) [ms] <- return (filter isMain mod_graph)
ml_hs_file (ms_location ms) ml_hs_file (ms_location ms)
#if defined(mingw32_HOST_OS)
guessedName = fmap (\fname -> basenameOf fname `joinFileExt` "exe") mainModuleSrcPath
#else
guessedName = fmap basenameOf mainModuleSrcPath guessedName = fmap basenameOf mainModuleSrcPath
#endif
in in
case outputFile dflags of case outputFile dflags of
Just _ -> env Just _ -> env
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment