100-no_readline.patch 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. --- a/src/luaconf.h
  2. +++ b/src/luaconf.h
  3. @@ -61,14 +61,12 @@
  4. #if defined(LUA_USE_LINUX)
  5. #define LUA_USE_POSIX
  6. #define LUA_USE_DLOPEN /* needs an extra library: -ldl */
  7. -#define LUA_USE_READLINE /* needs some extra libraries */
  8. #endif
  9. #if defined(LUA_USE_MACOSX)
  10. #define LUA_USE_POSIX
  11. #define LUA_USE_DLOPEN /* MacOS does not need -ldl */
  12. -#define LUA_USE_READLINE /* needs an extra library: -lreadline */
  13. #endif
  14. --- a/src/Makefile
  15. +++ b/src/Makefile
  16. @@ -23,6 +23,7 @@ MYCFLAGS=
  17. MYLDFLAGS=
  18. MYLIBS=
  19. MYOBJS=
  20. +# USE_READLINE=1
  21. # == END OF USER SETTINGS -- NO NEED TO CHANGE ANYTHING BELOW THIS LINE =======
  22. @@ -83,6 +84,7 @@ echo:
  23. # Convenience targets for popular platforms
  24. ALL= all
  25. +RFLAG=$(if $(USE_READLINE),-DLUA_USE_READLINE)
  26. none:
  27. @echo "Please do 'make PLATFORM' where PLATFORM is one of these:"
  28. @@ -102,15 +104,15 @@ c89:
  29. freebsd:
  30. - $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX -DLUA_USE_READLINE -I/usr/include/edit" SYSLIBS="-Wl,-E -ledit" CC="cc"
  31. + $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX $(RFLAG) -I/usr/include/edit" SYSLIBS="-Wl,-E -ledit" CC="cc"
  32. generic: $(ALL)
  33. linux:
  34. - $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -ldl -lreadline"
  35. + $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX" $(RFLAG) SYSLIBS="-Wl,-E -ldl $(if $(USE_READLINE), -lreadline)"
  36. macosx:
  37. - $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_MACOSX" SYSLIBS="-lreadline"
  38. + $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_MACOSX" $(RFLAG) SYSLIBS="$(if $(USE_READLINE), -lreadline)"
  39. mingw:
  40. $(MAKE) "LUA_A=lua53.dll" "LUA_T=lua.exe" \