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