From 65b10ebe9f63c1bf2932c3439c486800db6012e5 Mon Sep 17 00:00:00 2001 From: nakeee Date: Tue, 3 Mar 2009 20:14:39 +0000 Subject: [PATCH] Added portaudio version git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2538 8ced0084-cf51-0410-be5f-012b33b47a6e --- SConstruct | 8 ++++---- SconsTests/utils.py | 19 +++++++++++++++++++ 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/SConstruct b/SConstruct index 36111f81b3..a97894315d 100644 --- a/SConstruct +++ b/SConstruct @@ -186,7 +186,9 @@ env['CPPDEFINES'] = cppDefines tests = {'CheckWXConfig' : wxconfig.CheckWXConfig, 'CheckPKGConfig' : utils.CheckPKGConfig, 'CheckPKG' : utils.CheckPKG, - 'CheckSDL' : utils.CheckSDL} + 'CheckSDL' : utils.CheckSDL, + 'CheckPortaudio' : utils.CheckPortaudio, + } build_dir = os.path.join('Build', platform.system() + '-' + platform.machine() + '-' + env['flavor'] + os.sep) VariantDir(build_dir, '.', duplicate=0) @@ -206,9 +208,7 @@ env['HAVE_BLUEZ'] = conf.CheckPKG('bluez') env['HAVE_AO'] = conf.CheckPKG('ao') # needed for mic -env['HAVE_PORTAUDIO'] = 0 -if conf.CheckPKG('portaudio') and conf.CheckCHeader("portaudio.h"): - env['HAVE_PORTAUDIO'] = 1; +env['HAVE_PORTAUDIO'] = conf.CheckPortaudio(1890) # sfml env['HAVE_SFML'] = 0 diff --git a/SconsTests/utils.py b/SconsTests/utils.py index d507aca3ab..58078c6c75 100644 --- a/SconsTests/utils.py +++ b/SconsTests/utils.py @@ -83,6 +83,25 @@ def CheckSDL(context, version): context.env.ParseConfig('sdl-config --cflags --libs') return int(ret) +def CheckPortaudio(context, version): + context.Message( 'Checking for lib portaudio version > %s... ' % version) + context.env.Append(LIBS = 'portaudio') + found = context.TryRun(""" + #include + #include + int main(int argc, char **argv) { + printf("%d", Pa_GetVersion()); + return 0; + } + """, '.c')[1] + + ret = (found and (version <= found)) + + context.Result(ret) + return int(ret) + + + def GenerateRevFile(flavour, template, output): try: