[project @ 2001-07-24 04:46:37 by ken]
[ghc-hetmet.git] / ghc / compiler / main / DriverFlags.hs
index 739e760..4943cd4 100644 (file)
@@ -1,7 +1,7 @@
 {-# OPTIONS -#include "hschooks.h" #-}
 
 -----------------------------------------------------------------------------
--- $Id: DriverFlags.hs,v 1.59 2001/06/15 08:29:58 simonpj Exp $
+-- $Id: DriverFlags.hs,v 1.62 2001/07/24 04:46:37 ken Exp $
 --
 -- Driver flags
 --
@@ -302,8 +302,19 @@ dynamic_flags = [
   ,  ( "opta",         HasArg (addOpt_a) )
 
        ------ HsCpp opts ---------------------------------------------------
+       -- With a C compiler whose system() doesn't use a UNIX shell (i.e.
+       -- mingwin gcc), -D and -U args must *not* be quoted, as the quotes
+       -- will be interpreted as part of the arguments, and not stripped;
+       -- on all other systems, quoting is necessary, to avoid interpretation
+       -- of shell metacharacters in the arguments (e.g. green-card's
+       -- -DBEGIN_GHC_ONLY='}-' trick).
+#ifndef mingw32_TARGET_OS
   ,  ( "D",            Prefix (\s -> addOpt_P ("-D'"++s++"'") ) )
   ,  ( "U",            Prefix (\s -> addOpt_P ("-U'"++s++"'") ) )
+#else
+  ,  ( "D",            Prefix (\s -> addOpt_P ("-D"++s) ) )
+  ,  ( "U",            Prefix (\s -> addOpt_P ("-U"++s) ) )
+#endif
 
        ------ Debugging ----------------------------------------------------
   ,  ( "dstg-stats",   NoArg (writeIORef v_StgStats True) )
@@ -461,7 +472,7 @@ buildStaticHscOpts = do
 
 machdepCCOpts 
    | prefixMatch "alpha"   cTARGETPLATFORM  
-       = return ( ["-static"], [] )
+       = return ( ["-static", "-Xlinker -noprefix_recognition"], [] )
 
    | prefixMatch "hppa"    cTARGETPLATFORM  
         -- ___HPUX_SOURCE, not _HPUX_SOURCE, is #defined if -ansi!