summary refs log tree commit diff stats
path: root/tools
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2012-02-28 23:02:17 +0100
committerAraq <rumpf_a@web.de>2012-02-28 23:02:17 +0100
commit8f66c99f07abd1b3209ecf1e8bdc103f65d317f8 (patch)
tree59d10171eb2fc1ee9701d838041c99247121a9de /tools
parent4a9e07a47c40c672734a09934eca3a7e54897216 (diff)
downloadNim-8f66c99f07abd1b3209ecf1e8bdc103f65d317f8.tar.gz
prepared niminst for win64 target
Diffstat (limited to 'tools')
-rwxr-xr-xtools/niminst/buildbat.tmpl38
-rw-r--r--tools/niminst/debcreation.nim24
2 files changed, 49 insertions, 13 deletions
diff --git a/tools/niminst/buildbat.tmpl b/tools/niminst/buildbat.tmpl
index 57a2e9cdd..fdb55c8de 100755
--- a/tools/niminst/buildbat.tmpl
+++ b/tools/niminst/buildbat.tmpl
@@ -8,15 +8,43 @@ SET LINK_FLAGS=?{c.linker.flags}
 
 REM call the compiler:
 
-#  var linkCmd = ""
-#  for ff in items(c.cfiles[1][1]):
-#    let f = ff.replace('/', '\\')
+IF EXIST %SystemRoot%\SysWOW64 GOTO :Win64
+
+ECHO Building for Win32
+
+#  block win32:
+#    var linkCmd = ""
+#    for ff in items(c.cfiles[1][1]):
+#      let f = ff.replace('/', '\\')
 ECHO %CC% %COMP_FLAGS% -Ibuild -c ?{f} -o ?{changeFileExt(f, "o")}
 %CC% %COMP_FLAGS% -Ibuild -c ?{f} -o ?{changeFileExt(f, "o")}
-#    linkCmd.add(" " & changeFileExt(f, "o"))
-#  end for
+#      linkCmd.add(" " & changeFileExt(f, "o"))
+#    end for
 
 ECHO %LINKER% %LINK_FLAGS% -o ?{firstBinPath(c)\toLower(c.name)}.exe ?linkCmd
 %LINKER% %LINK_FLAGS% -o ?{firstBinPath(c)\toLower(c.name)}.exe ?linkCmd
 
+#  end block
+
+GOTO :end
+
+:Win64
+ECHO Building for Win64
+
+#  block win64:
+#    var linkCmd = ""
+#    for ff in items(c.cfiles[1][2]):
+#      let f = ff.replace('/', '\\')
+ECHO %CC% %COMP_FLAGS% -Ibuild -c ?{f} -o ?{changeFileExt(f, "o")}
+%CC% %COMP_FLAGS% -Ibuild -c ?{f} -o ?{changeFileExt(f, "o")}
+#      linkCmd.add(" " & changeFileExt(f, "o"))
+#    end for
+
+ECHO %LINKER% %LINK_FLAGS% -o ?{firstBinPath(c)\toLower(c.name)}.exe ?linkCmd
+%LINKER% %LINK_FLAGS% -o ?{firstBinPath(c)\toLower(c.name)}.exe ?linkCmd
+
+#  end block
+
+:end
+
 ECHO SUCCESS
diff --git a/tools/niminst/debcreation.nim b/tools/niminst/debcreation.nim
index 287bd9a7b..1e08e5653 100644
--- a/tools/niminst/debcreation.nim
+++ b/tools/niminst/debcreation.nim
@@ -1,3 +1,12 @@
+#
+#
+#        The Nimrod Installation Generator
+#        (c) Copyright 2012 Dominik Picheta
+#
+#    See the file "copying.txt", included in this
+#    distribution, for details about the copyright.
+#
+
 import osproc, times, os, strutils
 
 # http://www.debian.org/doc/manuals/maint-guide/
@@ -13,8 +22,9 @@ type
     buildDepends*, pkgDepends*, shortDesc*: string
     licenses*: seq[tuple[files, license: string]]
 
-template addN(r: string): expr =
-  result.add(r & "\n")
+template addN(r: string) =
+  result.add(r)
+  result.add("\n")
 
 proc createControl(pkgName, maintainer, shortDesc, desc: string,
                    buildDepends, pkgDepends: string = ""): string =
@@ -132,9 +142,9 @@ proc assertSuccess(exitCode: int) =
   doAssert(exitCode == QuitSuccess)
 
 proc prepDeb*(packName, version, mtnName, mtnEmail, shortDesc, desc: string,
-  licenses: seq[tuple[files, license: string]], binaries,
-  config, docs, lib: seq[string],
-  buildDepends, pkgDepends = "") =
+              licenses: seq[tuple[files, license: string]], binaries,
+              config, docs, lib: seq[string],
+              buildDepends, pkgDepends = "") =
   ## binaries/config/docs/lib: files relative to nimrod's root, that need to
   ##   be installed.
   
@@ -222,6 +232,4 @@ when isMainModule:
     @[("bin/nimrod", "gpl2"), ("lib/*", "lgpl")], 
     @["bin/nimrod"], @["config/*"], @["doc/*"], @["lib/*"],
     "gcc (>= 4:4.3.2)", "gcc (>= 4:4.3.2)")
- 
-  
-  
\ No newline at end of file
+