diff options
author | James Prestwood <james.prestwood@intel.com> | 2016-08-10 09:05:49 -0700 |
---|---|---|
committer | James Prestwood <james.prestwood@intel.com> | 2016-08-15 16:03:24 -0700 |
commit | c0f21fec1d784b9c791f89ce3c0f6feab4a6e739 (patch) | |
tree | 123e050f1545a19b1033d26d6b49f3f7ffbf9f42 /src/zjs_common.h | |
parent | c968aeddee33f0119a2a3b1b73d69d10148a0fdf (diff) |
[Linux] Added option to build for linux
- In prep for OCF work, having a linux build will be much easier for
development. With some minor porting changes/additions you can now
build for linux:
make linux JS=<script>
- Support is minimal and not extensively tested. I have confirmed that
HelloWorld.js and Timers.js work, though timers may not be accurate
due to Zephyr using ticks and linux using real time.
Signed-off-by: James Prestwood <james.prestwood@intel.com>
Diffstat (limited to 'src/zjs_common.h')
-rw-r--r-- | src/zjs_common.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/zjs_common.h b/src/zjs_common.h index ab46a54..352937a 100644 --- a/src/zjs_common.h +++ b/src/zjs_common.h @@ -4,7 +4,7 @@ #define __zjs_common_h__ // This file includes code common to both X86 and ARC - +#ifndef ZJS_LINUX_BUILD #if defined(CONFIG_STDOUT_CONSOLE) #include <stdio.h> #define PRINT printf @@ -12,6 +12,10 @@ #include <misc/printk.h> #define PRINT printk #endif +#else +#include <stdio.h> +#define PRINT printf +#endif // TODO: We should instead have a macro that changes in debug vs. release build, // to save string space and instead print error codes or something for release. |