1
0
mirror of https://github.com/elua/elua.git synced 2025-01-08 20:56:17 +08:00
elua/rpc-lua.py
James Snyder c31efa276a Switch SCons decider, crunch PNG screenshots.
SCons decider for main build and luarpc have been switched to MD5-timestamp,
which will prevent scons from re-digesting files it has cached unless
timestamp has changed (should shave a little off of build times, but be safe).

Some of the PNG screenshots that didn't get crunched before the 0.7 release
have been run through optipng, advpng and pngout to wring out as many bytes as
possible without losing data/quality.
2010-01-28 19:17:22 +00:00

34 lines
1.2 KiB
Python

import os, sys, platform
output = 'luarpc'
cdefs = ['-DLUA_CROSS_COMPILER','-DLUA_RPC']
# Lua source files and include path
lua_files = """lapi.c lcode.c ldebug.c ldo.c ldump.c lfunc.c lgc.c llex.c lmem.c lobject.c lopcodes.c
lparser.c lstate.c lstring.c ltable.c ltm.c lundump.c lvm.c lzio.c lauxlib.c lbaselib.c
ldblib.c liolib.c lmathlib.c loslib.c ltablib.c lstrlib.c loadlib.c linit.c lua.c print.c lrotable.c"""
lua_full_files = " " + " ".join( [ "src/lua/%s" % name for name in lua_files.split() ] )
lua_full_files += " src/modules/luarpc.c src/luarpc_desktop_serial.c "
external_libs = ['m']
if platform.system() == "Windows":
lua_full_files += " src/serial/serial_win32.c"
cdefs.append("-DWIN32_BUILD")
else:
lua_full_files += " src/serial/serial_posix.c"
external_libs += ['readline']
cdefs.append("-DLUA_USE_READLINE")
local_include = ['src/lua', 'inc', 'src/modules', 'inc/desktop'];
# Env for building the program
comp = Environment( CPPPATH = local_include,
CCFLAGS = cdefs,
ENV = os.environ )
# Debug
comp.PrependUnique(CCFLAGS=['-g'])
Decider( 'MD5-timestamp' )
Default( comp.Program( output, Split( lua_full_files ), LIBS=external_libs ) )