blob: e767900864ef3acea4366fbf22ca1b0356e42ae1 [file] [log] [blame]
Brad Bishop00ab2372019-10-14 11:06:18 -04001From 601ef636fc4dfb2af3e7fda88d8ea1c1d92affe4 Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex.kanavin@gmail.com>
3Date: Wed, 2 Oct 2019 17:54:15 +0200
4Subject: [PATCH] Allow building lua without readline on Linux
5
6Upstream-Status: Pending
7Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
8---
9 Makefile | 2 +-
10 src/Makefile | 3 +++
11 src/luaconf.h | 5 +++++
12 3 files changed, 9 insertions(+), 1 deletion(-)
13
14diff --git a/Makefile b/Makefile
15index 119110d..9f6df45 100644
16--- a/Makefile
17+++ b/Makefile
18@@ -36,7 +36,7 @@ RM= rm -f
19 # == END OF USER SETTINGS -- NO NEED TO CHANGE ANYTHING BELOW THIS LINE =======
20
21 # Convenience platforms targets.
22-PLATS= aix bsd c89 freebsd generic linux macosx mingw posix solaris
23+PLATS= aix bsd c89 freebsd generic linux linux-no-readline macosx mingw posix solaris
24
25 # What to install.
26 TO_BIN= lua luac
27diff --git a/src/Makefile b/src/Makefile
28index 64c78f7..5c0428a 100644
29--- a/src/Makefile
30+++ b/src/Makefile
31@@ -109,6 +109,9 @@ generic: $(ALL)
32 linux:
33 $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -ldl -lreadline"
34
35+linux-no-readline:
36+ $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX_NO_READLINE" SYSLIBS="-Wl,-E -ldl"
37+
38 macosx:
39 $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_MACOSX" SYSLIBS="-lreadline"
40
41diff --git a/src/luaconf.h b/src/luaconf.h
42index 9eeeea6..d71ca25 100644
43--- a/src/luaconf.h
44+++ b/src/luaconf.h
45@@ -64,6 +64,11 @@
46 #define LUA_USE_READLINE /* needs some extra libraries */
47 #endif
48
49+#if defined(LUA_USE_LINUX_NO_READLINE)
50+#define LUA_USE_POSIX
51+#define LUA_USE_DLOPEN /* needs an extra library: -ldl */
52+#endif
53+
54
55 #if defined(LUA_USE_MACOSX)
56 #define LUA_USE_POSIX
57--
582.17.1
59