--- prophet-gpl/tools/tclang.py 2016-11-30 16:19:11.000000000 -0700 +++ prophet-gpl-64/tools/tclang.py 2021-02-09 11:11:18.509759604 -0700 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # Copyright (C) 2016 Fan Long, Martin Rianrd and MIT CSAIL # Prophet # @@ -16,8 +16,9 @@ # # You should have received a copy of the GNU General Public License # along with Prophet. If not, see . -from sys import argv -from os import environ, path +from sys import argv,stderr +from os import system, environ, path +import random import subprocess #FIXME: this is very hacky, should properly handle the quote case @@ -31,13 +32,28 @@ else: return s; +bit_arch="" +bit32=False +skip_wrap=False for i in range(1, len(argv)): + if "-soname" in argv[i]: + skip_wrap=True + if "-m32" in argv[i]: + bit32=True + print("[tclang] 32bit compilation!") argv[i] = fix_argv(argv[i]); -compile_cmd = environ.get("COMPILE_CMD"); + +compile_cmd = path.abspath(path.realpath(environ.get("COMPILE_CMD"))); + +if bit32: + bit_arch="/32" + if 'tools/32' not in compile_cmd: + compile_cmd = compile_cmd.replace("tools/","tools/32/",1) + assert(compile_cmd != None); fulldir = path.abspath(path.dirname(argv[0])); -runtime_library_path = fulldir + "/../src/.libs" +runtime_library_path = fulldir + "/.."+bit_arch+"/src/.libs" just_compile = False; for i in range(1, len(argv)): @@ -51,9 +67,11 @@ else: cmd = compile_cmd + " " + " ".join(argv[1:]); # print "Linkcmd: " + cmd; + print("[tclang] Compile command: "+cmd); ret = subprocess.call(cmd, shell=True); exit(ret); cmd = compile_cmd + " " + " ".join(argv[1:]); +print("[tclang] Compile command: "+cmd); ret = subprocess.call(cmd, shell=True); exit(ret);