diff options
-rwxr-xr-x | emcc | 5 | ||||
-rwxr-xr-x | tests/runner.py | 5 | ||||
-rw-r--r-- | third_party/demangler.py | 5 | ||||
-rwxr-xr-x | tools/bindings_generator.py | 5 | ||||
-rwxr-xr-x | tools/emconfiguren.py | 5 | ||||
-rwxr-xr-x | tools/emmaken.py | 10 | ||||
-rwxr-xr-x | tools/emmakenxx.py | 5 | ||||
-rwxr-xr-x | tools/exec_llvm.py | 5 |
8 files changed, 26 insertions, 19 deletions
@@ -41,10 +41,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() diff --git a/tests/runner.py b/tests/runner.py index f92793d4..d9953c14 100755 --- a/tests/runner.py +++ b/tests/runner.py @@ -18,12 +18,11 @@ import os, unittest, tempfile, shutil, time, inspect, sys, math, glob, tempfile, # Setup -__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 * # Sanity check for config diff --git a/third_party/demangler.py b/third_party/demangler.py index d875d9a5..1066643b 100644 --- a/third_party/demangler.py +++ b/third_party/demangler.py @@ -21,10 +21,11 @@ JS_ENGINE_PARAMS=[] import os, sys, subprocess, re -__rootpath__ = os.path.abspath(os.path.dirname(__file__)) +__rootpath__ = os.path.dirname(os.path.abspath(__file__)) def path_from_root(*pathelems): return os.path.join(os.path.sep, *(__rootpath__.split(os.sep)[:-1] + list(pathelems))) -exec(open(path_from_root('tools', 'shared.py'), 'r').read()) +sys.path += [path_from_root('')] +from tools.shared import * data = open(sys.argv[1], 'r').readlines() diff --git a/tools/bindings_generator.py b/tools/bindings_generator.py index 0dbcca8e..8146215c 100755 --- a/tools/bindings_generator.py +++ b/tools/bindings_generator.py @@ -50,10 +50,11 @@ NOTE: ammo.js is currently the biggest consumer of this code. For some import os, sys, glob, re -__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 * # Find ply and CppHeaderParser sys.path = [path_from_root('third_party', 'ply'), path_from_root('third_party', 'CppHeaderParser')] + sys.path diff --git a/tools/emconfiguren.py b/tools/emconfiguren.py index 2ea5669f..fd7b7549 100755 --- a/tools/emconfiguren.py +++ b/tools/emconfiguren.py @@ -9,10 +9,11 @@ This is a helper script for emmaken.py. See docs in that file for more info. import os, sys -__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 * Building.configure(sys.argv[1:]) diff --git a/tools/emmaken.py b/tools/emmaken.py index 0759c2d3..8ef90cb3 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') diff --git a/tools/emmakenxx.py b/tools/emmakenxx.py index 31658df2..c9ab4ef4 100755 --- a/tools/emmakenxx.py +++ b/tools/emmakenxx.py @@ -6,10 +6,11 @@ see emmaken.py import os, sys -__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 * emmaken = path_from_root('tools', 'emmaken.py') os.environ['EMMAKEN_CXX'] = '1' diff --git a/tools/exec_llvm.py b/tools/exec_llvm.py index 1b1bba1b..a2a000f0 100755 --- a/tools/exec_llvm.py +++ b/tools/exec_llvm.py @@ -36,10 +36,11 @@ the .ll into native code. This can be done as follows: import os, sys from subprocess import Popen, PIPE, STDOUT -__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 * Popen([LLVM_OPT, sys.argv[1], '-strip-debug', '-o=' + sys.argv[1]+'.clean.bc']).communicate()[0] |