-{-# OPTIONS -#include "hschooks.h" #-}
-
-----------------------------------------------------------------------------
--- $Id: DriverFlags.hs,v 1.89 2002/03/15 13:57:31 simonmar Exp $
+-- $Id: DriverFlags.hs,v 1.100 2002/08/02 12:24:04 simonmar Exp $
--
-- Driver flags
--
arg_ok (NoArg _) rest arg = null rest
arg_ok (HasArg _) rest arg = True
arg_ok (SepArg _) rest arg = null rest
-arg_ok (Prefix _) rest arg = not (null rest)
-arg_ok (PrefixPred p _) rest arg = not (null rest) && p rest
+arg_ok (Prefix _) rest arg = notNull rest
+arg_ok (PrefixPred p _) rest arg = notNull rest && p rest
arg_ok (OptPrefix _) rest arg = True
arg_ok (PassFlag _) rest arg = null rest
arg_ok (AnySuffix _) rest arg = True
, ( "L" , Prefix (addToDirList v_Library_paths) )
, ( "l" , Prefix (add v_Cmdline_libraries) )
+#ifdef darwin_TARGET_OS
+ ------- Frameworks --------------------------------------------------
+ -- -framework-path should really be -F ...
+ , ( "framework-path" , HasArg (addToDirList v_Framework_paths) )
+ , ( "framework" , HasArg (add v_Cmdline_frameworks) )
+#endif
------- Packages ----------------------------------------------------
, ( "package-name" , HasArg (\s -> add v_Opt_C ("-inpackage="++s)) )
-- -fno-* pattern below doesn't work. We therefore allow
-- certain optimisation passes to be turned off explicitly:
, ( "fno-strictness" , NoArg (writeIORef v_Strictness False) )
-#ifdef OLD_STRICTNESS
- , ( "fno-cpr" , NoArg (writeIORef v_CPR False) )
-#endif
, ( "fno-cse" , NoArg (writeIORef v_CSE False) )
-- All other "-fno-<blah>" options cancel out "-f<blah>" on the hsc cmdline
-- 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
+#ifndef mingw32_HOST_OS
, ( "D", Prefix (\s -> addOpt_P ("-D'"++s++"'") ) )
, ( "U", Prefix (\s -> addOpt_P ("-U'"++s++"'") ) )
#else
( "warn-unused-matches", Opt_WarnUnusedMatches ),
( "warn-deprecations", Opt_WarnDeprecations ),
( "glasgow-exts", Opt_GlasgowExts ),
+ ( "fi", Opt_FFI ), -- support `-ffi'...
+ ( "ffi", Opt_FFI ), -- ...and also `-fffi'
+ ( "with", Opt_With ), -- with keyword
( "parr", Opt_PArr ),
( "allow-overlapping-instances", Opt_AllowOverlappingInstances ),
( "allow-undecidable-instances", Opt_AllowUndecidableInstances ),
machdepCCOpts
| prefixMatch "alpha" cTARGETPLATFORM
- = return ( ["-static", "-w", "-mieee"], [] )
+ = return ( ["-static", "-w", "-mieee"
+#ifdef HAVE_THREADED_RTS_SUPPORT
+ , "-D_REENTRANT"
+#endif
+ ], [] )
-- For now, to suppress the gcc warning "call-clobbered
-- register used for global register variable", we simply
-- disable all warnings altogether using the -w flag. Oh well.
-- the fp (%ebp) for our register maps.
= do n_regs <- dynFlag stolen_x86_regs
sta <- readIORef v_Static
- return ( [ if sta then "-DDONT_WANT_WIN32_DLL_SUPPORT" else "",
- if suffixMatch "mingw32" cTARGETPLATFORM then "-mno-cygwin" else "" ],
+ return ( [ if sta then "-DDONT_WANT_WIN32_DLL_SUPPORT" else ""
+-- , if suffixMatch "mingw32" cTARGETPLATFORM then "-mno-cygwin" else ""
+ ],
[ "-fno-defer-pop", "-fomit-frame-pointer",
+ -- we want -fno-builtin, because when gcc inlines
+ -- built-in functions like memcpy() it tends to
+ -- run out of registers, requiring -monly-n-regs
+ "-fno-builtin",
"-DSTOLEN_X86_REGS="++show n_regs ]
)
+ | prefixMatch "ia64" cTARGETPLATFORM
+ = return ( [], ["-fomit-frame-pointer", "-G0"] )
+
| prefixMatch "mips" cTARGETPLATFORM
= return ( ["-static"], [] )