|
4 | 4 | import sys |
5 | 5 | import subprocess |
6 | 6 |
|
7 | | -components = sys.argv[1].split(' ') |
| 7 | +f = open(sys.argv[1], 'wb') |
8 | 8 |
|
9 | | -print """// Copyright 2013 The Rust Project Developers. See the COPYRIGHT |
| 9 | +components = sys.argv[2].split(' ') |
| 10 | + |
| 11 | +f.write("""// Copyright 2013 The Rust Project Developers. See the COPYRIGHT |
10 | 12 | // file at the top-level directory of this distribution and at |
11 | 13 | // http://rust-lang.org/COPYRIGHT. |
12 | 14 | // |
|
18 | 20 |
|
19 | 21 | // WARNING: THIS IS A GENERATED FILE, DO NOT MODIFY |
20 | 22 | // take a look at src/etc/mklldeps.py if you're interested |
21 | | -""" |
| 23 | +""") |
22 | 24 |
|
23 | | -for llconfig in sys.argv[2:]: |
24 | | - print |
| 25 | +for llconfig in sys.argv[3:]: |
| 26 | + f.write("\n") |
25 | 27 |
|
26 | 28 | proc = subprocess.Popen([llconfig, '--host-target'], stdout = subprocess.PIPE) |
27 | 29 | out, err = proc.communicate() |
|
42 | 44 | "target_os = \"" + os + "\"", |
43 | 45 | ] |
44 | 46 |
|
45 | | - print "#[cfg(" + ', '.join(cfg) + ")]" |
| 47 | + f.write("#[cfg(" + ', '.join(cfg) + ")]\n") |
46 | 48 |
|
47 | 49 | args = [llconfig, '--libs'] |
48 | 50 | args.extend(components) |
|
51 | 53 |
|
52 | 54 | for lib in out.strip().split(' '): |
53 | 55 | lib = lib[2:] # chop of the leading '-l' |
54 | | - print "#[link(name = \"" + lib + "\", kind = \"static\")]" |
| 56 | + f.write("#[link(name = \"" + lib + "\", kind = \"static\")]\n") |
55 | 57 | if os == 'win32': |
56 | | - print "#[link(name = \"imagehlp\")]" |
57 | | - print "extern {}" |
| 58 | + f.write("#[link(name = \"imagehlp\")]\n") |
| 59 | + f.write("extern {}\n") |
0 commit comments