remove lua's dependency on libreadline and libncurses
[openwrt.git] / package / lua / patches / 100-no_readline.patch
1 Index: lua-5.1.3/src/luaconf.h
2 ===================================================================
3 --- lua-5.1.3.orig/src/luaconf.h        2008-04-13 16:18:00.338123105 +0200
4 +++ lua-5.1.3/src/luaconf.h     2008-04-13 16:18:14.110907972 +0200
5 @@ -36,7 +36,6 @@
6  #if defined(LUA_USE_LINUX)
7  #define LUA_USE_POSIX
8  #define LUA_USE_DLOPEN         /* needs an extra library: -ldl */
9 -#define LUA_USE_READLINE       /* needs some extra libraries */
10  #endif
11  
12  #if defined(LUA_USE_MACOSX)
13 Index: lua-5.1.3/src/Makefile
14 ===================================================================
15 --- lua-5.1.3.orig/src/Makefile 2008-04-13 16:18:18.695169214 +0200
16 +++ lua-5.1.3/src/Makefile      2008-04-13 16:24:41.036957630 +0200
17 @@ -17,6 +17,7 @@
18  MYCFLAGS=
19  MYLDFLAGS=
20  MYLIBS=
21 +# USE_READLINE=1
22  
23  # == END OF USER SETTINGS. NO NEED TO CHANGE ANYTHING BELOW THIS LINE =========
24  
25 @@ -83,7 +84,7 @@
26         @echo "MYLIBS = $(MYLIBS)"
27  
28  # convenience targets for popular platforms
29 -
30 +RFLAG=$(if $(USE_READLINE),-DLUA_USE_READLINE)
31  none:
32         @echo "Please choose a platform:"
33         @echo "   $(PLATS)"
34 @@ -98,16 +99,16 @@
35         $(MAKE) all MYCFLAGS="-DLUA_USE_POSIX -DLUA_USE_DLOPEN" MYLIBS="-Wl,-E"
36  
37  freebsd:
38 -       $(MAKE) all MYCFLAGS="-DLUA_USE_LINUX" MYLIBS="-Wl,-E -lreadline"
39 +       $(MAKE) all MYCFLAGS="-DLUA_USE_LINUX $(RFLAG)" MYLIBS="-Wl,-E$(if $(USE_READLINE), -lreadline)"
40  
41  generic:
42         $(MAKE) all MYCFLAGS=
43  
44  linux:
45 -       $(MAKE) all MYCFLAGS+=-DLUA_USE_LINUX MYLIBS="-Wl,-E -ldl -lreadline -lhistory -lncurses"
46 +       $(MAKE) all MYCFLAGS+="-DLUA_USE_LINUX $(RFLAG)" MYLIBS="-Wl,-E -ldl $(if $(USE_READLINE), -lreadline -lhistory -lncurses)"
47  
48  macosx:
49 -       $(MAKE) all MYCFLAGS=-DLUA_USE_LINUX MYLIBS="-lreadline"
50 +       $(MAKE) all MYCFLAGS=-DLUA_USE_LINUX $(if $(USE_READLINE), MYLIBS="-lreadline")
51  # use this on Mac OS X 10.3-
52  #      $(MAKE) all MYCFLAGS=-DLUA_USE_MACOSX
53