From: simonmar Date: Wed, 20 Oct 2004 14:25:34 +0000 (+0000) Subject: [project @ 2004-10-20 14:25:34 by simonmar] X-Git-Tag: Initial_conversion_from_CVS_complete~1487 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=57c616120454d7d4f2f1b6c339886b52ca83a394;p=ghc-hetmet.git [project @ 2004-10-20 14:25:34 by simonmar] compile: temporarily add the directory containing the .hs file to the include path. This matches what compiling in one-shot mode does, and fixes a bug whereby the _stub.h file couldn't be found when compiling with --make. --- diff --git a/ghc/compiler/main/DriverPipeline.hs b/ghc/compiler/main/DriverPipeline.hs index 0116aee..4e9e252 100644 --- a/ghc/compiler/main/DriverPipeline.hs +++ b/ghc/compiler/main/DriverPipeline.hs @@ -137,6 +137,15 @@ compile hsc_env this_mod location src_timestamp let (basename, _) = splitFilename input_fn + -- We add the directory in which the .hs files resides) to the import path. + -- This is needed when we try to compile the .hc file later, if it + -- imports a _stub.h file that we created here. + let current_dir = directoryOf basename + old_paths <- readIORef v_Include_paths + writeIORef v_Include_paths (current_dir : old_paths) + -- put back the old include paths afterward. + later (writeIORef v_Include_paths old_paths) $ do + -- figure out what lang we're generating hsc_lang <- hscMaybeAdjustLang (hscLang dyn_flags) -- figure out what the next phase should be