sconstruct slightly more robust

This commit is contained in:
punkrockguy318 2008-08-12 07:39:52 +00:00
parent b6bad1295e
commit 641a5ea657
1 changed files with 23 additions and 24 deletions

View File

@ -50,29 +50,29 @@ else:
if not conf.CheckLib('lua5.1', autoadd=1): if not conf.CheckLib('lua5.1', autoadd=1):
print 'Did not find liblua5.1 or lua5.1.lib, exiting!' print 'Did not find liblua5.1 or lua5.1.lib, exiting!'
Exit(1) Exit(1)
### Search for zenity if we're not in windows
### Search for zenity. if env['PLATFORM'] != 'win32' and env['PLATFORM'] != 'cygwin':
path = os.getenv('PATH') path = os.getenv('PATH')
directories = [] directories = []
dir = '' dir = ''
# check for '$' so last entry is processed # check for '$' so last entry is processed
for x in path + '$': for x in path + '$':
if x != ':' and x != '$': if x != ':' and x != '$':
dir += x dir += x
else: else:
directories.append(dir) directories.append(dir)
dir = '' dir = ''
zenity = 0 zenity = 0
print "Checking for zenity..." print "Checking for zenity..."
for x in directories: for x in directories:
if os.path.isfile(os.path.join(x, "zenity")): if os.path.isfile(os.path.join(x, "zenity")):
zenity = 1 zenity = 1
if zenity != 1: if zenity != 1:
print "*** WARNING ***" print "*** WARNING ***"
print "Zenity could not be found in the PATH. File dialogs will not work without zenity installed." print "Zenity could not be found in the PATH. File dialogs will not work without zenity installed."
raw_input('Press any key to continue. . .') raw_input('Press any key to continue. . .')
if conf.CheckFunc('asprintf'): if conf.CheckFunc('asprintf'):
conf.env.Append(CCFLAGS = " -DHAVE_ASPRINTF") conf.env.Append(CCFLAGS = " -DHAVE_ASPRINTF")
if env['OPENGL'] and conf.CheckLibWithHeader('GL', 'GL/gl.h', 'c++', autoadd=1): if env['OPENGL'] and conf.CheckLibWithHeader('GL', 'GL/gl.h', 'c++', autoadd=1):
@ -80,9 +80,8 @@ else:
conf.env.Append(CPPDEFINES = ['PSS_STYLE=1']) conf.env.Append(CPPDEFINES = ['PSS_STYLE=1'])
# parse SDL cflags/libs # parse SDL cflags/libs
env.ParseConfig('sdl-config --cflags --libs') env.ParseConfig('sdl-config --cflags --libs')
# parse liblua cflags/libs # parse liblua cflags
env.Append(CPPPATH = ['/usr/local/include/lua5.1', '/usr/include/lua5.1']) env.Append(CPPPATH = ['/usr/local/include/lua5.1', '/usr/include/lua5.1'])
env.Append(LINKFLAGS = "-llua5.1")
env = conf.Finish() env = conf.Finish()
if sys.byteorder == 'little' or env['PLATFORM'] == 'win32': if sys.byteorder == 'little' or env['PLATFORM'] == 'win32':