Hi,
  sorry for late reply: I'm busy with some wx patches currently

John Labenski ha scritto:
On 5/8/06, Steve Kieu <[EMAIL PROTECTED]> wrote:

OK now I got it working with ugly hack :-)

I undo all changes in loadlib.c and luaconf.h to its original. AND I
manually edit the $WXLUAROOTDIR/modules/Makefile   and add

-DLUA_USE_LINUX  to  CFLAGS
and
-Wl,-E -ldl -lreadline -lhistory -lncurses     to LDFLAGS

(Just copy from the lua Makefile  distribution the linux section)
and everything works as expected :-)
I hope you guys find where it is wrong in the build system and fix it
'officially', I am sorry I do not know enough about it to help.

Ohhh, I see now, you're using configure? It doesn't give the right
flags to build lua for unix systems.

Francesco, where would you add some checks for configure's system
determination to add lua's flags? In wxLua/configure or somewhere in
bakefile?
I could do everything in bakefiles if the platforms supported by Lua were one of:

PLATFORM_UNIX   UNIX variant
PLATFORM_WIN32  32bit Windows
PLATFORM_MSDOS  MS-DOS
PLATFORM_MAC    Mac OS X or Mac Classic
PLATFORM_MACOSX Mac OS X
PLATFORM_OS2    OS/2
PLATFORM_BEOS   BeOS
PLATFORM_SYMBIAN        Symbian OS

since they do distinctions inside the Unix family, I'll need to put these checks in configure.ac. Unfortunately they will require checks for platforms where I won't be able to test the configure script on...


See modules/lua/Makefile
PLATS= aix ansi bsd generic linux macosx mingw posix solaris

and modules/lua/src/Makefile where it translates these into the cflags
and libs. eg.
linux:
       $(MAKE) all MYCFLAGS=-DLUA_USE_LINUX MYLIBS="-Wl,-E -ldl
-lreadline -lhistory -lncurses"

Maybe it's possible to just translate configure's system to lua's
system and just call lua's Makefile as $(MAKE) platform? Though I
think the install would be broken then?
you're right: it would be easy to just call Lua's Makefile (when using mingw or autoconf); make install would still work however the executable would be named 'lua' and not, as it currently is in wxLua, 'wxlua-lua'. Thus other installations of lua could be overwritten by our version (which I think is not the vanilla version since there's a WXLUA_CODE block - right ?)...

Last big problem is that currently doing "make linux" using lua's makefile I get:

gcc -O2 -Wall -DLUA_USE_LINUX   -c -o lua.o lua.c
In file included from lua.h:16,
                 from lua.c:15:
luaconf.h:263:31: error: readline/readline.h: No such file or directory
luaconf.h:264:30: error: readline/history.h: No such file or directory

and in fact, these files are not in my system... installing the "libreadline5-dev" package solved the problem but I think it's just a bad thing to suppose that these readline files are always there.

I see that modules/lua/src/Makefile basically just defines the LUA_USE_* symbols and then adds to linker dlopen, readline, history. (it also adds "-Wl,-E" option to the linker). That is, it will be easy to reproduce this behaviour in wxlua bakefiles.

Also, since bakefiles would still have to contain lua modules for generating makefiles for MSVC, borland, etc. I think it's best to maintain all lua building stuff in a single place: wxlua bakefiles and avoid calling lua makefile.

Thus, in conclusion, if you agree I will do these changes:
configure.ac will NOT check for platforms (which is against autoconf-philosophy of "check for features rather than for platforms"), but rather will check & define symbols for

- readline => LUA_USE_READLINE
- dl => LUA_USE_DLOPEN or LUA_DL_DYLD
- mkstemp => LUA_USE_MKSTEMP
- isatty => LUA_USE_ISATTY
- popen => LUA_USE_POPEN
- ulongjmp => LUA_USE_ULONGJMP

Francesco



-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Wxlua-users mailing list
Wxlua-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxlua-users

Reply via email to