[commit: ghc] master: Build system: Make cGhcRtsWithLibdw flag a proper Bool (109d847)

git at git.haskell.org git at git.haskell.org
Thu Dec 17 11:54:25 UTC 2015


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/109d847971691a89dab6c80b37f46dc33197b8c2/ghc

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

commit 109d847971691a89dab6c80b37f46dc33197b8c2
Author: Ben Gamari <bgamari.foss at gmail.com>
Date:   Thu Dec 17 12:14:53 2015 +0100

    Build system: Make cGhcRtsWithLibdw flag a proper Bool
    
    Test Plan: validate
    
    Reviewers: austin
    
    Reviewed By: austin
    
    Subscribers: thomie
    
    Differential Revision: https://phabricator.haskell.org/D1642


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

109d847971691a89dab6c80b37f46dc33197b8c2
 compiler/ghc.mk           |  8 ++++++--
 compiler/main/DynFlags.hs | 15 +++++++--------
 2 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/compiler/ghc.mk b/compiler/ghc.mk
index f5c53d4..9148c79 100644
--- a/compiler/ghc.mk
+++ b/compiler/ghc.mk
@@ -102,8 +102,12 @@ endif
 	@echo 'cGhcWithSMP           = "$(GhcWithSMP)"'                     >> $@
 	@echo 'cGhcRTSWays           :: String'                             >> $@
 	@echo 'cGhcRTSWays           = "$(GhcRTSWays)"'                     >> $@
-	@echo 'cGhcRtsWithLibdw      :: String'                             >> $@
-	@echo 'cGhcRtsWithLibdw      = "$(GhcRtsWithLibdw)"'                >> $@
+	@echo 'cGhcRtsWithLibdw      :: Bool'                               >> $@
+ifeq "$(GhcRtsWithLibdw)" "YES"
+	@echo 'cGhcRtsWithLibdw      = True'                                >> $@
+else
+	@echo 'cGhcRtsWithLibdw      = False'                               >> $@
+endif
 	@echo 'cGhcEnableTablesNextToCode :: String'                        >> $@
 	@echo 'cGhcEnableTablesNextToCode = "$(GhcEnableTablesNextToCode)"' >> $@
 	@echo 'cLeadingUnderscore    :: String'                             >> $@
diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs
index 03eb398..f6a551b 100644
--- a/compiler/main/DynFlags.hs
+++ b/compiler/main/DynFlags.hs
@@ -4117,25 +4117,24 @@ compilerInfo dflags
        ("Support SMP",                 cGhcWithSMP),
        ("Tables next to code",         cGhcEnableTablesNextToCode),
        ("RTS ways",                    cGhcRTSWays),
-       ("RTS expects libdw",           cGhcRtsWithLibdw),
-       ("Support dynamic-too",         if isWindows then "NO" else "YES"),
+       ("RTS expects libdw",           showBool cGhcRtsWithLibdw),
+       ("Support dynamic-too",         showBool $ not isWindows),
        ("Support parallel --make",     "YES"),
        ("Support reexported-modules",  "YES"),
        ("Support thinning and renaming package flags", "YES"),
        ("Requires unified installed package IDs", "YES"),
        ("Uses package keys",           "YES"),
-       ("Dynamic by default",          if dYNAMIC_BY_DEFAULT dflags
-                                       then "YES" else "NO"),
-       ("GHC Dynamic",                 if dynamicGhc
-                                       then "YES" else "NO"),
-       ("GHC Profiled",                if rtsIsProfiled
-                                       then "YES" else "NO"),
+       ("Dynamic by default",          showBool $ dYNAMIC_BY_DEFAULT dflags),
+       ("GHC Dynamic",                 showBool dynamicGhc),
+       ("GHC Profiled",                showBool rtsIsProfiled),
        ("Leading underscore",          cLeadingUnderscore),
        ("Debug on",                    show debugIsOn),
        ("LibDir",                      topDir dflags),
        ("Global Package DB",           systemPackageConfig dflags)
       ]
   where
+    showBool True  = "YES"
+    showBool False = "NO"
     isWindows = platformOS (targetPlatform dflags) == OSMinGW32
 
 #include "../includes/dist-derivedconstants/header/GHCConstantsHaskellWrappers.hs"



More information about the ghc-commits mailing list