Commit 91a8babe authored by Andrey Mokhov's avatar Andrey Mokhov
Browse files

Add DepIncludeDirs package data option.

parent 20ed2d1d
......@@ -23,16 +23,17 @@ data PackageData = Version FilePath
| PackageKey FilePath
| Synopsis FilePath
data MultiPackageData = Modules FilePath
| SrcDirs FilePath
| IncludeDirs FilePath
| Deps FilePath
| DepKeys FilePath
| DepNames FilePath
| CppArgs FilePath
| HsArgs FilePath
| CcArgs FilePath
| CSrcs FilePath
data MultiPackageData = Modules FilePath
| SrcDirs FilePath
| IncludeDirs FilePath
| Deps FilePath
| DepKeys FilePath
| DepNames FilePath
| CppArgs FilePath
| HsArgs FilePath
| CcArgs FilePath
| CSrcs FilePath
| DepIncludeDirs FilePath
newtype PackageDataKey = PackageDataKey (FilePath, String)
deriving (Show, Typeable, Eq, Hashable, Binary, NFData)
......@@ -53,16 +54,17 @@ instance ShowArg PackageData where
instance ShowArgs MultiPackageData where
showArgs packageData = do
let (key, path, defaultValue) = case packageData of
Modules path -> ("MODULES" , path, "" )
SrcDirs path -> ("HS_SRC_DIRS" , path, ".")
IncludeDirs path -> ("INCLUDE_DIRS", path, ".")
Deps path -> ("DEPS" , path, "" )
DepKeys path -> ("DEP_KEYS" , path, "" )
DepNames path -> ("DEP_NAMES" , path, "" )
CppArgs path -> ("CPP_OPTS" , path, "" )
HsArgs path -> ("HC_OPTS" , path, "" )
CcArgs path -> ("CC_OPTS" , path, "" )
CSrcs path -> ("C_SRCS" , path, "" )
Modules path -> ("MODULES" , path, "" )
SrcDirs path -> ("HS_SRC_DIRS" , path, ".")
IncludeDirs path -> ("INCLUDE_DIRS" , path, ".")
Deps path -> ("DEPS" , path, "" )
DepKeys path -> ("DEP_KEYS" , path, "" )
DepNames path -> ("DEP_NAMES" , path, "" )
CppArgs path -> ("CPP_OPTS" , path, "" )
HsArgs path -> ("HC_OPTS" , path, "" )
CcArgs path -> ("CC_OPTS" , path, "" )
CSrcs path -> ("C_SRCS" , path, "" )
DepIncludeDirs path -> ("DEP_LIB_REL_DIRS", path, "" )
fullKey = replaceSeparators '_' $ path ++ "_" ++ key
pkgData = path </> "package-data.mk"
res <- askOracle $ PackageDataKey (pkgData, fullKey)
......
......@@ -155,7 +155,7 @@ findModuleFiles pathDist directories suffixes = do
] $ \file -> do
let dir = takeDirectory file
dirExists <- liftIO $ S.doesDirectoryExist dir
when dirExists $ return file
when dirExists $ return $ unifyPath file
files <- getDirectoryFiles "" fileList
return $ map unifyPath files
......
......@@ -35,6 +35,7 @@ gccArgs (Package _ path _) (_, dist, _) srcs result =
, commonCcArgs
, commonCcWarninigArgs
, pathArgs "-I" path $ IncludeDirs pathDist
, pathArgs "-I" path $ DepIncludeDirs pathDist
, args ("-c":srcs)
, args ["-o", result] ]
......
......@@ -21,6 +21,7 @@ libraryPackagesInStage Stage1 =
, "deepseq"
, "directory"
, "filepath"
, "ghc-prim"
, "parallel"
, "pretty"
, "stm"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment