7 components = sys.argv[1].split(' ')
9 print """// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
10 // file at the top-level directory of this distribution and at
11 // http://rust-lang.org/COPYRIGHT.
13 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
14 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
15 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
16 // option. This file may not be copied, modified, or distributed
17 // except according to those terms.
19 // WARNING: THIS IS A GENERATED FILE, DO NOT MODIFY
20 // take a look at src/etc/mklldeps.py if you're interested
23 for llconfig in sys.argv[2:]:
26 proc = subprocess.Popen([llconfig, '--host-target'], stdout = subprocess.PIPE)
27 out, err = proc.communicate()
28 arch, os = out.split('-', 1)
29 arch = 'x86' if arch == 'i686' or arch == 'i386' else arch
38 elif 'win' in os or 'mingw' in os:
41 "target_arch = \"" + arch + "\"",
42 "target_os = \"" + os + "\"",
45 print "#[cfg(" + ', '.join(cfg) + ")]"
47 args = [llconfig, '--libs']
48 args.extend(components)
49 proc = subprocess.Popen(args, stdout = subprocess.PIPE)
50 out, err = proc.communicate()
52 for lib in out.strip().split(' '):
53 lib = lib[2:] # chop of the leading '-l'
54 print "#[link(name = \"" + lib + "\", kind = \"static\")]"
56 print "#[link(name = \"pthread\")]"
57 print "#[link(name = \"imagehlp\")]"