def create(): logging.info('building port: ' + name + '...') port_build_dir = Ports.get_build_dir() shared.safe_ensure_dirs(port_build_dir) libs = shared.Building.build_library(name, port_build_dir, None, generated_libs, source_dir=os.path.join(Ports.get_dir(), name, subdir), copy_project=True, configure=configure, make=['make', '-j' + str(CORES)]) assert len(libs) == 1 if post_create: post_create() return libs[0]
def create(): logging.warning('building port: ' + name + '...') port_build_dir = Ports.get_build_dir() shared.safe_ensure_dirs(port_build_dir) libs = shared.Building.build_library(name, port_build_dir, None, generated_libs, source_dir=os.path.join(Ports.get_dir(), name, subdir), copy_project=True, configure=configure, make=['make', '-j' + str(CORES)]) assert len(libs) == 1 if post_create: post_create() return libs[0]
def unpack(): logging.warning('unpacking port: ' + name) shared.safe_ensure_dirs(fullname) z = zipfile.ZipFile(fullname + '.zip', 'r') try: cwd = os.getcwd() os.chdir(fullname) z.extractall() finally: os.chdir(cwd) State.unpacked = True
def get_dir(): dirname = os.environ.get('EM_PORTS') or os.path.expanduser(os.path.join('~', '.emscripten_ports')) shared.safe_ensure_dirs(dirname) return dirname
import os, sys, json, subprocess import shared, js_optimizer js_file = sys.argv[1] mem_init_file = sys.argv[2] total_memory = int(sys.argv[3]) total_stack = int(sys.argv[4]) global_base = int(sys.argv[5]) assert global_base > 0 config = shared.Configuration() if shared.DEBUG: temp_file = os.path.join(shared.CANONICAL_TEMP_DIR, 'ctorEval.js') shared.safe_ensure_dirs(shared.CANONICAL_TEMP_DIR) else: temp_file = config.get_temp_files().get('.ctorEval.js').name # helpers def get_asm(js): return js[js.find(js_optimizer.start_asm_marker):js.find(js_optimizer.end_asm_marker)] def find_ctors(js): ctors_start = js.find('__ATINIT__.push(') if ctors_start < 0: return (-1, -1) ctors_end = js.find(');', ctors_start) assert ctors_end > 0 ctors_end += 3
def get_dir(): dirname = os.environ.get('EM_PORTS') or os.path.expanduser( os.path.join('~', '.emscripten_ports')) shared.safe_ensure_dirs(dirname) return dirname