scons: for sdl checks, fall back to old mechanism if new fails
This should accomodate everyone, unless they are trying to do out- of-tree builds and also have unicode in their file paths. Works for me anyways.
This commit is contained in:
parent
2fca959437
commit
ef27b9b42c
1 changed files with 30 additions and 12 deletions
42
scons/sdl.py
42
scons/sdl.py
|
@ -99,19 +99,25 @@ def CheckOgg(context):
|
|||
}
|
||||
\n
|
||||
'''
|
||||
test_program = context.env.Clone(TESTFILE = File("data/core/music/main_menu.ogg").rfile().abspath).subst(test_program)
|
||||
test_program1 = context.env.Clone(TESTFILE = File("data/core/music/main_menu.ogg").rfile().abspath).subst(test_program)
|
||||
#context.env.AppendUnique(LIBS = "SDL_mixer")
|
||||
context.Message("Checking for Ogg Vorbis support in SDL... ")
|
||||
if context.env["host"]:
|
||||
context.Result("n/a (cross-compile)")
|
||||
return True
|
||||
(result, output) = context.TryRun(test_program, ".c")
|
||||
(result, output) = context.TryRun(test_program1, ".c")
|
||||
if result:
|
||||
context.Result("yes")
|
||||
return True
|
||||
else:
|
||||
context.Result("no")
|
||||
return False
|
||||
test_program2 = context.env.Clone(TESTFILE = "data/core/music/main_menu.ogg").subst(test_program)
|
||||
(result, output) = context.TryRun(test_program2, ".c")
|
||||
if result:
|
||||
context.Result("yes")
|
||||
return True
|
||||
else:
|
||||
context.Result("no")
|
||||
return False
|
||||
|
||||
def CheckPNG(context):
|
||||
test_program = '''
|
||||
|
@ -131,18 +137,24 @@ def CheckPNG(context):
|
|||
}
|
||||
\n
|
||||
'''
|
||||
test_program = context.env.Clone(TESTFILE = File("images/buttons/button_normal/button_H22-pressed.png").rfile().abspath).subst(test_program)
|
||||
test_program1 = context.env.Clone(TESTFILE = File("images/buttons/button_normal/button_H22-pressed.png").rfile().abspath).subst(test_program)
|
||||
context.Message("Checking for PNG support in SDL... ")
|
||||
if context.env["host"]:
|
||||
context.Result("n/a (cross-compile)")
|
||||
return True
|
||||
(result, output) = context.TryRun(test_program, ".c")
|
||||
(result, output) = context.TryRun(test_program1, ".c")
|
||||
if result:
|
||||
context.Result("yes")
|
||||
return True
|
||||
else:
|
||||
context.Result("no")
|
||||
return False
|
||||
test_program2 = context.env.Clone(TESTFILE = "images/buttons/button_normal/button_H22-pressed.png").subst(test_program)
|
||||
(result, output) = context.TryRun(test_program2, ".c")
|
||||
if result:
|
||||
context.Result("yes")
|
||||
return True
|
||||
else:
|
||||
context.Result("no")
|
||||
return False
|
||||
|
||||
def CheckJPG(context):
|
||||
test_program = '''
|
||||
|
@ -162,18 +174,24 @@ def CheckJPG(context):
|
|||
}
|
||||
\n
|
||||
'''
|
||||
test_program = context.env.Clone(TESTFILE = File("data/core/images/maps/background.jpg").rfile().abspath).subst(test_program)
|
||||
test_program1 = context.env.Clone(TESTFILE = File("data/core/images/maps/background.jpg").rfile().abspath).subst(test_program)
|
||||
context.Message("Checking for JPG support in SDL... ")
|
||||
if context.env["host"]:
|
||||
context.Result("n/a (cross-compile)")
|
||||
return True
|
||||
(result, output) = context.TryRun(test_program, ".c")
|
||||
(result, output) = context.TryRun(test_program1, ".c")
|
||||
if result:
|
||||
context.Result("yes")
|
||||
return True
|
||||
else:
|
||||
context.Result("no")
|
||||
return False
|
||||
test_program2 = context.env.Clone(TESTFILE = "data/core/images/maps/background.jpg").subst(test_program)
|
||||
(result, output) = context.TryRun(test_program2, ".c")
|
||||
if result:
|
||||
context.Result("yes")
|
||||
return True
|
||||
else:
|
||||
context.Result("no")
|
||||
return False
|
||||
|
||||
config_checks = { 'CheckSDL' : CheckSDL,
|
||||
'CheckOgg' : CheckOgg,
|
||||
|
|
Loading…
Add table
Reference in a new issue