-----------------------------------------------------------------------------
--- $Id: DriverFlags.hs,v 1.127 2003/10/09 11:58:56 simonpj Exp $
--
-- Driver flags
--
--- (c) Simon Marlow 2000
+-- (c) The University of Glasgow 2000-2003
--
-----------------------------------------------------------------------------
if rest /= ""
then fio rest >> return args
else case args of
- [] -> unknownFlagErr dash_arg
+ [] -> missingArgErr dash_arg
(arg1:args1) -> fio arg1 >> return args1
SepArg fio ->
, ( "smp" , NoArg (addNoDups v_Ways WaySMP) )
, ( "debug" , NoArg (addNoDups v_Ways WayDebug) )
, ( "ndp" , NoArg (addNoDups v_Ways WayNDP) )
+ , ( "threaded" , NoArg (addNoDups v_Ways WayThreaded) )
-- ToDo: user ways
+ ------ RTS ways -----------------------------------------------------
+
------ Debugging ----------------------------------------------------
, ( "dppr-noprags", PassFlag (add v_Opt_C) )
, ( "dppr-debug", PassFlag (add v_Opt_C) )
then do writeIORef v_Split_object_files True
add v_Opt_C "-fglobalise-toplev-names"
else hPutStrLn stderr
- "warning: don't know how to split \
- \object files on this architecture"
+ "warning: don't know how to split object files on this architecture"
) )
------- Include/Import Paths ----------------------------------------
- , ( "i" , OptPrefix (addToDirList v_Import_paths) )
+ , ( "i" , OptPrefix (addToOrDeleteDirList v_Import_paths) )
, ( "I" , Prefix (addToDirList v_Include_paths) )
------- Libraries ---------------------------------------------------
------- Specific phases --------------------------------------------
, ( "pgmL" , HasArg setPgmL )
, ( "pgmP" , HasArg setPgmP )
- , ( "pgmP" , HasArg setPgmP )
, ( "pgmF" , HasArg setPgmF )
, ( "pgmc" , HasArg setPgmc )
, ( "pgmm" , HasArg setPgmm )
, ( "pgms" , HasArg setPgms )
, ( "pgma" , HasArg setPgma )
, ( "pgml" , HasArg setPgml )
+ , ( "pgmdll" , HasArg setPgmDLL )
#ifdef ILX
, ( "pgmI" , HasArg setPgmI )
, ( "pgmi" , HasArg setPgmi )
( "allow-incoherent-instances", Opt_AllowIncoherentInstances ),
( "generics", Opt_Generics ),
( "strictness", Opt_Strictness ),
+ ( "full-laziness", Opt_FullLaziness ),
( "cse", Opt_CSE ),
( "ignore-interface-pragmas", Opt_IgnoreInterfacePragmas ),
( "omit-interface-pragmas", Opt_OmitInterfacePragmas ),
-- This is completely optional.
= return ( ["-no-cpp-precomp","-mdynamic-no-pic"], [] )
- | prefixMatch "powerpc" cTARGETPLATFORM || prefixMatch "rs6000" cTARGETPLATFORM
- = return ( ["-static"], ["-finhibit-size-directive"] )
-
| otherwise
= return ( [], [] )
addCmdlineHCInclude a = updDynFlags (\s -> s{cmdlineHcIncludes = a : cmdlineHcIncludes s})
+-- -----------------------------------------------------------------------------
+-- Version and usage messages
+
showVersion :: IO ()
showVersion = do
putStrLn (cProjectName ++ ", version " ++ cProjectVersion)
exitWith ExitSuccess
+
+showGhcUsage = do
+ (ghc_usage_path,ghci_usage_path) <- getUsageMsgPaths
+ mode <- readIORef v_GhcMode
+ let usage_path
+ | mode == DoInteractive = ghci_usage_path
+ | otherwise = ghc_usage_path
+ usage <- readFile usage_path
+ dump usage
+ exitWith ExitSuccess
+ where
+ dump "" = return ()
+ dump ('$':'$':s) = hPutStr stderr progName >> dump s
+ dump (c:s) = hPutChar stderr c >> dump s