make SYSTME_LUA actually work, default it to false, and fix building when it isn't chosen (so the embedded lua can actually be used)

This commit is contained in:
zeromus 2014-11-22 02:03:33 +00:00
parent 7b85e797d8
commit d520ffddf6
1 changed files with 15 additions and 11 deletions

View File

@ -24,7 +24,7 @@ opts.AddVariables(
BoolVariable('NEWPPU', 'Enable new PPU core', 1), BoolVariable('NEWPPU', 'Enable new PPU core', 1),
BoolVariable('CREATE_AVI', 'Enable avi creation support (SDL only)', 1), BoolVariable('CREATE_AVI', 'Enable avi creation support (SDL only)', 1),
BoolVariable('LOGO', 'Enable a logoscreen when creating avis (SDL only)', 1), BoolVariable('LOGO', 'Enable a logoscreen when creating avis (SDL only)', 1),
BoolVariable('SYSTEM_LUA','Use system lua instead of static lua provided with fceux', 1), BoolVariable('SYSTEM_LUA','Use system lua instead of static lua provided with fceux', 0),
BoolVariable('SYSTEM_MINIZIP', 'Use system minizip instead of static minizip provided with fceux', 0), BoolVariable('SYSTEM_MINIZIP', 'Use system minizip instead of static minizip provided with fceux', 0),
BoolVariable('LSB_FIRST', 'Least signficant byte first (non-PPC)', 1), BoolVariable('LSB_FIRST', 'Least signficant byte first (non-PPC)', 1),
BoolVariable('CLANG', 'Compile with llvm-clang instead of gcc', 0), BoolVariable('CLANG', 'Compile with llvm-clang instead of gcc', 0),
@ -138,6 +138,7 @@ else:
# Should work on any *nix # Should work on any *nix
env.Append(CCFLAGS = ["-DLUA_USE_LINUX"]) env.Append(CCFLAGS = ["-DLUA_USE_LINUX"])
lua_available = False lua_available = False
if env['SYSTEM_LUA']:
if conf.CheckLib('lua5.1'): if conf.CheckLib('lua5.1'):
env.Append(LINKFLAGS = ["-ldl", "-llua5.1"]) env.Append(LINKFLAGS = ["-ldl", "-llua5.1"])
env.Append(CCFLAGS = ["-I/usr/include/lua5.1"]) env.Append(CCFLAGS = ["-I/usr/include/lua5.1"])
@ -149,6 +150,9 @@ else:
if lua_available == False: if lua_available == False:
print 'Could not find liblua, exiting!' print 'Could not find liblua, exiting!'
Exit(1) Exit(1)
else:
env.Append(CCFLAGS = ["-Isrc/lua/src"])
lua_available = True
# "--as-needed" no longer available on OSX (probably BSD as well? TODO: test) # "--as-needed" no longer available on OSX (probably BSD as well? TODO: test)
if env['PLATFORM'] != 'darwin': if env['PLATFORM'] != 'darwin':
env.Append(LINKFLAGS=['-Wl,--as-needed']) env.Append(LINKFLAGS=['-Wl,--as-needed'])