[commit: ghc] wip/nfs-locking: use flag instead of setting for use system ffi value (afc4d05)

git at git.haskell.org git at git.haskell.org
Fri Oct 27 00:11:44 UTC 2017


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/nfs-locking
Link       : http://ghc.haskell.org/trac/ghc/changeset/afc4d05a9f33555887df3217adb6c70ebe806d2f/ghc

>---------------------------------------------------------------

commit afc4d05a9f33555887df3217adb6c70ebe806d2f
Author: Karel Gardas <karel.gardas at centrum.cz>
Date:   Sun Jan 17 23:52:48 2016 +0100

    use flag instead of setting for use system ffi value


>---------------------------------------------------------------

afc4d05a9f33555887df3217adb6c70ebe806d2f
 src/Oracles/Config/Flag.hs    | 2 ++
 src/Oracles/Config/Setting.hs | 2 --
 src/Rules/Libffi.hs           | 4 ++--
 src/Settings/Packages/Rts.hs  | 6 +++---
 4 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/Oracles/Config/Flag.hs b/src/Oracles/Config/Flag.hs
index 44e8a17..9d33445 100644
--- a/src/Oracles/Config/Flag.hs
+++ b/src/Oracles/Config/Flag.hs
@@ -19,6 +19,7 @@ data Flag = ArSupportsAtFile
           | SolarisBrokenShld
           | SplitObjectsBroken
           | WithLibdw
+          | UseSystemFfi
 
 -- Note, if a flag is set to empty string we treat it as set to NO. This seems
 -- fragile, but some flags do behave like this, e.g. GccIsClang.
@@ -34,6 +35,7 @@ flag f = do
         SolarisBrokenShld  -> "solaris-broken-shld"
         SplitObjectsBroken -> "split-objects-broken"
         WithLibdw          -> "with-libdw"
+        UseSystemFfi       -> "use-system-ffi"
     value <- askConfigWithDefault key . putError
         $ "\nFlag '" ++ key ++ "' not set in configuration files."
     unless (value == "YES" || value == "NO" || value == "") . putError
diff --git a/src/Oracles/Config/Setting.hs b/src/Oracles/Config/Setting.hs
index 7b5d71e..56ef1ca 100644
--- a/src/Oracles/Config/Setting.hs
+++ b/src/Oracles/Config/Setting.hs
@@ -47,7 +47,6 @@ data Setting = BuildArch
              | TargetPlatform
              | TargetPlatformFull
              | TargetVendor
-             | UseSystemFfi
 
 data SettingList = ConfCcArgs Stage
                  | ConfCppArgs Stage
@@ -91,7 +90,6 @@ setting key = askConfig $ case key of
     TargetPlatform     -> "target-platform"
     TargetPlatformFull -> "target-platform-full"
     TargetVendor       -> "target-vendor"
-    UseSystemFfi       -> "use-system-ffi"
 
 settingList :: SettingList -> Action [String]
 settingList key = fmap words $ askConfig $ case key of
diff --git a/src/Rules/Libffi.hs b/src/Rules/Libffi.hs
index 5f23cad..fea58ab 100644
--- a/src/Rules/Libffi.hs
+++ b/src/Rules/Libffi.hs
@@ -70,9 +70,9 @@ configureArguments = do
 libffiRules :: Rules ()
 libffiRules = do
     libffiDependencies &%> \_ -> do
-        use_system_ffi <- setting UseSystemFfi
         ffi_header_dirs <- settingList FfiIncludeDirs
-        if use_system_ffi == "YES"
+        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
diff --git a/src/Settings/Packages/Rts.hs b/src/Settings/Packages/Rts.hs
index 26fce73..e684b7a 100644
--- a/src/Settings/Packages/Rts.hs
+++ b/src/Settings/Packages/Rts.hs
@@ -20,11 +20,11 @@ rtsConf = pkgPath rts -/- targetDirectory Stage1 rts -/- "package.conf.inplace"
 
 rtsLibffiLibraryName :: Action FilePath
 rtsLibffiLibraryName = do
-    use_system_ffi <- setting UseSystemFfi
+    use_system_ffi <- flag UseSystemFfi
     windows <- windowsHost
     case (use_system_ffi, windows) of
-      ("YES", False) -> return "ffi"
-      ("NO", False) -> return "Cffi"
+      (True, False) -> return "ffi"
+      (False, False) -> return "Cffi"
       (_, True) -> return "Cffi-6"
       (_, _) -> error "Unsupported FFI library configuration case"
 



More information about the ghc-commits mailing list