From 366c85564874d560b3608349f752e9e490f9002d Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Thu, 4 Jul 2024 17:11:58 -0300 Subject: lua.c loads 'readline' dynamically (See comments in luaconf.h.) This change allows easier compilation, as Lua compiles and works even if the package 'readline' is absent from the system. Moreover, non-interactive uses don't load the library, making the stand-alone slightly faster for small loads. --- luaconf.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'luaconf.h') diff --git a/luaconf.h b/luaconf.h index fe98d9a9..65715c8b 100644 --- a/luaconf.h +++ b/luaconf.h @@ -58,15 +58,26 @@ #endif +/* +** When Posix DLL ('LUA_USE_DLOPEN') is enabled, the Lua stand-alone +** application will try to dynamically link a 'readline' facility +** for its REPL. In that case, LUA_READLINELIB is the name of the +** library it will look for those facilities. If lua.c cannot open +** the specified library, it will generate a warning and then run +** without 'readline'. If that macro is not defined, lua.c will not +** use 'readline'. +*/ #if defined(LUA_USE_LINUX) #define LUA_USE_POSIX #define LUA_USE_DLOPEN /* needs an extra library: -ldl */ +#define LUA_READLINELIB "libreadline.so" #endif #if defined(LUA_USE_MACOSX) #define LUA_USE_POSIX #define LUA_USE_DLOPEN /* MacOS does not need -ldl */ +#define LUA_READLINELIB "libedit.dylib" #endif -- cgit v1.2.3-55-g6feb