Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#5761 - Unable to compile ELinks with Lua

Attached to Project: Arch Linux
Opened by Igor Galić (jMCg) - Sunday, 05 November 2006, 23:06 GMT
Last edited by Roman Kyrylych (Romashka) - Monday, 20 November 2006, 16:48 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Damir Perisa (damir.perisa)
Architecture not specified
Severity Low
Priority Normal
Reported Version 0.7.2 Gimmick
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

In trying to configure elinks with Lua I encountered several problems, first of which was that I was unable to ./configure it.
I've patched configure.in:

AC_ARG_WITH(lua, [ --without-lua disable Lua support],
[if test "$withval" = no; then disable_lua=yes; fi])
AC_MSG_CHECKING([for Lua])

EL_SAVE_FLAGS
cf_result=no

if test -z "$disable_lua"; then
if test ! -d "$withval"; then
withval="";
fi
for luadir in "$withval" "" /usr /usr/local; do
for suffix in "" 50 51; do
if test "$cf_result" = no; then
for lualib in "" "-llualib$suffix"; do
if test "$cf_result" = no; then
LUA_LIBS="-llua$suffix $lualib -lm"

if test ! -z "$luadir"; then
LUA_LIBS="-L$luadir/lib $LUA_LIBS"
LUA_CFLAGS="-I$luadir/include -I$luadir/include/lua$suffix"
fi

LIBS="$LUA_LIBS $LIBS_X"
CFLAGS="$CFLAGS_X $LUA_CFLAGS"
CPPFLAGS="$CPPFLAGS_X $LUA_CFLAGS"

# Check that it is a compatible Lua version
AC_TRY_LINK([ #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);
lua_pushboolean(L, 1);
lua_close(L);],
cf_result=yes, cf_result=no)
fi
done
fi
done
done
fi

AC_MSG_RESULT($cf_result)

if test "$cf_result" != yes; then
EL_RESTORE_FLAGS
else



succeeding with the configure, but that left me unable to link:
[LINK] src/elinks
lib.o: In function `l_tmpname':
core.c:(.text+0x75140): warning: the use of `tempnam' is dangerous, better use `mkstemp'
lib.o: In function `handle_ret_eval':
core.c:(.text+0x7479d): undefined reference to `lua_dostring'
lib.o: In function `do_hooks_file':
core.c:(.text+0x74885): undefined reference to `lua_dofile'
lib.o: In function `script_hook_quit':
hooks.c:(.text+0x764c8): undefined reference to `lua_dostring'
collect2: ld returned 1 exit status
make[1]: *** [elinks] Error 1
make[1]: Leaving directory `/var/abs/extra/network/elinks/src/elinks-0.11.1/src'
make: *** [all-recursive] Error 1
==> ERROR: Build Failed. Aborting...
makepkg 193.43s user 34.25s system 87% cpu 4:19.20 total



I have not yet traced exactly what triggers the link error, whether it's ./configure believing to be confronted with lua 4.x or elinks not caring which version it's configured with at all.
This task depends upon

Closed by  Damir Perisa (damir.perisa)
Saturday, 25 November 2006, 16:40 GMT
Reason for closing:  Fixed
Comment by Igor Galić (jMCg) - Monday, 06 November 2006, 07:53 GMT
A possible solution would be to patch configure.in in a way that it makes use of pkg-config. I don't know if this will present a solution for this problem.. I briefly grepped the source for lua_dostring and didn't encounter anything that would distinguish between Lua 4.x and Lua 5.x..
Comment by Igor Galić (jMCg) - Tuesday, 07 November 2006, 21:33 GMT
22:26 < pasky> JmcG: google query returnedelinks-dev@linuxfromscratch.org/msg00240.html"> http://www.mail-archive.com/elinks-dev@linuxfromscratch.org/msg00240.html
#ELinks on freenode
Comment by Igor Galić (jMCg) - Wednesday, 08 November 2006, 12:22 GMT
I have fixed the problem described above and I also managed to fix an more subtle 'bug' of the PKGBUILD
--enable-local-cgi does not exist, I changed it to --enable-cgi.

Here's my PKGBUILD and the lua patch.
Comment by Igor Galić (jMCg) - Wednesday, 08 November 2006, 14:01 GMT
The above patch resulted in elinks being able to configure, compile and link.. But it wouldn't run. Instead it would panic...
So I patched it again.... And yes.. this time I checked before posting the patch.

jmcg@Laptorix ~ % elinks --version
ELinks 0.11.1 (built on Nov 8 2006 14:48:03)

Features:
Standard, IPv6, gzip, bzip2, Periodic Saving, Timer, Cascading Style Sheets,
Protocol (File, FTP, HTTP, SMB, URI rewrite, User protocols), SSL (OpenSSL),
MIME (Option system, Mailcap, Mimetypes files), LED indicators, Bookmarks,
Cookies, ECMAScript, Form History, Global History, Scripting (Lua, ECMAScript scripting engine),
Goto URL History, Search History

Comment by Damir Perisa (damir.perisa) - Saturday, 25 November 2006, 14:57 GMT
thanx Igor!
i'm going to update elinks now to 0.11.2 and your patch saved me some time investigating things

Loading...