1414
1515f = open (sys .argv [1 ], 'wb' )
1616
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
1918enable_static = sys .argv [3 ]
20- llconfig = sys .argv [4 ]
19+ llvm_config = sys .argv [4 ]
2120
2221f .write ("""// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
2322// file at the top-level directory of this distribution and at
@@ -39,15 +38,15 @@ def run(args):
3938 out , err = proc .communicate ()
4039
4140 if err :
42- print ("failed to run llconfig : args = `{}`" .format (args ))
41+ print ("failed to run llvm_config : args = `{}`" .format (args ))
4342 print (err )
4443 sys .exit (1 )
4544 return out
4645
4746f .write ("\n " )
4847
4948# LLVM libs
50- args = [llconfig , '--libs' , '--system-libs' ]
49+ args = [llvm_config , '--libs' , '--system-libs' ]
5150
5251args .extend (components )
5352out = run (args )
@@ -69,13 +68,13 @@ def run(args):
6968 f .write (")]\n " )
7069
7170# LLVM ldflags
72- out = run ([llconfig , '--ldflags' ])
71+ out = run ([llvm_config , '--ldflags' ])
7372for lib in out .strip ().split (' ' ):
7473 if lib [:2 ] == "-l" :
7574 f .write ("#[link(name = \" " + lib [2 :] + "\" )]\n " )
7675
7776# C++ runtime library
78- out = run ([llconfig , '--cxxflags' ])
77+ out = run ([llvm_config , '--cxxflags' ])
7978if enable_static == '1' :
8079 assert ('stdlib=libc++' not in out )
8180 f .write ("#[link(name = \" stdc++\" , kind = \" static\" )]\n " )
0 commit comments