Bug 2353 - [lua] fix build with 2010.08-rc1
Summary: [lua] fix build with 2010.08-rc1
Status: RESOLVED FIXED
Alias: None
Product: buildroot
Classification: Unclassified
Component: Other (show other bugs)
Version: unspecified
Hardware: PC Linux
: P5 normal
Target Milestone: ---
Assignee: Gustavo Zacarias
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-05 15:28 UTC by François Perrad
Modified: 2012-04-25 10:22 UTC (History)
1 user (show)

See Also:
Host: PC Ubuntu Lucid
Target: arm versatilepb (qemu)
Build:


Attachments
fix (2.16 KB, patch)
2010-08-05 15:28 UTC, François Perrad
Details
new version of the patch (1.56 KB, patch)
2010-08-06 19:15 UTC, François Perrad
Details
patch only for warnings (1.03 KB, patch)
2010-08-26 08:19 UTC, François Perrad
Details

Note You need to log in before you can comment on or make changes to this bug.
Description François Perrad 2010-08-05 15:28:13 UTC
Created attachment 2305 [details]
fix

with the attached patch, MYCFLAGS is really used,
so the support of readline and shared lib (with dlopen) works.
Comment 1 François Perrad 2010-08-06 19:15:55 UTC
Created attachment 2323 [details]
new version of the patch

simplified version of the patch
Comment 2 Thomas Petazzoni 2010-08-22 06:21:50 UTC
Thanks François for this patch. Your patch contained three things :

 *) Remove -DLUA_USE_DLOPEN from LUA_MYCFLAGS when LUA_SHARED_LIBRARY is enabled, and add -DLUA_USE_DLOPEN to LUA_MYCFLAGS when readline support is requested. Could you explain the rationale for this change ?

 *) A fix to make sure that the value of MYCFLAGS actually gets passed to Lua. This is correct, and I've committed it, in a slightly different form, see http://git.buildroot.net/~tpetazzoni/git/buildroot/commit/?id=8199f9f94bab74e27b0eed1a52ed1125e3af62e8

 *) A fix to make the clean in the src/ subdirectory. But I've just tested, the main Lua Makefile already goes into the src/ subdirectory when doing "make clean" at the root directory of Lua sources. So "make lua-clean" in Buildroot already works fine. Which problem are you fixing here ?

Again, thanks!
Comment 3 Thomas Petazzoni 2010-08-22 06:31:28 UTC
Oh, by the way, I did a test with the patch I mentionned, and readline is indeed working in the Lua interpreter (history, Ctrl+a, Ctrl+e, etc.)
Comment 4 François Perrad 2010-08-22 08:27:49 UTC
(In reply to comment #2)
> Thanks François for this patch. Your patch contained three things :
> 
>  *) Remove -DLUA_USE_DLOPEN from LUA_MYCFLAGS when LUA_SHARED_LIBRARY is
> enabled, and add -DLUA_USE_DLOPEN to LUA_MYCFLAGS when readline support is
> requested. Could you explain the rationale for this change ?
> 

This part avoids some warnings about the redefinition of LUA_USE_DLOPEN, when BR2_PACKAGE_LUA_INTERPRETER_READLINE is set.

See in src/luaconf.h lines 36-40 :
#if defined(LUA_USE_LINUX)
#define LUA_USE_POSIX
#define LUA_USE_DLOPEN		/* needs an extra library: -ldl */
#define LUA_USE_READLINE	/* needs some extra libraries */
#endif


>  *) A fix to make sure that the value of MYCFLAGS actually gets passed to Lua.
> This is correct, and I've committed it, in a slightly different form, see
> http://git.buildroot.net/~tpetazzoni/git/buildroot/commit/?id=8199f9f94bab74e27b0eed1a52ed1125e3af62e8
> 
>  *) A fix to make the clean in the src/ subdirectory. But I've just tested, the
> main Lua Makefile already goes into the src/ subdirectory when doing "make
> clean" at the root directory of Lua sources. So "make lua-clean" in Buildroot
> already works fine. Which problem are you fixing here ?

There are 2 Makefiles in the Lua distribution :
Makefile which deals with different platforms : linux, mingw, ...
src/Makefile which does the real job, and is used by LUA_BUILD_CMDS

For symmetry, I want use src/Makefile in LUA_CLEAN_CMDS.

The next step is to remove a part of lua-shared-libs.patch which alters Makefile.

> 
> Again, thanks!
Comment 5 François Perrad 2010-08-22 08:30:46 UTC
(In reply to comment #3)
> Oh, by the way, I did a test with the patch I mentionned, and readline is
> indeed working in the Lua interpreter (history, Ctrl+a, Ctrl+e, etc.)

A easy way to check the loading of native extension is to build LuaFileSystem, and try :
    $ lua -l lfs
Comment 6 François Perrad 2010-08-26 08:19:01 UTC
Created attachment 2371 [details]
patch only for warnings
Comment 7 François Perrad 2011-03-01 20:26:56 UTC
ping for attachment "patch only for warnings"
Comment 8 Thomas Petazzoni 2012-01-31 22:47:04 UTC
Gustavo, since you are usually maintaining the Lua stuff, could you take care of this bug?
Comment 9 Peter Korsgaard 2012-04-25 10:22:04 UTC
Fixed in git