-----------------------------------------------------------------------------
--- $Id: DriverUtil.hs,v 1.24 2001/06/14 12:50:06 simonpj Exp $
+-- $Id: DriverUtil.hs,v 1.26 2001/07/23 20:19:53 sof Exp $
--
-- Utils for the driver
--
import Util
import Panic
+import Config ( cLeadingUnderscore )
import IOExts
import Exception
-> IO [String] -- options, if any
getOptionsFromSource file
= do h <- openFile file ReadMode
- catchJust ioErrors (look h)
+ catchJust ioErrors (look h `finally` hClose h)
(\e -> if isEOFError e then return [] else ioError e)
where
look h = do
)
-----------------------------------------------------------------------------
+-- Prefixing underscore to linker-level names
+prefixUnderscore :: String -> String
+prefixUnderscore
+ | cLeadingUnderscore == "YES" = ('_':)
+ | otherwise = id
+
+-----------------------------------------------------------------------------
-- Utils
unknownFlagErr :: String -> a