Merge changes from old driver in before-ghci-branch.
-----------------------------------------------------------------------------
--- $Id: DriverFlags.hs,v 1.24 2000/11/24 09:51:39 simonpj Exp $
+-- $Id: DriverFlags.hs,v 1.25 2000/12/04 16:42:14 rrt Exp $
--
-- Driver flags
--
------- Miscellaneous -----------------------------------------------
, ( "no-link-chk" , NoArg (return ()) ) -- ignored for backwards compat
+ , ( "no-hs-main" , NoArg (writeIORef no_hs_main True) )
------- Output Redirection ------------------------------------------
, ( "odir" , HasArg (writeIORef v_Output_dir . Just) )
----- Linker --------------------------------------------------------
, ( "static" , NoArg (writeIORef v_Static True) )
+ , ( "rdynamic" , NoArg (return ()) ) -- ignored for compat w/ gcc
----- RTS opts ------------------------------------------------------
#ifdef not_yet
hPutStrLn h cmd
hClose h
exit_code <- system ("sh - " ++ tmp) `catchAllIO`
- (\e -> throwDyn (PhaseFailed phase_name (ExitFailure 1)))
+ (\_ -> throwDyn (PhaseFailed phase_name (ExitFailure 1)))
removeFile tmp
#endif
-----------------------------------------------------------------------------
--- $Id: DriverPipeline.hs,v 1.35 2000/11/24 17:09:52 simonmar Exp $
+-- $Id: DriverPipeline.hs,v 1.36 2000/12/04 16:42:14 rrt Exp $
--
-- GHC Driver
--
-- 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
-- concurrently, automatically taking advantage of extra processors on
-- 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.
+-- that the C compiler from the first compilation can be overlapped
+-- with the hsc compilation for the second file.
data IntermediateFileType
= Temporary
-- date wrt M.hs (or M.o doesn't exist) so we must recompile regardless.
do_recomp <- readIORef v_Recomp
todo <- readIORef v_GhcMode
- o_file <- odir_ify (basename ++ '.':phaseInputExt Ln)
+ o_file' <- odir_ify (basename ++ '.':phase_input_ext Ln)
+ o_file <- osuf_ify o_file'
source_unchanged <-
if not (do_recomp && ( todo == DoLink || todo == StopBefore Ln ))
then return False
++ [ "-D__GLASGOW_HASKELL__="++cProjectVersionInt ]
++ cc_opts
++ split_opt
-#ifdef mingw32_TARGET_OS
- ++ [" -mno-cygwin"]
-#endif
++ (if excessPrecision then [] else [ "-ffloat-store" ])
++ include_paths
++ pkg_extra_cc_opts
runSomething "Copy stub .c file"
(unwords [
"rm -f", stub_c, "&&",
- "echo \'#include \""++stub_h++"\"\' >"++stub_c, " &&",
+ "echo \'#include \"Stg.h\"\n#include \""++stub_h++"\"\' >"++stub_c, " &&",
"cat", tmp_stub_c, ">> ", stub_c
])
-----------------------------------------------------------------------------
--- $Id: DriverState.hs,v 1.16 2000/11/21 14:35:05 simonmar Exp $
+-- $Id: DriverState.hs,v 1.17 2000/12/04 16:42:14 rrt Exp $
--
-- Settings for the driver
--
data WayName
= WayProf
| WayUnreg
- | WayDll
| WayTicky
| WayPar
| WayGran
GLOBAL_VAR(v_Ways, [] ,[WayName])
--- ToDo: allow WayDll with any other allowed combination
-
-allowed_combinations =
- [ [WayProf,WayUnreg],
- [WayProf,WaySMP] -- works???
- ]
+allowed_combinations way = ways `elem` combs
+ where -- the sub-lists must be ordered according to WayName, because findBuildTag sorts them
+ combs = [ [WayProf,WayUnreg], [WayProf,WaySMP] ]
findBuildTag :: IO [String] -- new options
findBuildTag = do
writeIORef v_Build_tag (wayTag details)
return (wayOpts details)
- ws -> if ws `notElem` allowed_combinations
+ ws -> if not allowed_combination ws
then throwDyn (OtherError $
"combination not supported: " ++
foldr1 (\a b -> a ++ '/':b)
, "-funregisterised"
, "-fvia-C" ]),
- (WayDll, Way "dll" "DLLized"
- [ ]),
-
(WayPar, Way "mp" "Parallel"
[ "-fparallel"
, "-D__PARALLEL_HASKELL__"
-- the fp (%ebp) for our register maps.
= do n_regs <- readState stolen_x86_regs
sta <- readIORef v_Static
- return ( [ if sta then "-DDONT_WANT_WIN32_DLL_SUPPORT" else "" ],
+ return ( [ if sta then "-DDONT_WANT_WIN32_DLL_SUPPORT" else "",
+ if suffixMatch "mingw32" cTARGETPLATFORM then "-mno-cygwin" else "" ],
[ "-fno-defer-pop", "-fomit-frame-pointer",
"-DSTOLEN_X86_REGS="++show n_regs ]
)
-----------------------------------------------------------------------------
--- $Id: TmpFiles.hs,v 1.8 2000/10/30 09:52:15 simonpj Exp $
+-- $Id: TmpFiles.hs,v 1.9 2000/12/04 16:42:14 rrt Exp $
--
-- Temporary file management
--
initTempFileStorage = do
-- check whether TMPDIR is set in the environment
IO.try (do dir <- getEnv "TMPDIR" -- fails if not set
- writeIORef v_TmpDir dir)
-
+#ifndef mingw32_TARGET_OS
+ writeIORef v_TmpDir dir
+#endif
+ )
cleanTempFiles :: Bool -> IO ()
cleanTempFiles verbose = do