Add shared library scons options to stable tree.

git-svn-id: https://dolphin-emu.googlecode.com/svn/branches/stable@5197 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Glenn Rice
2010-03-15 12:23:19 +00:00
parent 88af328437
commit 29cb2ddd87
11 changed files with 62 additions and 19 deletions

View File

@ -10,4 +10,4 @@ env_lzo = env.Clone(
CCFLAGS = env.filterWarnings(env['CCFLAGS']), CCFLAGS = env.filterWarnings(env['CCFLAGS']),
CXXFLAGS = env.filterWarnings(env['CXXFLAGS']), CXXFLAGS = env.filterWarnings(env['CXXFLAGS']),
) )
env_lzo.StaticLibrary(env['local_libs'] + "minilzo", files) env_lzo.StaticLibrary(env['local_libs'] + "lzo2", files)

View File

@ -19,4 +19,4 @@ env_sfml = env.Clone(
CXXFLAGS = env.filterWarnings(env['CXXFLAGS']), CXXFLAGS = env.filterWarnings(env['CXXFLAGS']),
) )
env_sfml.StaticLibrary(env['local_libs'] + "sfml", files) env_sfml.StaticLibrary(env['local_libs'] + "sfml-network", files)

View File

@ -15,4 +15,4 @@ env_soil = env.Clone(
parse_flags = ['-fPIC'] parse_flags = ['-fPIC']
) )
env_soil.StaticLibrary(env['local_libs'] + "libsoil", files) env_soil.StaticLibrary(env['local_libs'] + "SOIL", files)

View File

