@echo "cBooterVersion = \"$(GhcVersion)\"" >> $(CONFIG_HS)
@echo "cStage = STAGE" >> $(CONFIG_HS)
@echo "cHscIfaceFileVersion = \"$(HscIfaceFileVersion)\"" >> $(CONFIG_HS)
+ @echo "cSplitObjs = \"$(SplitObjs)\"" >> $(CONFIG_HS)
@echo "cGhcWithNativeCodeGen = \"$(GhcWithNativeCodeGen)\"" >> $(CONFIG_HS)
@echo "cGhcUnregisterised = \"$(GhcUnregisterised)\"" >> $(CONFIG_HS)
@echo "cGhcEnableTablesNextToCode = \"$(GhcEnableTablesNextToCode)\"" >> $(CONFIG_HS)
-- misc stuff
machdepCCOpts, picCCOpts,
supportedLanguages,
+ compilerInfo,
) where
#include "HsVersions.h"
-- Splitting
can_split :: Bool
-can_split =
-#if defined(i386_TARGET_ARCH) \
- || defined(x86_64_TARGET_ARCH) \
- || defined(alpha_TARGET_ARCH) \
- || defined(hppa_TARGET_ARCH) \
- || defined(m68k_TARGET_ARCH) \
- || defined(mips_TARGET_ARCH) \
- || defined(powerpc_TARGET_ARCH) \
- || defined(rs6000_TARGET_ARCH) \
- || defined(sparc_TARGET_ARCH)
- True
-#else
- False
-#endif
+can_split = cSplitObjs == "YES"
+
+-- -----------------------------------------------------------------------------
+-- Compiler Info
+
+compilerInfo :: [(String, String)]
+compilerInfo = [("Project name", cProjectName),
+ ("Project version", cProjectVersion),
+ ("Booter version", cBooterVersion),
+ ("Stage", cStage),
+ ("Interface file version", cHscIfaceFileVersion),
+ ("Object splitting", cSplitObjs),
+ ("Have native code generator", cGhcWithNativeCodeGen),
+ ("Unregisterised", cGhcUnregisterised),
+ ("Tables next to code", cGhcEnableTablesNextToCode),
+ ("Win32 DLLs", cEnableWin32DLLs),
+ ("Leading underscore", cLeadingUnderscore)]
-- to find out what version of GHC it's using before package.conf
-- exists, so starting the session fails.
case cli_mode of
+ ShowInfo -> do showInfo
+ exitWith ExitSuccess
ShowSupportedLanguages -> do showSupportedLanguages
exitWith ExitSuccess
ShowVersion -> do showVersion
data CmdLineMode
= ShowUsage -- ghc -?
| PrintLibdir -- ghc --print-libdir
+ | ShowInfo -- ghc --info
| ShowSupportedLanguages -- ghc --supported-languages
| ShowVersion -- ghc -V/--version
| ShowNumVersion -- ghc --numeric-version
, ( "V" , PassFlag (setMode ShowVersion))
, ( "-version" , PassFlag (setMode ShowVersion))
, ( "-numeric-version", PassFlag (setMode ShowNumVersion))
+ , ( "-info", PassFlag (setMode ShowInfo))
, ( "-supported-languages", PassFlag (setMode ShowSupportedLanguages))
------- interfaces ----------------------------------------------------
hPutStr stderr " booted by GHC version "
hPutStrLn stderr cBooterVersion
+-- We print out a Read-friendly string, but a prettier one than the
+-- Show instance gives us
+showInfo :: IO ()
+showInfo = do
+ let sq x = " [" ++ x ++ "\n ]"
+ putStrLn $ sq $ concat $ intersperse "\n ," $ map show compilerInfo
+ exitWith ExitSuccess
+
showSupportedLanguages :: IO ()
showSupportedLanguages = do mapM_ putStrLn supportedLanguages
exitWith ExitSuccess