2008-09-19 20:13:30 +00:00
|
|
|
import os, sys
|
|
|
|
|
|
|
|
output = 'luac'
|
|
|
|
cdefs = '-DLUA_CROSS_COMPILER'
|
|
|
|
|
|
|
|
# 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
|
2009-02-23 15:28:56 +00:00
|
|
|
ldblib.c liolib.c lmathlib.c loslib.c ltablib.c lstrlib.c loadlib.c linit.c luac.c print.c lrotable.c"""
|
2008-09-19 20:13:30 +00:00
|
|
|
lua_full_files = " " + " ".join( [ "src/lua/%s" % name for name in lua_files.split() ] )
|
|
|
|
local_include = "-Isrc/lua"
|
|
|
|
|
|
|
|
# Compiler/linker options
|
2009-06-22 23:49:21 +00:00
|
|
|
cccom = "gcc -g %s -Wall %s -c $SOURCE -o $TARGET" % ( local_include, cdefs )
|
2008-09-19 20:13:30 +00:00
|
|
|
linkcom = "gcc -o $TARGET $SOURCES -lm"
|
|
|
|
|
|
|
|
# Env for building the program
|
|
|
|
comp = Environment( CCCOM = cccom,
|
|
|
|
LINKCOM = linkcom,
|
|
|
|
ENV = os.environ )
|
2009-02-23 15:28:56 +00:00
|
|
|
Decider( 'MD5' )
|
2008-09-19 20:13:30 +00:00
|
|
|
Default( comp.Program( output, Split( lua_full_files ) ) )
|