[project @ 2001-09-04 18:29:20 by ken]
[ghc-hetmet.git] / ghc / compiler / main / DriverPipeline.hs
index f4722bb..4ab9f55 100644 (file)
@@ -266,7 +266,7 @@ runPipeline pipeline (input_fn,suffix) do_linking use_ofile
   where (basename, _) = splitFilename input_fn
 
 pipeLoop [] input_fn _ _ _ _ = return input_fn
-pipeLoop ((phase, keep, o_suffix):phases) 
+pipeLoop (all_phases@((phase, keep, o_suffix):phases))
        (input_fn,real_suff) do_linking use_ofile orig_basename orig_suffix
   = do
 
@@ -277,7 +277,7 @@ pipeLoop ((phase, keep, o_suffix):phases)
        -- checker has determined that recompilation isn't necessary.
      case mbCarryOn of
        Nothing -> do
-             let (_,keep,final_suffix) = last phases
+             let (_,keep,final_suffix) = last all_phases
              ofile <- outputFileName True keep final_suffix
              return (ofile, final_suffix)
           -- carry on ...
@@ -868,8 +868,8 @@ doLink o_files = do
                      ++ pkg_extra_ld_opts
                      ++ extra_ld_opts
                      ++ if static && not no_hs_main then
-                           [ "-u", prefixUnderscore "PrelMain_mainIO_closure" ,
-                             "-u", prefixUnderscore "__init_PrelMain"] 
+                           [ "-u", prefixUnderscore "PrelMain_mainIO_closure",
+                             "-u", prefixUnderscore "__stginit_PrelMain"] 
                         else []))
 
     -- parallel only: move binary to another dir -- HWL
@@ -1052,10 +1052,14 @@ compile ghci_mode summary source_unchanged have_object
 
    writeIORef v_HCHeader cc_injects
 
+   -- -no-recomp should also work with --make
+   do_recomp <- readIORef v_Recomp
+   let source_unchanged' = source_unchanged && do_recomp
+
    -- run the compiler
    hsc_result <- hscMain ghci_mode dyn_flags'
                         (ms_mod summary) location
-                        source_unchanged have_object old_iface hst hit pcs
+                        source_unchanged' have_object old_iface hst hit pcs
 
    case hsc_result of
       HscFail pcs -> return (CompErrs pcs)