env = hamster.Environment{ objdir = 'build', outdir = 'build', LIBPATH = {'build'} } require( "find_lua" ) require( "detect_gender" ) -- TODO report inability to detect gender io.open( "src/gender.h", "w" ):write( "#define GENDER " .. (detect_gender( env ) or "UNKNOWN") .. "\n" ) if not find_lua( env ) then print( "Could not find your lua distribution -- please add the prefix directory to those listed in etc/find_lua.lua, and send swdunlop@gmail.com an email with its location." ) os.exit( 1 ) end -- TODO automate selection of socket source. windows_socket_src = 'wsocket.c' unix_socket_src = 'usocket.c' socket_src = unix_socket_src luasocket = env:StaticLibrary{ 'auxiliar.c', 'buffer.c', 'except.c', 'inet.c', 'io.c', 'luasocket.c', 'mime.c', 'options.c', 'select.c', 'tcp.c', 'timeout.c', 'udp.c', 'compat-5.1r2/compat-5.1.c', socket_src, CCFLAGS = '-Isrc/luasocket/compat-5.1r2', target = 'luasocket', srcdir = 'src/luasocket', } core = env:StaticLibrary{ 'src/core/ent.c', 'src/core/lent.c', 'src/core/lrsa.c', 'src/core/sx.c', 'src/core/lsx.c', 'src/core/isaac.c', 'src/core/lisaac.c', 'src/core/test.c', CCFLAGS = '-g', target = 'core' } glue = env:Program{ 'glue.c', srcdir = 'src/bootstrap', outdir = 'build' } stub = env:Program{ luasocket, core, 'srlua.c', target = 'stub', CCFLAGS = '-Isrc/core -Isrc/luasocket', srcdir = 'src/bootstrap', libs = { 'lua', 'lualib', 'luasocket', 'crypto' } }