From f02c73214c30637687bbe7dd7d2a8df427141fe5 Mon Sep 17 00:00:00 2001 From: sewardj Date: Tue, 3 Apr 2001 15:36:44 +0000 Subject: [PATCH] [project @ 2001-04-03 15:36:44 by sewardj] Add headers to generated .hc files in --make mode too. --- ghc/compiler/main/DriverPipeline.hs | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/ghc/compiler/main/DriverPipeline.hs b/ghc/compiler/main/DriverPipeline.hs index f0e2db9..1971674 100644 --- a/ghc/compiler/main/DriverPipeline.hs +++ b/ghc/compiler/main/DriverPipeline.hs @@ -1,5 +1,5 @@ ----------------------------------------------------------------------------- --- $Id: DriverPipeline.hs,v 1.62 2001/03/28 16:51:03 simonmar Exp $ +-- $Id: DriverPipeline.hs,v 1.63 2001/04/03 15:36:44 sewardj Exp $ -- -- GHC Driver -- @@ -446,7 +446,7 @@ run_phase Hsc basename suff input_fn output_fn cmdline_includes <- dynFlag cmdlineHcIncludes -- -#include options let cc_injects = unlines (map mk_include - (c_includes ++ reverse cmdline_includes)) + (c_includes ++ reverse cmdline_includes)) mk_include h_file = case h_file of '"':_{-"-} -> "#include "++h_file @@ -992,6 +992,20 @@ compile ghci_mode summary source_unchanged have_object hscStubCOutName = basename ++ "_stub.c", hscStubHOutName = basename ++ "_stub.h" } + -- figure out which header files to #include in a generated .hc file + c_includes <- getPackageCIncludes + cmdline_includes <- dynFlag cmdlineHcIncludes -- -#include options + + let cc_injects = unlines (map mk_include + (c_includes ++ reverse cmdline_includes)) + mk_include h_file = + case h_file of + '"':_{-"-} -> "#include "++h_file + '<':_ -> "#include "++h_file + _ -> "#include \""++h_file++"\"" + + writeIORef v_HCHeader cc_injects + -- run the compiler hsc_result <- hscMain ghci_mode dyn_flags' (ms_mod summary) location -- 1.7.10.4