lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hi,

I agree the distribution sucks. I will try to improve it for the next
release. The next alpha version is comming soon, to be followed shortly
by a beta version.

> I have already compiled Lua 5 successfully. For LuaSocket I only
> succeeded in creating a libluasocket.a file when I disabled
> -DLUASOCKET_COMPILED flag. I don't know how to create .lch files used
> for -DLUASOCKET_COMPILED flag. I figured that when using
> -DLUASOCKET_COMPILED flag is should get a file named libluasocket.so. I
> also understood that -DLUASOCKET_COMPILED flag is recommended.

LuaSocket has a C part and a Lua part. The LUASOCKET_COMPILED flag asks
LuaSocket to embed the Lua part inside the library. The other option is
to load the files from disk, which require them to be accessible to
your executable in run-time.

To create the lch, first compile the Lua files with luac, then use the
bin2c (in lua/etc or the bin2c.lua that has been recently mentioned
in the list) utility to generate the lch. After the lch's are ready,
you can compile the library with LUASOCKET_COMPILED.

> But how I can use for example libluasocket.a file in the regular
> stand-alone interpreter of Lua 5?

If you don't want to recompile your Lua 5 interpreter, you will need to
generate a dynamic library for LuaSocket, and use loadlib to load it.
Otherwise, just add a call to luaopen_socket  to lua.c (near to
luaopen_math, for instance) and recompile the interpreter.

[]s,
Diego.