2010-01-25 23:43:05 +00:00
|
|
|
import os, sys, platform
|
2009-06-22 23:49:21 +00:00
|
|
|
|
2009-12-04 01:46:47 +00:00
|
|
|
output = 'luarpc'
|
2010-01-28 01:31:32 +00:00
|
|
|
cdefs = ['-DLUA_CROSS_COMPILER','-DLUA_RPC']
|
2009-06-22 23:49:21 +00:00
|
|
|
|
|
|
|
# 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() ] )
|
2010-01-25 23:43:05 +00:00
|
|
|
lua_full_files += " src/modules/luarpc.c src/luarpc_desktop_serial.c "
|
|
|
|
|
2010-01-28 01:31:32 +00:00
|
|
|
external_libs = ['m']
|
2010-01-25 23:43:05 +00:00
|
|
|
|
|
|
|
if platform.system() == "Windows":
|
|
|
|
lua_full_files += " src/serial/serial_win32.c"
|
2010-01-28 01:31:32 +00:00
|
|
|
cdefs.append("-DWIN32_BUILD")
|
2010-01-25 23:43:05 +00:00
|
|
|
else:
|
|
|
|
lua_full_files += " src/serial/serial_posix.c"
|
2010-01-28 01:31:32 +00:00
|
|
|
external_libs += ['readline']
|
|
|
|
cdefs.append("-DLUA_USE_READLINE")
|
2010-01-25 23:43:05 +00:00
|
|
|
|
2010-01-28 01:31:32 +00:00
|
|
|
local_include = ['src/lua', 'inc', 'src/modules', 'inc/desktop'];
|
2009-06-22 23:49:21 +00:00
|
|
|
|
|
|
|
# Env for building the program
|
2010-01-28 01:31:32 +00:00
|
|
|
comp = Environment( CPPPATH = local_include,
|
|
|
|
CCFLAGS = cdefs,
|
2009-06-22 23:49:21 +00:00
|
|
|
ENV = os.environ )
|
2010-01-28 01:31:32 +00:00
|
|
|
# Debug
|
|
|
|
comp.PrependUnique(CCFLAGS=['-g'])
|
|
|
|
|
2009-06-22 23:49:21 +00:00
|
|
|
Decider( 'MD5' )
|
2010-01-28 01:31:32 +00:00
|
|
|
Default( comp.Program( output, Split( lua_full_files ), LIBS=external_libs ) )
|