[project @ 2002-12-12 17:36:16 by simonmar]
[ghc-hetmet.git] / ghc / compiler / main / DriverFlags.hs
index cf039d9..9813c82 100644 (file)
@@ -1,5 +1,5 @@
 -----------------------------------------------------------------------------
--- $Id: DriverFlags.hs,v 1.103 2002/10/11 16:45:17 simonpj Exp $
+-- $Id: DriverFlags.hs,v 1.107 2002/12/12 17:36:18 simonmar Exp $
 --
 -- Driver flags
 --
@@ -229,7 +229,7 @@ static_flags =
        ------- Output Redirection ------------------------------------------
   ,  ( "odir"          , HasArg (writeIORef v_Output_dir  . Just) )
   ,  ( "o"             , SepArg (writeIORef v_Output_file . Just) )
-  ,  ( "osuf"          , HasArg (writeIORef v_Object_suf  . Just) )
+  ,  ( "osuf"          , HasArg (writeIORef v_Object_suf) )
   ,  ( "hcsuf"         , HasArg (writeIORef v_HC_suf      . Just) )
   ,  ( "hisuf"         , HasArg (writeIORef v_Hi_suf) )
   ,  ( "hidir"         , HasArg (writeIORef v_Hi_dir . Just) )
@@ -261,7 +261,7 @@ static_flags =
 
        ------- Libraries ---------------------------------------------------
   ,  ( "L"             , Prefix (addToDirList v_Library_paths) )
-  ,  ( "l"             , Prefix (add v_Cmdline_libraries) )
+  ,  ( "l"             , AnySuffix (\s -> add v_Opt_l s >> add v_Opt_dll s) )
 
 #ifdef darwin_TARGET_OS
        ------- Frameworks --------------------------------------------------
@@ -424,6 +424,7 @@ dynamic_flags = [
 
        ------ Warning opts -------------------------------------------------
   ,  ( "W"             , NoArg (mapM_ setDynFlag   minusWOpts)    )
+  ,  ( "Werror"                , NoArg (setDynFlag         Opt_WarnIsError) )
   ,  ( "Wall"          , NoArg (mapM_ setDynFlag   minusWallOpts) )
   ,  ( "Wnot"          , NoArg (mapM_ unSetDynFlag minusWallOpts) ) /* DEPREC */
   ,  ( "w"             , NoArg (mapM_ unSetDynFlag minusWallOpts) )
@@ -598,7 +599,15 @@ machdepCCOpts
        -- disable all warnings altogether using the -w flag. Oh well.
 
    | prefixMatch "powerpc-apple-darwin" cTARGETPLATFORM
-       = return ( ["-no-cpp-precomp"], [""] )
+      -- -no-cpp-precomp:
+      --     Disable Apple's precompiling preprocessor. It's a great thing
+      --     for "normal" programs, but it doesn't support register variable
+      --     declarations.
+      -- -mdynamic-no-pic:
+      --     As we don't support haskell code in shared libraries anyway,
+      --     we might as well turn of PIC code generation and save space and time.
+      --     This is completely optional.
+       = return ( ["-no-cpp-precomp","-mdynamic-no-pic"], [] )
 
    | prefixMatch "powerpc" cTARGETPLATFORM || prefixMatch "rs6000" cTARGETPLATFORM
        = return ( ["-static"], ["-finhibit-size-directive"] )