Bug fixing in chroma block matching
[schroedinger/research-port.git] / cudalt.py
blobc59fadbb5a94214cf40d14d715fa066fafcb55fb
1 #!/usr/bin/python
2 # libtoolish hack
3 import sys
4 import os
5 out_lo = sys.argv[1]
6 out_o = out_lo.replace(".lo", ".o")
8 try:
9 i = out_o.rindex("/")
10 dir = out_o[0:i+1] + ".libs/"
11 out_l = ".libs/" + out_o[i+1:]
12 out_o = out_o[0:i+1] + ".libs/" + out_o[i+1:]
14 except ValueError:
15 dir = ".libs/"
16 out_o = ".libs/" + out_o
17 out_l = out_o
19 #print out_o
21 # Make lib dir
22 try:
23 os.mkdir(dir)
24 except OSError:
25 pass
26 # pic_object='.libs/libschroedinger_0.1_la-schro.o'
28 args = sys.argv[2:]
29 args.extend(["-Xcompiler","-fPIC"]) # position indep code
30 args.append("-o")
31 args.append(out_o)
33 rv = os.system(" ".join(args))
34 if rv != 0:
35 #print "******** RV is ", rv
36 sys.exit(1)
38 f = open(out_lo, "w")
39 f.write("# libschroedinger_0.1_la-schro.lo - a libtool object file\n")
40 f.write("# Generated by ltmain.sh - GNU libtool 1.5.22 Debian 1.5.22-4 (1.1220.2.365 2005/12/18 22:14:06)\n")
42 f.write("pic_object='" + out_l + "'")
43 f.close()
45 sys.exit(0)