+ ---------------- Do the business -----------
+
+ -- Always link in the haskell98 package for static linking. Other
+ -- packages have to be specified via the -package flag.
+ let link_pkgs
+ | ExtPackage h98_id <- haskell98PackageId (pkgState dflags) = [h98_id]
+ | otherwise = []
+
+ case mode of
+ DoMake -> doMake dflags srcs
+ DoMkDependHS -> doMkDependHS dflags srcs
+ StopBefore p -> do { compileFiles mode dflags srcs; return () }
+ DoMkDLL -> do { o_files <- compileFiles mode dflags srcs;
+ doMkDLL dflags o_files link_pkgs }
+ DoLink -> do { o_files <- compileFiles mode dflags srcs;
+ omit_linking <- readIORef v_NoLink;
+ when (not omit_linking)
+ (staticLink dflags o_files link_pkgs) }
+
+#ifndef GHCI
+ DoInteractive -> noInteractiveError
+ DoEval _ -> noInteractiveError
+ where
+ noInteractiveError = throwDyn (CmdLineError "not built for interactive use")
+#else
+ DoInteractive -> interactiveUI dflags srcs Nothing
+ DoEval expr -> interactiveUI dflags srcs (Just expr)
+#endif