aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--icebram/icebram.cc16
-rw-r--r--icemulti/icemulti.cc16
-rw-r--r--icepack/icepack.cc16
-rw-r--r--icepll/icepll.cc16
-rw-r--r--icetime/icetime.cc16
5 files changed, 80 insertions, 0 deletions
diff --git a/icebram/icebram.cc b/icebram/icebram.cc
index 245a0ab..a796f92 100644
--- a/icebram/icebram.cc
+++ b/icebram/icebram.cc
@@ -28,6 +28,10 @@
#include <fstream>
#include <iostream>
+#ifdef __EMSCRIPTEN__
+#include <emscripten.h>
+#endif
+
using std::map;
using std::pair;
using std::vector;
@@ -109,6 +113,18 @@ void help(const char *cmd)
int main(int argc, char **argv)
{
+#ifdef __EMSCRIPTEN__
+ EM_ASM(
+ if (ENVIRONMENT_IS_NODE)
+ {
+ FS.mkdir('/hostcwd');
+ FS.mount(NODEFS, { root: '.' }, '/hostcwd');
+ FS.mkdir('/hostfs');
+ FS.mount(NODEFS, { root: '/' }, '/hostfs');
+ }
+ );
+#endif
+
bool verbose = false;
bool generate = false;
diff --git a/icemulti/icemulti.cc b/icemulti/icemulti.cc
index 65ae6b6..4bc0919 100644
--- a/icemulti/icemulti.cc
+++ b/icemulti/icemulti.cc
@@ -24,6 +24,10 @@
#include <stdlib.h>
#include <string.h>
+#ifdef __EMSCRIPTEN__
+#include <emscripten.h>
+#endif
+
#define log(...) fprintf(stderr, __VA_ARGS__);
#define error(...) do { fprintf(stderr, "%s: ", program_short_name); fprintf(stderr, __VA_ARGS__); exit(EXIT_FAILURE); } while (0)
@@ -178,6 +182,18 @@ void usage()
int main(int argc, char **argv)
{
+#ifdef __EMSCRIPTEN__
+ EM_ASM(
+ if (ENVIRONMENT_IS_NODE)
+ {
+ FS.mkdir('/hostcwd');
+ FS.mount(NODEFS, { root: '.' }, '/hostcwd');
+ FS.mkdir('/hostfs');
+ FS.mount(NODEFS, { root: '/' }, '/hostfs');
+ }
+ );
+#endif
+
int c;
char *endptr = NULL;
bool coldboot = false;
diff --git a/icepack/icepack.cc b/icepack/icepack.cc
index d845ba7..3029c25 100644
--- a/icepack/icepack.cc
+++ b/icepack/icepack.cc
@@ -34,6 +34,10 @@
#include <stdio.h>
#include <stdarg.h>
+#ifdef __EMSCRIPTEN__
+#include <emscripten.h>
+#endif
+
#ifdef _WIN32
#define __PRETTY_FUNCTION__ __FUNCTION__
#endif
@@ -1338,6 +1342,18 @@ void usage()
int main(int argc, char **argv)
{
+#ifdef __EMSCRIPTEN__
+ EM_ASM(
+ if (ENVIRONMENT_IS_NODE)
+ {
+ FS.mkdir('/hostcwd');
+ FS.mount(NODEFS, { root: '.' }, '/hostcwd');
+ FS.mkdir('/hostfs');
+ FS.mount(NODEFS, { root: '/' }, '/hostfs');
+ }
+ );
+#endif
+
vector<string> parameters;
bool unpack_mode = false;
bool nosleep_mode = false;
diff --git a/icepll/icepll.cc b/icepll/icepll.cc
index b123f32..82bf3e3 100644
--- a/icepll/icepll.cc
+++ b/icepll/icepll.cc
@@ -20,6 +20,10 @@
#include <string.h>
#include <math.h>
+#ifdef __EMSCRIPTEN__
+#include <emscripten.h>
+#endif
+
const char *binstr(int v, int n)
{
static char buffer[16];
@@ -63,6 +67,18 @@ void help(const char *cmd)
int main(int argc, char **argv)
{
+#ifdef __EMSCRIPTEN__
+ EM_ASM(
+ if (ENVIRONMENT_IS_NODE)
+ {
+ FS.mkdir('/hostcwd');
+ FS.mount(NODEFS, { root: '.' }, '/hostcwd');
+ FS.mkdir('/hostfs');
+ FS.mount(NODEFS, { root: '/' }, '/hostfs');
+ }
+ );
+#endif
+
double f_pllin = 12;
double f_pllout = 60;
bool simple_feedback = true;
diff --git a/icetime/icetime.cc b/icetime/icetime.cc
index 0b7cea2..f9e0994 100644
--- a/icetime/icetime.cc
+++ b/icetime/icetime.cc
@@ -33,6 +33,10 @@
#include <map>
#include <set>
+#ifdef __EMSCRIPTEN__
+#include <emscripten.h>
+#endif
+
// add this number of ns as estimate for clock distribution mismatch
#define GLOBAL_CLK_DIST_JITTER 0.1
@@ -2223,6 +2227,18 @@ void help(const char *cmd)
int main(int argc, char **argv)
{
+#ifdef __EMSCRIPTEN__
+ EM_ASM(
+ if (ENVIRONMENT_IS_NODE)
+ {
+ FS.mkdir('/hostcwd');
+ FS.mount(NODEFS, { root: '.' }, '/hostcwd');
+ FS.mkdir('/hostfs');
+ FS.mount(NODEFS, { root: '/' }, '/hostfs');
+ }
+ );
+#endif
+
bool listnets = false;
bool print_timing = false;
bool interior_timing = false;