{-# OPTIONS -W -fno-warn-incomplete-patterns #-}
-----------------------------------------------------------------------------
--- $Id: Main.hs,v 1.64 2000/10/05 13:27:54 simonmar Exp $
+-- $Id: Main.hs,v 1.68 2000/10/11 16:06:38 simonmar Exp $
--
-- GHC Driver program
--
[ "-fwarn-type-defaults"
, "-fwarn-name-shadowing"
, "-fwarn-missing-signatures"
+ , "-fwarn-hi-shadowing"
]
data WarningState = W_default | W_ | W_all | W_not
[ ]),
(WayPar, Way "mp" "Parallel"
- [ "-fstack-check"
- , "-fparallel"
+ [ "-fparallel"
, "-D__PARALLEL_HASKELL__"
, "-optc-DPAR"
, "-package concurrent"
, "-fvia-C" ]),
(WayGran, Way "mg" "Gransim"
- [ "-fstack-check"
- , "-fgransim"
+ [ "-fgransim"
, "-D__GRANSIM__"
, "-optc-DGRAN"
, "-package concurrent"
argv' <- setTopDir argv
-- check whether TMPDIR is set in the environment
+#ifndef mingw32_TARGET_OS
IO.try (do dir <- getEnv "TMPDIR" -- fails if not set
writeIORef tmpdir dir)
+#endif
-- read the package configuration
conf_file <- readIORef package_config
-- what the suffix of the intermediate files should be, etc.
-- The following compilation pipeline algorithm is fairly hacky. A
--- better way to do this would be to express the whole comilation as a
+-- better way to do this would be to express the whole compilation as a
-- data flow DAG, where the nodes are the intermediate files and the
-- edges are the compilation phases. This framework would also work
--- nicely if a haskell dependency generator was included in the
+-- nicely if a Haskell dependency generator were included in the
-- driver.
-- It would also deal much more cleanly with compilation phases that
-- the host machine. For example, when compiling two Haskell files
-- where one depends on the other, the data flow graph would determine
-- that the C compiler from the first comilation can be overlapped
--- with the hsc comilation for the second file.
+-- with the hsc compilation for the second file.
data IntermediateFileType
= Temporary
-- build the hsc command line
hsc_opts <- build_hsc_opts
- doing_hi <- readIORef produceHi
- tmp_hi_file <- if doing_hi
- then do fn <- newTempName "hi"
- add files_to_clean fn
- return fn
- else return ""
-
-- deal with -Rghc-timing
timing <- readIORef collect_ghc_timing
stat_file <- newTempName "stat"