Add platform info to "ghc --info" output
authorIan Lynagh <igloo@earth.li>
Fri, 16 Jul 2010 14:19:53 +0000 (14:19 +0000)
committerIan Lynagh <igloo@earth.li>
Fri, 16 Jul 2010 14:19:53 +0000 (14:19 +0000)
compiler/ghc.mk
compiler/main/DynFlags.hs

index 486e2b6..54b3012 100644 (file)
@@ -46,7 +46,18 @@ endif
 $(compiler_CONFIG_HS) : mk/config.mk mk/project.mk
        "$(RM)" $(RM_OPTS) $@
        @echo 'Creating $@ ... '
 $(compiler_CONFIG_HS) : mk/config.mk mk/project.mk
        "$(RM)" $(RM_OPTS) $@
        @echo 'Creating $@ ... '
+       @echo '{-# LANGUAGE CPP #-}'                                        >> $@
        @echo 'module Config where'                                         >> $@
        @echo 'module Config where'                                         >> $@
+       @echo                                                               >> $@
+       @echo '#include "ghc_boot_platform.h"'                              >> $@
+       @echo                                                               >> $@
+       @echo 'cBuildPlatform :: String'                                    >> $@
+       @echo 'cBuildPlatform = BuildPlatform_NAME'                         >> $@
+       @echo 'cHostPlatform :: String'                                     >> $@
+       @echo 'cHostPlatform = HostPlatform_NAME'                           >> $@
+       @echo 'cTargetPlatform :: String'                                   >> $@
+       @echo 'cTargetPlatform = TargetPlatform_NAME'                       >> $@
+       @echo                                                               >> $@
        @echo 'cProjectName          :: String'                             >> $@
        @echo 'cProjectName          = "$(ProjectName)"'                    >> $@
        @echo 'cProjectVersion       :: String'                             >> $@
        @echo 'cProjectName          :: String'                             >> $@
        @echo 'cProjectName          = "$(ProjectName)"'                    >> $@
        @echo 'cProjectVersion       :: String'                             >> $@
index 3c117c4..4b3f2c6 100644 (file)
@@ -2229,6 +2229,9 @@ compilerInfo = [("Project name",                String cProjectName),
                 ("Project version",             String cProjectVersion),
                 ("Booter version",              String cBooterVersion),
                 ("Stage",                       String cStage),
                 ("Project version",             String cProjectVersion),
                 ("Booter version",              String cBooterVersion),
                 ("Stage",                       String cStage),
+                ("Build platform",              String cBuildPlatform),
+                ("Host platform",               String cHostPlatform),
+                ("Target platform",             String cTargetPlatform),
                 ("Have interpreter",            String cGhcWithInterpreter),
                 ("Object splitting",            String cSplitObjs),
                 ("Have native code generator",  String cGhcWithNativeCodeGen),
                 ("Have interpreter",            String cGhcWithInterpreter),
                 ("Object splitting",            String cSplitObjs),
                 ("Have native code generator",  String cGhcWithNativeCodeGen),