aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/jsifier.js7
-rw-r--r--src/preamble_sharedlib.js11
2 files changed, 14 insertions, 4 deletions
diff --git a/src/jsifier.js b/src/jsifier.js
index 9621bb8e..d7143dde 100644
--- a/src/jsifier.js
+++ b/src/jsifier.js
@@ -774,10 +774,9 @@ function JSify(data, functionsOnly, givenFunctions, givenGlobalVariables) {
var shellFile = BUILD_AS_SHARED_LIB ? 'shell_sharedlib.js' : 'shell.js';
var shellParts = read(shellFile).split('{{BODY}}');
print(shellParts[0]);
- if (!BUILD_AS_SHARED_LIB) {
- var pre = processMacros(preprocess(read('preamble.js').replace('{{RUNTIME}}', getRuntime()), CONSTANTS));
- print(pre);
- }
+ var preFile = BUILD_AS_SHARED_LIB ? 'preamble_sharedlib.js' : 'preamble.js';
+ var pre = processMacros(preprocess(read(preFile).replace('{{RUNTIME}}', getRuntime()), CONSTANTS));
+ print(pre);
generated.forEach(function(item) { print(indentify(item.JS || '', 2)); });
print(Functions.generateIndexing());
diff --git a/src/preamble_sharedlib.js b/src/preamble_sharedlib.js
new file mode 100644
index 00000000..01d68cfe
--- /dev/null
+++ b/src/preamble_sharedlib.js
@@ -0,0 +1,11 @@
+// === Auto-generated preamble library stuff ===
+
+//========================================
+// Runtime essentials
+//========================================
+
+function __globalConstructor__() {
+}
+
+// === Body ===
+