Make sure all boolean settings entries use `YES` / `NO`
authorJohn Ericson <git@JohnEricson.me>
Wed, 4 Sep 2019 01:10:59 +0000 (21:10 -0400)
committerMarge Bot <ben+marge-bot@smart-cactus.org>
Thu, 5 Sep 2019 22:50:56 +0000 (18:50 -0400)
Some where using `True` / `False`, a legacy of when they were in
`Config.hs`. See #16914 / d238d3062a9858 for a similar problem.

Also clean up the configure variables names for consistency and clarity
while we're at it. "Target" makes clear we are talking about outputted
code, not where GHC itself runs.

aclocal.m4
configure.ac
distrib/configure.ac.in
hadrian/cfg/system.config.in
hadrian/src/Rules/Generate.hs
includes/ghc.mk
libraries/ghc-boot/GHC/Settings.hs
mk/config.mk.in

index dd5efdf..4729a1c 100644 (file)
@@ -315,11 +315,11 @@ AC_DEFUN([FPTOOLS_SET_HASKELL_PLATFORM_VARS],
     AC_LINK_IFELSE(
         [AC_LANG_PROGRAM([], [__asm__ (".subsections_via_symbols");])],
         [AC_MSG_RESULT(yes)
-         HaskellHaveSubsectionsViaSymbols=True
+         TargetHasSubsectionsViaSymbols=YES
          AC_DEFINE([HAVE_SUBSECTIONS_VIA_SYMBOLS],[1],
                    [Define to 1 if Apple-style dead-stripping is supported.])
         ],
-        [HaskellHaveSubsectionsViaSymbols=False
+        [TargetHasSubsectionsViaSymbols=NO
          AC_MSG_RESULT(no)])
 
     dnl ** check for .ident assembler directive
@@ -329,9 +329,9 @@ AC_DEFUN([FPTOOLS_SET_HASKELL_PLATFORM_VARS],
     AC_LINK_IFELSE(
         [AC_LANG_PROGRAM([__asm__ (".ident \"GHC x.y.z\"");], [])],
         [AC_MSG_RESULT(yes)
-         HaskellHaveIdentDirective=True],
+         TargetHasIdentDirective=YES],
         [AC_MSG_RESULT(no)
-         HaskellHaveIdentDirective=False])
+         TargetHasIdentDirective=NO])
 
     dnl *** check for GNU non-executable stack note support (ELF only)
     dnl     (.section .note.GNU-stack,"",@progbits)
@@ -361,9 +361,9 @@ AC_DEFUN([FPTOOLS_SET_HASKELL_PLATFORM_VARS],
            __asm__ (".section .text");
          ], [0])],
         [AC_MSG_RESULT(yes)
-         HaskellHaveGnuNonexecStack=True],
+         TargetHasGnuNonexecStack=YES],
         [AC_MSG_RESULT(no)
-         HaskellHaveGnuNonexecStack=False])
+         TargetHasGnuNonexecStack=NO])
     CFLAGS="$CFLAGS2"
 
     checkArch "$BuildArch" "HaskellBuildArch"
@@ -380,9 +380,9 @@ AC_DEFUN([FPTOOLS_SET_HASKELL_PLATFORM_VARS],
 
     AC_SUBST(HaskellTargetArch)
     AC_SUBST(HaskellTargetOs)
-    AC_SUBST(HaskellHaveSubsectionsViaSymbols)
-    AC_SUBST(HaskellHaveIdentDirective)
-    AC_SUBST(HaskellHaveGnuNonexecStack)
+    AC_SUBST(TargetHasSubsectionsViaSymbols)
+    AC_SUBST(TargetHasIdentDirective)
+    AC_SUBST(TargetHasGnuNonexecStack)
 ])
 
 
index 9fc54fc..470de21 100644 (file)
@@ -324,13 +324,13 @@ dnl ** Does target have runtime linker support?
 dnl --------------------------------------------------------------
 case "$target" in
     powerpc64-*|powerpc64le-*|powerpc-ibm-aix*)
-        HaskellHaveRTSLinker=NO
+        TargetHasRTSLinker=NO
         ;;
     *)
-        HaskellHaveRTSLinker=YES
+        TargetHasRTSLinker=YES
         ;;
 esac
-AC_SUBST(HaskellHaveRTSLinker)
+AC_SUBST(TargetHasRTSLinker)
 
 # Requires FPTOOLS_SET_PLATFORM_VARS to be run first.
 FP_FIND_ROOT
index f8fa83e..b5f4412 100644 (file)
@@ -18,8 +18,8 @@ FP_GMP
 dnl Various things from the source distribution configure
 bootstrap_target=@TargetPlatform@
 
-HaskellHaveRTSLinker=@HaskellHaveRTSLinker@
-AC_SUBST(HaskellHaveRTSLinker)
+HaveRTSLinker=@HaveRTSLinker@
+AC_SUBST(HaveRTSLinker)
 
 FFIIncludeDir=@FFIIncludeDir@
 FFILibDir=@FFILibDir@
index 2380baf..e826db0 100644 (file)
@@ -145,10 +145,10 @@ settings-opt-command = @SettingsOptCommand@
 haskell-target-os = @HaskellTargetOs@
 haskell-target-arch = @HaskellTargetArch@
 target-word-size = @TargetWordSize@
