From 06c0128c1ee0f08c710bbb1a120acf08b5da9665 Mon Sep 17 00:00:00 2001 From: Ian Lynagh Date: Fri, 16 Jul 2010 14:19:53 +0000 Subject: [PATCH] Add platform info to "ghc --info" output --- compiler/ghc.mk | 11 +++++++++++ compiler/main/DynFlags.hs | 3 +++ 2 files changed, 14 insertions(+) diff --git a/compiler/ghc.mk b/compiler/ghc.mk index 486e2b6..54b3012 100644 --- a/compiler/ghc.mk +++ b/compiler/ghc.mk @@ -46,7 +46,18 @@ endif $(compiler_CONFIG_HS) : mk/config.mk mk/project.mk "$(RM)" $(RM_OPTS) $@ @echo 'Creating $@ ... ' + @echo '{-# LANGUAGE CPP #-}' >> $@ @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' >> $@ diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs index 3c117c4..4b3f2c6 100644 --- a/compiler/main/DynFlags.hs +++ b/compiler/main/DynFlags.hs @@ -2229,6 +2229,9 @@ compilerInfo = [("Project name", String cProjectName), ("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), -- 1.7.10.4