Commit d5b3e9b5 authored by simonpj's avatar simonpj
Browse files

[project @ 2005-03-18 17:16:00 by simonpj]

Fix stage-2 build
parent 9b73f1ba
{-# 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
......
......@@ -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
......
......@@ -26,6 +26,7 @@ import Foreign.C
import Foreign ( Ptr, nullPtr )
import Panic ( panic )
import BasicTypes ( SuccessFlag, successIf )
import Config ( cLeadingUnderscore )
import Outputable
-- ---------------------------------------------------------------------------
......
......@@ -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
......
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment