also set LLVM_ROOT
@@ -2,10 +2,19 @@ import os
path = os.path.join(os.environ['PREFIX'], 'lib', 'emscripten-' + os.environ['PKG_VERSION'], '.emscripten')
with open(path, 'r') as fi:
- s = fi.read()
+ lines = fi.readlines()
-s = s.replace("BINARYEN_ROOT = os.path.expanduser(os.getenv('BINARYEN', '')) # directory",
- "BINARYEN_ROOT = os.path.expanduser(os.getenv('BINARYEN', '{}')) # directory".format(os.environ['PREFIX']))
+out_lines = []
+for line in lines:
+ if line.startswith("BINARYEN_ROOT"):
+ out_lines.append("BINARYEN_ROOT = os.path.expanduser(os.getenv('BINARYEN', '{}')) # directory\n".format(os.environ['PREFIX']))
+ elif line.startswith("LLVM_ROOT"):
+ out_lines.append("LLVM_ROOT = os.path.expanduser(os.getenv('LLVM', '{}'))\n".format(os.path.join(os.environ['PREFIX'], 'bin')))
+ else:
+ out_lines.append(line)
+
+print("Writing out .emscripten config file\n")
+print(''.join(out_lines) + '\n')
with open(path, 'w') as fo:
- fo.write(s)
\ No newline at end of file
+ fo.write(''.join(out_lines))
\ No newline at end of file
