enable EMCONFIGURE_JS by default, i.e., run configure tests by compiling to js

This commit is contained in:
Alon Zakai 2015-02-09 12:35:19 -08:00
Родитель 720f5d0efc
Коммит 9be0275876
2 изменённых файлов: 14 добавлений и 10 удалений

8
emcc
Просмотреть файл

@ -186,9 +186,11 @@ CONFIGURE_CONFIG = (os.environ.get('EMMAKEN_JUST_CONFIGURE') or 'conftest.c' in
CMAKE_CONFIG = 'CMakeFiles/cmTryCompileExec.dir' in ' '.join(sys.argv)# or 'CMakeCCompilerId' in ' '.join(sys.argv)
if CONFIGURE_CONFIG or CMAKE_CONFIG:
debug_configure = 0 # XXX use this to debug configure stuff. ./configure's generally hide our normal output including stderr so we write to a file
use_js = os.environ.get('EMCONFIGURE_JS') # whether we fake configure tests using clang - the local, native compiler - or not. if not we generate JS and use node with a shebang
# neither approach is perfect, you can try both, but may need to edit configure scripts in some cases
# XXX False is not fully tested yet
# whether we fake configure tests using clang - the local, native compiler - or not. if not we generate JS and use node with a shebang
# neither approach is perfect, you can try both, but may need to edit configure scripts in some cases
# by default we configure in js, which can break on local filesystem access, etc., but is otherwise accurate
use_js = os.environ.get('EMCONFIGURE_JS') or 1
if debug_configure:
tempout = '/tmp/emscripten_temp/out'

Просмотреть файл

@ -4632,13 +4632,15 @@ int main(void) {
def test_emconfigure_js_o(self):
# issue 2994
try:
os.environ['EMCONFIGURE_JS'] = '1'
Popen([PYTHON, path_from_root('emconfigure'), PYTHON, EMCC, '-c', '-o', 'a.o', path_from_root('tests', 'hello_world.c')]).communicate()
Popen([PYTHON, EMCC, 'a.o']).communicate()
assert 'hello, world!' in run_js(self.in_dir('a.out.js'))
finally:
del os.environ['EMCONFIGURE_JS']
for i in [0, 1]:
print i
try:
os.environ['EMCONFIGURE_JS'] = str(i)
Popen([PYTHON, path_from_root('emconfigure'), PYTHON, EMCC, '-c', '-o', 'a.o', path_from_root('tests', 'hello_world.c')]).communicate()
Popen([PYTHON, EMCC, 'a.o']).communicate()
assert 'hello, world!' in run_js(self.in_dir('a.out.js'))
finally:
del os.environ['EMCONFIGURE_JS']
def test_emcc_c_multi(self):
def test(args, llvm_opts=None):