From b63e15e412804288f679c3a577b994050f3956cc Mon Sep 17 00:00:00 2001 From: Soren Jorvang Date: Wed, 16 Jun 2010 16:35:19 +0000 Subject: [PATCH] Don't try to link with dynamic versions of the LZO/SFML/SOIL libraries on Linux when building a release image to make it more general. OpenCL is new in OS X 10.6, so we can't restrict ourselves to the 10.5 compatibility SDK when OpenCL is enabled. OpenCL really should be a runtime option (and weakly linked on OS X). git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5727 8ced0084-cf51-0410-be5f-012b33b47a6e --- SConstruct | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/SConstruct b/SConstruct index f8aebfa58f..1d62dbfa93 100644 --- a/SConstruct +++ b/SConstruct @@ -251,10 +251,17 @@ if sys.platform == 'darwin': conf = env.Configure(custom_tests = tests, config_h="Source/Core/Common/Src/Config.h") +env['HAVE_OPENCL'] = 0 +if env['opencl']: + env['HAVE_OPENCL'] = conf.CheckPKG('OpenCL') + # OS X specifics if sys.platform == 'darwin': + # OpenCL is new in OS X 10.6. Other than OpenCL, + # we try to maintain 10.5 compatibility, however. + if not env['HAVE_OPENCL']: + compileFlags += ['-isysroot', '/Developer/SDKs/MacOSX10.5.sdk'] compileFlags += ['-mmacosx-version-min=10.5'] - compileFlags += ['-isysroot', '/Developer/SDKs/MacOSX10.5.sdk'] conf.Define('MAP_32BIT', 0) env['CC'] = "gcc-4.2" env['CFLAGS'] = ['-x', 'objective-c'] @@ -273,14 +280,21 @@ shared = {} shared['glew'] = shared['lzo'] = shared['sdl'] = \ shared['soil'] = shared['sfml'] = shared['zlib'] = 0 if not sys.platform == 'darwin': + # GLEW, SDL and zlib are present on almost all Linux systems, + # so it is generally safe to link with their shared distribution + # libraries even when we are building a redistributable image. shared['glew'] = conf.CheckPKG('GLEW') - shared['lzo'] = conf.CheckPKG('lzo2') shared['sdl'] = conf.CheckPKG('SDL') - shared['soil'] = conf.CheckPKG('SOIL') - # TODO: Check the version of sfml. It should be at least version 1.5 - shared['sfml'] = conf.CheckPKG('sfml-network') and \ - conf.CheckCXXHeader("SFML/Network/Ftp.hpp") shared['zlib'] = conf.CheckPKG('z') + # LZO, SFML and SOIL are not typically part of a default install + # of most Linux distributions, so only link with any of these + # shared libraries if we are just doing a development build. + if flavour != 'release': + shared['lzo'] = conf.CheckPKG('lzo2') + # TODO: Check the version of sfml. It should be at least version 1.5 + shared['sfml'] = conf.CheckPKG('sfml-network') and \ + conf.CheckCXXHeader("SFML/Network/Ftp.hpp") + shared['soil'] = conf.CheckPKG('SOIL') for lib in shared: if not shared[lib]: print "Shared library " + lib + " not detected, " \ @@ -337,13 +351,10 @@ if not env['HAVE_WX'] and not env['nowx']: print "WX libraries not found - see config.log" Exit(1) -env['HAVE_OPENCL'] = 0 if not sys.platform == 'win32': if not conf.CheckPKG('Cg'): print "Must have Cg framework from NVidia to build" Exit(1) - if env['opencl']: - env['HAVE_OPENCL'] = conf.CheckPKG('OpenCL') env['HAVE_BLUEZ'] = 0 env['HAVE_ALSA'] = env['HAVE_AO'] = env['HAVE_OPENAL'] = \