[project @ 2001-01-16 12:41:03 by simonmar]
authorsimonmar <unknown>
Tue, 16 Jan 2001 12:41:03 +0000 (12:41 +0000)
committersimonmar <unknown>
Tue, 16 Jan 2001 12:41:03 +0000 (12:41 +0000)
take account of GhcUnregisterised

ghc/compiler/main/DriverState.hs
ghc/compiler/main/Main.hs

index 70a80b8..b462da8 100644 (file)
@@ -1,5 +1,5 @@
 -----------------------------------------------------------------------------
--- $Id: DriverState.hs,v 1.23 2001/01/12 11:04:45 simonmar Exp $
+-- $Id: DriverState.hs,v 1.24 2001/01/16 12:41:03 simonmar Exp $
 --
 -- Settings for the driver
 --
@@ -602,11 +602,7 @@ way_details =
        , "-fvia-C" ]),
 
     (WayUnreg, Way  "u" "Unregisterised" 
-       [ "-optc-DNO_REGS"
-       , "-optc-DUSE_MINIINTERPRETER"
-       , "-fno-asm-mangling"
-       , "-funregisterised"
-       , "-fvia-C" ]),
+       unregFlags ),
 
     (WayPar, Way  "mp" "Parallel" 
        [ "-fparallel"
@@ -648,6 +644,13 @@ way_details =
     (WayUser_B,  Way  "B"  "User way 'B'"  ["$WAY_B_REAL_OPTS"]) 
   ]
 
+unregFlags = 
+   [ "-optc-DNO_REGS"
+   , "-optc-DUSE_MINIINTERPRETER"
+   , "-fno-asm-mangling"
+   , "-funregisterised"
+   , "-fvia-C" ]
+
 -----------------------------------------------------------------------------
 -- Programs for particular phases
 
index a3ad516..e2a863b 100644 (file)
@@ -1,6 +1,6 @@
 {-# OPTIONS -fno-warn-incomplete-patterns #-}
 -----------------------------------------------------------------------------
--- $Id: Main.hs,v 1.46 2001/01/12 11:04:45 simonmar Exp $
+-- $Id: Main.hs,v 1.47 2001/01/16 12:41:03 simonmar Exp $
 --
 -- GHC Driver program
 --
@@ -168,9 +168,13 @@ main =
        -- process all the other arguments, and get the source files
    non_static <- processArgs static_flags flags2 []
 
-       -- find the build tag, and re-process the build-specific options
-   more_opts <- findBuildTag
-   way_non_static <- processArgs static_flags more_opts []
+       -- Find the build tag, and re-process the build-specific options.
+       -- Also add in flags for unregisterised compilation, if 
+       -- GhcUnregisterised=YES.
+   way_opts <- findBuildTag
+   let unreg_opts | cGhcUnregisterised == "YES" = unregFlags
+                 | otherwise = []
+   way_non_static <- processArgs static_flags (unreg_opts ++ way_opts) []
 
        -- give the static flags to hsc
    static_opts <- buildStaticHscOpts