change from using "dirs" to "dir" for FFI library configuration
authorKarel Gardas <karel.gardas@centrum.cz>
Mon, 18 Jan 2016 09:24:42 +0000 (10:24 +0100)
committerKarel Gardas <karel.gardas@centrum.cz>
Mon, 18 Jan 2016 09:24:42 +0000 (10:24 +0100)
cfg/system.config.in
src/Oracles/Config/Setting.hs
src/Rules/Libffi.hs

index ecbf18d..94058df 100644 (file)
@@ -128,8 +128,8 @@ gmp-include-dirs   = @GMP_INCLUDE_DIRS@
 gmp-lib-dirs       = @GMP_LIB_DIRS@\r
 \r
 use-system-ffi     = @UseSystemLibFFI@\r
-ffi-include-dirs   = @FFIIncludeDir@\r
-ffi-lib-dirs       = @FFILibDir@\r
+ffi-include-dir   = @FFIIncludeDir@\r
+ffi-lib-dir       = @FFILibDir@\r
 \r
 # Optional Dependencies:\r
 #=======================\r
index 56ef1ca..f4540cc 100644 (file)
@@ -47,6 +47,8 @@ data Setting = BuildArch
              | TargetPlatform
              | TargetPlatformFull
              | TargetVendor
+             | FfiIncludeDir
+             | FfiLibDir
 
 data SettingList = ConfCcArgs Stage
                  | ConfCppArgs Stage
@@ -57,8 +59,6 @@ data SettingList = ConfCcArgs Stage
                  | HsCppArgs
                  | IconvIncludeDirs
                  | IconvLibDirs
-                 | FfiIncludeDirs
-                 | FfiLibDirs
 
 setting :: Setting -> Action String
 setting key = askConfig $ case key of
@@ -90,6 +90,8 @@ setting key = askConfig $ case key of
     TargetPlatform     -> "target-platform"
     TargetPlatformFull -> "target-platform-full"
     TargetVendor       -> "target-vendor"
+    FfiIncludeDir      -> "ffi-include-dir"
+    FfiLibDir          -> "ffi-lib-dir"
 
 settingList :: SettingList -> Action [String]
 settingList key = fmap words $ askConfig $ case key of
@@ -102,8 +104,6 @@ settingList key = fmap words $ askConfig $ case key of
     HsCppArgs               -> "hs-cpp-args"
     IconvIncludeDirs        -> "iconv-include-dirs"
     IconvLibDirs            -> "iconv-lib-dirs"
-    FfiIncludeDirs          -> "ffi-include-dirs"
-    FfiLibDirs              -> "ffi-lib-dirs"
 
 getSetting :: Setting -> ReaderT a Action String
 getSetting = lift . setting
index fea58ab..518389e 100644 (file)
@@ -70,12 +70,11 @@ configureArguments = do
 libffiRules :: Rules ()
 libffiRules = do
     libffiDependencies &%> \_ -> do
-        ffi_header_dirs <- settingList FfiIncludeDirs
+        ffi_header_dir <- setting FfiIncludeDir
         use_system_ffi <- flag UseSystemFfi
         if use_system_ffi
         then do
           putBuild "| System supplied FFI library will be used"
-          let ffi_header_dir = head ffi_header_dirs
           forM_ ["ffi.h", "ffitarget.h"] $ \file -> do
               let src = ffi_header_dir  -/- file
               copyFile src (rtsBuildPath -/- file)