lbry-android/p4a/pythonforandroid/bootstraps/pygame/build/tools/liblink-jb
Akinwale Ariwodola 744cfaebc2 Initial commit
2017-08-13 02:24:00 +01:00

43 lines
873 B
Python
Executable file

#!/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))