Skip to content

Commit

Permalink
fix for #187 -- directory of Paths_packagename is included when looki…
Browse files Browse the repository at this point in the history
…ng for source files
  • Loading branch information
kosmikus committed Apr 12, 2008
1 parent 13d4b4f commit 6bc049c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Distribution/Simple/GHC.hs
Expand Up @@ -588,9 +588,9 @@ ghcOptions lbi bi odir
= ["-hide-all-packages"]
++ (if splitObjs lbi then ["-split-objs"] else [])
++ ["-i"]
++ ["-i" ++ autogenModulesDir lbi]
++ ["-i" ++ odir]
++ ["-i" ++ l | l <- nub (hsSourceDirs bi)]
++ ["-i" ++ autogenModulesDir lbi]
++ ["-I" ++ odir]
++ ["-I" ++ dir | dir <- includeDirs bi]
++ ["-optP" ++ opt | opt <- cppOptions bi]
Expand Down
2 changes: 1 addition & 1 deletion Distribution/Simple/Haddock.hs
Expand Up @@ -322,8 +322,8 @@ ghcSimpleOptions lbi bi mockDir
++ (concat [ ["-package", display pkg] | pkg <- packageDeps lbi ])
++ ["-i"]
++ hcOptions GHC bi
++ ["-i" ++ autogenModulesDir lbi]
++ ["-i" ++ l | l <- nub (hsSourceDirs bi)]
++ ["-i" ++ autogenModulesDir lbi]
++ ["-i" ++ mockDir]
++ ["-I" ++ dir | dir <- PD.includeDirs bi]
++ ["-odir", mockDir]
Expand Down
2 changes: 1 addition & 1 deletion Distribution/Simple/JHC.hs
Expand Up @@ -157,8 +157,8 @@ constructJHCCmdLine lbi bi _odir verbosity =
++ extensionsToFlags (compiler lbi) (extensions bi)
++ hcOptions JHC bi
++ ["--noauto","-i-"]
++ ["-i", autogenModulesDir lbi]
++ concat [["-i", l] | l <- nub (hsSourceDirs bi)]
++ ["-i", autogenModulesDir lbi]
++ ["-optc" ++ opt | opt <- PD.ccOptions bi]
++ (concat [ ["-p", display pkg] | pkg <- packageDeps lbi ])

Expand Down
5 changes: 3 additions & 2 deletions Distribution/Simple/PreProcess.hs
Expand Up @@ -64,6 +64,7 @@ import Distribution.Package
import Distribution.Simple.Compiler
( CompilerFlavor(..), Compiler(..), compilerFlavor, compilerVersion )
import Distribution.Simple.LocalBuildInfo (LocalBuildInfo(..))
import Distribution.Simple.BuildPaths (autogenModulesDir)
import Distribution.Simple.Utils
( createDirectoryIfMissingVerbose, readUTF8File, writeUTF8File
, die, setupMessage, intercalate
Expand Down Expand Up @@ -173,7 +174,7 @@ preprocessSources pkg_descr lbi forSDist verbosity handlers = do
setupMessage verbosity "Preprocessing library" (packageId pkg_descr)
let bi = libBuildInfo lib
let biHandlers = localHandlers bi
sequence_ [ preprocessModule (hsSourceDirs bi) (buildDir lbi) forSDist
sequence_ [ preprocessModule (hsSourceDirs bi ++ [autogenModulesDir lbi]) (buildDir lbi) forSDist
modu verbosity builtinSuffixes biHandlers
| modu <- libModules pkg_descr]
unless (null (executables pkg_descr)) $
Expand All @@ -182,7 +183,7 @@ preprocessSources pkg_descr lbi forSDist verbosity handlers = do
let bi = buildInfo theExe
let biHandlers = localHandlers bi
let exeDir = buildDir lbi </> exeName theExe </> exeName theExe ++ "-tmp"
sequence_ [ preprocessModule (hsSourceDirs bi) exeDir forSDist
sequence_ [ preprocessModule (hsSourceDirs bi ++ [autogenModulesDir lbi]) exeDir forSDist
modu verbosity builtinSuffixes biHandlers
| modu <- otherModules bi]
preprocessModule (hsSourceDirs bi) exeDir forSDist
Expand Down

0 comments on commit 6bc049c

Please sign in to comment.