lua-users home
lua-l archive

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


On Fri, Aug 07, 2020 at 02:11:02PM +0200, Marc Balmer wrote:
> Attached is my approach (in Lua land, everyone creates his own batteries...)
> 
> Requires a C compiler.  Tested on macOS only....
> 


> 
> 
> Oh yes, and it can eat its own dogfood, too: 
> 
> $ lua luacc.lua -o luacc luacc.lua
> 
> - mb

Verified on Devuan Beowulf with this patch:
 
--- luacc.lua   2020-08-07 08:44:00.299980320 -0700
+++ luacc.linux.lua     2020-08-07 08:39:10.975984249 -0700
@@ -21,8 +21,8 @@
 end
 
 -- Start the compiler that expects C code on standard input
-local c = io.popen('cc -x c -o ' .. outfile .. ' -O3 -I/usr/local/include '
-    .. '-L/usr/local/lib -llua -', 'w')
+local c = io.popen('cc -x c -o ' .. outfile .. ' -O3 -I/usr/include/lua5.3 '
+    .. '-L/usr/lib/x86_64-linux-gnu -llua5.3 -', 'w')
 
 -- Dump the bytecode to a const char array
 c:write('static const char bytecode[] = {')

Attachment: signature.asc
Description: PGP signature