diff options
author | Ben Gamari <ben@smart-cactus.org> | 2019-09-26 16:06:28 -0400 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2019-11-06 08:05:57 -0500 |
commit | ce9e2a1a9307bf43ead278dd1fc8db4325d82340 (patch) | |
tree | bd134ac511b2d20755290d9b63505cffeb2a9518 /hadrian | |
parent | 3ce18700f80a12c48a029b49c6201ad2410071bb (diff) | |
download | haskell-ce9e2a1a9307bf43ead278dd1fc8db4325d82340.tar.gz |
configure: Add --with-libdw-{includes,libraries} flags
Fixing #17255.
Diffstat (limited to 'hadrian')
-rw-r--r-- | hadrian/cfg/system.config.in | 3 | ||||
-rw-r--r-- | hadrian/src/Oracles/Setting.hs | 4 | ||||
-rw-r--r-- | hadrian/src/Settings/Builders/Common.hs | 2 | ||||
-rw-r--r-- | hadrian/src/Settings/Packages.hs | 6 |
4 files changed, 14 insertions, 1 deletions
diff --git a/hadrian/cfg/system.config.in b/hadrian/cfg/system.config.in index 6c78f43ccb..b531bd8c31 100644 --- a/hadrian/cfg/system.config.in +++ b/hadrian/cfg/system.config.in @@ -169,6 +169,9 @@ use-system-ffi = @UseSystemLibFFI@ ffi-include-dir = @FFIIncludeDir@ ffi-lib-dir = @FFILibDir@ +libdw-include-dir = @LibdwIncludeDir@ +libdw-lib-dir = @LibdwLibDir@ + # Optional Dependencies: #======================= diff --git a/hadrian/src/Oracles/Setting.hs b/hadrian/src/Oracles/Setting.hs index d8156f778f..569d9a4ed4 100644 --- a/hadrian/src/Oracles/Setting.hs +++ b/hadrian/src/Oracles/Setting.hs @@ -54,6 +54,8 @@ data Setting = BuildArch | HostOsHaskell | IconvIncludeDir | IconvLibDir + | LibdwIncludeDir + | LibdwLibDir | LlvmTarget | ProjectGitCommitId | ProjectName @@ -141,6 +143,8 @@ setting key = lookupValueOrError configFile $ case key of HostOsHaskell -> "host-os-haskell" IconvIncludeDir -> "iconv-include-dir" IconvLibDir -> "iconv-lib-dir" + LibdwIncludeDir -> "libdw-include-dir" + LibdwLibDir -> "libdw-lib-dir" LlvmTarget -> "llvm-target" ProjectGitCommitId -> "project-git-commit-id" ProjectName -> "project-name" diff --git a/hadrian/src/Settings/Builders/Common.hs b/hadrian/src/Settings/Builders/Common.hs index 2c41d92493..5421972659 100644 --- a/hadrian/src/Settings/Builders/Common.hs +++ b/hadrian/src/Settings/Builders/Common.hs @@ -29,12 +29,14 @@ cIncludeArgs = do iconvIncludeDir <- getSetting IconvIncludeDir gmpIncludeDir <- getSetting GmpIncludeDir ffiIncludeDir <- getSetting FfiIncludeDir + libdwIncludeDir <- getSetting FfiIncludeDir libPath <- expr $ stageLibPath stage mconcat [ notStage0 ||^ package compiler ? arg "-Iincludes" , arg $ "-I" ++ libPath , arg $ "-I" ++ path , pure . map ("-I"++) . filter (/= "") $ [iconvIncludeDir, gmpIncludeDir] , flag UseSystemFfi ? arg ("-I" ++ ffiIncludeDir) + , flag WithLibdw ? if not (null libdwIncludeDir) then arg ("-I" ++ libdwIncludeDir) else mempty -- Add @incDirs@ in the build directory, since some files generated -- with @autoconf@ may end up in the build directory. , pure [ "-I" ++ path -/- dir | dir <- incDirs ] diff --git a/hadrian/src/Settings/Packages.hs b/hadrian/src/Settings/Packages.hs index 0f1ae6426a..4d399ca9f0 100644 --- a/hadrian/src/Settings/Packages.hs +++ b/hadrian/src/Settings/Packages.hs @@ -199,11 +199,14 @@ rtsPackageArgs = package rts ? do libffiName <- expr libffiLibraryName ffiIncludeDir <- getSetting FfiIncludeDir ffiLibraryDir <- getSetting FfiLibDir + libdwIncludeDir <- getSetting LibdwIncludeDir + libdwLibraryDir <- getSetting LibdwLibDir -- Arguments passed to GHC when compiling C and .cmm sources. let ghcArgs = mconcat [ arg "-Irts" , arg $ "-I" ++ path + , flag WithLibdw ? if not (null libdwIncludeDir) then arg ("-I" ++ libdwIncludeDir) else mempty , arg $ "-DRtsWay=\"rts_" ++ show way ++ "\"" -- Set the namespace for the rts fs functions , arg $ "-DFS_NAMESPACE=rts" @@ -320,7 +323,8 @@ rtsPackageArgs = package rts ? do [ "-DTOP=" ++ show top , "-DFFI_INCLUDE_DIR=" ++ show ffiIncludeDir , "-DFFI_LIB_DIR=" ++ show ffiLibraryDir - , "-DFFI_LIB=" ++ show libffiName ] + , "-DFFI_LIB=" ++ show libffiName + , "-DLIBDW_LIB_DIR=" ++ show libdwLibraryDir ] , builder HsCpp ? flag HaveLibMingwEx ? arg "-DHAVE_LIBMINGWEX" ] |