kivy-ios/tools/biglink

25 lines
683 B
Text
Raw Normal View History

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'))
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)
print(cmd)
subprocess.Popen(cmd, shell=True).communicate()