diff options
author | max99x <max99x@gmail.com> | 2011-06-26 02:17:23 +0300 |
---|---|---|
committer | max99x <max99x@gmail.com> | 2011-06-26 02:17:23 +0300 |
commit | 77e318392f888b3affe5e4d05520abb13cbff197 (patch) | |
tree | d37c88b32b66bcee5993b615412f78fb3b7bb32d | |
parent | 30c26439216b6f07848ee3611412671fe84cd19a (diff) |
Added support for including the whole library.
-rw-r--r-- | src/analyzer.js | 8 | ||||
-rw-r--r-- | src/settings.js | 5 |
2 files changed, 12 insertions, 1 deletions
diff --git a/src/analyzer.js b/src/analyzer.js index 33238e8a..3cc07f22 100644 --- a/src/analyzer.js +++ b/src/analyzer.js @@ -1127,7 +1127,13 @@ function analyzer(data) { var ret = substrate.solve(); // Add additional necessary items - ['memset', 'malloc', 'free'].forEach(function(ident) { + if (INCLUDE_FULL_LIBRARY) { + assert(!BUILD_AS_SHARED_LIB, 'Cannot have both INCLUDE_FULL_LIBRARY and BUILD_AS_SHARED_LIB set.') + var libFuncsToInclude = Object.keys(Library); + } else { + var libFuncsToInclude = ['memset', 'malloc', 'free']; + } + libFuncsToInclude.forEach(function(ident) { ret.functionStubs.push({ intertype: 'functionStub', ident: '_' + ident diff --git a/src/settings.js b/src/settings.js index 614a29ac..437d61b5 100644 --- a/src/settings.js +++ b/src/settings.js @@ -105,6 +105,11 @@ EXPORTED_GLOBALS = []; // Global non-function variables that are explicitly // exported, so they are guaranteed to be // accessible outside of the generated code. +INCLUDE_FULL_LIBRARY = 0; // Whether to include the whole library rather than just the + // functions used by the generated code. This is needed when + // dynamically loading modules that make use of runtime + // library functions that are not used in the main module. + SHOW_LABELS = 0; // Show labels in the generated code BUILD_AS_SHARED_LIB = 0; // Whether to build the code as a shared library, which |