summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2017-01-06 10:58:42 +0100
committerAraq <rumpf_a@web.de>2017-01-06 13:11:17 +0100
commitd54539a6481133ab071445e558d5664e6e45dc6a (patch)
tree6de428eef2d322572b958ca83891be8b2a87de37
parent842f66db25e38029ae9db38af38310c065aeb06f (diff)
downloadNim-d54539a6481133ab071445e558d5664e6e45dc6a.tar.gz
attempt to re-enable trimcc tool
-rw-r--r--tools/trimcc.nim14
1 files changed, 7 insertions, 7 deletions
diff --git a/tools/trimcc.nim b/tools/trimcc.nim
index 7f0adcbc9..959eaf310 100644
--- a/tools/trimcc.nim
+++ b/tools/trimcc.nim
@@ -1,6 +1,6 @@
 # Trim C compiler installation to a minimum
 
-import strutils, os, pegs, strtabs, math, threadpool, times
+import strutils, os, pegs, strtabs, math, times
 
 const
   Essential = """gcc.exe g++.exe gdb.exe ld.exe as.exe c++.exe cpp.exe cc1.exe
@@ -10,7 +10,7 @@ fenv.h fmtmsg.h fnmatch.h ftw.h errno.h glob.h gtmath.h if.h in.h ipc.h
 langinfo.h locale.h math.h mman.h netdb.h nl_types.h poll.h pthread.h pwd.h
 sched.h select.h semaphore.h signal.h socket.h spawn.h stat.h statvfs.h stdio.h
 stdlib.h string.h strings.h tcp.h time.h types.h ucontext.h uio.h utsname.h
-unistd.h wait.h varargs.h windows.h zlib.h libgdi32.a libcomdlg32.a
+unistd.h wait.h varargs.h windows.h zlib.h
 """.split
 
 proc includes(headerpath, headerfile: string, whitelist: StringTableRef) =
@@ -20,7 +20,7 @@ proc includes(headerpath, headerfile: string, whitelist: StringTableRef) =
                      comment <- '/*' @ '*/' / '//' .*
                      ws <- (comment / \s+)* """:
       let m = matches[0].extractFilename
-      if whitelist[m] != "processed":
+      if whitelist.getOrDefault(m) != "processed":
         whitelist[m] = "found"
 
 proc processIncludes(dir: string, whitelist: StringTableRef) =
@@ -29,10 +29,10 @@ proc processIncludes(dir: string, whitelist: StringTableRef) =
     of pcFile:
       let name = extractFilename(path)
       if ('.' notin name and "include" in path) or ("c++" in path):
-        let n = whitelist[name]
+        let n = whitelist.getOrDefault(name)
         if n != "processed": whitelist[name] = "found"
       if name.endswith(".h"):
-        let n = whitelist[name]
+        let n = whitelist.getOrDefault(name)
         if n == "found": includes(path, name, whitelist)
     of pcDir: processIncludes(path, whitelist)
     else: discard
@@ -72,8 +72,8 @@ proc newName(f: string): string =
 proc ccStillWorks(): bool =
   const
     c1 = r"nim c --verbosity:0 --force_build koch"
-    c2 = r"nim c --verbosity:0 --force_build --threads:on --out:tempOne.exe trimcc"
-    c3 = r"nim c --verbosity:0 --force_build --threads:on --out:tempTwo.exe fakeDeps"
+    c2 = r"nim c --verbosity:0 --force_build --threads:on --out:tempOne.exe tools/trimcc"
+    c3 = r"nim c --verbosity:0 --force_build --threads:on --out:tempTwo.exe tools/fakeDeps"
     c4 = r".\koch.exe"
     c5 = r".\tempOne.exe"
     c6 = r".\tempTwo.exe"