All Makefiles in extra folder were using gcc instead of $(CC), fix this
to allow cross-compilation
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Previously extras relied on ../../src which only exists in the end user
distributable. It's better to run tools/configure.py because the extras
will then work both from the main repo and the distributable. Also the
configure.py will be more apparent and maybe picked up by the user.
duk_compile() + DUK_COMPILE_SHEBANG is not enough for modules because there is
a module function wrapper which offsets the shebang in the module source when
Duktape actually sees it.
* Fix function name in README.
* Rename duk_module_node_peval_file() to duk_module_node_peval_main() which
is less confusing (the function doesn't eval a file but expects the module
source on the value stack).
* Fix forward declaration of duk__push_module_object() which was missing the
"int main" argument.
* Avoid DUK_ERR_API_ERROR which is now removed; use DUK_ERR_TYPE_ERROR instead.
* Fix duk_safe_call() which was depending on Duktape 1.x API, now supports both
1.x and 2.x.
* Change typing from "int main" to "duk_bool_t main".
* Comment and C convention trivia.
* Fix typo in type name (duk_int -> duk_int_t)
* Fix value stack index usage for safe call, was using positive indices
* Add exitcode to test.c so that 'make test' errors out
* Add exitcode to other extras too where applicable
This loader has the following features:
* Application-provided callbacks for module resolution and loading
* Module caching based on resolved module ID
* Tolerates circular `require()` chains
* Supports `module.exports`, `module.loaded`, and `module.require`
* Supports `require.cache`
* Supports `__filename` (but not `__dirname`)