14
14
15
15
f = open (sys .argv [1 ], 'wb' )
16
16
17
- components = sys .argv [2 ].split (' ' )
18
- components = [i for i in components if i ] # ignore extra whitespaces
17
+ components = sys .argv [2 ].split () # splits on whitespace
19
18
enable_static = sys .argv [3 ]
20
- llconfig = sys .argv [4 ]
19
+ llvm_config = sys .argv [4 ]
21
20
22
21
f .write ("""// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
23
22
// file at the top-level directory of this distribution and at
@@ -39,15 +38,15 @@ def run(args):
39
38
out , err = proc .communicate ()
40
39
41
40
if err :
42
- print ("failed to run llconfig : args = `{}`" .format (args ))
41
+ print ("failed to run llvm_config : args = `{}`" .format (args ))
43
42
print (err )
44
43
sys .exit (1 )
45
44
return out
46
45
47
46
f .write ("\n " )
48
47
49
48
# LLVM libs
50
- args = [llconfig , '--libs' , '--system-libs' ]
49
+ args = [llvm_config , '--libs' , '--system-libs' ]
51
50
52
51
args .extend (components )
53
52
out = run (args )
@@ -69,13 +68,13 @@ def run(args):
69
68
f .write (")]\n " )
70
69
71
70
# LLVM ldflags
72
- out = run ([llconfig , '--ldflags' ])
71
+ out = run ([llvm_config , '--ldflags' ])
73
72
for lib in out .strip ().split (' ' ):
74
73
if lib [:2 ] == "-l" :
75
74
f .write ("#[link(name = \" " + lib [2 :] + "\" )]\n " )
76
75
77
76
# C++ runtime library
78
- out = run ([llconfig , '--cxxflags' ])
77
+ out = run ([llvm_config , '--cxxflags' ])
79
78
if enable_static == '1' :
80
79
assert ('stdlib=libc++' not in out )
81
80
f .write ("#[link(name = \" stdc++\" , kind = \" static\" )]\n " )
0 commit comments