[project @ 2001-12-10 01:27:59 by sebc]
[ghc-hetmet.git] / ghc / compiler / main / DriverFlags.hs
index 65080f2..e4dd662 100644 (file)
@@ -1,7 +1,7 @@
 {-# OPTIONS -#include "hschooks.h" #-}
 
 -----------------------------------------------------------------------------
--- $Id: DriverFlags.hs,v 1.77 2001/10/26 00:53:27 sof Exp $
+-- $Id: DriverFlags.hs,v 1.81 2001/12/10 01:28:00 sebc Exp $
 --
 -- Driver flags
 --
@@ -22,7 +22,7 @@ module DriverFlags (
 
 import DriverState
 import DriverUtil
-import SysTools                ( setTmpDir, setPgm, setDryRun, showGhcUsage )
+import SysTools
 import CmdLineOpts
 import Config
 import Util
@@ -152,16 +152,15 @@ arg_ok (AnySuffixPred p _)  rest arg = p arg
 -- flags further down the list with the same prefix.
 
 static_flags = 
-  [  ------- help -------------------------------------------------------
-     ( "?"             , NoArg showGhcUsage)
-  ,  ( "-help"         , NoArg showGhcUsage)
-  
-
-      ------- version ----------------------------------------------------
-  ,  ( "-version"       , NoArg (do hPutStrLn stdout (cProjectName
+  [  ------- help / version ----------------------------------------------
+     ( "?"              , NoArg showGhcUsage)
+  ,  ( "-help"          , NoArg showGhcUsage)
+  ,  ( "-print-libdir"   , NoArg (do getTopDir >>= putStrLn
+                                    exitWith ExitSuccess))  
+  ,  ( "-version"       , NoArg (do putStrLn (cProjectName
                                      ++ ", version " ++ cProjectVersion)
                                     exitWith ExitSuccess))
-  ,  ( "-numeric-version", NoArg (do hPutStrLn stdout cProjectVersion
+  ,  ( "-numeric-version", NoArg (do putStrLn cProjectVersion
                                     exitWith ExitSuccess))
 
       ------- verbosity ----------------------------------------------------
@@ -222,7 +221,10 @@ static_flags =
   ,  ( "keep-hc-file"   , AnySuffix (\_ -> writeIORef v_Keep_hc_files True) )
   ,  ( "keep-s-file"    , AnySuffix (\_ -> writeIORef v_Keep_s_files  True) )
   ,  ( "keep-raw-s-file", AnySuffix (\_ -> writeIORef v_Keep_raw_s_files  True) )
+#ifdef ILX
   ,  ( "keep-il-file"   , AnySuffix (\_ -> writeIORef v_Keep_il_files True) )
+  ,  ( "keep-ilx-file"  , AnySuffix (\_ -> writeIORef v_Keep_ilx_files True) )
+#endif
   ,  ( "keep-tmp-files" , AnySuffix (\_ -> writeIORef v_Keep_tmp_files True) )
 
   ,  ( "split-objs"    , NoArg (if can_split
@@ -533,6 +535,9 @@ machdepCCOpts
        -- register used for global register variable", we simply
        -- disable all warnings altogether using the -w flag. Oh well.
 
+   | prefixMatch "powerpc-apple-darwin" cTARGETPLATFORM
+       = return ( ["-no-cpp-precomp"], [""] )
+
    | prefixMatch "powerpc" cTARGETPLATFORM || prefixMatch "rs6000" cTARGETPLATFORM
        = return ( ["-static"], ["-finhibit-size-directive"] )