2011-12-05 10:09:35 +01:00
|
|
|
#!/usr/bin/env python
|
|
|
|
|
|
|
|
import os
|
|
|
|
import sys
|
|
|
|
import subprocess
|
|
|
|
|
2017-04-14 01:53:45 +02:00
|
|
|
sofiles = []
|
2011-12-06 10:49:14 +01:00
|
|
|
for dir in sys.argv[2:]:
|
2011-12-05 10:09:35 +01:00
|
|
|
for fn in os.listdir(dir):
|
2017-04-14 01:53:45 +02:00
|
|
|
if fn.endswith(".so"):
|
|
|
|
fn = os.path.join(dir, fn)
|
|
|
|
if os.path.exists(fn + ".o") and os.path.exists(fn + ".libs"):
|
|
|
|
sofiles.append(fn)
|
2011-12-05 10:09:35 +01:00
|
|
|
|
2017-04-14 01:53:45 +02:00
|
|
|
args = [] # The raw argument list.
|
2011-12-05 10:09:35 +01:00
|
|
|
for fn in sofiles:
|
2017-04-14 01:53:45 +02:00
|
|
|
args.append(fn + ".o")
|
|
|
|
args.extend(open(fn + ".libs").read().split(" "))
|
2011-12-05 10:09:35 +01:00
|
|
|
|
2017-04-14 01:53:45 +02:00
|
|
|
unique_args = ' '.join(x for x in sorted(set(args)) if x.endswith('.so.o'))
|
2014-02-03 06:53:30 +01:00
|
|
|
print('Biglink create %s library' % sys.argv[1])
|
2017-04-14 01:53:45 +02:00
|
|
|
cmd = "ar -q %s %s" % (sys.argv[1], unique_args)
|
2019-01-12 22:19:21 +01:00
|
|
|
print('Binlinking: {}'.format(cmd))
|
2017-04-14 01:53:45 +02:00
|
|
|
subprocess.Popen(cmd, shell=True).communicate()
|