From d5b3e9b5f30ccdd34a964f109c03c56ff71dee2e Mon Sep 17 00:00:00 2001 From: simonpj Date: Fri, 18 Mar 2005 17:16:07 +0000 Subject: [PATCH] [project @ 2005-03-18 17:16:00 by simonpj] Fix stage-2 build --- ghc/compiler/ghci/InteractiveUI.hs | 25 +++++++++++-------------- ghc/compiler/ghci/Linker.lhs | 9 +++++---- ghc/compiler/ghci/ObjLink.lhs | 1 + ghc/compiler/main/CmdLineParser.hs | 1 + ghc/compiler/main/Main.hs | 2 +- 5 files changed, 19 insertions(+), 19 deletions(-) diff --git a/ghc/compiler/ghci/InteractiveUI.hs b/ghc/compiler/ghci/InteractiveUI.hs index b812354..0939218 100644 --- a/ghc/compiler/ghci/InteractiveUI.hs +++ b/ghc/compiler/ghci/InteractiveUI.hs @@ -1,6 +1,6 @@ {-# OPTIONS -#include "Linker.h" #-} ----------------------------------------------------------------------------- --- $Id: InteractiveUI.hs,v 1.194 2005/03/18 13:38:31 simonmar Exp $ +-- $Id: InteractiveUI.hs,v 1.195 2005/03/18 17:16:03 simonpj Exp $ -- -- GHC Interactive User Interface -- @@ -15,23 +15,23 @@ module InteractiveUI ( #include "HsVersions.h" import CompManager -import HscTypes ( GhciMode(..) ) import IfaceSyn ( IfaceDecl(..), IfaceClassOp(..), IfaceConDecls(..), IfaceConDecl(..), IfaceType, pprIfaceDeclHead, pprParendIfaceType, pprIfaceForAllPart, pprIfaceType ) import FunDeps ( pprFundeps ) -import Util ( removeSpaces ) +import Util ( removeSpaces, handle ) import Linker ( showLinkerState, linkPackages ) import Util import Name ( Name, NamedThing(..) ) import OccName ( OccName, parenSymOcc, occNameUserString ) import BasicTypes ( StrictnessMark(..), defaultFixity, SuccessFlag(..) ) import Outputable -import DynFlags ( DynFlags(..), DynFlag(..), dopt ) +import DynFlags import Panic hiding ( showException ) import Config import SrcLoc ( SrcLoc, isGoodSrcLoc ) +import StaticFlags ( opt_IgnoreDotGhci ) #ifndef mingw32_HOST_OS import Util ( handle ) @@ -154,7 +154,7 @@ helpText = interactiveUI :: DynFlags -> [FilePath] -> Maybe String -> IO () interactiveUI dflags srcs maybe_expr = do - cmstate <- cmInit Interactive dflags; + cmstate <- cmInit dflags; -- HACK! If we happen to get into an infinite loop (eg the user -- types 'let x=x in x' at the prompt), then the thread will block @@ -200,7 +200,7 @@ interactiveUI dflags srcs maybe_expr = do runGHCi :: [FilePath] -> DynFlags -> Maybe String -> GHCi () runGHCi paths dflags maybe_expr = do - read_dot_files <- io (readIORef v_Read_DotGHCi) + let read_dot_files = not opt_IgnoreDotGhci when (read_dot_files) $ do -- Read in ./.ghci. @@ -284,7 +284,7 @@ checkPerms name = #ifdef mingw32_HOST_OS return True #else - DriverUtil.handle (\_ -> return False) $ do + Util.handle (\_ -> return False) $ do st <- getFileStatus name me <- getRealUserID if fileOwner st /= me then do @@ -317,7 +317,7 @@ fileLoop hdl prompt = do -- perhaps did getContents which closes stdin at -- EOF. Right l -> - case remove_spaces l of + case removeSpaces l of "" -> fileLoop hdl prompt l -> do quit <- runCommand l if quit then return () else fileLoop hdl prompt @@ -325,7 +325,7 @@ fileLoop hdl prompt = do stringLoop :: [String] -> GHCi () stringLoop [] = return () stringLoop (s:ss) = do - case remove_spaces s of + case removeSpaces s of "" -> stringLoop ss l -> do quit <- runCommand l if quit then return () else stringLoop ss @@ -346,7 +346,7 @@ readlineLoop = do case l of Nothing -> return () Just l -> - case remove_spaces l of + case removeSpaces l of "" -> readlineLoop l -> do io (addHistory l) @@ -916,12 +916,9 @@ setOptions wds = let (plus_opts, minus_opts) = partition isPlus wds mapM_ setOpt plus_opts - -- now, the GHC flags - leftovers <- io $ processStaticFlags minus_opts - -- then, dynamic flags dflags <- getDynFlags - (dflags',leftovers) <- io $ processDynamicFlags leftovers dflags + (dflags',leftovers) <- io $ parseDynamicFlags dflags minus_opts setDynFlags dflags' -- update things if the users wants more packages diff --git a/ghc/compiler/ghci/Linker.lhs b/ghc/compiler/ghci/Linker.lhs index d87c2bb..b582e7e 100644 --- a/ghc/compiler/ghci/Linker.lhs +++ b/ghc/compiler/ghci/Linker.lhs @@ -37,11 +37,12 @@ import NameEnv import NameSet ( nameSetToList ) import Module import ListSetOps ( minusList ) -import DynFlags ( DynFlags(..) ) +import DynFlags ( DynFlags(..), getOpts ) import BasicTypes ( SuccessFlag(..), succeeded, failed ) import Outputable import Panic ( GhcException(..) ) import Util ( zipLazy, global ) +import StaticFlags ( v_Ld_inputs ) -- Standard libraries import Control.Monad ( when, filterM, foldM ) @@ -202,11 +203,11 @@ reallyInitDynLinker dflags ; linkPackages dflags (explicitPackages (pkgState dflags)) -- (c) Link libraries from the command-line - ; opt_l <- getStaticOpts v_Opt_l - ; let minus_ls = [ lib | '-':'l':lib <- opt_l ] + ; let optl = getOpts dflags opt_l + ; let minus_ls = [ lib | '-':'l':lib <- optl ] -- (d) Link .o files from the command-line - ; lib_paths <- readIORef v_Library_paths + ; let lib_paths = libraryPaths dflags ; cmdline_ld_inputs <- readIORef v_Ld_inputs ; classified_ld_inputs <- mapM classifyLdInput cmdline_ld_inputs diff --git a/ghc/compiler/ghci/ObjLink.lhs b/ghc/compiler/ghci/ObjLink.lhs index 0feb26b..057938a 100644 --- a/ghc/compiler/ghci/ObjLink.lhs +++ b/ghc/compiler/ghci/ObjLink.lhs @@ -26,6 +26,7 @@ import Foreign.C import Foreign ( Ptr, nullPtr ) import Panic ( panic ) import BasicTypes ( SuccessFlag, successIf ) +import Config ( cLeadingUnderscore ) import Outputable -- --------------------------------------------------------------------------- diff --git a/ghc/compiler/main/CmdLineParser.hs b/ghc/compiler/main/CmdLineParser.hs index dd22348..d8807fe 100644 --- a/ghc/compiler/main/CmdLineParser.hs +++ b/ghc/compiler/main/CmdLineParser.hs @@ -17,6 +17,7 @@ module CmdLineParser ( #include "HsVersions.h" import Util ( maybePrefixMatch, notNull, removeSpaces ) +-- import Panic data OptKind m = NoArg (m ()) -- flag with no argument diff --git a/ghc/compiler/main/Main.hs b/ghc/compiler/main/Main.hs index f311130..8d156db 100644 --- a/ghc/compiler/main/Main.hs +++ b/ghc/compiler/main/Main.hs @@ -457,7 +457,7 @@ showBanner cli_mode dflags = do let verb = verbosity dflags -- Show the GHCi banner # ifdef GHCI - when (isInteractiveMode mode && verb >= 1) $ + when (isInteractiveMode cli_mode && verb >= 1) $ hPutStrLn stdout ghciWelcomeMsg # endif -- 1.7.10.4