summaryrefslogtreecommitdiff
path: root/kernel/driver.cc
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2014-08-22 16:09:13 +0200
committerClifford Wolf <clifford@clifford.at>2014-08-22 16:20:22 +0200
commit98442e019d745f1d61983c071decfa3ebc1ff0cf (patch)
treecb7776cfb0916f529042b4ffd2249404a3aaefdb /kernel/driver.cc
parentba83a7bdc641c68344b41f407323c76b8c62c674 (diff)
Added emscripten (emcc) support to build system and some build fixes
Diffstat (limited to 'kernel/driver.cc')
-rw-r--r--kernel/driver.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/kernel/driver.cc b/kernel/driver.cc
index 6bd60d7b..e778e138 100644
--- a/kernel/driver.cc
+++ b/kernel/driver.cc
@@ -20,8 +20,10 @@
#include "kernel/yosys.h"
#include "libs/sha1/sha1.h"
-#include <readline/readline.h>
-#include <readline/history.h>
+#ifdef YOSYS_ENABLE_READLINE
+# include <readline/readline.h>
+# include <readline/history.h>
+#endif
#include <stdio.h>
#include <string.h>
@@ -46,6 +48,7 @@ int main(int argc, char **argv)
bool print_stats = true;
bool call_abort = false;
+#ifdef YOSYS_ENABLE_READLINE
int history_offset = 0;
std::string history_file;
if (getenv("HOME") != NULL) {
@@ -53,6 +56,7 @@ int main(int argc, char **argv)
read_history(history_file.c_str());
history_offset = where_history();
}
+#endif
int opt;
while ((opt = getopt(argc, argv, "AQTVSm:f:Hh:b:o:p:l:qv:ts:c:")) != -1)
@@ -329,6 +333,7 @@ int main(int argc, char **argv)
if (call_abort)
abort();
+#ifdef YOSYS_ENABLE_READLINE
if (!history_file.empty()) {
if (history_offset > 0) {
history_truncate_file(history_file.c_str(), 100);
@@ -341,6 +346,7 @@ int main(int argc, char **argv)
HIST_ENTRY **hist_list = history_list();
if (hist_list != NULL)
free(hist_list);
+#endif
yosys_shutdown();