aboutsummaryrefslogtreecommitdiff
path: root/tools/emmaken.py
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-01-31 14:11:57 -0800
committerAlon Zakai <alonzakai@gmail.com>2012-01-31 14:11:57 -0800
commit2761fe8d19002c94aa25d92246fc9968ba7c2cac (patch)
treed2c4eb386d071f96330ce5de55ed79c815734efd /tools/emmaken.py
parentab7dacbf6278ad1cbe1633231d1c04abaa80b702 (diff)
parentd48cba10976ff7665fb39768ca251c8f08e1bbe8 (diff)
Merge pull request #198 from ehsan/import_shared_properly
Import shared.py properly
Diffstat (limited to 'tools/emmaken.py')
-rwxr-xr-xtools/emmaken.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/tools/emmaken.py b/tools/emmaken.py
index 447a7d6d..8e1bfdc8 100755
--- a/tools/emmaken.py
+++ b/tools/emmaken.py
@@ -56,10 +56,11 @@ Example uses:
* For SCons the shared.py can be imported like so:
__file__ = str(Dir('#/project_path_to_emscripten/dummy/dummy'))
- __rootpath__ = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
+ __rootpath__ = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
def path_from_root(*pathelems):
return os.path.join(__rootpath__, *pathelems)
- exec(open(path_from_root('tools', 'shared.py'), 'r').read())
+ sys.path += [path_from_root('')]
+ from tools.shared import *
For using the Emscripten compilers/linkers/etc. you can do:
env = Environment()
@@ -99,10 +100,11 @@ import subprocess
print >> sys.stderr, 'emmaken.py: ', ' '.join(sys.argv)
-__rootpath__ = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
+__rootpath__ = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
def path_from_root(*pathelems):
return os.path.join(__rootpath__, *pathelems)
-exec(open(path_from_root('tools', 'shared.py'), 'r').read())
+sys.path += [path_from_root('')]
+from tools.shared import *
# If this is a configure-type thing, just do that
CONFIGURE_CONFIG = os.environ.get('EMMAKEN_JUST_CONFIGURE')