forked from kivy/python-for-android
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathliblink-jb
More file actions
executable file
·43 lines (31 loc) · 873 Bytes
/
liblink-jb
File metadata and controls
executable file
·43 lines (31 loc) · 873 Bytes
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
#!/usr/bin/env python
from __future__ import print_function
import sys
import subprocess
from os import environ
from os.path import basename, join
libs = [ ]
libdirs = [ ]
output = None
i = 1
while i < len(sys.argv):
opt = sys.argv[i]
i += 1
if opt == "-o":
output = sys.argv[i]
i ++ 1
continue
if opt.startswith("-l"):
libs.append(opt[2:])
continue
if opt.startswith("-L"):
libdirs.append(opt[2:])
continue
output = join(environ.get('LIBLINK_PATH'), basename(output))
with open(output + ".libs", "w") as f:
f.write("\n".join(libs))
with open(output + ".libdirs", "w") as f:
f.write("\n".join(libdirs))
libargs = ' '.join(["'%s'" % arg for arg in sys.argv[1:]])
cmd = '%s -shared %s %s' % (environ['CC'], environ['LDFLAGS'], libargs)
sys.exit(subprocess.call(cmd, shell=True))