Fix LaTeX build
diff --git a/src/lisp/Jmk b/src/lisp/Jmk
index ed2e788..03b0e55 100644
--- a/src/lisp/Jmk
+++ b/src/lisp/Jmk
@@ -15,12 +15,14 @@
NO_READLINE ?= 0
-CFLAGS += -Ivendor/luajit/dynasm -Werror -lreadline # -fsanitize=address
-LDFLAGS += -lreadline
+CFLAGS += -Ivendor/luajit/dynasm -Werror # -fsanitize=address
ASMFLAGS += -felf -Fdwarf
ifeq ($(NO_READLINE),1)
CFLAGS += -DNO_READLINE
+else
+LDFLAGS += -lreadline
+CFLAGS += -lreadline
endif
OBJECTS = main.o \
diff --git a/src/lisp/plat/linux.c b/src/lisp/plat/linux.c
index 82ecb10..fa6336f 100644
--- a/src/lisp/plat/linux.c
+++ b/src/lisp/plat/linux.c
@@ -4,8 +4,10 @@
#include <string.h>
#include <sys/mman.h>
#include <unistd.h>
+#ifndef NO_READLINE
#include <readline/readline.h>
#include <readline/history.h>
+#endif
void *malloc_aligned(size_t size)
{
@@ -45,10 +47,16 @@
char *read_input_line(char *prompt)
{
+#ifndef NO_READLINE
return readline(prompt);
+#else
+ return "";
+#endif
}
void add_line_to_history(char *line)
{
+#ifndef NO_READLINE
add_history(line);
+#endif
}