From: John L. <jla...@gm...> - 2006-05-10 19:06:51
|
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=3DBUILD? If it can't be guessed then the user can force it to be whatever they like? > > See modules/lua/Makefile > > PLATS=3D 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=3D-DLUA_USE_LINUX MYLIBS=3D"-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? They don't use pgk-config, but can you just look for the lib libreadline.so? I think that lua's command prompt interface is much nicer with it, though I don't use it myself. > 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=3D"-DLUA_USE_POSIX -DLUA_USE_DLOPEN" MYLIBS=3D= "-Wl,-E" linux: $(MAKE) all MYCFLAGS=3D-DLUA_USE_LINUX MYLIBS=3D"-Wl,-E -ldl -lreadline -lhistory -lncurses" > 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. Ok. > 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 =3D> LUA_USE_READLINE > - dl =3D> LUA_USE_DLOPEN or LUA_DL_DYLD > - mkstemp =3D> LUA_USE_MKSTEMP > - isatty =3D> LUA_USE_ISATTY > - popen =3D> LUA_USE_POPEN > - ulongjmp =3D> LUA_USE_ULONGJMP Sounds good. Thanks, John Labenski |