2006-07-31 22:24:21 +00:00
|
|
|
import os
|
2006-08-08 23:20:16 +00:00
|
|
|
import sys
|
2006-07-31 22:24:21 +00:00
|
|
|
|
2006-07-31 00:03:35 +00:00
|
|
|
# XXX path separator fixed right now
|
|
|
|
opts = Options()
|
2006-08-04 17:32:08 +00:00
|
|
|
opts.AddOptions(
|
|
|
|
BoolOption('PSS_STYLE', 'Path separator style', 1),
|
2006-08-08 23:20:16 +00:00
|
|
|
BoolOption('LSB_FIRST', 'Least significant byte first?', None),
|
2006-08-04 17:32:08 +00:00
|
|
|
BoolOption('FRAMESKIP', 'Enable frameskipping', 1),
|
|
|
|
BoolOption('OPENGL', 'Enable OpenGL support', 1)
|
|
|
|
)
|
2006-07-31 00:03:35 +00:00
|
|
|
|
|
|
|
env = Environment(options = opts,
|
2006-08-08 23:20:16 +00:00
|
|
|
CPPDEFINES={'PSS_STYLE' : '${PSS_STYLE}'})
|
2006-07-31 00:03:35 +00:00
|
|
|
|
2006-07-31 22:24:21 +00:00
|
|
|
if os.environ.has_key('CC'):
|
|
|
|
env.Replace(CC = os.environ['CC'])
|
2006-08-01 01:15:30 +00:00
|
|
|
if os.environ.has_key('CXX'):
|
|
|
|
env.Replace(CXX = os.environ['CXX'])
|
2006-07-31 22:24:21 +00:00
|
|
|
if os.environ.has_key('CFLAGS'):
|
|
|
|
env.Append(CCFLAGS = os.environ['CFLAGS'])
|
|
|
|
if os.environ.has_key('LDFLAGS'):
|
|
|
|
env.Append(LINKFLAGS = os.environ['LDFLAGS'])
|
2006-07-31 20:07:15 +00:00
|
|
|
|
2006-07-31 00:03:35 +00:00
|
|
|
print "platform: ", env['PLATFORM']
|
|
|
|
|
2006-07-31 22:24:21 +00:00
|
|
|
# special flags for cygwin
|
|
|
|
# we have to do this here so that the function and lib checks will go through
|
|
|
|
# mingw
|
2006-07-31 00:03:35 +00:00
|
|
|
if env['PLATFORM'] == 'cygwin':
|
2006-07-31 22:24:21 +00:00
|
|
|
env.Append(CCFLAGS = " -mno-cygwin")
|
|
|
|
env.Append(LINKFLAGS = " -mno-cygwin")
|
2006-08-22 06:27:18 +00:00
|
|
|
env['LIBS'] = ['wsock32'];
|
2006-07-29 05:46:15 +00:00
|
|
|
|
|
|
|
conf = Configure(env)
|
|
|
|
if not conf.CheckLib('SDL'):
|
2006-07-31 22:24:21 +00:00
|
|
|
print 'Did not find libSDL or SDL.lib, exiting!'
|
2006-07-29 05:46:15 +00:00
|
|
|
Exit(1)
|
2006-08-04 17:32:08 +00:00
|
|
|
if not conf.CheckLib('z', autoadd=1):
|
2006-07-31 22:24:21 +00:00
|
|
|
print 'Did not find libz or z.lib, exiting!'
|
2006-07-29 05:46:15 +00:00
|
|
|
Exit(1)
|
2006-07-31 00:03:35 +00:00
|
|
|
if conf.CheckFunc('asprintf'):
|
2006-07-31 22:24:21 +00:00
|
|
|
conf.env.Append(CCFLAGS = " -DHAVE_ASPRINTF")
|
2006-08-04 17:32:08 +00:00
|
|
|
if env['OPENGL'] and conf.CheckLibWithHeader('GL', 'GL/gl.h', 'c++', autoadd=1):
|
|
|
|
conf.env.Append(CCFLAGS = " -DOPENGL")
|
2006-07-29 05:46:15 +00:00
|
|
|
|
|
|
|
env = conf.Finish()
|
2006-07-31 22:24:21 +00:00
|
|
|
|
2006-08-08 23:20:16 +00:00
|
|
|
# option specified
|
|
|
|
if env.has_key('LSB_FIRST'):
|
|
|
|
if env['LSB_FIRST']:
|
|
|
|
env.Append(CCFLAGS = ' -DLSB_FIRST')
|
|
|
|
# option not specified, check host system
|
|
|
|
elif sys.byteorder == 'little':
|
|
|
|
env.Append(CCFLAGS = ' -DLSB_FIRST')
|
|
|
|
|
|
|
|
if env['FRAMESKIP']:
|
|
|
|
env.Append(CCFLAGS = ' -DFRAMESKIP')
|
|
|
|
|
2006-07-31 22:24:21 +00:00
|
|
|
# parse SDL cflags/libs
|
|
|
|
env.ParseConfig('sdl-config --cflags --libs')
|
|
|
|
|
2006-08-22 06:27:18 +00:00
|
|
|
print "LIBS:",env['CCFLAGS']
|
|
|
|
#env['IBS'] = ['wsock32', 'SDL', 'z', 'mingw32', 'SDL']
|
2006-07-29 05:46:15 +00:00
|
|
|
Export('env')
|
|
|
|
|
|
|
|
SConscript(['src/SConscript'])
|