[commit: ghc] wip/nfs-locking: Add options SplitObjectsBroken, GhcUnregisterised, DynamicExtension, ProjectVersion. (b5beba9)

git at git.haskell.org git at git.haskell.org
Thu Oct 26 23:21:15 UTC 2017


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

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

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

commit b5beba96f0d4c6ba31e0e97d08ca54502acf8ec7
Author: Andrey Mokhov <andrey.mokhov at gmail.com>
Date:   Tue Jan 13 02:17:53 2015 +0000

    Add options SplitObjectsBroken, GhcUnregisterised, DynamicExtension, ProjectVersion.


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

b5beba96f0d4c6ba31e0e97d08ca54502acf8ec7
 cfg/default.config.in |  6 ++++++
 src/Oracles/Flag.hs   |  4 ++++
 src/Oracles/Option.hs | 34 ++++++++++++++++++++++++++--------
 3 files changed, 36 insertions(+), 8 deletions(-)

diff --git a/cfg/default.config.in b/cfg/default.config.in
index b1eadd0..ac42e24 100644
--- a/cfg/default.config.in
+++ b/cfg/default.config.in
@@ -32,6 +32,8 @@ lax-dependencies     = NO
 dynamic-ghc-programs = NO
 supports-package-key = @SUPPORTS_PACKAGE_KEY@
 solaris-broken-shld  = @SOLARIS_BROKEN_SHLD@
+split-objects-broken = @SplitObjsBroken@
+ghc-unregisterised   = @Unregisterised@
 
 # Information about host and target systems:
 #===========================================
@@ -44,6 +46,10 @@ host-os-cpp          = @HostOS_CPP@
 
 cross-compiling      = @CrossCompiling@
 
+dynamic-extension    = @soext_target@
+
+project-version      = @ProjectVersion@
+
 # Compilation and linking flags:
 #===============================
 
diff --git a/src/Oracles/Flag.hs b/src/Oracles/Flag.hs
index b93e4ab..e9aace5 100644
--- a/src/Oracles/Flag.hs
+++ b/src/Oracles/Flag.hs
@@ -21,6 +21,8 @@ data Flag = LaxDeps
           | Validating
           | SupportsPackageKey
           | SolarisBrokenShld
+          | SplitObjectsBroken
+          | GhcUnregisterised
 
 -- TODO: Give the warning *only once* per key
 test :: Flag -> Action Bool
@@ -34,6 +36,8 @@ test flag = do
         Validating         -> ("validating"           , False)
         SupportsPackageKey -> ("supports-package-key" , False)
         SolarisBrokenShld  -> ("solaris-broken-shld"  , False)
+        SplitObjectsBroken -> ("split-objects-broken" , False)
+        GhcUnregisterised  -> ("ghc-unregisterised"   , False)
     let defaultString = if defaultValue then "YES" else "NO"
     value <- askConfigWithDefault key $
         do putLoud $ "\nFlag '"
diff --git a/src/Oracles/Option.hs b/src/Oracles/Option.hs
index 029b9bd..89192a7 100644
--- a/src/Oracles/Option.hs
+++ b/src/Oracles/Option.hs
@@ -1,13 +1,14 @@
 {-# LANGUAGE NoImplicitPrelude #-}
 module Oracles.Option (
     Option (..),
-    ghcWithInterpreter, platformSupportsSharedLibs, windowsHost
+    ghcWithInterpreter, platformSupportsSharedLibs, windowsHost, splitObjects
     ) where
 
 import Base
 import Oracles.Flag
 import Oracles.Base
 
+-- TODO: separate single string options from multiple string ones.
 data Option = TargetOS
             | TargetArch
             | TargetPlatformFull
@@ -21,6 +22,8 @@ data Option = TargetOS
             | GmpLibDirs
             | SrcHcOpts
             | HostOsCpp
+            | DynamicExtension
+            | ProjectVersion
 
 instance ShowArgs Option where
     showArgs opt = showArgs $ fmap words $ askConfig $ case opt of 
@@ -37,15 +40,17 @@ instance ShowArgs Option where
         GmpLibDirs              -> "gmp-lib-dirs"
         SrcHcOpts               -> "src-hc-opts"
         HostOsCpp               -> "host-os-cpp"
+        DynamicExtension        -> "dynamic-extension"
+        ProjectVersion          -> "project-version"
 
 ghcWithInterpreter :: Condition
 ghcWithInterpreter = do
     [os]   <- showArgs TargetOS
     [arch] <- showArgs TargetArch
     return $
-        os `elem` [ "mingw32", "cygwin32", "linux", "solaris2"
-                  , "freebsd", "dragonfly", "netbsd", "openbsd"
-                  , "darwin", "kfreebsdgnu"]
+        os `elem` ["mingw32", "cygwin32", "linux", "solaris2",
+                   "freebsd", "dragonfly", "netbsd", "openbsd",
+                   "darwin", "kfreebsdgnu"]
         &&
         arch `elem` ["i386", "x86_64", "powerpc", "sparc", "sparc64", "arm"]
 
@@ -54,12 +59,25 @@ platformSupportsSharedLibs = do
     [platform] <- showArgs TargetPlatformFull
     solarisBrokenShld <- test SolarisBrokenShld
     return $ notElem platform $
-        [ "powerpc-unknown-linux"
-        , "x86_64-unknown-mingw32"
-        , "i386-unknown-mingw32"] ++
-        [ "i386-unknown-solaris2" | solarisBrokenShld ]
+        ["powerpc-unknown-linux",
+         "x86_64-unknown-mingw32",
+         "i386-unknown-mingw32"] ++
+        ["i386-unknown-solaris2" | solarisBrokenShld]
 
 windowsHost :: Condition
 windowsHost = do
     [hostOsCpp] <- showArgs HostOsCpp
     return $ hostOsCpp `elem` ["mingw32", "cygwin32"]
+
+-- TODO: refactor helper Condition functions into a separate file
+splitObjects :: Stage -> Condition
+splitObjects stage = do
+    [os]   <- showArgs TargetOS
+    [arch] <- showArgs TargetArch
+    splitObjectsBroken <- test SplitObjectsBroken
+    ghcUnregisterised  <- test GhcUnregisterised
+    return $ not splitObjectsBroken && not ghcUnregisterised
+           && arch `elem` ["i386", "x86_64", "powerpc", "sparc"]
+           && os   `elem` ["mingw32", "cygwin32", "linux", "darwin",
+                           "solaris2", "freebsd", "dragonfly", "netbsd",
+                           "openbsd"]



More information about the ghc-commits mailing list