summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
0f9750b)
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.
import Module ( Module )
import ListSetOps ( removeDupsEq )
import Module ( Module )
import ListSetOps ( removeDupsEq )
+import System.Directory ( doesFileExist )
import Monad ( when )
import IO
\end{code}
import Monad ( when )
import IO
\end{code}
outputForeignStubs :: DynFlags -> ForeignStubs
-> IO (Bool, -- Header file created
Bool) -- C file created
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
outputForeignStubs dflags (ForeignStubs h_code c_code _ _)
= do
dumpIfSet_dyn dflags Opt_D_dump_foreign