diff options
author | krc <unknown> | 2003-08-19 22:03:04 +0000 |
---|---|---|
committer | krc <unknown> | 2003-08-19 22:03:04 +0000 |
commit | 5c15e80ba77d4e30a84578df95ad32e471b0ff8c (patch) | |
tree | f24f5bb0a2bd7b582cb86ae556293f9d62bec001 /ghc | |
parent | 0f9750be555082f42ac65a5e8029947bf23fc9e2 (diff) | |
download | haskell-5c15e80ba77d4e30a84578df95ad32e471b0ff8c.tar.gz |
[project @ 2003-08-19 22:03:04 by krc]
Changed outputForeignStubs to check whether stub files from a previous
compilation still exist (in the case where no new stubs exist). This is
necessary to compile External Core programs that require these stubs.
Diffstat (limited to 'ghc')
-rw-r--r-- | ghc/compiler/main/CodeOutput.lhs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/ghc/compiler/main/CodeOutput.lhs b/ghc/compiler/main/CodeOutput.lhs index 14fbb0b3a2..5e9e7e5bef 100644 --- a/ghc/compiler/main/CodeOutput.lhs +++ b/ghc/compiler/main/CodeOutput.lhs @@ -37,6 +37,7 @@ import Pretty ( Mode(..), printDoc ) import Module ( Module ) import ListSetOps ( removeDupsEq ) +import System.Directory ( doesFileExist ) import Monad ( when ) import IO \end{code} @@ -220,7 +221,12 @@ outputIlx dflags filename mod tycons stg_binds outputForeignStubs :: DynFlags -> ForeignStubs -> IO (Bool, -- Header file created Bool) -- C file created -outputForeignStubs dflags NoStubs = return (False, False) +outputForeignStubs dflags NoStubs = do +-- When compiling External Core files, may need to use stub files from a +-- previous compilation + hFileExists <- doesFileExist (hscStubHOutName dflags) + cFileExists <- doesFileExist (hscStubCOutName dflags) + return (hFileExists, cFileExists) outputForeignStubs dflags (ForeignStubs h_code c_code _ _) = do dumpIfSet_dyn dflags Opt_D_dump_foreign |