Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Static lua compiler - Compile Lua code into C code.

branch: master

This branch is 0 commits ahead and 0 commits behind master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 cmake
Octocat-spinner-32 compiler
Octocat-spinner-32 doc
Octocat-spinner-32 etc
Octocat-spinner-32 src
Octocat-spinner-32 test
Octocat-spinner-32 .gitignore
Octocat-spinner-32 AUTHORS
Octocat-spinner-32 CMakeLists.txt
Octocat-spinner-32 COPYRIGHT
Octocat-spinner-32 HISTORY
Octocat-spinner-32 INSTALL
Octocat-spinner-32 README
Octocat-spinner-32 README.lua
Octocat-spinner-32 TODO
Octocat-spinner-32 cmake_uninstall.cmake.in
README
README for slua

=== Requires ===

=== Compile ===
 * mkdir build
 * cd build
 for Release build:
 * cmake .. -DCMAKE_BUILD_TYPE=Release
 for Debug build:
 * cmake .. -DCMAKE_BUILD_TYPE=Debug
 * make

=== Install ===
 * make install

=== Patches to lua/src ===
 * Emergency Garbage Collector: http://lua-users.org/wiki/EmergencyGarbageCollector
 * LuaCoco-1.1.6: http://luajit.org/coco.html + (x86_64 support added)
 * a few hooks where added to support static compiled functions.

=== Programs ===
 * slua: This command can be used to run Lua script.  It doesn't have JIT support!
 * sluac: This command compiles Lua scripts into C code which calls lua vm ops functions.
 * slua-compiler: This is a bash script that wraps sluac to compile Lua scripts into standalone executables or loadable modules.

=== Libraries ===
 -- static & dynamic libraries for linking into host app.
 * libslua_static.a & libslua.so

 -- Used for compling Lua scripts to standalone executables.
 * liblua_main.a

=== Using slua ===
'sluac' alone can only compile Lua scripts to Lua bytecode or C code.  A wrapper script called 'slua-compiler' is provided that wraps 'sluac' and gcc.

Compile standalone Lua script:
slua-compiler script.lua
outputs: ./script

Compile Lua script as a module:
slua-compiler -lua-module script.lua
outputs: ./script.so

Something went wrong with that request. Please try again.