-haskell-have-gnu-nonexec-stack = @HaskellHaveGnuNonexecStack@
-haskell-have-ident-directive = @HaskellHaveIdentDirective@
-haskell-have-subsections-via-symbols = @HaskellHaveSubsectionsViaSymbols@
-haskell-have-rts-linker = @HaskellHaveRTSLinker@
+target-has-gnu-nonexec-stack = @TargetHasGnuNonexecStack@
+target-has-ident-directive = @TargetHasIdentDirective@
+target-has-subsections-via-symbols = @TargetHasSubsectionsViaSymbols@
+target-has-rts-linker = @TargetHasRTSLinker@
 
 # Include and library directories:
 #=================================
index 8ad8ead..1736405 100644 (file)
@@ -298,10 +298,10 @@ generateSettings = do
         , ("target os", expr $ lookupValueOrError configFile "haskell-target-os")
         , ("target arch", expr $ lookupValueOrError configFile "haskell-target-arch")
         , ("target word size", expr $ lookupValueOrError configFile "target-word-size")
-        , ("target has GNU nonexec stack", expr $ lookupValueOrError configFile "haskell-have-gnu-nonexec-stack")
-        , ("target has .ident directive", expr $ lookupValueOrError configFile "haskell-have-ident-directive")
-        , ("target has subsections via symbols", expr $ lookupValueOrError configFile "haskell-have-subsections-via-symbols")
-        , ("target has RTS linker", expr $ lookupValueOrError configFile "haskell-have-rts-linker")
+        , ("target has GNU nonexec stack", expr $ lookupValueOrError configFile "target-has-gnu-nonexec-stack")
+        , ("target has .ident directive", expr $ lookupValueOrError configFile "target-has-ident-directive")
+        , ("target has subsections via symbols", expr $ lookupValueOrError configFile "target-has-subsections-via-symbols")
+        , ("target has RTS linker", expr $ lookupValueOrError configFile "target-has-rts-linker")
         , ("Unregisterised", expr $ yesNo <$> flag GhcUnregisterised)
         , ("LLVM target", getSetting LlvmTarget)
         , ("LLVM llc command", expr $ settingsFileSetting SettingsFileSetting_LlcCommand)
index ad51234..81e7483 100644 (file)
@@ -196,11 +196,11 @@ $(includes_SETTINGS) : includes/Makefile | $$(dir $$@)/.
        @echo ',("target os", "$(HaskellTargetOs)")' >> $@
        @echo ',("target arch", "$(HaskellTargetArch)")' >> $@
        @echo ',("target word size", "$(TargetWordSize)")' >> $@
-       @echo ',("target has GNU nonexec stack", "$(HaskellHaveGnuNonexecStack)")' >> $@
-       @echo ',("target has .ident directive", "$(HaskellHaveIdentDirective)")' >> $@
-       @echo ',("target has subsections via symbols", "$(HaskellHaveSubsectionsViaSymbols)")' >> $@
-       @echo ',("target has RTS linker", "$(HaskellHaveRTSLinker)")' >> $@
-       @echo ',("Unregisterised", "$(Unregisterised)")' >> $@
+       @echo ',("target has GNU nonexec stack", "$(TargetHasGnuNonexecStack)")' >> $@
+       @echo ',("target has .ident directive", "$(TargetHasIdentDirective)")' >> $@
+       @echo ',("target has subsections via symbols", "$(TargetHasSubsectionsViaSymbols)")' >> $@
+       @echo ',("target has RTS linker", "$(TargetHasRTSLinker)")' >> $@
+       @echo ',("Unregisterised", "$(GhcUnregisterised)")' >> $@
        @echo ',("LLVM target", "$(LLVMTarget_CPP)")' >> $@
        @echo ',("LLVM llc command", "$(SettingsLlcCommand)")' >> $@
        @echo ',("LLVM opt command", "$(SettingsOptCommand)")' >> $@
index fc9f95a..a112c5d 100644 (file)
@@ -37,9 +37,9 @@ getTargetPlatform settingsFile mySettings = do
   targetOS <- readSetting "target os"
   targetWordSize <- readSetting "target word size"
   targetUnregisterised <- getBooleanSetting "Unregisterised"
-  targetHasGnuNonexecStack <- readSetting "target has GNU nonexec stack"
-  targetHasIdentDirective <- readSetting "target has .ident directive"
-  targetHasSubsectionsViaSymbols <- readSetting "target has subsections via symbols"
+  targetHasGnuNonexecStack <- getBooleanSetting "target has GNU nonexec stack"
+  targetHasIdentDirective <- getBooleanSetting "target has .ident directive"
+  targetHasSubsectionsViaSymbols <- getBooleanSetting "target has subsections via symbols"
   crossCompiling <- getBooleanSetting "cross compiling"
 
   pure $ Platform
index ca17e86..0f4208e 100644 (file)
@@ -489,11 +489,10 @@ ArArgs = @ArArgs@
 HaskellTargetOs = @HaskellTargetOs@
 HaskellTargetArch = @HaskellTargetArch@
 TargetWordSize = @TargetWordSize@
-HaskellHaveGnuNonexecStack = @HaskellHaveGnuNonexecStack@
-HaskellHaveIdentDirective = @HaskellHaveIdentDirective@
-HaskellHaveSubsectionsViaSymbols = @HaskellHaveSubsectionsViaSymbols@
-HaskellHaveRTSLinker = @HaskellHaveRTSLinker@
-Unregisterised = @Unregisterised@
+TargetHasGnuNonexecStack = @TargetHasGnuNonexecStack@
+TargetHasIdentDirective = @TargetHasIdentDirective@
+TargetHasSubsectionsViaSymbols = @TargetHasSubsectionsViaSymbols@
+TargetHasRTSLinker = @TargetHasRTSLinker@
 TablesNextToCode = @TablesNextToCode@
 
 SettingsCCompilerCommand = @SettingsCCompilerCommand@