[project @ 2000-11-17 13:33:17 by sewardj]
[ghc-hetmet.git] / ghc / compiler / main / DriverUtil.hs
index 9a92b83..a8dd667 100644 (file)
@@ -1,5 +1,5 @@
 -----------------------------------------------------------------------------
--- $Id: DriverUtil.hs,v 1.5 2000/10/27 13:50:25 sewardj Exp $
+-- $Id: DriverUtil.hs,v 1.8 2000/11/17 13:33:17 sewardj Exp $
 --
 -- Utils for the driver
 --
@@ -42,8 +42,6 @@ long_usage = do
      dump ('$':'$':s) = hPutStr stderr get_prog_name >> dump s
      dump (c:s) = hPutChar stderr c >> dump s
 
-version_str = cProjectVersion
-
 data BarfKind
   = PhaseFailed String ExitCode
   | Interrupted
@@ -72,6 +70,7 @@ instance Typeable BarfKind where
 
 -----------------------------------------------------------------------------
 -- Reading OPTIONS pragmas
+
 getOptionsFromSource 
        :: String               -- input file
        -> IO [String]          -- options, if any
@@ -137,6 +136,13 @@ splitFilename f = (reverse (stripDot rev_basename), reverse rev_ext)
         stripDot ('.':xs) = xs
         stripDot xs       = xs
 
+-- "foo/bar/xyzzy.ext" -> ("foo/bar", "xyzzy", ".ext")
+splitFilename3 :: String -> (String,String,String)
+splitFilename3 str
+   = let dir = getdir str
+         (name, ext) = splitFilename (drop (length dir) str)
+     in  (dir, name, ext)
+
 remove_suffix :: Char -> String -> String
 remove_suffix c s
   | null pre  = reverse suf
@@ -164,10 +170,3 @@ newdir dir s = dir ++ '/':drop_longest_prefix s '/'
 
 remove_spaces :: String -> String
 remove_spaces = reverse . dropWhile isSpace . reverse . dropWhile isSpace
-
-booter_version
- = case "\ 
-       \ __GLASGOW_HASKELL__" of
-    ' ':n:ns -> n:'.':ns
-    ' ':m    -> m
-