forked from kivy/kivy-ios
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbiglink
executable file
·44 lines (30 loc) · 881 Bytes
/
biglink
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/usr/bin/env python
import os
import sys
import subprocess
sofiles = [ ]
for dir in sys.argv[2:]:
for fn in os.listdir(dir):
fn = os.path.join(dir, fn)
if not fn.endswith(".so"):
continue
if not os.path.exists(fn + ".o"):
continue
if not os.path.exists(fn + ".libs"):
continue
sofiles.append(fn)
# The raw argument list.
args = [ ]
for fn in sofiles:
afn = fn + ".o"
libsfn = fn + ".libs"
args.append(afn)
args.extend(file(libsfn).read().split(" "))
unique_args = [ ]
while args:
a = args.pop()
if a not in unique_args:
unique_args.insert(0, a)
unique_args = ' '.join([ x for x in unique_args if x.endswith('.so.o') ])
print 'Biglink create %s library' % sys.argv[1]
subprocess.Popen(("ar -q %s " % sys.argv[1]) + unique_args, shell=True).communicate()