Commit 1c198086 authored by Ian Lynagh's avatar Ian Lynagh

Make the --info values printable with "ghc --print-foo"; trac #3122

Also, libdir is now part of the --info output, so this subsumes the old
--print-libdir flag.
The mode parsing was getting rather adhoc, so I've tidied it up a bit
in the process.
parent 36dfa351
...@@ -57,6 +57,7 @@ module DynFlags ( ...@@ -57,6 +57,7 @@ module DynFlags (
getStgToDo, getStgToDo,
-- * Compiler configuration suitable for display to the user -- * Compiler configuration suitable for display to the user
compilerInfo compilerInfo
) where ) where
...@@ -2350,21 +2351,25 @@ can_split = cSplitObjs == "YES" ...@@ -2350,21 +2351,25 @@ can_split = cSplitObjs == "YES"
-- ----------------------------------------------------------------------------- -- -----------------------------------------------------------------------------
-- Compiler Info -- Compiler Info
compilerInfo :: [(String, String)] data Printable = String String
compilerInfo = [("Project name", cProjectName), | FromDynFlags (DynFlags -> String)
("Project version", cProjectVersion),
("Booter version", cBooterVersion), compilerInfo :: [(String, Printable)]
("Stage", cStage), compilerInfo = [("Project name", String cProjectName),
("Interface file version", cHscIfaceFileVersion), ("Project version", String cProjectVersion),
("Have interpreter", cGhcWithInterpreter), ("Booter version", String cBooterVersion),
("Object splitting", cSplitObjs), ("Stage", String cStage),
("Have native code generator", cGhcWithNativeCodeGen), ("Interface file version", String cHscIfaceFileVersion),
("Support SMP", cGhcWithSMP), ("Have interpreter", String cGhcWithInterpreter),
("Unregisterised", cGhcUnregisterised), ("Object splitting", String cSplitObjs),
("Tables next to code", cGhcEnableTablesNextToCode), ("Have native code generator", String cGhcWithNativeCodeGen),
("Win32 DLLs", cEnableWin32DLLs), ("Support SMP", String cGhcWithSMP),
("RTS ways", cGhcRTSWays), ("Unregisterised", String cGhcUnregisterised),
("Leading underscore", cLeadingUnderscore), ("Tables next to code", String cGhcEnableTablesNextToCode),
("Debug on", show debugIsOn) ("Win32 DLLs", String cEnableWin32DLLs),
("RTS ways", String cGhcRTSWays),
("Leading underscore", String cLeadingUnderscore),
("Debug on", String (show debugIsOn)),
("LibDir", FromDynFlags topDir)
] ]
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment