import ParserCoreUtils ( getCoreModuleName )
+import EXCEPTION
+import DATA_IOREF ( readIORef, writeIORef )
+
#ifdef GHCI
import Time ( getClockTime )
#endif
import Directory
import System
-import IOExts
-import Exception
-
import IO
import Monad
import Maybe
-import PackedString
-
-----------------------------------------------------------------------------
-- genPipeline
--
| split -> not_valid
| otherwise -> [ Hsc, HCc, As ]
- HscCore | split && mangle -> [ Hsc, HCc, Mangle, SplitMangle, SplitAs ]
- | mangle -> [ Hsc, HCc, Mangle, As ]
- | split -> not_valid
- | otherwise -> [ Hsc, HCc, As ]
-
HscAsm | split -> [ Hsc, SplitMangle, SplitAs ]
| otherwise -> [ Hsc, As ]
-------------------------------------------------------------------------------
-- HsPp phase
-run_phase HsPp basename suff input_fn output_fn
- = do src_opts <- getOptionsFromSource input_fn
- unhandled_flags <- processArgs dynamic_flags src_opts []
- checkProcessArgsResult unhandled_flags basename suff
- let orig_fn = basename ++ '.':suff
+run_phase HsPp basename suff input_fn output_fn
+ = do let orig_fn = basename ++ '.':suff
do_pp <- dynFlag ppFlag
if not do_pp then
-- no need to preprocess, just pass input file along
let lib_opts = map ("-l"++) (reverse libs)
-- reverse because they're added in reverse order from the cmd line
+#ifdef darwin_TARGET_OS
+ pkg_framework_paths <- getPackageFrameworkPath
+ let pkg_framework_path_opts = map ("-F"++) pkg_framework_paths
+
+ framework_paths <- readIORef v_Framework_paths
+ let framework_path_opts = map ("-F"++) framework_paths
+
+ pkg_frameworks <- getPackageFrameworks
+ let pkg_framework_opts = map ("-framework " ++) pkg_frameworks
+
+ frameworks <- readIORef v_Cmdline_frameworks
+ let framework_opts = map ("-framework "++) (reverse frameworks)
+ -- reverse because they're added in reverse order from the cmd line
+#endif
+
pkg_extra_ld_opts <- getPackageExtraLdOpts
-- probably _stub.o files
++ extra_ld_inputs
++ lib_path_opts
++ lib_opts
+#ifdef darwin_TARGET_OS
+ ++ framework_path_opts
+ ++ framework_opts
+#endif
++ pkg_lib_path_opts
++ pkg_lib_opts
+#ifdef darwin_TARGET_OS
+ ++ pkg_framework_path_opts
+ ++ pkg_framework_opts
+#endif
++ pkg_extra_ld_opts
++ extra_ld_opts
++ if static && not no_hs_main then