aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Kligman <alan.kligman@gmail.com>2012-12-19 15:20:20 -0500
committerAlan Kligman <alan.kligman@gmail.com>2012-12-19 18:06:48 -0500
commit6ef49ebf698f670f667cddfbd4f0f8fcb3789456 (patch)
tree2686c36cdc2280833d972dd60b49584e0e8c7a36
parent5eb806577f88f11a4e587eb4936b5329358dc367 (diff)
Added support for python in auto-generated config so that warnings about PYTHON not being defined are not emitted.
-rw-r--r--tools/settings_template_readonly.py1
-rw-r--r--tools/shared.py9
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