diff --git a/emconfigure b/emconfigure index ce98af226..df1e5e7f0 100755 --- a/emconfigure +++ b/emconfigure @@ -20,6 +20,17 @@ import os, sys from tools import shared from subprocess import CalledProcessError +if len(sys.argv) < 2 or 'configure' not in sys.argv[1]: + print >> sys.stderr, ''' +emconfigure is a helper for configure, setting various environment +variables so that emcc etc. are used. + +TYPICAL USAGE: emconfigure ./configure [FLAGS] + +warning: you do not seem to have 'configure' as the first argument + +''' + try: shared.Building.configure(sys.argv[1:]) except CalledProcessError, e: diff --git a/emmake b/emmake index e8f34f416..f1c956093 100755 --- a/emmake +++ b/emmake @@ -22,6 +22,17 @@ import os, sys from tools import shared from subprocess import CalledProcessError +if len(sys.argv) < 2 or sys.argv[1] != 'make': + print >> sys.stderr, ''' +emmake is a helper for make, setting various environment +variables so that emcc etc. are used. + +USAGE: emmake make [FLAGS] + +warning: you do not seem to have 'make' as the first argument + +''' + try: shared.Building.make(sys.argv[1:]) except CalledProcessError, e: diff --git a/tests/test_other.py b/tests/test_other.py index ad11e97d1..3d0a4af01 100644 --- a/tests/test_other.py +++ b/tests/test_other.py @@ -4692,3 +4692,18 @@ Descriptor desc; break assert change > 0 and change <= n + def test_emmake_emconfigure(self): + def check(what, args, fail=True): + print what, args, fail + our, err = Popen([PYTHON, path_from_root(what)] + args, stdout=PIPE, stderr=PIPE).communicate() + assert ('is a helper for' in err) == fail + assert ('USAGE' in err) == fail + assert ('warning: you do not seem to have' in err) == fail + check('emmake', []) + check('emconfigure', []) + check('emmake', ['--version']) + check('emconfigure', ['--version']) + check('emmake', ['make'], fail=False) + check('emconfigure', ['configure'], fail=False) + check('emconfigure', ['./configure'], fail=False) + diff --git a/tests/test_sockets.py b/tests/test_sockets.py index ce6b1ab3d..06712f919 100644 --- a/tests/test_sockets.py +++ b/tests/test_sockets.py @@ -325,6 +325,7 @@ class sockets(BrowserCore): self.btest(os.path.join('sockets', 'test_sockets_select_server_closes_connection_client_rw.c'), expected='266', args=[sockets_include, '-DSOCKK=%d' % harness.listen_port]) def test_enet(self): + # this is also a good test of raw usage of emconfigure and emmake try_delete(self.in_dir('enet')) shutil.copytree(path_from_root('tests', 'enet'), self.in_dir('enet')) pwd = os.getcwd()