Build with shared libraries whenever possible on Linux;
on OS X, always build with static libraries from Externals. XXX LZO/SFML/SOIL are currently static only on Linux as well, as they have been all along, because of a conflict between CheckPKG('FOO') and the SHARED_FOO conditionals - on the second build run with static version of these libraries, CheckPKG picks them up, negating SHARED_FOO and making the code try to include the canonical locations for these packages. The easiest fix is probably to adjust the relative pathnames for those header files in Externals, so that the same ones are included in the shared and static cases. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5722 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
4f8a6a1573
commit
d24e5a37a6
152
SConstruct
152
SConstruct
|
@ -98,16 +98,10 @@ vars.AddVariables(
|
||||||
BoolVariable('verbose', 'Set for compilation line', False),
|
BoolVariable('verbose', 'Set for compilation line', False),
|
||||||
BoolVariable('bundle', 'Set to create bundle', False),
|
BoolVariable('bundle', 'Set to create bundle', False),
|
||||||
BoolVariable('lint', 'Set for lint build (extra warnings)', False),
|
BoolVariable('lint', 'Set for lint build (extra warnings)', False),
|
||||||
BoolVariable('nowx', 'Set For Building with no WX libs', False),
|
BoolVariable('nowx', 'Set for building with no WX libs', False),
|
||||||
BoolVariable('wxgl', 'Set For Building with WX GL libs', False),
|
BoolVariable('wxgl', 'Set for building with WX GL on Linux', False),
|
||||||
BoolVariable('opencl', 'Build with OpenCL', False),
|
BoolVariable('opencl', 'Build with OpenCL', False),
|
||||||
BoolVariable('nojit', 'Remove entire jit cores', False),
|
BoolVariable('nojit', 'Remove entire jit cores', False),
|
||||||
BoolVariable('shared_glew', 'Use system shared libGLEW', False),
|
|
||||||
BoolVariable('shared_lzo', 'Use system shared liblzo2', False),
|
|
||||||
BoolVariable('shared_sdl', 'Use system shared libSDL', False),
|
|
||||||
BoolVariable('shared_sfml', 'Use system shared libsfml-network', False),
|
|
||||||
BoolVariable('shared_soil', 'Use system shared libSOIL', False),
|
|
||||||
BoolVariable('shared_zlib', 'Use system shared libz', False),
|
|
||||||
PathVariable('userdir', 'Set the name of the user data directory in home',
|
PathVariable('userdir', 'Set the name of the user data directory in home',
|
||||||
'.dolphin-emu', PathVariable.PathAccept),
|
'.dolphin-emu', PathVariable.PathAccept),
|
||||||
EnumVariable('install', 'Choose a local or global installation', 'local',
|
EnumVariable('install', 'Choose a local or global installation', 'local',
|
||||||
|
@ -218,8 +212,6 @@ tests = {'CheckWXConfig' : wxconfig.CheckWXConfig,
|
||||||
'CheckPKGConfig' : utils.CheckPKGConfig,
|
'CheckPKGConfig' : utils.CheckPKGConfig,
|
||||||
'CheckPKG' : utils.CheckPKG,
|
'CheckPKG' : utils.CheckPKG,
|
||||||
'CheckSDL' : utils.CheckSDL,
|
'CheckSDL' : utils.CheckSDL,
|
||||||
'CheckFink' : utils.CheckFink,
|
|
||||||
'CheckMacports' : utils.CheckMacports,
|
|
||||||
'CheckPortaudio' : utils.CheckPortaudio,
|
'CheckPortaudio' : utils.CheckPortaudio,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -261,16 +253,6 @@ env['LIBPATH'].append(env['local_libs'])
|
||||||
conf = env.Configure(custom_tests = tests,
|
conf = env.Configure(custom_tests = tests,
|
||||||
config_h="Source/Core/Common/Src/Config.h")
|
config_h="Source/Core/Common/Src/Config.h")
|
||||||
|
|
||||||
if env['shared_glew'] or env['shared_lzo'] or env['shared_sdl'] or \
|
|
||||||
env['shared_sfml'] or env['shared_soil'] or env['shared_zlib']:
|
|
||||||
if not conf.CheckPKGConfig('0.15.0'):
|
|
||||||
print "Can't find pkg-config, some tests will fail"
|
|
||||||
# Find MacPorts or Fink for library and include paths
|
|
||||||
if sys.platform == 'darwin':
|
|
||||||
# MacPorts usually has newer versions
|
|
||||||
conf.CheckMacports()
|
|
||||||
conf.CheckFink()
|
|
||||||
|
|
||||||
# OS X specifics
|
# OS X specifics
|
||||||
if sys.platform == 'darwin':
|
if sys.platform == 'darwin':
|
||||||
compileFlags += ['-mmacosx-version-min=10.5']
|
compileFlags += ['-mmacosx-version-min=10.5']
|
||||||
|
@ -285,79 +267,49 @@ if sys.platform == 'darwin':
|
||||||
env['FRAMEWORKS'] += ['CoreFoundation', 'CoreServices']
|
env['FRAMEWORKS'] += ['CoreFoundation', 'CoreServices']
|
||||||
env['FRAMEWORKS'] += ['IOBluetooth', 'IOKit', 'OpenGL']
|
env['FRAMEWORKS'] += ['IOBluetooth', 'IOKit', 'OpenGL']
|
||||||
env['FRAMEWORKS'] += ['AudioUnit', 'CoreAudio']
|
env['FRAMEWORKS'] += ['AudioUnit', 'CoreAudio']
|
||||||
|
else:
|
||||||
|
if not conf.CheckPKGConfig('0.15.0'):
|
||||||
|
print "Can't find pkg-config, some tests will fail"
|
||||||
|
|
||||||
# OpenCL
|
shared = {}
|
||||||
env['HAVE_OPENCL'] = 0
|
shared['glew'] = shared['lzo'] = shared['sdl'] = \
|
||||||
if env['opencl']:
|
shared['soil'] = shared['sfml'] = shared['zlib'] = 0
|
||||||
env['HAVE_OPENCL'] = conf.CheckPKG('OpenCL')
|
if not sys.platform == 'darwin':
|
||||||
|
shared['glew'] = conf.CheckPKG('GLEW')
|
||||||
# GLEW
|
#shared['lzo'] = conf.CheckPKG('lzo2') XXX
|
||||||
env['SHARED_GLEW'] = 0;
|
shared['sdl'] = conf.CheckPKG('SDL')
|
||||||
if env['shared_glew']:
|
#shared['soil'] = conf.CheckPKG('SOIL') XXX
|
||||||
env['SHARED_GLEW'] = conf.CheckPKG('GLEW')
|
|
||||||
if not env['SHARED_GLEW']:
|
|
||||||
print "shared GLEW library not detected"
|
|
||||||
print "falling back to the static library"
|
|
||||||
if not env['SHARED_GLEW']:
|
|
||||||
env['CPPPATH'] += [ basedir + 'Externals/GLew/include' ]
|
|
||||||
dirs += ['Externals/GLew']
|
|
||||||
|
|
||||||
# LZO
|
|
||||||
env['SHARED_LZO'] = 0;
|
|
||||||
if env['shared_lzo']:
|
|
||||||
env['SHARED_LZO'] = conf.CheckPKG('lzo2')
|
|
||||||
if not env['SHARED_LZO']:
|
|
||||||
print "shared LZO library not detected"
|
|
||||||
print "falling back to the static library"
|
|
||||||
if not env['SHARED_LZO']:
|
|
||||||
env['CPPPATH'] += [ basedir + 'Externals/LZO' ]
|
|
||||||
dirs += ['Externals/LZO']
|
|
||||||
|
|
||||||
# SDL
|
|
||||||
env['SHARED_SDL'] = 0;
|
|
||||||
if env['shared_sdl']:
|
|
||||||
env['SHARED_SDL'] = conf.CheckPKG('SDL')
|
|
||||||
if not env['SHARED_SDL']:
|
|
||||||
print "shared SDL library not detected"
|
|
||||||
print "falling back to the static library"
|
|
||||||
if not env['SHARED_SDL']:
|
|
||||||
env['CPPPATH'] += [ basedir + 'Externals/SDL' ]
|
|
||||||
env['CPPPATH'] += [ basedir + 'Externals/SDL/include' ]
|
|
||||||
dirs += ['Externals/SDL']
|
|
||||||
|
|
||||||
# SOIL
|
|
||||||
env['SHARED_SOIL'] = 0;
|
|
||||||
if env['shared_soil']:
|
|
||||||
env['SHARED_SOIL'] = conf.CheckPKG('SOIL')
|
|
||||||
if not env['SHARED_SOIL']:
|
|
||||||
print "shared SOIL library not detected"
|
|
||||||
print "falling back to the static library"
|
|
||||||
if not env['SHARED_SOIL']:
|
|
||||||
env['CPPPATH'] += [ basedir + 'Externals/SOIL' ]
|
|
||||||
dirs += ['Externals/SOIL']
|
|
||||||
|
|
||||||
# SFML
|
|
||||||
env['SHARED_SFML'] = 0;
|
|
||||||
if env['shared_sfml']:
|
|
||||||
# TODO: Check the version of sfml. It should be at least version 1.5
|
# TODO: Check the version of sfml. It should be at least version 1.5
|
||||||
env['SHARED_SFML'] = conf.CheckPKG('sfml-network') and \
|
#shared['sfml'] = conf.CheckPKG('sfml-network') and \
|
||||||
conf.CheckCXXHeader("SFML/Network/Ftp.hpp")
|
# conf.CheckCXXHeader("SFML/Network/Ftp.hpp") XXX
|
||||||
if not env['SHARED_SFML']:
|
shared['zlib'] = conf.CheckPKG('z')
|
||||||
print "shared sfml-network library not detected"
|
for lib in shared:
|
||||||
print "falling back to the static library"
|
if not shared[lib]:
|
||||||
if not env['SHARED_SFML']:
|
print "Shared library " + lib + " not detected, " \
|
||||||
env['CPPPATH'] += [ basedir + 'Externals/SFML/include' ]
|
"falling back to the static library"
|
||||||
dirs += ['Externals/SFML/src']
|
|
||||||
|
|
||||||
# zlib
|
conf.Define('SHARED_SOIL', shared['soil'])
|
||||||
env['SHARED_ZLIB'] = 0;
|
conf.Define('SHARED_LZO', shared['lzo'])
|
||||||
if env['shared_zlib']:
|
conf.Define('SHARED_SFML', shared['sfml'])
|
||||||
env['SHARED_ZLIB'] = conf.CheckPKG('z')
|
|
||||||
if not env['SHARED_ZLIB']:
|
if shared['glew'] == 0:
|
||||||
print "shared zlib library not detected"
|
env['CPPPATH'] += [basedir + 'Externals/GLew/include']
|
||||||
print "falling back to the static library"
|
dirs += ['Externals/GLew']
|
||||||
if not env['SHARED_ZLIB']:
|
if shared['lzo'] == 0:
|
||||||
env['CPPPATH'] += [ basedir + 'Externals/zlib' ]
|
env['CPPPATH'] += [basedir + 'Externals/LZO']
|
||||||
|
dirs += ['Externals/LZO']
|
||||||
|
if shared['sdl'] == 0:
|
||||||
|
env['CPPPATH'] += [basedir + 'Externals/SDL']
|
||||||
|
env['CPPPATH'] += [basedir + 'Externals/SDL/include']
|
||||||
|
dirs += ['Externals/SDL']
|
||||||
|
if shared['soil'] == 0:
|
||||||
|
env['CPPPATH'] += [basedir + 'Externals/SOIL']
|
||||||
|
dirs += ['Externals/SOIL']
|
||||||
|
if shared['sfml'] == 0:
|
||||||
|
env['CPPPATH'] += [basedir + 'Externals/SFML/include']
|
||||||
|
dirs += ['Externals/SFML/src']
|
||||||
|
if shared['zlib'] == 0:
|
||||||
|
env['CPPPATH'] += [basedir + 'Externals/zlib']
|
||||||
dirs += ['Externals/zlib']
|
dirs += ['Externals/zlib']
|
||||||
|
|
||||||
wxmods = ['aui', 'adv', 'core', 'base']
|
wxmods = ['aui', 'adv', 'core', 'base']
|
||||||
|
@ -391,19 +343,18 @@ if not env['HAVE_WX'] and not env['nowx']:
|
||||||
print "WX libraries not found - see config.log"
|
print "WX libraries not found - see config.log"
|
||||||
Exit(1)
|
Exit(1)
|
||||||
|
|
||||||
|
env['HAVE_OPENCL'] = 0
|
||||||
if not sys.platform == 'win32':
|
if not sys.platform == 'win32':
|
||||||
if not conf.CheckPKG('Cg'):
|
if not conf.CheckPKG('Cg'):
|
||||||
print "Must have Cg framework from NVidia to build"
|
print "Must have Cg framework from NVidia to build"
|
||||||
Exit(1)
|
Exit(1)
|
||||||
|
if env['opencl']:
|
||||||
|
env['HAVE_OPENCL'] = conf.CheckPKG('OpenCL')
|
||||||
|
|
||||||
env['HAVE_BLUEZ'] = 0
|
env['HAVE_BLUEZ'] = 0
|
||||||
env['HAVE_ALSA'] = 0
|
env['HAVE_ALSA'] = env['HAVE_AO'] = env['HAVE_OPENAL'] = \
|
||||||
env['HAVE_AO'] = 0
|
env['HAVE_PORTAUDIO'] = env['HAVE_PULSEAUDIO'] = 0
|
||||||
env['HAVE_OPENAL'] = 0
|
env['HAVE_X11'] = env['HAVE_XRANDR'] = 0
|
||||||
env['HAVE_PORTAUDIO'] = 0
|
|
||||||
env['HAVE_PULSEAUDIO'] = 0
|
|
||||||
env['HAVE_X11'] = 0
|
|
||||||
env['HAVE_XRANDR'] = 0
|
|
||||||
if not sys.platform == 'win32' and not sys.platform == 'darwin':
|
if not sys.platform == 'win32' and not sys.platform == 'darwin':
|
||||||
env['LINKFLAGS'] += ['-pthread']
|
env['LINKFLAGS'] += ['-pthread']
|
||||||
|
|
||||||
|
@ -452,18 +403,13 @@ conf.Define('USE_WX', env['USE_WX'])
|
||||||
conf.Define('HAVE_X11', env['HAVE_X11'])
|
conf.Define('HAVE_X11', env['HAVE_X11'])
|
||||||
conf.Define('HAVE_XRANDR', env['HAVE_XRANDR'])
|
conf.Define('HAVE_XRANDR', env['HAVE_XRANDR'])
|
||||||
conf.Define('HAVE_PORTAUDIO', env['HAVE_PORTAUDIO'])
|
conf.Define('HAVE_PORTAUDIO', env['HAVE_PORTAUDIO'])
|
||||||
conf.Define('SHARED_SOIL', env['SHARED_SOIL'])
|
|
||||||
conf.Define('SHARED_LZO', env['SHARED_LZO'])
|
|
||||||
conf.Define('SHARED_SFML', env['SHARED_SFML'])
|
|
||||||
conf.Define('USER_DIR', "\"" + env['userdir'] + "\"")
|
conf.Define('USER_DIR', "\"" + env['userdir'] + "\"")
|
||||||
if (env['install'] == 'global'):
|
if (env['install'] == 'global'):
|
||||||
conf.Define('DATA_DIR', "\"" + env['data_dir'] + "\"")
|
conf.Define('DATA_DIR', "\"" + env['data_dir'] + "\"")
|
||||||
conf.Define('LIBS_DIR', "\"" + env['prefix'] + 'lib/' + "\"")
|
conf.Define('LIBS_DIR', "\"" + env['prefix'] + 'lib/' + "\"")
|
||||||
|
|
||||||
# Lua
|
# Lua
|
||||||
env['LUA_USE_MACOSX'] = 0
|
env['LUA_USE_MACOSX'] = env['LUA_USE_LINUX'] = env['LUA_USE_POSIX'] = 0
|
||||||
env['LUA_USE_LINUX'] = 0
|
|
||||||
env['LUA_USE_POSIX'] = 0
|
|
||||||
if sys.platform == 'darwin':
|
if sys.platform == 'darwin':
|
||||||
env['LUA_USE_MACOSX'] = 1
|
env['LUA_USE_MACOSX'] = 1
|
||||||
elif sys.platform == 'linux2':
|
elif sys.platform == 'linux2':
|
||||||
|
|
|
@ -24,36 +24,6 @@ def CheckFramework(context, name):
|
||||||
|
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
def CheckFink(context):
|
|
||||||
context.Message( 'Looking for fink... ')
|
|
||||||
prog = context.env.WhereIs('fink')
|
|
||||||
if prog:
|
|
||||||
ret = 1
|
|
||||||
prefix = prog.rsplit(os.sep, 2)[0]
|
|
||||||
context.env.Append(LIBPATH = [prefix + os.sep +'lib'],
|
|
||||||
CPPPATH = [prefix + os.sep +'include'])
|
|
||||||
context.Message( 'Adding fink lib and include path ')
|
|
||||||
else:
|
|
||||||
ret = 0
|
|
||||||
|
|
||||||
context.Result(ret)
|
|
||||||
return int(ret)
|
|
||||||
|
|
||||||
def CheckMacports(context):
|
|
||||||
context.Message( 'Looking for macports... ')
|
|
||||||
prog = context.env.WhereIs('port')
|
|
||||||
if prog:
|
|
||||||
ret = 1
|
|
||||||
prefix = prog.rsplit(os.sep, 2)[0]
|
|
||||||
context.env.Append(LIBPATH = [prefix + os.sep + 'lib'],
|
|
||||||
CPPPATH = [prefix + os.sep + 'include'])
|
|
||||||
context.Message( 'Adding port lib and include path ')
|
|
||||||
else:
|
|
||||||
ret = 0
|
|
||||||
|
|
||||||
context.Result(ret)
|
|
||||||
return int(ret)
|
|
||||||
|
|
||||||
# TODO: We should use the scons one instead
|
# TODO: We should use the scons one instead
|
||||||
def CheckLib(context, name):
|
def CheckLib(context, name):
|
||||||
context.Message( 'Looking for lib %s... ' % name )
|
context.Message( 'Looking for lib %s... ' % name )
|
||||||
|
|
Loading…
Reference in New Issue