X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2FcompMan%2FCompManager.lhs;h=c4c1913a6af5b1bc9d95c44c06f8530674867b7d;hb=c0c05bb3fbfdd1a82bccdcbc34c77a4927c99316;hp=29178793e36dfc4c338e1a8f1476c5d0b0b93f1e;hpb=f714e6b642fd614a9971717045ae47c3d871275e;p=ghc-hetmet.git diff --git a/ghc/compiler/compMan/CompManager.lhs b/ghc/compiler/compMan/CompManager.lhs index 2917879..c4c1913 100644 --- a/ghc/compiler/compMan/CompManager.lhs +++ b/ghc/compiler/compMan/CompManager.lhs @@ -56,7 +56,7 @@ where import DriverPipeline ( CompResult(..), preprocess, compile, link ) import HscMain ( newHscEnv ) -import DriverState ( v_Output_file, v_NoHsMain ) +import DriverState ( v_Output_file, v_NoHsMain, v_MainModIs ) import DriverPhases import Finder import HscTypes @@ -443,8 +443,11 @@ cmLoadModules cmstate1 mg2unsorted let verb = verbosity dflags -- Find out if we have a Main module - let a_root_is_Main - = any ((=="Main").moduleNameUserString.modSummaryName) + mb_main_mod <- readIORef v_MainModIs + let + main_mod = mb_main_mod `orElse` "Main" + a_root_is_Main + = any ((==main_mod).moduleNameUserString.modSummaryName) mg2unsorted let mg2unsorted_names = map modSummaryName mg2unsorted @@ -573,7 +576,7 @@ cmLoadModules cmstate1 mg2unsorted let do_linking = a_root_is_Main || no_hs_main when (ghci_mode == Batch && isJust ofile && not do_linking && verb > 0) $ - hPutStrLn stderr "Warning: output was redirected with -o, but no output will be generated\nbecause there is no Main module." + hPutStrLn stderr ("Warning: output was redirected with -o, but no output will be generated\nbecause there is no " ++ main_mod ++ " module.") -- link everything together linkresult <- link ghci_mode dflags do_linking (hsc_HPT hsc_env3)