From: Francesco M. <f18...@ya...> - 2006-05-11 11:44:25
|
John Labenski ha scritto: > On 5/10/06, Francesco Montorsi > <f18...@ya...> wrote: >> > 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... > > Can we use configure --build=BUILD? If it can't be guessed then the > user can force it to be whatever they like? yes, in fact I thought to use exactly that: it's 99.9% times guessed correctly AFAIK with latest autoconf suites (the value guessed is taken by config.guess). But still I won't be able to test configure on platforms != linux. > >> > 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 ?)... > > Ummm, not anymore, I always define it since the code does nothing > unless you actually call it from C. However, for people using rpm > systems (like me) I wouldn't want to overwrite the rpm's lua > executable. I just read that Fedora now has lua5.1 as a package. > >> 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. > > libreadline is used fairly often I think. Is it easy to have configure > check for it? yes, the check is easy... > They don't use pgk-config, but can you just look for the > lib libreadline.so? there's a more detailed test which I find googling a bit - it will do the work ;) > I think that lua's command prompt interface is > much nicer with it, though I don't use it myself. yes, sure > >> 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. > > Great. Just note that even for bsd vs. linux we need to have at least > -ldl for dynamic library loading, which was the problem in the first > place. > > bsd: > $(MAKE) all MYCFLAGS="-DLUA_USE_POSIX -DLUA_USE_DLOPEN" > MYLIBS="-Wl,-E" > linux: > $(MAKE) all MYCFLAGS=-DLUA_USE_LINUX MYLIBS="-Wl,-E -ldl > -lreadline -lhistory -lncurses" sorry, I don't understand what you mean... isn't checking for dlopen() enough (if it's present, we just define LUA_USE_DLOPEN). >> - 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 > > Sounds good. I've done all changes and they work well. Unfortunately I cannot commit them since SF server is down. Again. :( Francesco |