Version switch displays options used during koch boot

This commit is contained in:
Grzegorz Adam Hankiewicz
2014-04-20 12:23:54 +02:00
parent 13b941d8ee
commit 03ffc344e1
3 changed files with 24 additions and 2 deletions

View File

@@ -50,11 +50,33 @@ proc writeAdvancedUsage(pass: TCmdLinePass) =
CPU[platform.hostCPU].name]) & AdvancedUsage)
quit(0)
template bootSwitch(name, expr, userString: expr): expr =
# Helper to build boot constants, for debugging you can 'echo' the else part.
const name = if expr: " " & userString else: ""
bootSwitch(usedAvoidTimeMachine, noTimeMachine, "-d:avoidTimeMachine")
bootSwitch(usedRelease, defined(release), "-d:release")
bootSwitch(usedTinyC, hasTinyCBackend, "-d:tinyc")
bootSwitch(usedGnuReadline, defined(useGnuReadline), "-d:useGnuReadline")
bootSwitch(usedNativeStacktrace,
defined(nativeStackTrace) and nativeStackTraceSupported,
"-d:nativeStackTrace")
bootSwitch(usedNoCaas, defined(noCaas), "-d:noCaas")
bootSwitch(usedFFI, hasFFI, "-d:useFFI")
bootSwitch(usedBoehm, defined(boehmgc), "--gc:boehm")
bootSwitch(usedMarkAndSweep, defined(gcmarkandsweep), "--gc:markAndSweep")
bootSwitch(usedGenerational, defined(gcgenerational), "--gc:generational")
bootSwitch(usedNoGC, defined(nogc), "--gc:none")
proc writeVersionInfo(pass: TCmdLinePass) =
if pass == passCmd1:
msgWriteln(`%`(HelpMessage, [VersionAsString,
platform.OS[platform.hostOS].name,
CPU[platform.hostCPU].name]))
msgWriteln("active boot switches:" & usedRelease & usedAvoidTimeMachine &
usedTinyC & usedGnuReadline & usedNativeStacktrace & usedNoCaas &
usedFFI & usedBoehm & usedMarkAndSweep & usedGenerational & usedNoGC)
quit(0)
var

View File

@@ -16,7 +16,7 @@ const
hasFFI* = defined(useFFI)
newScopeForIf* = true
useCaas* = not defined(noCaas)
noTimeMachine = defined(avoidTimeMachine) and defined(macosx)
noTimeMachine* = defined(avoidTimeMachine) and defined(macosx)
type # please make sure we have under 32 options
# (improves code efficiency a lot!)

View File

@@ -71,7 +71,7 @@ proc popCurrentException {.compilerRtl, inl.} =
# some platforms have native support for stack traces:
const
nativeStackTraceSupported = (defined(macosx) or defined(linux)) and
nativeStackTraceSupported* = (defined(macosx) or defined(linux)) and
not nimrodStackTrace
hasSomeStackTrace = nimrodStackTrace or
defined(nativeStackTrace) and nativeStackTraceSupported