Skip to content

Commit 95919e7

Browse files
committed
Updated a few things...
- Dropped need to -DLUA_51, etc (except for LUA_JIT_51) - Defaulted to luajit - Updated gcc table parameters - Indented a lot to make it look neat - Fixed up a few comments - lua_define now works as a variable
1 parent 617205c commit 95919e7

File tree

1 file changed

+22
-23
lines changed

1 file changed

+22
-23
lines changed

build.lua

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,9 @@ require("luaadd")
3434
require("build_func")
3535

3636

37-
-- TODO: local no_additions
38-
local lua_ver = choose_opt("lua51", "luajit-5.1", "luajit-5.1")
39-
local lua_define = " -DLUA_JIT_51"
40-
local lua_includes = choose_opt("", "/usr/local/include/luajit-2.0", "/usr/local/include/luajit-2.0")
37+
local lua_ver = choose_opt("lua51", "luajit-5.1", "luajit-5.1")
38+
local lua_define = " -DLUA_JIT_51"
39+
local lua_includes = " "
4140

4241

4342
--[[
@@ -46,16 +45,16 @@ local lua_includes = choose_opt("", "/usr/local/include/luajit-2.0", "/usr/local
4645
--]]
4746

4847
local gcc = {
49-
gcc_name = "gcc";
50-
debug = false;
51-
warnings = " -Wall";
52-
windows = choose_opt(true, false, false);
53-
extra_warnings = "";
54-
include_dir = " -I. -Iinclude";
55-
library_dir = " -L. -Llib -Lobj -Ldll";
56-
ccextras = " -s" .. lua_define;
57-
ldextras = choose_opt(" -s", " -s -fPIC -Wl,-E", " -s -Wl,-E");
58-
defines = choose_opt(" -D__USE_MINGW_ANSI_STDIO=1", "", "");
48+
gcc_name = "gcc";
49+
debug = false;
50+
warnings = " -Wall";
51+
windows = choose_opt(true, false, false);
52+
extra_warnings = "";
53+
include_dir = " -I. -Iinclude" .. lua_includes;
54+
library_dir = " -L. -Llib -Lobj -Ldll";
55+
ccextras = " -s" .. lua_define;
56+
ldextras = choose_opt(" -s", " -s -fPIC -Wl,-E", " -s -Wl,-E");
57+
defines = choose_opt(" -D__USE_MINGW_ANSI_STDIO=1", "", "");
5958
}
6059
gcc.g = gcc.debug and 3 or 0
6160
gcc.O = gcc.debug and 0 or 2
@@ -64,7 +63,7 @@ local install_path = plat == os.types.Windows and (gcc.debug and ("bin\\Debug")
6463

6564

6665

67-
-- this is only a print
66+
-- this is only a print()
6867
local targ_dir = (gcc.debug and "DEBUG" or "RELEASE")
6968

7069

@@ -108,15 +107,15 @@ end
108107
local std_libs = enc_dll(" dll/" .. lua_ver) .. choose_opt("", " -lm -ldl", " -lm -ldl")
109108

110109

111-
local targ1_luaw_exe = enc_exe("luaw")
112-
local targ1_luaw_exe_o = {"consolew.o", "jitsupport.o", "darr.o"}
113-
local targ1_lua_exe_libs = std_libs
110+
local targ1_luaw_exe = enc_exe("luaw")
111+
local targ1_luaw_exe_o = {"consolew.o", "jitsupport.o", "darr.o"}
112+
local targ1_lua_exe_libs = std_libs
114113

115114

116-
local targ2_luaadd_dll_a = nil
117-
local targ2_luaadd_dll = enc_dll("luaadd")
118-
local targ2_luaadd_o = {"additions.o"}
119-
local targ2_luaadd_libs = std_libs
115+
local targ2_luaadd_dll_a = nil
116+
local targ2_luaadd_dll = enc_dll("luaadd")
117+
local targ2_luaadd_o = {"additions.o"}
118+
local targ2_luaadd_libs = std_libs
120119

121120

122121

@@ -201,6 +200,6 @@ if(#targ1_compile_units + #targ2_compile_units > 0 or exe_test or force)then
201200
-- setup
202201
migrate_binaries(install_path, {enc_exe("luaw"), enc_dll("luaadd")})
203202
end
204-
print("Done. Up to date.")
205203

204+
print("Done. Up to date.")
206205

0 commit comments

Comments
 (0)