lua-users home
lua-l archive

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


1.  make a static luasocket library; add these 2 lines to your lua makefile
2.  edit lua.c
3.  edit makefile; append "-L . -lluasocket" to the line that compiles
4.  do a make

If you still have access to socket.lua, mime.lua and its
friends through the filesystem, this is the way to go.

If you won't have a filesystem, you need to take a look at
luac and bin2c. These allow you to turn a .lua file into a
.c file, which you can compile and link with your
monolythic executable.

The other decision you have to make is whether you care if
LuaSocket is always loaded when you run the interpreter, or
if you want it to be loaded only when a script calls
require(). If the latter is important, you will have to
use the package.preload table.