Commit a0928e35 authored by simonmar's avatar simonmar

[project @ 2002-12-17 13:50:28 by simonmar]

- add -no-link flag (omits link step, except in GHCi)
- tidy up some informmational messages
parent 840871d4
......@@ -490,7 +490,7 @@ cmDepAnal cmstate dflags rootnames
= do showPass dflags "Chasing dependencies"
when (verbosity dflags >= 1 && gmode cmstate == Batch) $
hPutStrLn stderr (showSDoc (hcat [
text progName, text ": chasing modules from: ",
text "Chasing modules from: ",
hcat (punctuate comma (map text rootnames))]))
downsweep rootnames (mg cmstate)
......
-----------------------------------------------------------------------------
-- $Id: DriverFlags.hs,v 1.107 2002/12/12 17:36:18 simonmar Exp $
-- $Id: DriverFlags.hs,v 1.108 2002/12/17 13:50:29 simonmar Exp $
--
-- Driver flags
--
......@@ -294,6 +294,7 @@ static_flags =
, ( "optdll" , HasArg (add v_Opt_dll) )
----- Linker --------------------------------------------------------
, ( "no-link" , NoArg (writeIORef v_NoLink True) )
, ( "static" , NoArg (writeIORef v_Static True) )
, ( "dynamic" , NoArg (writeIORef v_Static False) )
, ( "rdynamic" , NoArg (return ()) ) -- ignored for compat w/ gcc
......
......@@ -301,8 +301,17 @@ link' Interactive dflags batch_attempt_linking linkables
link' Batch dflags batch_attempt_linking linkables
| batch_attempt_linking
= do when (verb >= 1) $
hPutStrLn stderr "ghc: linking ..."
= do
-- check for the -no-link flag
omit_linking <- readIORef v_NoLink
if omit_linking
then do when (verb >= 3) $
hPutStrLn stderr "link(batch): linking omitted (-no-link flag given)."
return Succeeded
else do
when (verb >= 1) $
hPutStrLn stderr "Linking ..."
-- Don't showPass in Batch mode; doLink will do that for us.
staticLink (concatMap getOfiles linkables)
......
-----------------------------------------------------------------------------
-- $Id: DriverState.hs,v 1.86 2002/12/12 17:36:19 simonmar Exp $
-- $Id: DriverState.hs,v 1.87 2002/12/17 13:50:29 simonmar Exp $
--
-- Settings for the driver
--
......@@ -96,6 +96,7 @@ GLOBAL_VAR(v_Keep_ilx_files, False, Bool)
-- Misc
GLOBAL_VAR(v_Scale_sizes_by, 1.0, Double)
GLOBAL_VAR(v_Static, True, Bool)
GLOBAL_VAR(v_NoLink, False, Bool)
GLOBAL_VAR(v_NoHsMain, False, Bool)
GLOBAL_VAR(v_Recomp, True, Bool)
GLOBAL_VAR(v_Collect_ghc_timing, False, Bool)
......
{-# OPTIONS -fno-warn-incomplete-patterns -optc-DNON_POSIX_SOURCE #-}
-----------------------------------------------------------------------------
-- $Id: Main.hs,v 1.114 2002/10/25 16:54:59 simonpj Exp $
-- $Id: Main.hs,v 1.115 2002/12/17 13:50:29 simonmar Exp $
--
-- GHC Driver program
--
......@@ -37,7 +37,7 @@ import DriverState ( buildCoreToDo, buildStgToDo,
v_GhcMode, v_GhcModeFlag, GhcMode(..),
v_Keep_tmp_files, v_Ld_inputs, v_Ways,
v_OptLevel, v_Output_file, v_Output_hi,
readPackageConf, verifyOutputFiles
readPackageConf, verifyOutputFiles, v_NoLink
)
import DriverFlags ( buildStaticHscOpts,
dynamic_flags, processArgs, static_flags)
......@@ -304,8 +304,10 @@ main =
o_files <- mapM compileFile srcs
omit_linking <- readIORef v_NoLink
when (mode == DoMkDependHS) endMkDependHS
when (mode == DoLink) (staticLink o_files)
when (mode == DoLink && not omit_linking) (staticLink o_files)
when (mode == DoMkDLL) (doMkDLL o_files)
......
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