@ -50,10 +50,7 @@ include_paths = [
basedir + 'Source/Core/Core/Src', basedir + 'Source/Core/Core/Src',
basedir + 'Source/Core/DebuggerWX/Src', basedir + 'Source/Core/DebuggerWX/Src',
basedir + 'Externals/Bochs_disasm', basedir + 'Externals/Bochs_disasm',
basedir + 'Externals/LZO',
basedir + 'Externals/SOIL',
basedir + 'Externals/Lua', basedir + 'Externals/Lua',
basedir + 'Externals/SFML/include',
basedir + 'Externals/WiiUseSrc/Src', basedir + 'Externals/WiiUseSrc/Src',
basedir + 'Source/Core/VideoCommon/Src', basedir + 'Source/Core/VideoCommon/Src',
basedir + 'Source/Core/InputCommon/Src', basedir + 'Source/Core/InputCommon/Src',
@ -64,9 +61,6 @@ include_paths = [
dirs = [ dirs = [
'Externals/Bochs_disasm', 'Externals/Bochs_disasm',
'Externals/LZO',
'Externals/SOIL',
'Externals/SFML/src',
'Externals/Lua', 'Externals/Lua',
'Externals/WiiUseSrc/Src', 'Externals/WiiUseSrc/Src',
'Source/Core/Common/Src', 'Source/Core/Common/Src',
@ -112,6 +106,9 @@ vars.AddVariables(
BoolVariable('wxgl', 'Set For Building with WX GL libs (WIP)', False), BoolVariable('wxgl', 'Set For Building with WX GL libs (WIP)', 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_soil', 'Use system shared libSOIL', False),
BoolVariable('shared_lzo', 'Use system shared liblzo2', False),
BoolVariable('shared_sfml', 'Use system shared libsfml-network', False),
PathVariable('userdir', 'Set the name of the user data directory in home', '.dolphin-emu', PathVariable.PathAccept), PathVariable('userdir', 'Set the name of the user data directory in home', '.dolphin-emu', PathVariable.PathAccept),
EnumVariable('install', 'Choose a local or global installation', 'local', EnumVariable('install', 'Choose a local or global installation', 'local',
allowed_values = ('local', 'global'), allowed_values = ('local', 'global'),
@ -188,7 +185,7 @@ if not env['verbose']:
env['RANLIBCOMSTR'] = "Indexing $TARGET" env['RANLIBCOMSTR'] = "Indexing $TARGET"
# build flavor # build flavor
flavour = ARGUMENTS.get('flavor') flavour = env['flavor']
if (flavour == 'debug'): if (flavour == 'debug'):
compileFlags.append('-ggdb') compileFlags.append('-ggdb')
cppDefines.append('_DEBUG') #enables LOGGING cppDefines.append('_DEBUG') #enables LOGGING
@ -257,7 +254,7 @@ elif flavour == 'prof':
extra = '-prof' extra = '-prof'
# Set up the install locations # Set up the install locations
if (ARGUMENTS.get('install') == 'global'): if (env['install'] == 'global'):
env['prefix'] = os.path.join(env['prefix'] + os.sep) env['prefix'] = os.path.join(env['prefix'] + os.sep)
env['binary_dir'] = env['prefix'] + 'bin/' env['binary_dir'] = env['prefix'] + 'bin/'
env['libs_dir'] = env['prefix'] + 'lib/' env['libs_dir'] = env['prefix'] + 'lib/'
@ -324,6 +321,40 @@ if sys.platform != 'darwin':
# needed for mic # needed for mic
env['HAVE_PORTAUDIO'] = conf.CheckPortaudio(1890) env['HAVE_PORTAUDIO'] = conf.CheckPortaudio(1890)
# 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']
# 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']
# SFML
env['SHARED_SFML'] = 0;
if env['shared_sfml']:
# TODO: Check the version of sfml. It should be at least version 1.5
env['SHARED_SFML'] = conf.CheckPKG('sfml-network') and conf.CheckCXXHeader("SFML/Network/Ftp.hpp")
if not env['SHARED_SFML']:
print "shared sfml-network library not detected"
print "falling back to the static library"
if not env['SHARED_SFML']:
env['CPPPATH'] += [ basedir + 'Externals/SFML/include' ]
dirs += ['Externals/SFML/src']
#osx 64 specifics #osx 64 specifics
if sys.platform == 'darwin': if sys.platform == 'darwin':
if env['osx'] == '64cocoa': if env['osx'] == '64cocoa':
@ -380,8 +411,11 @@ conf.Define('USE_WX', env['USE_WX'])
conf.Define('HAVE_X11', env['HAVE_X11']) conf.Define('HAVE_X11', env['HAVE_X11'])
conf.Define('HAVE_COCOA', env['HAVE_COCOA']) conf.Define('HAVE_COCOA', env['HAVE_COCOA'])
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 (ARGUMENTS.get('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['libs_dir'] + "\"") conf.Define('LIBS_DIR', "\"" + env['libs_dir'] + "\"")

View File

@ -1,2 +1,3 @@
#define SVN_REV 5163 #define SVN_REV $WCREV$
#define SVN_REV_STR "2.0 RC1" #define SVN_REV_STR "5196M-release"

View File

@ -138,7 +138,7 @@ libs = [
'bdisasm', 'bdisasm',
'inputcommon', 'inputcommon',
'lua', 'lua',
'sfml' 'sfml-network'
] ]
env_core = env.Clone(); env_core = env.Clone();

View File

@ -31,7 +31,11 @@
#include <string> #include <string>
#if defined(SHARED_LZO) && SHARED_LZO
#include <lzo/lzo1x.h>
#else
#include "minilzo.h" #include "minilzo.h"
#endif
// TODO: Move to namespace // TODO: Move to namespace

View File

@ -11,8 +11,8 @@ files = [
] ]
libs = [ libs = [
'core', 'minilzo', 'discio', 'bdisasm', 'videocommon', 'core', 'lzo2', 'discio', 'bdisasm', 'videocommon',
'inputcommon', 'common', 'lua', 'z', 'sfml' 'inputcommon', 'common', 'lua', 'z', 'sfml-network'
] ]
if wxenv['HAVE_WX']: if wxenv['HAVE_WX']:

View File

@ -20,7 +20,11 @@
#include <cstring> #include <cstring>
#include <utility> #include <utility>
#include <algorithm> #include <algorithm>
#if defined(SHARED_SOIL) && SHARED_SOIL
#include <SOIL/SOIL.h>
#else
#include "SOIL.h" #include "SOIL.h"
#endif
#include "CommonPaths.h" #include "CommonPaths.h"
#include "FileUtil.h" #include "FileUtil.h"
#include "FileSearch.h" #include "FileSearch.h"

View File

@ -31,7 +31,7 @@ compileFlags = [
linkFlags = [ linkFlags = [
] ]
libs = [ libs = [
'videocommon', 'soil', 'common' 'videocommon', 'SOIL', 'common'
] ]
gfxenv = env.Clone() gfxenv = env.Clone()

View File

@ -42,7 +42,7 @@ compileFlags = [
linkFlags = [ linkFlags = [
] ]
libs = [ libs = [
'videocommon', 'soil', 'common' 'videocommon', 'SOIL', 'common'
] ]
gfxenv = env.Clone() gfxenv = env.Clone()