aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-08-08 14:44:19 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-08-08 14:44:19 -0700
commit3284c0b5aa51e049c1af7af038e90b9099a7b00c (patch)
treea7aad2875437ac8b409ec31247d0ca1a0cbd4356
parentd65c3474df9dd630fd1809f03a2650f6564cf963 (diff)
parent8e5bdd53c51bb50e61c5a7a312e0c1f17f3da327 (diff)
Merge pull request #1403 from imvu/scons-updates-pull-request
Bring SCons integration up to date with latest incoming and fix some SCons build reliability issues and races
-rwxr-xr-xemscripten.py5
-rwxr-xr-xscons-tools/emscripten.py17
-rwxr-xr-xscons-tools/llvm.py7
3 files changed, 18 insertions, 11 deletions
diff --git a/emscripten.py b/emscripten.py
index ab68fcaa..aa47e4f1 100755
--- a/emscripten.py
+++ b/emscripten.py
@@ -11,7 +11,6 @@ headers, for the libc implementation in JS).
import os, sys, json, optparse, subprocess, re, time, multiprocessing, string
-from tools import shared
from tools import jsrun, cache as cache_module, tempfiles
from tools.response_file import read_response_file
@@ -26,6 +25,7 @@ def get_configuration():
if hasattr(get_configuration, 'configuration'):
return get_configuration.configuration
+ from tools import shared
configuration = shared.Configuration(environ=os.environ)
get_configuration.configuration = configuration
return configuration
@@ -469,6 +469,7 @@ def emscript(infile, settings, outfile, libraries=[], compiler_engine=None,
}
''' % (sig, i, args, arg_coercions, jsret))
+ from tools import shared
asm_setup += '\n' + shared.JS.make_invoke(sig) + '\n'
basic_funcs.append('invoke_%s' % sig)
@@ -807,7 +808,7 @@ WARNING: You should normally never use this! Use emcc instead.
'''
if len(positional) != 1:
- raise RuntimeError('Must provide exactly one positional argument.')
+ raise RuntimeError('Must provide exactly one positional argument. Got ' + str(len(positional)) + ': "' + '", "'.join(positional) + '"')
keywords.infile = os.path.abspath(positional[0])
if isinstance(keywords.outfile, basestring):
keywords.outfile = open(keywords.outfile, 'w')
diff --git a/scons-tools/emscripten.py b/scons-tools/emscripten.py
index 473c51ad..b4912aaa 100755
--- a/scons-tools/emscripten.py
+++ b/scons-tools/emscripten.py
@@ -24,6 +24,7 @@ def build_version_file(env):
EMSCRIPTEN_DEPENDENCIES = [
env.Glob('${EMSCRIPTEN_HOME}/src/*.js'),
+ env.Glob('${EMSCRIPTEN_HOME}/src/embind/*.js'),
env.Glob('${EMSCRIPTEN_HOME}/tools/*.py'),
'${EMSCRIPTEN_HOME}/emscripten.py',
]
@@ -141,7 +142,7 @@ def emscripten(env, target_js, source_bc):
[global_emscripten_min_js] = env.JSOptimizer(
buildName('global.min.js'),
closure_js,
- JS_OPTIMIZER_PASSES=['simplifyExpressionsPost', 'compress', 'last'])
+ JS_OPTIMIZER_PASSES=['simplifyExpressionsPost', 'minifyWhitespace', 'last'])
[emscripten_iteration_js] = env.WrapInModule(
buildName('iteration.js'),
@@ -155,8 +156,6 @@ def emscripten(env, target_js, source_bc):
buildName('min.js'),
global_emscripten_min_js)
- env.InstallAs(buildName('js'), emscripten_js)
-
return [emscripten_iteration_js, emscripten_js, emscripten_min_js]
LIBC_SOURCES = [
@@ -265,9 +264,9 @@ def generate(env):
)
env.Replace(
- CC='${LLVM_ROOT}/${CLANG}',
- CXX='${LLVM_ROOT}/${CLANGXX}',
- AR='${LLVM_ROOT}/${LLVM_LINK}',
+ CC=os.path.join('${LLVM_ROOT}', '${CLANG}'),
+ CXX=os.path.join('${LLVM_ROOT}', '${CLANGXX}'),
+ AR=os.path.join('${LLVM_ROOT}', '${LLVM_LINK}'),
ARCOM='$AR -o $TARGET $SOURCES',
OBJSUFFIX='.bc',
LIBPREFIX='',
@@ -301,6 +300,12 @@ def generate(env):
'__IEEE_LITTLE_ENDIAN',
])
+ env.Append(
+ CPPPATH=[
+ env.Dir('${EMSCRIPTEN_HOME}/system/include'),
+ ]
+ )
+
env['BUILDERS']['Emscripten'] = Builder(
action='$PYTHON ${EMSCRIPTEN_HOME}/emscripten.py $EMSCRIPTEN_FLAGS $_EMSCRIPTEN_SETTINGS_FLAGS --temp-dir=$EMSCRIPTEN_TEMP_DIR --compiler $JS_ENGINE --relooper=third-party/relooper.js $SOURCE > $TARGET',
target_scanner=EmscriptenScanner)
diff --git a/scons-tools/llvm.py b/scons-tools/llvm.py
index f272bd16..2dc65dd3 100755
--- a/scons-tools/llvm.py
+++ b/scons-tools/llvm.py
@@ -1,5 +1,6 @@
from SCons.Scanner.Prog import scan
from SCons.Builder import Builder
+import os
def exists(env):
return True
@@ -23,11 +24,11 @@ def generate(env):
LLVM_LINK='llvm-link')
env['BUILDERS']['LLVMDis'] = Builder(
- action='${LLVM_ROOT}/$LLVM_DIS -o=$TARGET $SOURCE')
+ action=os.path.join('${LLVM_ROOT}', '$LLVM_DIS') + ' -o=$TARGET $SOURCE')
env['BUILDERS']['LLVMOpt'] = Builder(
- action='${LLVM_ROOT}/$LLVM_OPT $LLVM_OPT_FLAGS $LLVM_OPT_PASSES -o=$TARGET $SOURCE')
+ action=os.path.join('${LLVM_ROOT}', '$LLVM_OPT') + ' $LLVM_OPT_FLAGS $LLVM_OPT_PASSES -o=$TARGET $SOURCE')
env['BUILDERS']['LLVMLink'] = Builder(
- action='${LLVM_ROOT}/$LLVM_LINK -o=$TARGET $SOURCES',
+ action=os.path.join('${LLVM_ROOT}', '$LLVM_LINK') + ' -o=$TARGET $SOURCES',
emitter=add_libraries)