Skip to content

Feature Improvement Release

Compare
Choose a tag to compare
@tilkinsc tilkinsc released this 26 Sep 06:24
· 290 commits to master since this release

This build uses lua5.3.4 which was compiled with -O2 -g0 and archived (no special defines). No support for Lua dynamic library. Licenses included with the src.

  • Important update: heavily optimized -D by...
    • Building a high level strtok function, which optimizes with compiler better
    • Using the high level function and ensuring it runs better
    • Handling errors properly to show invalid input (debugging)
  • Code beautifications
  • Added -DLUACON_ADDITIONS to add additions, else won't be compiled in
  • Stripped release executables, lua*_add.exe are compiled with additions
  • Now updating release date correctly in help message
  • Compiled with stripping and under -std=gnu99
  • Corrected error macro message in headings of c files

Includes testing.lua, which prints out arguments inputted using the -n switch at the end. It displays use of the -D switch using the 'test' variable print. Now tries to call an invalid function for error testing display.

Compiled on Intel machine using mingw64, therefore is a 64-bit compilation.

Instructions:
Make a folder in your C:\Program Files\ or where ever and make a 'bin' folder. Shove lua.exe and luaw.exe into it. Add this 'bin' folder to your path. C:\Program Files\LuaConsole\bin, for example. Or just use the README.md's method and shove them into C:\Windows\System32.

Use luaw when you want to do stuff in lua and use the interpreter.

Compile with -DLUACON_ADDITIONS if you want to have the few additions added:

stackdump(...) -- for viewing the current stack in Lua using printf in C, showing how arguments unroll to the stack
os.getcwd() -- for getting the process' current working directory
os.setcwd(string) -- for setting the process' current working directory
os.clear() -- for clearing the console window (uses SYSTEM() call, and should correct when compiled under your os)

Compilation script:

@echo off

rem Debug version

rem Compile everything debug w/ additions
gcc -std=gnu99 -Wall -O0 -g3 -DLUACON_ADDITIONS -c console.c consolew.c additions.c

rem Link lua_debug.exe w/ additions
gcc -std=gnu99 -Wall -O0 -g3 -o lua_debug_add.exe console.o additions.o -llua

rem Link luaw_debug.exe w/ additions
gcc -std=gnu99 -Wall -O0 -g3 -o luaw_debug_add.exe consolew.o additions.o -llua


rem Compile everything debug
gcc -std=gnu99 -Wall -O0 -g3 -c console.c consolew.c

rem Link lua_debug.exe w/o additions
gcc -std=gnu99 -Wall -O0 -g3 -o lua_debug.exe console.o -llua

rem Link luaw_debug.exe w/o additions
gcc -std=gnu99 -Wall -O0 -g3 -o luaw_debug.exe consolew.o -llua


rem Release version

rem Compile everything release w/ additions
gcc -std=gnu99 -Wall -O2 -g0 -DLUACON_ADDITIONS -c console.c consolew.c additions.c

rem Link luaw.exe
gcc -std=gnu99 -s -Wall -O2 -g0 -o lua_add.exe console.o additions.o -llua

rem Link lua.exe
gcc -std=gnu99 -s -Wall -O2 -g0 -o luaw_add.exe consolew.o additions.o -llua


rem Compile everything release
gcc -std=gnu99 -Wall -O2 -g0 -c console.c consolew.c

rem Link luaw.exe
gcc -std=gnu99 -s -Wall -O2 -g0 -o lua.exe console.o -llua

rem Link lua.exe
gcc -std=gnu99 -s -Wall -O2 -g0 -o luaw.exe consolew.o -llua

strip --strip-all lua_add.exe
strip --strip-all luaw_add.exe
strip --strip-all lua.exe
strip --strip-all luaw.exe