scons: search for linker options named -llua5.1 and -llua to compile sucessfully on debian

This commit is contained in:
punkrockguy318 2012-06-24 17:03:44 +00:00
parent 9944118c2a
commit dfc148cfb4
2 changed files with 7 additions and 4 deletions

View File

@ -24,6 +24,7 @@ Table of Contents
* scons - Required to build fceux.
* libgtk2.0 (optional) - version >= 2.24 recommended
* libgtk3.0 (optional) - this compiles as of fceux 2.1.6.
* liblua5.1 (optional)
* g++ - fceux requires g++ from the gcc. llvm-clang is known to not compile fceux (patches welcome).
2 - Installation
@ -63,7 +64,7 @@ GTK3 BoolVariable to 1 in the SConstruct.
5 - LUA Scripting
-----------------
FCEUX provides a LUA engine that allows for in-game scripting capabilities. LUA can be enabled or disabled at build time by adjusting the "LUA" BoolVariable in the SConstruct file.
FCEUX provides a LUA 5.1 engine that allows for in-game scripting capabilities. LUA can be enabled or disabled at build time by adjusting the "LUA" BoolVariable in the SConstruct file.
A collection of LUA scripts are provided with the source distribuition in the output directory:

View File

@ -73,6 +73,8 @@ if env['PLATFORM'] == 'win32':
env.Append(LIBS = ["rpcrt4", "comctl32", "vfw32", "winmm", "ws2_32", "comdlg32", "ole32", "gdi32", "htmlhelp"])
else:
conf = Configure(env)
if conf.CheckFunc('asprintf'):
conf.env.Append(CCFLAGS = "-DHAVE_ASPRINTF")
assert conf.CheckLibWithHeader('z', 'zlib.h', 'c', 'inflate;', 1), "please install: zlib"
if not conf.CheckLib('SDL'):
print 'Did not find libSDL or SDL.lib, exiting!'
@ -102,7 +104,9 @@ else:
# If we're POSIX, we use LUA_USE_LINUX since that combines usual lua posix defines with dlfcn calls for dynamic library loading.
# Should work on any *nix
env.Append(CCFLAGS = ["-DLUA_USE_LINUX"])
if conf.CheckLib('lua'):
if conf.CheckLib('lua5.1'):
env.Append(LINKFLAGS = ["-ldl", "-llua5.1"])
elif conf.CheckLib('lua'):
env.Append(LINKFLAGS = ["-ldl", "-llua"])
env.Append(LINKFLAGS=['-Wl,--as-needed'])
@ -113,8 +117,6 @@ else:
env['LOGO'] = 0
print 'Did not find libgd, you won\'t be able to create a logo screen for your avis.'
if conf.CheckFunc('asprintf'):
conf.env.Append(CCFLAGS = "-DHAVE_ASPRINTF")
if env['OPENGL'] and conf.CheckLibWithHeader('GL', 'GL/gl.h', 'c', autoadd=1):
conf.env.Append(CCFLAGS = "-DOPENGL")
conf.env.Append(CPPDEFINES = ['PSS_STYLE=1'])