diff options
-rw-r--r-- | tools/settings_template_readonly.py | 1 | ||||
-rw-r--r-- | tools/shared.py | 9 |
2 files changed, 9 insertions, 1 deletions
diff --git a/tools/settings_template_readonly.py b/tools/settings_template_readonly.py index 93ea2036..970a8f8c 100644 --- a/tools/settings_template_readonly.py +++ b/tools/settings_template_readonly.py @@ -7,6 +7,7 @@ import os # this helps projects using emscripten find it EMSCRIPTEN_ROOT = os.path.expanduser(os.getenv('EMSCRIPTEN') or '{{{ EMSCRIPTEN_ROOT }}}') LLVM_ROOT = os.path.expanduser(os.getenv('LLVM') or '{{{ LLVM_ROOT }}}') +PYTHON = os.path.expanduser(os.getenv('PYTHON') or '{{{ PYTHON }}}') # See below for notes on which JS engine(s) you need NODE_JS = os.path.expanduser(os.getenv('NODE') or '{{{ NODE }}}') diff --git a/tools/shared.py b/tools/shared.py index dc3e2a30..461f0561 100644 --- a/tools/shared.py +++ b/tools/shared.py @@ -96,6 +96,12 @@ else: except: pass config_file = config_file.replace('{{{ NODE }}}', node) + python = 'python' + try: + python = Popen(['which', 'python'], stdout=PIPE).communicate()[0].replace('\n', '') + except: + pass + config_file = config_file.replace('{{{ PYTHON }}}', python) # write open(CONFIG_FILE, 'w').write(config_file) @@ -110,6 +116,7 @@ A settings file has been copied to %s, at absolute path: %s It contains our best guesses for the important paths, which are: LLVM_ROOT = %s + PYTHON = %s NODE_JS = %s EMSCRIPTEN_ROOT = %s @@ -117,7 +124,7 @@ Please edit the file if any of those are incorrect. This command will now exit. When you are done editing those paths, re-run it. ============================================================================== -''' % (EM_CONFIG, CONFIG_FILE, llvm_root, node, __rootpath__) +''' % (EM_CONFIG, CONFIG_FILE, llvm_root, python, node, __rootpath__) sys.exit(0) try: config_text = open(CONFIG_FILE, 'r').read() if CONFIG_FILE else EM_CONFIG |