about summary refs log tree commit diff
path: root/src/etc
diff options
context:
space:
mode:
authorklutzy <klutzytheklutzy@gmail.com>2013-12-17 14:35:22 +0900
committerklutzy <klutzytheklutzy@gmail.com>2013-12-18 09:49:55 +0900
commitb0a9937a6d252eaf6c936284c377227ae510cc0f (patch)
tree129735ad9e195c2a313562f760c88e4a58e60895 /src/etc
parent1890290ded2b56410b4b2e0dca4c1518b294a2b2 (diff)
downloadrust-b0a9937a6d252eaf6c936284c377227ae510cc0f.tar.gz
rust-b0a9937a6d252eaf6c936284c377227ae510cc0f.zip
mklldeps.py: Write to file instead of print
It seems that msys automatically converts `\n` to `\r\n` on pipe
redirection, which causes `make tidy` failure.
Diffstat (limited to 'src/etc')
-rw-r--r--src/etc/mklldeps.py20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/etc/mklldeps.py b/src/etc/mklldeps.py
index cea86b7a4f9..5b1abdf68a3 100644
--- a/src/etc/mklldeps.py
+++ b/src/etc/mklldeps.py
@@ -4,9 +4,11 @@ import os
 import sys
 import subprocess
 
-components = sys.argv[1].split(' ')
+f = open(sys.argv[1], 'wb')
 
-print """// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
+components = sys.argv[2].split(' ')
+
+f.write("""// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
 // file at the top-level directory of this distribution and at
 // http://rust-lang.org/COPYRIGHT.
 //
@@ -18,10 +20,10 @@ print """// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
 
 // WARNING: THIS IS A GENERATED FILE, DO NOT MODIFY
 //          take a look at src/etc/mklldeps.py if you're interested
-"""
+""")
 
-for llconfig in sys.argv[2:]:
-    print
+for llconfig in sys.argv[3:]:
+    f.write("\n")
 
     proc = subprocess.Popen([llconfig, '--host-target'], stdout = subprocess.PIPE)
     out, err = proc.communicate()
@@ -42,7 +44,7 @@ for llconfig in sys.argv[2:]:
         "target_os = \"" + os + "\"",
     ]
 
-    print "#[cfg(" + ', '.join(cfg) + ")]"
+    f.write("#[cfg(" + ', '.join(cfg) + ")]\n")
 
     args = [llconfig, '--libs']
     args.extend(components)
@@ -51,7 +53,7 @@ for llconfig in sys.argv[2:]:
 
     for lib in out.strip().split(' '):
         lib = lib[2:] # chop of the leading '-l'
-        print "#[link(name = \"" + lib + "\", kind = \"static\")]"
+        f.write("#[link(name = \"" + lib + "\", kind = \"static\")]\n")
     if os == 'win32':
-        print "#[link(name = \"imagehlp\")]"
-    print "extern {}"
+        f.write("#[link(name = \"imagehlp\")]\n")
+    f.write("extern {}\n")