diff options
author | Ben Gamari <ben@smart-cactus.org> | 2020-02-17 17:50:56 -0500 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-02-26 15:08:47 -0500 |
commit | def486c90ef6f37d81d0d9c6df754431ff94c6a4 (patch) | |
tree | 698fc18d7c9f21075057285495d3436082ebf6ce /hadrian | |
parent | 621468f680a111c20366a9445a3b225cbc34ffbf (diff) | |
download | haskell-def486c90ef6f37d81d0d9c6df754431ff94c6a4.tar.gz |
hadrian: Allow libnuma library path to be specified
Diffstat (limited to 'hadrian')
-rw-r--r-- | hadrian/cfg/system.config.in | 4 | ||||
-rw-r--r-- | hadrian/src/Oracles/Flag.hs | 2 | ||||
-rw-r--r-- | hadrian/src/Oracles/Setting.hs | 4 | ||||
-rw-r--r-- | hadrian/src/Settings/Packages.hs | 7 |
4 files changed, 17 insertions, 0 deletions
diff --git a/hadrian/cfg/system.config.in b/hadrian/cfg/system.config.in index 5c494cf27e..3a67bffbe0 100644 --- a/hadrian/cfg/system.config.in +++ b/hadrian/cfg/system.config.in @@ -172,8 +172,12 @@ ffi-lib-dir = @FFILibDir@ libdw-include-dir = @LibdwIncludeDir@ libdw-lib-dir = @LibdwLibDir@ +libnuma-include-dir = @LibNumaIncludeDir@ +libnuma-lib-dir = @LibNumaLibDir@ + # Optional Dependencies: #======================= with-libdw = @UseLibdw@ +with-libnuma = @UseLibNuma@ have-lib-mingw-ex = @HaveLibMingwEx@ diff --git a/hadrian/src/Oracles/Flag.hs b/hadrian/src/Oracles/Flag.hs index c5c5360422..34713faae1 100644 --- a/hadrian/src/Oracles/Flag.hs +++ b/hadrian/src/Oracles/Flag.hs @@ -21,6 +21,7 @@ data Flag = ArSupportsAtFile | LeadingUnderscore | SolarisBrokenShld | WithLibdw + | WithLibnuma | HaveLibMingwEx | UseSystemFfi @@ -39,6 +40,7 @@ flag f = do LeadingUnderscore -> "leading-underscore" SolarisBrokenShld -> "solaris-broken-shld" WithLibdw -> "with-libdw" + WithLibnuma -> "with-libnuma" HaveLibMingwEx -> "have-lib-mingw-ex" UseSystemFfi -> "use-system-ffi" value <- lookupValueOrError configFile key diff --git a/hadrian/src/Oracles/Setting.hs b/hadrian/src/Oracles/Setting.hs index 632d783e9a..ac343fc67e 100644 --- a/hadrian/src/Oracles/Setting.hs +++ b/hadrian/src/Oracles/Setting.hs @@ -56,6 +56,8 @@ data Setting = BuildArch | IconvLibDir | LibdwIncludeDir | LibdwLibDir + | LibnumaIncludeDir + | LibnumaLibDir | LlvmTarget | ProjectGitCommitId | ProjectName @@ -145,6 +147,8 @@ setting key = lookupValueOrError configFile $ case key of IconvLibDir -> "iconv-lib-dir" LibdwIncludeDir -> "libdw-include-dir" LibdwLibDir -> "libdw-lib-dir" + LibnumaIncludeDir -> "libnuma-include-dir" + LibnumaLibDir -> "libnuma-lib-dir" LlvmTarget -> "llvm-target" ProjectGitCommitId -> "project-git-commit-id" ProjectName -> "project-name" diff --git a/hadrian/src/Settings/Packages.hs b/hadrian/src/Settings/Packages.hs index 0c10549f90..6e1f8f625f 100644 --- a/hadrian/src/Settings/Packages.hs +++ b/hadrian/src/Settings/Packages.hs @@ -205,6 +205,8 @@ rtsPackageArgs = package rts ? do ffiLibraryDir <- getSetting FfiLibDir libdwIncludeDir <- getSetting LibdwIncludeDir libdwLibraryDir <- getSetting LibdwLibDir + libnumaIncludeDir <- getSetting LibnumaIncludeDir + libnumaLibraryDir <- getSetting LibnumaLibDir -- Arguments passed to GHC when compiling C and .cmm sources. let ghcArgs = mconcat @@ -212,6 +214,8 @@ rtsPackageArgs = package rts ? do , arg $ "-I" ++ path , flag WithLibdw ? if not (null libdwIncludeDir) then arg ("-I" ++ libdwIncludeDir) else mempty , flag WithLibdw ? if not (null libdwLibraryDir) then arg ("-L" ++ libdwLibraryDir) else mempty + , flag WithLibnuma ? if not (null libnumaIncludeDir) then arg ("-I" ++ libnumaIncludeDir) else mempty + , flag WithLibnuma ? if not (null libnumaLibraryDir) then arg ("-L" ++ libnumaLibraryDir) else mempty , arg $ "-DRtsWay=\"rts_" ++ show way ++ "\"" -- Set the namespace for the rts fs functions , arg $ "-DFS_NAMESPACE=rts" @@ -321,6 +325,9 @@ rtsPackageArgs = package rts ? do , any (wayUnit Dynamic) rtsWays ? arg "dynamic" , Debug `wayUnit` way ? arg "find-ptr" ] + , builder (Cabal Setup) ? + if not (null libnumaLibraryDir) then arg ("--extra-lib-dirs="++libnumaLibraryDir) else mempty + <> if not (null libnumaIncludeDir) then arg ("--extra-include-dirs="++libnumaIncludeDir) else mempty , builder (Cc FindCDependencies) ? cArgs , builder (Ghc CompileCWithGhc) ? map ("-optc" ++) <$> cArgs , builder Ghc ? ghcArgs |