• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

ers35/luastatic: Build a standalone executable from a Lua program.

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

ers35/luastatic

开源软件地址(OpenSource Url):

https://github.com/ers35/luastatic

开源编程语言(OpenSource Language):

Lua 71.8%

开源软件介绍(OpenSource Introduction):

luastatic is a command line tool that builds a standalone executable from a Lua program. The executable runs on systems that do not have Lua installed. Lua 5.1, 5.2, 5.3, 5.4, and LuaJIT are supported.

Install

Run luastatic.lua or install from LuaRocks.

Usage

luastatic main.lua[1] require.lua[2] liblua.a[3] library.a[4] -I/include/lua[5] [6]
  [1]: The entry point to the Lua program
  [2]: One or more required Lua source files
  [3]: The path to the Lua interpreter static library
  [4]: One or more static libraries for a required Lua binary module
  [5]: The path to the directory containing lua.h
  [6]: Additional arguments are passed to the C compiler

Examples

Single Lua file

luastatic main.lua /usr/lib/x86_64-linux-gnu/liblua5.2.a -I/usr/include/lua5.2

Embed library.lua for require("library")

luastatic main.lua library.lua /usr/lib/x86_64-linux-gnu/liblua5.2.a -I/usr/include/lua5.2

C library containing luaopen_()

luastatic main.lua library.a /usr/lib/x86_64-linux-gnu/liblua5.2.a -I/usr/include/lua5.2

Dynamically link with Lua

luastatic main.lua -llua5.2 -I/usr/include/lua5.2

Statically link with musl libc

CC=musl-gcc luastatic main.lua /usr/lib/x86_64-linux-musl/liblua5.2.a -I/usr/include/lua5.2 -static

Cross compile for Windows

CC=x86_64-w64-mingw32-gcc luastatic main.lua /usr/x86_64-w64-mingw32/lib/liblua5.2.a -I/usr/x86_64-w64-mingw32/include/lua5.2/

LuaJIT 2.0.4 on Ubuntu 16.10

luastatic main.lua /usr/lib/x86_64-linux-gnu/libluajit-5.1.a -I/usr/include/luajit-2.0 -no-pie

LuaJIT on macOS

luastatic main.lua /opt/local/lib/libluajit-5.1.a -I/opt/local/include/luajit-2.0 -pagezero_size 10000 -image_base 100000000

Generate the C file but don't compile it

CC="" luastatic main.lua

Lua using Homebrew

# Install Lua and LuaRocks from Homebrew.
brew install lua luarocks
# Install luastatic from LuaRocks.
luarocks install luastatic
# Build using the Homebrew installation path.
luastatic main.lua $(brew --prefix lua)/lib/liblua.a -I$(brew --prefix lua)/include/lua

See another example at Lua.Space.

Users




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
topameng/CsToLua: The fastest unity lua binding solution发布时间:2022-08-16
下一篇:
jinq0123/LuaPbIntf: Binding Protobuf 3 to Lua 5.3发布时间:2022-08-16
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap