Build system: Make cGhcRtsWithLibdw flag a proper Bool
authorBen Gamari <bgamari.foss@gmail.com>
Thu, 17 Dec 2015 11:14:53 +0000 (12:14 +0100)
committerBen Gamari <ben@smart-cactus.org>
Thu, 17 Dec 2015 11:54:31 +0000 (12:54 +0100)
Test Plan: validate

Reviewers: austin

Reviewed By: austin

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D1642

compiler/ghc.mk
compiler/main/DynFlags.hs

index f5c53d4..9148c79 100644 (file)
@@ -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'                             >> $@
index 03eb398..f6a551b 100644 (file)
@@ -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"