Commit ee8ca7bf authored by Duncan Coutts's avatar Duncan Coutts
Browse files

Specify a temp output file for the header/lib checks

Otherwise we litter the current dir with a.out and *.o files.
parent 52f3c481
......@@ -725,12 +725,13 @@ checkForeignDeps pkg lbi verbosity = do
builds program args = do
tempDir <- getTemporaryDirectory
withTempFile tempDir ".c" $ \fname hd ->
do
hPutStrLn hd program
hClose hd
withTempFile tempDir ".c" $ \cName cHnd ->
withTempFile tempDir "" $ \oNname oHnd -> do
hPutStrLn cHnd program
hClose cHnd
hClose oHnd
rawSystemProgramStdoutConf verbosity
gccProgram (withPrograms lbi) (fname:args)
gccProgram (withPrograms lbi) (cName:"-o":oNname:args)
return True
`catchIO` (\_ -> return False)
`catchExit` (\_ -> return False)
......
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