1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00

Link against lua51, not lua50.

This commit is contained in:
Witold Filipczyk 2010-07-21 19:07:49 +02:00 committed by Witold Filipczyk
parent 13f1c878ac
commit 331a4dc62b
4 changed files with 18 additions and 18 deletions

1
NEWS
View File

@ -69,6 +69,7 @@ Miscellaneous:
* enhancement: Add ``Search contents'' button to the cache manager with
which one can search through the cache items' data rather than their
metadata.
* link against lua51 not lua50
//////////////////////////////////////////////////////////////////////
The following changes should be removed from NEWS before ELinks 0.13.0

View File

@ -900,10 +900,10 @@ if test -z "$disable_lua"; then
withval="";
fi
for luadir in "$withval" "" /usr /usr/local; do
for suffix in "" 50; do
for suffix in "" 51; do
if test "$cf_result" = no && ( test -f "$luadir/include/lua.h" || \
test -f "$luadir/include/lua$suffix/lua.h" ) ; then
LUA_LIBS="-L$luadir/lib -llua$suffix -llualib$suffix -lm"
LUA_LIBS="-L$luadir/lib -llua$suffix -lm"
LUA_CFLAGS="-I$luadir/include -I$luadir/include/lua$suffix"
LIBS="$LUA_LIBS $LIBS_X"
@ -911,13 +911,11 @@ if test -z "$disable_lua"; then
CPPFLAGS="$CPPFLAGS_X $LUA_CFLAGS"
# Check that it is a compatible Lua version
AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include <lua.h>
#include <lualib.h>]], [[ lua_State *L = lua_open();
luaopen_base(L);
luaopen_table(L);
luaopen_io(L);
luaopen_string(L);
luaopen_math(L);
AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include <lauxlib.h>]
#include <lua.h>
#include <lualib.h>
], [[ lua_State *L = luaL_newstate();
luaL_openlibs(L);
lua_pushboolean(L, 1);
lua_close(L);]])],[cf_result=yes],[cf_result=no])
fi

View File

@ -12,6 +12,7 @@
#include <unistd.h>
#endif
#include <lauxlib.h>
#include <lua.h>
#include <lualib.h>
@ -659,7 +660,7 @@ do_hooks_file(LS, unsigned char *prefix, unsigned char *filename)
if (file_can_read(file)) {
int oldtop = lua_gettop(S);
if (lua_dofile(S, file) != 0)
if (luaL_dofile(S, file) != 0)
sleep(3); /* Let some time to see error messages. */
lua_settop(S, oldtop);
}
@ -670,13 +671,9 @@ do_hooks_file(LS, unsigned char *prefix, unsigned char *filename)
void
init_lua(struct module *module)
{
L = lua_open();
L = luaL_newstate();
luaopen_base(L);
luaopen_table(L);
luaopen_io(L);
luaopen_string(L);
luaopen_math(L);
luaL_openlibs(L);
lua_register(L, LUA_ALERT, l_alert);
lua_register(L, "current_url", l_current_url);
@ -781,7 +778,7 @@ handle_ret_eval(struct session *ses)
int oldtop = lua_gettop(L);
if (prepare_lua(ses) == 0) {
lua_dostring(L, expr);
luaL_dostring(L, expr);
lua_settop(L, oldtop);
finish_lua();
}

View File

@ -4,6 +4,10 @@
#include "config.h"
#endif
#include <lauxlib.h>
#include <lua.h>
#include <lualib.h>
#include "elinks.h"
#include "cache/cache.h"
@ -200,7 +204,7 @@ static enum evhook_status
script_hook_quit(va_list ap, void *data)
{
if (!prepare_lua(NULL)) {
lua_dostring(lua_state, "if quit_hook then quit_hook() end");
luaL_dostring(lua_state, "if quit_hook then quit_hook() end");
finish_lua();
}