[project @ 2001-08-16 11:06:10 by simonmar]
[ghc-hetmet.git] / ghc / compiler / main / DriverUtil.hs
index e0141ce..264be5c 100644 (file)
@@ -1,5 +1,5 @@
 -----------------------------------------------------------------------------
--- $Id: DriverUtil.hs,v 1.25 2001/06/27 10:14:13 rrt Exp $
+-- $Id: DriverUtil.hs,v 1.27 2001/08/16 11:06:10 simonmar Exp $
 --
 -- Utils for the driver
 --
@@ -14,6 +14,7 @@ module DriverUtil where
 
 import Util
 import Panic
+import Config          ( cLeadingUnderscore )
 
 import IOExts
 import Exception
@@ -60,12 +61,19 @@ optionRegex = mkRegex "\\{-#[ \t]+OPTIONS[ \t]+(.*)#-\\}"   -- -}
 
 softGetDirectoryContents d
    = IO.catch (getDirectoryContents d)
-         (\_ -> do hPutStr stderr 
+         (\_ -> do hPutStrLn stderr 
                          ("WARNING: error while reading directory " ++ d)
                    return []
          )
 
 -----------------------------------------------------------------------------
+-- Prefixing underscore to linker-level names
+prefixUnderscore :: String -> String
+prefixUnderscore
+ | cLeadingUnderscore == "YES" = ('_':)
+ | otherwise                   = id
+
+-----------------------------------------------------------------------------
 -- Utils
 
 unknownFlagErr :: String -> a