summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--koch.nim17
-rw-r--r--lib/wrappers/zip/libzip.nim8
2 files changed, 15 insertions, 10 deletions
diff --git a/koch.nim b/koch.nim
index 883fffb6d..30ad8c597 100644
--- a/koch.nim
+++ b/koch.nim
@@ -64,13 +64,16 @@ proc tryExec(cmd: string): bool =
   echo(cmd)
   result = execShellCmd(cmd) == 0
 
+const
+  compileNimInst = "-d:useLibzipSrc tools/niminst/niminst"
+
 proc csource(args: string) = 
-  exec("nimrod cc $1 -r tools/niminst/niminst --var:version=$2 csource compiler/nimrod.ini $1" %
-       [args, NimrodVersion])
+  exec("nimrod cc $1 -r $3 --var:version=$2 csource compiler/nimrod.ini $1" %
+       [args, NimrodVersion, compileNimInst])
 
 proc zip(args: string) = 
-  exec("nimrod cc -r tools/niminst/niminst --var:version=$# zip compiler/nimrod.ini" %
-       NimrodVersion)
+  exec("nimrod cc -r $2 --var:version=$1 zip compiler/nimrod.ini" %
+       [NimrodVersion, compileNimInst])
   
 proc buildTool(toolname, args: string) = 
   exec("nimrod cc $# $#" % [args, toolname])
@@ -85,9 +88,9 @@ proc inno(args: string) =
        NimrodVersion)
 
 proc install(args: string) = 
-  exec("nimrod cc -r tools/niminst/niminst --var:version=$# scripts compiler/nimrod.ini" %
-       NimrodVersion)
-  exec("sh ./install.sh $#" % args)  
+  exec("nimrod cc -r $# --var:version=$# scripts compiler/nimrod.ini" %
+       [compileNimInst, NimrodVersion])
+  exec("sh ./install.sh $#" % args)
 
 proc web(args: string) =
   exec(("nimrod cc -r tools/nimweb.nim web/nimrod --putenv:nimrodversion=$#" &
diff --git a/lib/wrappers/zip/libzip.nim b/lib/wrappers/zip/libzip.nim
index fe4316dc7..26a0ce67c 100644
--- a/lib/wrappers/zip/libzip.nim
+++ b/lib/wrappers/zip/libzip.nim
@@ -8,7 +8,9 @@
 #
 
 ## Interface to the `libzip <http://www.nih.at/libzip/index.html>`_ library by
-## Dieter Baron and Thomas Klausner.
+## Dieter Baron and Thomas Klausner. This version links
+## against ``libzip2.so.2`` unless you define the symbol ``useLibzipSrc``; then
+## it is compiled against some old ``libizp_all.c`` file.
 
 #
 #  zip.h -- exported declarations.
@@ -45,12 +47,12 @@
 
 import times
 
-when defined(unix):
+when defined(unix) and not defined(useLibzipSrc):
   {.passl: "-lz".}
   when defined(macosx):
     {.pragma: mydll, dynlib: "libzip2.dylib".}
   else:
-    {.pragma: mydll, dynlib: "libzip2.so(|.0|.1)".}
+    {.pragma: mydll, dynlib: "libzip2.so(|.2|.1|.0)".}
 else:
   {.compile: "libzip_all.c".}
   {.pragma: mydll.}