This is implemented to be compatible for user-code with the 2.0 frontend, if scrapping that it could be a vendor for Clang instead. The other quirk here is that the version reported is the Clang version rather than the Emscripten version, I can't think of much use for the Emscripten version and it makes version tests for flags a lot simpler to write (it would be nice for AMBuild to have something to help manage that in the future though).
The 2nd commit here makes ambuild able to be used without the emconfigure wrapper, which is just a bit simpler to use (and makes auto-reconfigure work correctly) - it'd be nice if it could be less strict about when it is used (passing a full path to emcc doesn't work currently for instance), but I think it would be more annoying than useful to default to Emscripten just because you've got the EMSDK set up. It is still a lot less hacky than the 2.0 code was.
Example with emconfigure:
$ emconfigure python ../configure.py --build=spcomp,vm,test --enable-optimize
emconfigure is a helper for configure, setting various environment
variables so that emcc etc. are used. Typical usage:
emconfigure ./configure [FLAGS]
(but you can run any command instead of configure)
Checking CC compiler (vendor test gcc)... ['python', '/root/code/emsdk-portable/emscripten/1.37.33/emcc.py', 'test.c', '-o', 'test']
found emscripten version 5.0
Checking CXX compiler (vendor test gcc)... ['python', '/root/code/emsdk-portable/emscripten/1.37.33/em++.py', 'test.cpp', '-o', 'testp']
found emscripten version 5.0
Example with native support: (same invocation as 2.0 frontend)
$ CC=emcc CXX=em++ python ../configure.py --build=spcomp,vm,test --enable-optimize
Checking CC compiler (vendor test emscripten)... ['emcc', '-s', 'NO_EXIT_RUNTIME=0', 'test.c', '-o', 'test.js']
found emscripten version 5.0
Checking CXX compiler (vendor test emscripten)... ['em++', '-s', 'NO_EXIT_RUNTIME=0', 'test.cpp', '-o', 'testp.js']
found emscripten version 5.0
This is implemented to be compatible for user-code with the 2.0 frontend, if scrapping that it could be a vendor for Clang instead. The other quirk here is that the version reported is the Clang version rather than the Emscripten version, I can't think of much use for the Emscripten version and it makes version tests for flags a lot simpler to write (it would be nice for AMBuild to have something to help manage that in the future though).
The 2nd commit here makes ambuild able to be used without the
emconfigure
wrapper, which is just a bit simpler to use (and makes auto-reconfigure work correctly) - it'd be nice if it could be less strict about when it is used (passing a full path toemcc
doesn't work currently for instance), but I think it would be more annoying than useful to default to Emscripten just because you've got the EMSDK set up. It is still a lot less hacky than the 2.0 code was.Example with emconfigure:
Example with native support: (same invocation as 2.0 frontend)