[commit: ghc] wip/nfs-locking: Fix include paths for Gcc. (2c7003a)
git at git.haskell.org
git at git.haskell.org
Thu Oct 26 23:08:47 UTC 2017
Repository : ssh://git@git.haskell.org/ghc
On branch : wip/nfs-locking
Link : http://ghc.haskell.org/trac/ghc/changeset/2c7003a009d1205a73430b21bdc05caab23a8d85/ghc
>---------------------------------------------------------------
commit 2c7003a009d1205a73430b21bdc05caab23a8d85
Author: Andrey Mokhov <andrey.mokhov at gmail.com>
Date: Mon Jan 19 17:03:40 2015 +0000
Fix include paths for Gcc.
>---------------------------------------------------------------
2c7003a009d1205a73430b21bdc05caab23a8d85
src/Oracles/Builder.hs | 2 +-
src/Package/Base.hs | 9 ++++++++-
src/Package/Compile.hs | 3 +--
src/Package/Dependencies.hs | 2 +-
4 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/src/Oracles/Builder.hs b/src/Oracles/Builder.hs
index e52cc58..dc41507 100644
--- a/src/Oracles/Builder.hs
+++ b/src/Oracles/Builder.hs
@@ -119,7 +119,7 @@ interestingInfo builder ss = case builder of
Ld -> prefixAndSuffix 4 0 ss
Gcc _ -> if head ss == "-MM"
then prefixAndSuffix 1 1 ss
- else ss
+ else prefixAndSuffix 0 4 ss
Ghc _ -> if head ss == "-M"
then prefixAndSuffix 1 1 ss
else prefixAndSuffix 0 4 ss
diff --git a/src/Package/Base.hs b/src/Package/Base.hs
index 8e12f15..e2031b6 100644
--- a/src/Package/Base.hs
+++ b/src/Package/Base.hs
@@ -7,7 +7,8 @@ module Package.Base (
Package (..), Settings (..), TodoItem (..),
defaultSettings, libraryPackage, standardLibrary,
commonCcArgs, commonLdArgs, commonCppArgs, commonCcWarninigArgs,
- pathArgs, packageArgs, includeGhcArgs, pkgHsSources,
+ pathArgs, packageArgs,
+ includeGccArgs, includeGhcArgs, pkgHsSources,
pkgDepHsObjects, pkgLibHsObjects, pkgCObjects,
argSizeLimit,
sourceDependecies,
@@ -99,6 +100,12 @@ packageArgs stage pathDist = do
else productArgs "-package-name" (arg $ PackageKey pathDist)
<> productArgs "-package" (args $ Deps pathDist) ]
+includeGccArgs :: FilePath -> FilePath -> Args
+includeGccArgs path dist =
+ let pathDist = path </> dist
+ in args [ pathArgs "-I" path $ IncludeDirs pathDist
+ , pathArgs "-I" path $ DepIncludeDirs pathDist ]
+
includeGhcArgs :: FilePath -> FilePath -> Args
includeGhcArgs path dist =
let pathDist = path </> dist
diff --git a/src/Package/Compile.hs b/src/Package/Compile.hs
index e98f1a5..eb2417f 100644
--- a/src/Package/Compile.hs
+++ b/src/Package/Compile.hs
@@ -34,8 +34,7 @@ gccArgs (Package _ path _) (_, dist, _) srcs result =
in args [ args $ CcArgs pathDist
, commonCcArgs
, commonCcWarninigArgs
- , pathArgs "-I" path $ IncludeDirs pathDist
- , pathArgs "-I" path $ DepIncludeDirs pathDist
+ , includeGccArgs path dist
, args ("-c":srcs)
, args ["-o", result] ]
diff --git a/src/Package/Dependencies.hs b/src/Package/Dependencies.hs
index f87580a..abee3f3 100644
--- a/src/Package/Dependencies.hs
+++ b/src/Package/Dependencies.hs
@@ -51,7 +51,7 @@ gccArgs sourceFile (Package _ path _) (stage, dist, _) =
, args $ CcArgs pathDist
, commonCcArgs
, commonCcWarninigArgs
- , pathArgs "-I" path $ IncludeDirs pathDist
+ , includeGccArgs path dist
, args ["-MF", unifyPath depFile]
, args ["-x", "c"]
, arg $ unifyPath sourceFile ]
More information about the ghc-commits
mailing list