This commit is contained in:
Alon Zakai 2011-12-11 10:23:03 -08:00
Родитель 994e01663b
Коммит 58f694a190
4 изменённых файлов: 25 добавлений и 17 удалений

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

@ -5,13 +5,8 @@ See emcc.py. This script forwards to there, noting that we want C++ and not C by
'''
import os, sys
from tools import shared
__rootpath__ = os.path.abspath(os.path.dirname(__file__))
def path_from_root(*pathelems):
return os.path.join(__rootpath__, *pathelems)
exec(open(path_from_root('tools', 'shared.py'), 'r').read())
emmaken = path_from_root('tools', 'emmaken.py')
os.environ['EMMAKEN_CXX'] = '1'
exit(os.execvp('python', ['python', emmaken] + sys.argv[1:]))
exit(os.execvp(shared.EMCC, [shared.EMCC] + sys.argv[1:]))

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

@ -95,25 +95,28 @@ emcc can be influenced by a few environment variables:
import sys
import os
import subprocess
from tools import shared
DEBUG = 0
################### XXX
print >> sys.stderr, '***This is a WORK IN PROGRESS***'
print >> sys.stderr, '\n***This is a WORK IN PROGRESS***'
print >> sys.stderr, '***[%s]***\n' % str(sys.argv)
################### XXX
if DEBUG: print >> sys.stderr, 'emcc.py: ', ' '.join(sys.argv)
__rootpath__ = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
def path_from_root(*pathelems):
return os.path.join(__rootpath__, *pathelems)
exec(open(path_from_root('tools', 'shared.py'), 'r').read())
# Handle some global flags
if len(sys.argv) == 1:
print 'emcc: no input files'
exit(0)
if sys.argv[1] == '--version':
print '''emcc 2.X
This is drop-in compiler replacement for Emscripten
http://emscripten.org
print '''emcc (Emscripten GCC-like replacement) 2.0
Copyright (C) 2011 the Emscripten authors.
This is free and open source software under the MIT license.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
'''
exit(0)
elif sys.argv[1] == '--help':

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

@ -4868,7 +4868,15 @@ TT = %s
class other(RunnerCore):
def test_emcc(self):
pass
for compiler in [EMCC, EMXX]:
# --version
output = Popen([compiler, '--version'], stdout=PIPE, stderr=PIPE).communicate(input)[0]
self.assertContained('''emcc (Emscripten GCC-like replacement) 2.0
Copyright (C) 2011 the Emscripten authors.
This is free and open source software under the MIT license.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
''', output)
# TODO: make sure all of these match gcc
# TODO: when this is done, more test runner to test these (i.e., test all -Ox thoroughly)
# -- options: check these, warn about errors. valid gcc ones are help, version. Ours should be -- too, not -.

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

@ -26,6 +26,8 @@ COFFEESCRIPT = path_from_root('tools', 'eliminator', 'node_modules', 'coffee-scr
EMSCRIPTEN = path_from_root('emscripten.py')
DEMANGLER = path_from_root('third_party', 'demangler.py')
NAMESPACER = path_from_root('tools', 'namespacer.py')
EMCC = path_from_root('emcc')
EMXX = path_from_root('em++')
EMMAKEN = path_from_root('tools', 'emmaken.py')
AUTODEBUGGER = path_from_root('tools', 'autodebugger.py')
DFE = path_from_root('tools', 'dead_function_eliminator.py')