Commit 19310e7f authored by Andrey Mokhov's avatar Andrey Mokhov
Browse files

Fix libCffi name on Windows (fix #89).

parent 64f93509
......@@ -6,6 +6,7 @@ import GHC
import Rules.Actions
import Rules.Generate
import Rules.Libffi
import Settings.Packages.Rts
import Settings.TargetDirectory
installTargets :: [FilePath]
......@@ -23,7 +24,8 @@ copyRules = do
++ "(found: " ++ show ffiHPaths ++ ")."
copyFile (takeDirectory (head ffiHPaths) -/- takeFileName ffih) ffih
copyFile libffiLibrary (targetPath Stage1 rts -/- "build" -/- "libCffi.a")
libffiName <- rtsLibffiLibraryName
copyFile libffiLibrary (targetPath Stage1 rts -/- "build/lib" ++ libffiName <.> "a")
"inplace/lib/template-hsc.h" <~ pkgPath hsc2hs
"inplace/lib/platformConstants" <~ derivedConstantsPath
......
module Settings.Packages.Rts (rtsPackageArgs, rtsConfIn, rtsConf) where
module Settings.Packages.Rts (
rtsPackageArgs, rtsConfIn, rtsConf, rtsLibffiLibraryName
) where
import Base
import Expression
......@@ -15,6 +17,11 @@ rtsConfIn = pkgPath rts -/- "package.conf.in"
rtsConf :: FilePath
rtsConf = targetPath Stage1 rts -/- "package.conf.inplace"
rtsLibffiLibraryName :: Action FilePath
rtsLibffiLibraryName = do
windows <- windowsHost
return $ if windows then "Cffi-6" else "Cffi"
rtsPackageArgs :: Args
rtsPackageArgs = package rts ? do
let yesNo = lift . fmap (\x -> if x then "YES" else "NO")
......@@ -36,8 +43,7 @@ rtsPackageArgs = package rts ? do
way <- getWay
path <- getTargetPath
top <- getSetting GhcSourcePath
windows <- lift $ windowsHost
let libffiName = if windows then "ffi-6" else "ffi"
libffiName <- lift $ rtsLibffiLibraryName
mconcat
[ builderGcc ? mconcat
[ arg "-Irts"
......@@ -74,7 +80,7 @@ rtsPackageArgs = package rts ? do
[ arg ("-DTOP=" ++ quote top)
, arg "-DFFI_INCLUDE_DIR="
, arg "-DFFI_LIB_DIR="
, arg $ "-DFFI_LIB=" ++ quote ("C" ++ libffiName) ] ]
, arg $ "-DFFI_LIB=" ++ quote libffiName ] ]
-- #-----------------------------------------------------------------------------
-- # Use system provided libffi
......
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