summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorVarriount <Varriount@users.noreply.github.com>2014-04-21 15:41:03 -0400
committerVarriount <Varriount@users.noreply.github.com>2014-04-21 15:41:03 -0400
commitc0338eacb6b35b2d6a1c051b26d56c31b973cc30 (patch)
tree78cbfbc17b106be8d8575057262dd4d45b429268
parentbc79f40281accea987b23b47778782f7684de38c (diff)
parent03ffc344e129e38638a698fa0e83bb6c7b634913 (diff)
downloadNim-c0338eacb6b35b2d6a1c051b26d56c31b973cc30.tar.gz
Merge pull request #1118 from gradha/pr_show_boot_options
Version switch displays options used during `koch boot`
-rw-r--r--compiler/commands.nim22
-rw-r--r--compiler/options.nim2
-rw-r--r--lib/system/excpt.nim2
3 files changed, 24 insertions, 2 deletions
diff --git a/compiler/commands.nim b/compiler/commands.nim
index 8339219ed..366019c19 100644
--- a/compiler/commands.nim
+++ b/compiler/commands.nim
@@ -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
diff --git a/compiler/options.nim b/compiler/options.nim
index 36d343d1b..58a340d21 100644
--- a/compiler/options.nim
+++ b/compiler/options.nim
@@ -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!)
diff --git a/lib/system/excpt.nim b/lib/system/excpt.nim
index 2f7c5ed51..2dc134eaf 100644
--- a/lib/system/excpt.nim
+++ b/lib/system/excpt.nim
@@ -77,7 +77,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