From e7a85df91e80bd7e66c36603f4e8fe5c0609c879 Mon Sep 17 00:00:00 2001 From: Ken Hughes Date: Sun, 4 Jun 2006 15:54:23 +0000 Subject: Bugfix #4089: Some Linux distros are using newer versions of OpenAL which have FreeAlut (the OpenAL Utility Toolkit) separated out into libalut. Added a configuration test to check for libalut and add to LIBPATH if detected. --- SConstruct | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'SConstruct') diff --git a/SConstruct b/SConstruct index fadd4b9dda0..f6385b17a34 100644 --- a/SConstruct +++ b/SConstruct @@ -40,6 +40,8 @@ import shutil import glob import re +print sys.version_info + import tools.Blender import tools.btools import tools.bcolors @@ -166,6 +168,38 @@ if env.has_key('BF_DEBUG_LIBS'): printdebug = B.arguments.get('BF_LISTDEBUG', 0) +# see if this linux distro has libalut + +if env['OURPLATFORM'] == 'linux2' : + if env['WITH_BF_OPENAL']: + mylib_test_source_file = """ + #include "AL/alut.h" + int main(int argc, char **argv) + { + alutGetMajorVersion(); + return 0; + } + """ + + def CheckFreeAlut(context,env): + context.Message( B.bc.OKGREEN + "Linux platform detected:\n checking for FreeAlut... " + B.bc.ENDC ) + env['LIBS'] = 'alut' + result = context.TryLink(mylib_test_source_file, '.c') + context.Result(result) + return result + + env2 = env.Copy( LIBPATH = env['BF_OPENAL'] ) + conf = Configure( env2, {'CheckFreeAlut' : CheckFreeAlut}, '.sconf_temp', '/dev/null' ) + if conf.CheckFreeAlut( env2 ): + env['BF_OPENAL_LIB'] += ' alut' + del env2 + for root, dirs, files in os.walk('.sconf_temp', topdown=False): + for name in files: + os.remove(os.path.join(root, name)) + for name in dirs: + os.rmdir(os.path.join(root, name)) + os.rmdir(root) + if len(B.quickdebug) > 0 and printdebug != 0: print B.bc.OKGREEN + "Buildings these libs with debug symbols:" + B.bc.ENDC for l in B.quickdebug: -- cgit v1.2.3