2010-06-10 08:18:21 -06:00
|
|
|
# -*- python -*-
|
2008-09-20 11:31:54 -06:00
|
|
|
|
2008-07-12 11:40:22 -06:00
|
|
|
import os
|
2008-07-30 03:12:52 -06:00
|
|
|
import sys
|
2008-11-13 01:12:48 -07:00
|
|
|
import platform
|
2008-07-12 11:40:22 -06:00
|
|
|
|
2008-09-21 07:13:20 -06:00
|
|
|
# Home made tests
|
|
|
|
sys.path.append('SconsTests')
|
2010-06-10 08:18:21 -06:00
|
|
|
import wxconfig
|
2008-09-21 13:54:29 -06:00
|
|
|
import utils
|
2008-09-21 07:13:20 -06:00
|
|
|
|
2010-06-10 08:18:21 -06:00
|
|
|
# Some features need at least SCons 1.2
|
2009-06-08 08:36:00 -06:00
|
|
|
EnsureSConsVersion(1, 2)
|
2008-09-21 07:13:20 -06:00
|
|
|
|
2008-08-26 15:02:23 -06:00
|
|
|
warnings = [
|
2008-10-05 12:49:55 -06:00
|
|
|
'all',
|
|
|
|
'write-strings',
|
|
|
|
'shadow',
|
|
|
|
'pointer-arith',
|
|
|
|
'packed',
|
|
|
|
'no-conversion',
|
|
|
|
]
|
2010-06-02 14:35:12 -06:00
|
|
|
|
2008-08-26 15:02:23 -06:00
|
|
|
compileFlags = [
|
2008-10-05 12:49:55 -06:00
|
|
|
'-fno-exceptions',
|
|
|
|
'-fno-strict-aliasing',
|
|
|
|
'-msse2',
|
2010-06-02 14:35:12 -06:00
|
|
|
'-fPIC',
|
2008-10-05 12:49:55 -06:00
|
|
|
]
|
2008-09-18 04:04:03 -06:00
|
|
|
|
2008-09-19 09:03:31 -06:00
|
|
|
cppDefines = [
|
2008-10-05 12:49:55 -06:00
|
|
|
( '_FILE_OFFSET_BITS', 64),
|
|
|
|
'_LARGEFILE_SOURCE',
|
|
|
|
'GCC_HASCLASSVISIBILITY',
|
|
|
|
]
|
2008-09-19 09:03:31 -06:00
|
|
|
|
2010-06-14 12:07:29 -06:00
|
|
|
basedir = os.getcwd() + '/'
|
2009-04-12 15:30:22 -06:00
|
|
|
|
2008-08-26 15:02:23 -06:00
|
|
|
include_paths = [
|
2009-04-12 15:30:22 -06:00
|
|
|
basedir + 'Source/Core/Common/Src',
|
|
|
|
basedir + 'Source/Core/DiscIO/Src',
|
|
|
|
basedir + 'Source/PluginSpecs',
|
|
|
|
basedir + 'Source/Core/Core/Src',
|
|
|
|
basedir + 'Source/Core/DebuggerWX/Src',
|
|
|
|
basedir + 'Externals/Bochs_disasm',
|
2009-08-23 07:13:58 -06:00
|
|
|
basedir + 'Externals/Lua',
|
2009-04-12 15:30:22 -06:00
|
|
|
basedir + 'Externals/WiiUseSrc/Src',
|
|
|
|
basedir + 'Source/Core/VideoCommon/Src',
|
|
|
|
basedir + 'Source/Core/InputCommon/Src',
|
2010-06-12 14:33:29 -06:00
|
|
|
basedir + 'Source/Core/InputUICommon/Src',
|
2009-04-12 15:30:22 -06:00
|
|
|
basedir + 'Source/Core/AudioCommon/Src',
|
2009-07-08 02:29:22 -06:00
|
|
|
basedir + 'Source/Core/DebuggerUICommon/Src',
|
2010-06-14 12:07:29 -06:00
|
|
|
basedir + 'Source/Core/DolphinWX/Src',
|
2009-04-12 15:30:22 -06:00
|
|
|
basedir + 'Source/Core/DSPCore/Src',
|
2008-10-05 12:49:55 -06:00
|
|
|
]
|
2008-07-12 11:40:22 -06:00
|
|
|
|
2008-08-20 05:01:29 -06:00
|
|
|
dirs = [
|
2008-10-05 12:49:55 -06:00
|
|
|
'Externals/Bochs_disasm',
|
2009-08-23 07:13:58 -06:00
|
|
|
'Externals/Lua',
|
2010-06-14 12:07:29 -06:00
|
|
|
'Externals/MemcardManager',
|
2010-06-10 08:18:21 -06:00
|
|
|
'Externals/WiiUseSrc/Src',
|
2008-11-19 03:22:29 -07:00
|
|
|
'Source/Core/Common/Src',
|
2008-10-05 12:49:55 -06:00
|
|
|
'Source/Core/Core/Src',
|
|
|
|
'Source/Core/DiscIO/Src',
|
|
|
|
'Source/Core/VideoCommon/Src',
|
2009-01-04 12:54:56 -07:00
|
|
|
'Source/Core/InputCommon/Src',
|
2009-04-08 07:42:30 -06:00
|
|
|
'Source/Core/AudioCommon/Src',
|
2009-07-08 02:29:22 -06:00
|
|
|
'Source/Core/DebuggerUICommon/Src',
|
2009-04-12 13:56:59 -06:00
|
|
|
'Source/Core/DSPCore/Src',
|
2009-04-12 15:30:22 -06:00
|
|
|
'Source/DSPTool/Src',
|
2010-06-12 14:33:29 -06:00
|
|
|
'Source/Core/InputUICommon/Src/',
|
2008-10-05 12:49:55 -06:00
|
|
|
'Source/Plugins/Plugin_VideoOGL/Src',
|
2009-10-12 10:29:32 -06:00
|
|
|
'Source/Plugins/Plugin_VideoSoftware/Src',
|
2008-10-05 12:49:55 -06:00
|
|
|
'Source/Plugins/Plugin_DSP_HLE/Src',
|
2009-04-08 14:21:07 -06:00
|
|
|
'Source/Plugins/Plugin_DSP_LLE/Src',
|
2009-02-03 15:06:18 -07:00
|
|
|
'Source/Plugins/Plugin_Wiimote/Src',
|
2010-06-12 07:50:24 -06:00
|
|
|
'Source/Plugins/Plugin_WiimoteNew/Src/',
|
2008-10-05 12:49:55 -06:00
|
|
|
'Source/Core/DolphinWX/Src',
|
2008-12-05 06:46:19 -07:00
|
|
|
'Source/Core/DebuggerWX/Src',
|
2010-04-11 23:33:17 -06:00
|
|
|
'Source/UnitTests/',
|
2008-10-05 12:49:55 -06:00
|
|
|
]
|
|
|
|
|
2008-08-12 17:17:29 -06:00
|
|
|
builders = {}
|
2008-08-26 15:02:23 -06:00
|
|
|
if sys.platform == 'darwin':
|
2008-10-05 12:49:55 -06:00
|
|
|
from plistlib import writePlist
|
|
|
|
def createPlist(target, source, env):
|
|
|
|
properties = {}
|
|
|
|
for srcNode in source:
|
|
|
|
properties.update(srcNode.value)
|
|
|
|
for dstNode in target:
|
|
|
|
writePlist(properties, str(dstNode))
|
2008-10-17 03:44:44 -06:00
|
|
|
builders['Plist'] = Builder(action = createPlist)
|
2008-08-12 17:17:29 -06:00
|
|
|
|
2010-06-09 13:41:17 -06:00
|
|
|
# Handle command line options
|
2008-09-21 09:55:27 -06:00
|
|
|
vars = Variables('args.cache')
|
2008-12-10 11:33:13 -07:00
|
|
|
|
2008-09-19 09:03:31 -06:00
|
|
|
vars.AddVariables(
|
2008-10-05 12:49:55 -06:00
|
|
|
BoolVariable('verbose', 'Set for compilation line', False),
|
2008-11-13 03:04:10 -07:00
|
|
|
BoolVariable('bundle', 'Set to create bundle', False),
|
2008-10-05 12:49:55 -06:00
|
|
|
BoolVariable('lint', 'Set for lint build (extra warnings)', False),
|
2010-06-16 05:39:23 -06:00
|
|
|
BoolVariable('nowx', 'Set for building with no WX libs', False),
|
|
|
|
BoolVariable('wxgl', 'Set for building with WX GL on Linux', False),
|
2010-06-26 08:16:19 -06:00
|
|
|
BoolVariable('opencl', 'Build with OpenCL', False),
|
2010-01-19 13:21:17 -07:00
|
|
|
BoolVariable('nojit', 'Remove entire jit cores', False),
|
2010-06-16 19:18:22 -06:00
|
|
|
BoolVariable('shared_glew', 'Use system shared libGLEW', True),
|
|
|
|
BoolVariable('shared_lzo', 'Use system shared liblzo2', True),
|
|
|
|
BoolVariable('shared_sdl', 'Use system shared libSDL', True),
|
|
|
|
BoolVariable('shared_sfml', 'Use system shared libsfml-network', True),
|
|
|
|
BoolVariable('shared_soil', 'Use system shared libSOIL', True),
|
|
|
|
BoolVariable('shared_zlib', 'Use system shared libz', True),
|
2010-06-02 14:35:12 -06:00
|
|
|
PathVariable('userdir', 'Set the name of the user data directory in home',
|
|
|
|
'.dolphin-emu', PathVariable.PathAccept),
|
2010-02-02 14:56:29 -07:00
|
|
|
EnumVariable('install', 'Choose a local or global installation', 'local',
|
|
|
|
allowed_values = ('local', 'global'),
|
|
|
|
ignorecase = 2
|
|
|
|
),
|
2010-06-02 14:35:12 -06:00
|
|
|
PathVariable('prefix', 'Installation prefix (only used for a global build)',
|
|
|
|
'/usr', PathVariable.PathAccept),
|
|
|
|
PathVariable('destdir', 'Temporary install location (for package building)',
|
|
|
|
None, PathVariable.PathAccept),
|
2008-10-05 12:49:55 -06:00
|
|
|
EnumVariable('flavor', 'Choose a build flavor', 'release',
|
2010-06-02 14:35:12 -06:00
|
|
|
allowed_values = ('release','devel','debug','fastlog','prof'),
|
2008-10-05 12:49:55 -06:00
|
|
|
ignorecase = 2
|
2008-11-30 15:05:43 -07:00
|
|
|
),
|
2008-12-09 16:47:18 -07:00
|
|
|
PathVariable('wxconfig', 'Path to the wxconfig', None),
|
2010-02-05 02:53:33 -07:00
|
|
|
EnumVariable('pgo', 'Profile-Guided Optimization (generate or use)', 'none',
|
|
|
|
allowed_values = ('none', 'generate', 'use'),
|
|
|
|
ignorecase = 2
|
|
|
|
),
|
2009-11-19 15:48:14 -07:00
|
|
|
('CC', 'The c compiler', 'gcc'),
|
|
|
|
('CXX', 'The c++ compiler', 'g++'),
|
2008-10-05 12:49:55 -06:00
|
|
|
)
|
2008-09-19 09:03:31 -06:00
|
|
|
|
2010-06-14 12:07:29 -06:00
|
|
|
env = Environment(
|
|
|
|
CPPPATH = include_paths,
|
|
|
|
RPATH = [],
|
|
|
|
LIBS = [],
|
|
|
|
LIBPATH = [],
|
|
|
|
BUILDERS = builders,
|
|
|
|
variables = vars,
|
|
|
|
)
|
|
|
|
|
Some scons updates,
windows scons will build if dirs =
'Externals/Bochs_disasm',
'Externals/LZO',
'Externals/WiiUseSrc/Src',
#'Source/Core/Common/Src',
#'Source/Core/Core/Src',
# 'Source/Core/DiscIO/Src',
# 'Source/Core/VideoCommon/Src',
#'Source/Core/InputCommon/Src',
'Source/Plugins/Plugin_VideoOGL/Src',
#'Source/Plugins/Plugin_DSP_HLE/Src',
'Source/Plugins/Plugin_DSP_LLE/Src',
'Source/Plugins/Plugin_PadSimple/Src',
'Source/Plugins/Plugin_PadSimpleEvnt/Src',
# 'Source/Plugins/Plugin_nJoy_SDL/Src',
#'Source/Plugins/Plugin_nJoy_Testing/Src',
#'Source/Plugins/Plugin_Wiimote/Src',
# 'Source/Core/DolphinWX/Src',
'Source/Core/DebuggerWX/Src',
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2627 8ced0084-cf51-0410-be5f-012b33b47a6e
2009-03-08 18:36:59 -06:00
|
|
|
if sys.platform == 'win32':
|
2010-06-14 12:07:29 -06:00
|
|
|
env['tools'] = ['mingw']
|
|
|
|
env['ENV'] = os.environ
|
Some scons updates,
windows scons will build if dirs =
'Externals/Bochs_disasm',
'Externals/LZO',
'Externals/WiiUseSrc/Src',
#'Source/Core/Common/Src',
#'Source/Core/Core/Src',
# 'Source/Core/DiscIO/Src',
# 'Source/Core/VideoCommon/Src',
#'Source/Core/InputCommon/Src',
'Source/Plugins/Plugin_VideoOGL/Src',
#'Source/Plugins/Plugin_DSP_HLE/Src',
'Source/Plugins/Plugin_DSP_LLE/Src',
'Source/Plugins/Plugin_PadSimple/Src',
'Source/Plugins/Plugin_PadSimpleEvnt/Src',
# 'Source/Plugins/Plugin_nJoy_SDL/Src',
#'Source/Plugins/Plugin_nJoy_Testing/Src',
#'Source/Plugins/Plugin_Wiimote/Src',
# 'Source/Core/DolphinWX/Src',
'Source/Core/DebuggerWX/Src',
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2627 8ced0084-cf51-0410-be5f-012b33b47a6e
2009-03-08 18:36:59 -06:00
|
|
|
else:
|
2010-06-14 12:07:29 -06:00
|
|
|
env['ENV'] = {
|
|
|
|
'PATH' : os.environ['PATH'],
|
|
|
|
'HOME' : os.environ['HOME'],
|
|
|
|
'PKG_CONFIG_PATH' : os.environ.get('PKG_CONFIG_PATH')
|
|
|
|
}
|
2008-07-12 11:40:22 -06:00
|
|
|
|
2010-06-09 13:41:17 -06:00
|
|
|
# Save the given command line options
|
2008-09-21 09:55:27 -06:00
|
|
|
vars.Save('args.cache', env)
|
|
|
|
|
2010-06-09 13:41:17 -06:00
|
|
|
# Verbose compile
|
2008-09-20 16:06:22 -06:00
|
|
|
if not env['verbose']:
|
2008-10-05 12:49:55 -06:00
|
|
|
env['CCCOMSTR'] = "Compiling $TARGET"
|
|
|
|
env['CXXCOMSTR'] = "Compiling $TARGET"
|
|
|
|
env['ARCOMSTR'] = "Archiving $TARGET"
|
|
|
|
env['LINKCOMSTR'] = "Linking $TARGET"
|
|
|
|
env['ASCOMSTR'] = "Assembling $TARGET"
|
|
|
|
env['ASPPCOMSTR'] = "Assembling $TARGET"
|
|
|
|
env['SHCCCOMSTR'] = "Compiling shared $TARGET"
|
|
|
|
env['SHCXXCOMSTR'] = "Compiling shared $TARGET"
|
|
|
|
env['SHLINKCOMSTR'] = "Linking shared $TARGET"
|
|
|
|
env['RANLIBCOMSTR'] = "Indexing $TARGET"
|
2008-09-21 13:54:29 -06:00
|
|
|
|
2010-06-09 13:41:17 -06:00
|
|
|
# Build flavor
|
2010-03-14 15:01:02 -06:00
|
|
|
flavour = env['flavor']
|
2008-09-20 16:06:22 -06:00
|
|
|
if (flavour == 'debug'):
|
2009-12-02 03:24:15 -07:00
|
|
|
compileFlags.append('-ggdb')
|
2009-03-05 09:26:05 -07:00
|
|
|
cppDefines.append('_DEBUG') #enables LOGGING
|
2008-12-19 02:36:27 -07:00
|
|
|
# FIXME: this disable wx debugging how do we make it work?
|
2010-06-10 08:18:21 -06:00
|
|
|
cppDefines.append('NDEBUG')
|
2008-09-24 11:39:15 -06:00
|
|
|
elif (flavour == 'devel'):
|
2009-12-02 03:24:15 -07:00
|
|
|
compileFlags.append('-ggdb')
|
2008-12-17 17:37:24 -07:00
|
|
|
elif (flavour == 'fastlog'):
|
|
|
|
compileFlags.append('-O3')
|
2009-03-05 09:26:05 -07:00
|
|
|
cppDefines.append('DEBUGFAST')
|
2009-01-04 03:20:38 -07:00
|
|
|
elif (flavour == 'prof'):
|
|
|
|
compileFlags.append('-O3')
|
2009-12-02 03:24:15 -07:00
|
|
|
compileFlags.append('-ggdb')
|
2009-01-04 03:20:38 -07:00
|
|
|
elif (flavour == 'release'):
|
2008-10-05 12:49:55 -06:00
|
|
|
compileFlags.append('-O3')
|
2009-12-02 03:24:15 -07:00
|
|
|
compileFlags.append('-fomit-frame-pointer');
|
2010-06-09 13:41:17 -06:00
|
|
|
# More warnings
|
2008-09-20 16:06:22 -06:00
|
|
|
if env['lint']:
|
2010-06-03 12:49:35 -06:00
|
|
|
warnings.append('error')
|
2010-06-09 13:41:17 -06:00
|
|
|
# Should check for the availability of these (in GCC 4.3 or newer)
|
2010-06-03 23:21:46 -06:00
|
|
|
if sys.platform != 'darwin':
|
|
|
|
warnings.append('no-array-bounds')
|
|
|
|
warnings.append('no-unused-result')
|
2010-06-09 13:41:17 -06:00
|
|
|
# wxWidgets causes too many warnings with these
|
2010-06-03 12:49:35 -06:00
|
|
|
#warnings.append('unreachable-code')
|
|
|
|
#warnings.append('float-equal')
|
2008-09-20 16:06:22 -06:00
|
|
|
|
2010-06-09 13:41:17 -06:00
|
|
|
# Add the warnings to the compile flags
|
2009-09-08 15:16:05 -06:00
|
|
|
compileFlags += [ ('-W' + warning) for warning in warnings ]
|
2008-09-20 16:06:22 -06:00
|
|
|
|
|
|
|
env['CCFLAGS'] = compileFlags
|
|
|
|
env['CPPDEFINES'] = cppDefines
|
2010-06-26 07:29:44 -06:00
|
|
|
if not sys.platform == 'win32':
|
|
|
|
env['CXXFLAGS'] = ['-fvisibility-inlines-hidden']
|
2008-09-20 16:06:22 -06:00
|
|
|
|
2010-06-09 13:41:17 -06:00
|
|
|
# PGO - Profile Guided Optimization
|
2010-02-05 02:53:33 -07:00
|
|
|
if env['pgo']=='generate':
|
|
|
|
compileFlags.append('-fprofile-generate')
|
|
|
|
env['LINKFLAGS']='-fprofile-generate'
|
|
|
|
if env['pgo']=='use':
|
|
|
|
compileFlags.append('-fprofile-use')
|
|
|
|
env['LINKFLAGS']='-fprofile-use'
|
|
|
|
|
2008-09-21 07:13:20 -06:00
|
|
|
# Configuration tests section
|
2008-09-24 11:39:15 -06:00
|
|
|
tests = {'CheckWXConfig' : wxconfig.CheckWXConfig,
|
|
|
|
'CheckPKGConfig' : utils.CheckPKGConfig,
|
|
|
|
'CheckPKG' : utils.CheckPKG,
|
2009-03-03 13:14:39 -07:00
|
|
|
'CheckSDL' : utils.CheckSDL,
|
|
|
|
'CheckPortaudio' : utils.CheckPortaudio,
|
|
|
|
}
|
2008-09-22 18:24:28 -06:00
|
|
|
|
2010-06-09 13:41:17 -06:00
|
|
|
# Object files
|
2010-06-02 14:35:12 -06:00
|
|
|
env['build_dir'] = os.path.join(basedir, 'Build',
|
|
|
|
platform.system() + '-' + platform.machine() + '-' + env['flavor'] + os.sep)
|
2009-04-12 15:30:22 -06:00
|
|
|
|
2010-05-26 15:31:50 -06:00
|
|
|
# Static libs go here
|
|
|
|
env['local_libs'] = env['build_dir'] + os.sep + 'libs' + os.sep
|
2008-12-10 17:45:14 -07:00
|
|
|
|
2010-02-02 14:56:29 -07:00
|
|
|
# Where do we run from
|
|
|
|
env['base_dir'] = os.getcwd()+ '/'
|
|
|
|
|
2010-06-09 13:41:17 -06:00
|
|
|
# Install paths
|
2010-02-02 14:56:29 -07:00
|
|
|
extra=''
|
|
|
|
if flavour == 'debug':
|
|
|
|
extra = '-debug'
|
|
|
|
elif flavour == 'prof':
|
|
|
|
extra = '-prof'
|
|
|
|
|
2010-02-02 16:21:19 -07:00
|
|
|
# Set up the install locations
|
2010-03-14 15:01:02 -06:00
|
|
|
if (env['install'] == 'global'):
|
2010-02-02 14:56:29 -07:00
|
|
|
env['prefix'] = os.path.join(env['prefix'] + os.sep)
|
|
|
|
env['binary_dir'] = env['prefix'] + 'bin/'
|
2010-06-10 08:18:21 -06:00
|
|
|
env['plugin_dir'] = env['prefix'] + 'lib/dolphin-emu/'
|
2010-02-02 14:56:29 -07:00
|
|
|
env['data_dir'] = env['prefix'] + "share/dolphin-emu/"
|
|
|
|
else:
|
2010-06-02 14:35:12 -06:00
|
|
|
env['prefix'] = os.path.join(env['base_dir'] + 'Binary',
|
|
|
|
platform.system() + '-' + platform.machine() + extra + os.sep)
|
2010-02-02 16:21:19 -07:00
|
|
|
env['binary_dir'] = env['prefix']
|
2010-06-10 08:18:21 -06:00
|
|
|
env['plugin_dir'] = env['prefix'] + 'plugins/'
|
2010-05-26 15:31:50 -06:00
|
|
|
env['data_dir'] = env['prefix']
|
|
|
|
if sys.platform == 'darwin':
|
|
|
|
env['plugin_dir'] = env['prefix'] + 'Dolphin.app/Contents/PlugIns/'
|
|
|
|
env['data_dir'] = env['prefix'] + 'Dolphin.app/Contents/'
|
2010-02-02 14:56:29 -07:00
|
|
|
|
2010-06-10 08:18:21 -06:00
|
|
|
conf = env.Configure(custom_tests = tests,
|
2008-12-05 06:46:19 -07:00
|
|
|
config_h="Source/Core/Common/Src/Config.h")
|
2008-09-21 07:13:20 -06:00
|
|
|
|
2010-06-26 07:56:29 -06:00
|
|
|
env['HAVE_OPENCL'] = 0
|
2010-06-26 07:29:44 -06:00
|
|
|
if not sys.platform == 'win32':
|
|
|
|
if env['opencl']:
|
|
|
|
env['HAVE_OPENCL'] = conf.CheckPKG('OpenCL')
|
2010-06-16 10:35:19 -06:00
|
|
|
|
2010-06-14 12:07:29 -06:00
|
|
|
# OS X specifics
|
|
|
|
if sys.platform == 'darwin':
|
2010-06-26 07:29:44 -06:00
|
|
|
if env['FRAMEWORKS'].count('OpenCL'):
|
|
|
|
env['FRAMEWORKS'].remove('OpenCL')
|
|
|
|
env['LINKFLAGS'] += ['-weak_framework', 'OpenCL']
|
|
|
|
compileFlags += ['-isysroot', '/Developer/SDKs/MacOSX10.6.sdk']
|
|
|
|
else:
|
|
|
|
# OpenCL is new in OS X 10.6. Other than OpenCL,
|
|
|
|
# we try to maintain 10.5 compatibility, however.
|
2010-06-16 10:35:19 -06:00
|
|
|
compileFlags += ['-isysroot', '/Developer/SDKs/MacOSX10.5.sdk']
|
2010-06-14 12:07:29 -06:00
|
|
|
compileFlags += ['-mmacosx-version-min=10.5']
|
|
|
|
conf.Define('MAP_32BIT', 0)
|
|
|
|
env['CC'] = "gcc-4.2"
|
|
|
|
env['CFLAGS'] = ['-x', 'objective-c']
|
|
|
|
env['CXX'] = "g++-4.2"
|
|
|
|
env['CXXFLAGS'] = ['-x', 'objective-c++']
|
|
|
|
env['CCFLAGS'] += ['-arch' , 'x86_64' , '-arch' , 'i386']
|
|
|
|
env['LINKFLAGS'] += ['-arch', 'x86_64' , '-arch' , 'i386']
|
|
|
|
env['FRAMEWORKS'] += ['CoreFoundation', 'CoreServices']
|
|
|
|
env['FRAMEWORKS'] += ['IOBluetooth', 'IOKit', 'OpenGL']
|
|
|
|
env['FRAMEWORKS'] += ['AudioUnit', 'CoreAudio']
|
2010-06-16 05:39:23 -06:00
|
|
|
else:
|
|
|
|
if not conf.CheckPKGConfig('0.15.0'):
|
|
|
|
print "Can't find pkg-config, some tests will fail"
|
2010-06-14 12:07:29 -06:00
|
|
|
|
2010-06-16 05:39:23 -06:00
|
|
|
shared = {}
|
|
|
|
shared['glew'] = shared['lzo'] = shared['sdl'] = \
|
|
|
|
shared['soil'] = shared['sfml'] = shared['zlib'] = 0
|
2010-06-26 07:29:44 -06:00
|
|
|
if not sys.platform == 'win32' and not sys.platform == 'darwin':
|
2010-06-16 19:18:22 -06:00
|
|
|
if env['shared_glew']:
|
|
|
|
shared['glew'] = conf.CheckPKG('GLEW')
|
|
|
|
if env['shared_sdl']:
|
|
|
|
shared['sdl'] = conf.CheckPKG('SDL')
|
|
|
|
if env['shared_zlib']:
|
|
|
|
shared['zlib'] = conf.CheckPKG('z')
|
|
|
|
if env['shared_lzo']:
|
2010-06-16 10:35:19 -06:00
|
|
|
shared['lzo'] = conf.CheckPKG('lzo2')
|
2010-06-16 19:18:22 -06:00
|
|
|
# TODO: Check the version of sfml. It should be at least version 1.5
|
|
|
|
if env['shared_sfml']:
|
2010-06-16 10:35:19 -06:00
|
|
|
shared['sfml'] = conf.CheckPKG('sfml-network') and \
|
|
|
|
conf.CheckCXXHeader("SFML/Network/Ftp.hpp")
|
2010-06-16 19:18:22 -06:00
|
|
|
if env['shared_soil']:
|
2010-06-16 10:35:19 -06:00
|
|
|
shared['soil'] = conf.CheckPKG('SOIL')
|
2010-06-16 05:39:23 -06:00
|
|
|
for lib in shared:
|
|
|
|
if not shared[lib]:
|
|
|
|
print "Shared library " + lib + " not detected, " \
|
|
|
|
"falling back to the static library"
|
|
|
|
|
|
|
|
if shared['glew'] == 0:
|
|
|
|
env['CPPPATH'] += [basedir + 'Externals/GLew/include']
|
2010-06-15 18:07:52 -06:00
|
|
|
dirs += ['Externals/GLew']
|
2010-06-16 05:39:23 -06:00
|
|
|
if shared['lzo'] == 0:
|
|
|
|
env['CPPPATH'] += [basedir + 'Externals/LZO']
|
2010-03-09 15:17:33 -07:00
|
|
|
dirs += ['Externals/LZO']
|
2010-06-16 05:39:23 -06:00
|
|
|
if shared['sdl'] == 0:
|
|
|
|
env['CPPPATH'] += [basedir + 'Externals/SDL']
|
|
|
|
env['CPPPATH'] += [basedir + 'Externals/SDL/include']
|
2010-06-15 18:07:52 -06:00
|
|
|
dirs += ['Externals/SDL']
|
2010-06-16 05:39:23 -06:00
|
|
|
if shared['soil'] == 0:
|
|
|
|
env['CPPPATH'] += [basedir + 'Externals/SOIL']
|
2010-06-15 18:07:52 -06:00
|
|
|
dirs += ['Externals/SOIL']
|
2010-06-16 05:39:23 -06:00
|
|
|
if shared['sfml'] == 0:
|
|
|
|
env['CPPPATH'] += [basedir + 'Externals/SFML/include']
|
2010-03-09 15:17:33 -07:00
|
|
|
dirs += ['Externals/SFML/src']
|
2010-06-16 05:39:23 -06:00
|
|
|
if shared['zlib'] == 0:
|
|
|
|
env['CPPPATH'] += [basedir + 'Externals/zlib']
|
2010-06-15 18:07:52 -06:00
|
|
|
dirs += ['Externals/zlib']
|
|
|
|
|
2010-06-04 15:00:39 -06:00
|
|
|
wxmods = ['aui', 'adv', 'core', 'base']
|
|
|
|
if env['wxgl'] or sys.platform == 'win32' or sys.platform == 'darwin':
|
Some scons updates,
windows scons will build if dirs =
'Externals/Bochs_disasm',
'Externals/LZO',
'Externals/WiiUseSrc/Src',
#'Source/Core/Common/Src',
#'Source/Core/Core/Src',
# 'Source/Core/DiscIO/Src',
# 'Source/Core/VideoCommon/Src',
#'Source/Core/InputCommon/Src',
'Source/Plugins/Plugin_VideoOGL/Src',
#'Source/Plugins/Plugin_DSP_HLE/Src',
'Source/Plugins/Plugin_DSP_LLE/Src',
'Source/Plugins/Plugin_PadSimple/Src',
'Source/Plugins/Plugin_PadSimpleEvnt/Src',
# 'Source/Plugins/Plugin_nJoy_SDL/Src',
#'Source/Plugins/Plugin_nJoy_Testing/Src',
#'Source/Plugins/Plugin_Wiimote/Src',
# 'Source/Core/DolphinWX/Src',
'Source/Core/DebuggerWX/Src',
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2627 8ced0084-cf51-0410-be5f-012b33b47a6e
2009-03-08 18:36:59 -06:00
|
|
|
env['USE_WX'] = 1
|
2010-06-02 19:24:26 -06:00
|
|
|
wxmods.append('gl')
|
2010-06-04 15:00:39 -06:00
|
|
|
else:
|
|
|
|
env['USE_WX'] = 0;
|
|
|
|
if env['nowx']:
|
|
|
|
env['USE_WX'] = 0;
|
|
|
|
|
|
|
|
if sys.platform == 'darwin':
|
|
|
|
wxver = '2.9' # 64-bit on OS X
|
|
|
|
else:
|
|
|
|
wxver = '2.8'
|
Some scons updates,
windows scons will build if dirs =
'Externals/Bochs_disasm',
'Externals/LZO',
'Externals/WiiUseSrc/Src',
#'Source/Core/Common/Src',
#'Source/Core/Core/Src',
# 'Source/Core/DiscIO/Src',
# 'Source/Core/VideoCommon/Src',
#'Source/Core/InputCommon/Src',
'Source/Plugins/Plugin_VideoOGL/Src',
#'Source/Plugins/Plugin_DSP_HLE/Src',
'Source/Plugins/Plugin_DSP_LLE/Src',
'Source/Plugins/Plugin_PadSimple/Src',
'Source/Plugins/Plugin_PadSimpleEvnt/Src',
# 'Source/Plugins/Plugin_nJoy_SDL/Src',
#'Source/Plugins/Plugin_nJoy_Testing/Src',
#'Source/Plugins/Plugin_Wiimote/Src',
# 'Source/Core/DolphinWX/Src',
'Source/Core/DebuggerWX/Src',
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2627 8ced0084-cf51-0410-be5f-012b33b47a6e
2009-03-08 18:36:59 -06:00
|
|
|
|
2009-01-08 04:50:49 -07:00
|
|
|
if env['nowx']:
|
|
|
|
env['HAVE_WX'] = 0;
|
|
|
|
else:
|
2010-06-10 08:18:21 -06:00
|
|
|
env['HAVE_WX'] = conf.CheckWXConfig(wxver, wxmods, 0)
|
2010-06-04 15:00:39 -06:00
|
|
|
wxconfig.ParseWXConfig(env)
|
2010-06-10 08:18:21 -06:00
|
|
|
# wx-config wants us to link with the OS X QuickTime framework
|
|
|
|
# which is not available for x86_64 and we don't use it anyway.
|
|
|
|
# Strip it out to silence some harmless linker warnings.
|
|
|
|
if env['FRAMEWORKS'].count('QuickTime'):
|
2010-06-15 18:07:52 -06:00
|
|
|
env['FRAMEWORKS'].remove('QuickTime')
|
2010-06-10 08:18:21 -06:00
|
|
|
# Make sure that the libraries claimed by wx-config are valid
|
2010-06-26 07:29:44 -06:00
|
|
|
#env['HAVE_WX'] = conf.CheckPKG('c')
|
2010-06-04 15:00:39 -06:00
|
|
|
|
|
|
|
if not env['HAVE_WX'] and not env['nowx']:
|
2010-06-10 08:18:21 -06:00
|
|
|
print "WX libraries not found - see config.log"
|
2010-06-04 15:00:39 -06:00
|
|
|
Exit(1)
|
|
|
|
|
2010-06-10 08:18:21 -06:00
|
|
|
if not sys.platform == 'win32':
|
|
|
|
if not conf.CheckPKG('Cg'):
|
|
|
|
print "Must have Cg framework from NVidia to build"
|
|
|
|
Exit(1)
|
|
|
|
|
2010-06-15 18:07:52 -06:00
|
|
|
env['HAVE_BLUEZ'] = 0
|
2010-06-16 05:39:23 -06:00
|
|
|
env['HAVE_ALSA'] = env['HAVE_AO'] = env['HAVE_OPENAL'] = \
|
|
|
|
env['HAVE_PORTAUDIO'] = env['HAVE_PULSEAUDIO'] = 0
|
|
|
|
env['HAVE_X11'] = env['HAVE_XRANDR'] = 0
|
2010-06-10 08:18:21 -06:00
|
|
|
if not sys.platform == 'win32' and not sys.platform == 'darwin':
|
2010-06-15 18:07:52 -06:00
|
|
|
env['LINKFLAGS'] += ['-pthread']
|
|
|
|
|
|
|
|
env['HAVE_BLUEZ'] = conf.CheckPKG('bluez')
|
|
|
|
|
|
|
|
env['HAVE_ALSA'] = conf.CheckPKG('alsa')
|
|
|
|
env['HAVE_AO'] = conf.CheckPKG('ao')
|
|
|
|
env['HAVE_OPENAL'] = conf.CheckPKG('openal')
|
|
|
|
env['HAVE_PORTAUDIO'] = conf.CheckPortaudio(1890)
|
|
|
|
env['HAVE_PULSEAUDIO'] = conf.CheckPKG('libpulse-simple')
|
|
|
|
|
2010-06-14 12:07:29 -06:00
|
|
|
env['HAVE_X11'] = conf.CheckPKG('x11')
|
|
|
|
env['HAVE_XRANDR'] = env['HAVE_X11'] and conf.CheckPKG('xrandr')
|
2010-06-10 08:18:21 -06:00
|
|
|
if not conf.CheckPKG('GL'):
|
|
|
|
print "Must have OpenGL to build"
|
|
|
|
Exit(1)
|
|
|
|
if not conf.CheckPKG('GLU'):
|
|
|
|
print "Must have GLU to build"
|
|
|
|
Exit(1)
|
|
|
|
if not conf.CheckPKG('CgGL'):
|
|
|
|
print "Must have CgGl to build"
|
|
|
|
Exit(1)
|
|
|
|
|
2010-06-09 13:41:17 -06:00
|
|
|
# Check for GTK 2.0 or newer
|
2010-04-11 19:33:10 -06:00
|
|
|
if sys.platform == 'linux2':
|
2010-06-11 02:51:46 -06:00
|
|
|
if env['HAVE_WX'] and not conf.CheckPKG('gtk+-2.0'):
|
2010-04-11 19:33:10 -06:00
|
|
|
print "gtk+-2.0 developement headers not detected"
|
|
|
|
print "gtk+-2.0 is required to build the WX GUI"
|
|
|
|
Exit(1)
|
|
|
|
|
2009-07-13 00:34:12 -06:00
|
|
|
env['NOJIT'] = 0
|
|
|
|
if env['nojit']:
|
2010-06-10 08:18:21 -06:00
|
|
|
env['NOJIT'] = 1
|
2009-01-04 02:12:12 -07:00
|
|
|
|
2009-07-13 00:34:12 -06:00
|
|
|
conf.Define('NOJIT', env['NOJIT'])
|
2009-01-04 02:12:12 -07:00
|
|
|
|
2008-12-05 06:46:19 -07:00
|
|
|
# Creating config.h defines
|
|
|
|
conf.Define('HAVE_BLUEZ', env['HAVE_BLUEZ'])
|
|
|
|
conf.Define('HAVE_AO', env['HAVE_AO'])
|
2009-10-06 20:48:21 -06:00
|
|
|
conf.Define('HAVE_OPENCL', env['HAVE_OPENCL'])
|
2009-03-30 11:24:55 -06:00
|
|
|
conf.Define('HAVE_OPENAL', env['HAVE_OPENAL'])
|
2009-09-15 04:47:19 -06:00
|
|
|
conf.Define('HAVE_ALSA', env['HAVE_ALSA'])
|
2010-06-05 22:02:16 -06:00
|
|
|
conf.Define('HAVE_PULSEAUDIO', env['HAVE_PULSEAUDIO'])
|
2008-12-05 06:46:19 -07:00
|
|
|
conf.Define('HAVE_WX', env['HAVE_WX'])
|
2008-12-10 16:39:59 -07:00
|
|
|
conf.Define('USE_WX', env['USE_WX'])
|
2008-12-06 15:28:32 -07:00
|
|
|
conf.Define('HAVE_X11', env['HAVE_X11'])
|
2010-04-21 22:28:34 -06:00
|
|
|
conf.Define('HAVE_XRANDR', env['HAVE_XRANDR'])
|
2009-02-28 17:07:17 -07:00
|
|
|
conf.Define('HAVE_PORTAUDIO', env['HAVE_PORTAUDIO'])
|
2010-02-02 14:56:29 -07:00
|
|
|
conf.Define('USER_DIR', "\"" + env['userdir'] + "\"")
|
2010-03-14 15:01:02 -06:00
|
|
|
if (env['install'] == 'global'):
|
2010-02-02 14:56:29 -07:00
|
|
|
conf.Define('DATA_DIR', "\"" + env['data_dir'] + "\"")
|
2010-05-27 06:13:37 -06:00
|
|
|
conf.Define('LIBS_DIR', "\"" + env['prefix'] + 'lib/' + "\"")
|
2008-09-21 07:13:20 -06:00
|
|
|
|
2010-06-09 13:41:17 -06:00
|
|
|
# Lua
|
2010-06-16 05:39:23 -06:00
|
|
|
env['LUA_USE_MACOSX'] = env['LUA_USE_LINUX'] = env['LUA_USE_POSIX'] = 0
|
2009-11-15 14:25:44 -07:00
|
|
|
if sys.platform == 'darwin':
|
2010-06-10 08:18:21 -06:00
|
|
|
env['LUA_USE_MACOSX'] = 1
|
2009-11-15 14:25:44 -07:00
|
|
|
elif sys.platform == 'linux2':
|
2010-06-10 08:18:21 -06:00
|
|
|
env['LUA_USE_LINUX'] = 1
|
2009-11-15 14:25:44 -07:00
|
|
|
|
|
|
|
conf.Define('LUA_USE_MACOSX', env['LUA_USE_MACOSX'])
|
|
|
|
conf.Define('LUA_USE_LINUX', env['LUA_USE_LINUX'])
|
|
|
|
|
2010-06-09 13:41:17 -06:00
|
|
|
# Profiling
|
2009-01-04 03:20:38 -07:00
|
|
|
env['USE_OPROFILE'] = 0
|
2010-06-10 08:18:21 -06:00
|
|
|
if (flavour == 'prof'):
|
2009-01-04 03:37:10 -07:00
|
|
|
proflibs = [ '/usr/lib/oprofile', '/usr/local/lib/oprofile' ]
|
|
|
|
env['LIBPATH'].append(proflibs)
|
|
|
|
env['RPATH'].append(proflibs)
|
2009-01-04 03:20:38 -07:00
|
|
|
if conf.CheckPKG('opagent'):
|
|
|
|
env['USE_OPROFILE'] = 1
|
|
|
|
else:
|
|
|
|
print "Can't build prof without oprofile, disabling"
|
|
|
|
|
|
|
|
conf.Define('USE_OPROFILE', env['USE_OPROFILE'])
|
2008-09-22 18:07:51 -06:00
|
|
|
# After all configuration tests are done
|
2008-12-05 06:46:19 -07:00
|
|
|
conf.Finish()
|
2008-09-22 18:07:51 -06:00
|
|
|
|
2010-06-16 06:42:49 -06:00
|
|
|
env['LIBPATH'].append(env['local_libs'])
|
|
|
|
|
2010-06-10 08:18:21 -06:00
|
|
|
rev = utils.GenerateRevFile(env['flavor'],
|
2008-11-13 03:04:10 -07:00
|
|
|
"Source/Core/Common/Src/svnrev_template.h",
|
|
|
|
"Source/Core/Common/Src/svnrev.h")
|
2010-06-09 13:41:17 -06:00
|
|
|
# Print a nice progress indication when not compiling
|
2010-06-05 10:42:04 -06:00
|
|
|
Progress(['-\r', '\\\r', '|\r', '/\r'], interval=5)
|
2008-09-19 09:03:31 -06:00
|
|
|
|
2010-02-02 14:56:29 -07:00
|
|
|
# Setup destdir for package building
|
|
|
|
# Warning: The program will not run from this location. It is assumed the
|
|
|
|
# package will later install it to the prefix as it was defined before this.
|
|
|
|
if env.has_key('destdir'):
|
|
|
|
env['prefix'] = env['destdir'] + env['prefix']
|
|
|
|
env['plugin_dir'] = env['destdir'] + env['plugin_dir']
|
|
|
|
env['binary_dir'] = env['destdir'] + env['binary_dir']
|
|
|
|
env['data_dir'] = env['destdir'] + env['data_dir']
|
|
|
|
|
2010-06-09 13:41:17 -06:00
|
|
|
# Die on unknown variables
|
2008-09-19 09:03:31 -06:00
|
|
|
unknown = vars.UnknownVariables()
|
|
|
|
if unknown:
|
2008-10-05 12:49:55 -06:00
|
|
|
print "Unknown variables:", unknown.keys()
|
|
|
|
Exit(1)
|
2008-09-19 09:03:31 -06:00
|
|
|
|
2010-06-09 13:41:17 -06:00
|
|
|
# Generate help
|
2008-09-19 09:03:31 -06:00
|
|
|
Help(vars.GenerateHelpText(env))
|
|
|
|
|
2008-12-05 06:46:19 -07:00
|
|
|
Export('env')
|
|
|
|
|
2008-08-26 15:02:23 -06:00
|
|
|
for subdir in dirs:
|
2008-10-05 12:49:55 -06:00
|
|
|
SConscript(
|
|
|
|
subdir + os.sep + 'SConscript',
|
2009-04-12 15:30:22 -06:00
|
|
|
variant_dir = env[ 'build_dir' ] + subdir + os.sep,
|
2008-12-10 17:45:14 -07:00
|
|
|
duplicate=0
|
2008-10-05 12:49:55 -06:00
|
|
|
)
|
2008-11-13 01:12:48 -07:00
|
|
|
|
|
|
|
# Data install
|
|
|
|
if sys.platform == 'darwin':
|
2010-02-02 14:56:29 -07:00
|
|
|
env.Install(env['data_dir'], 'Data/Sys')
|
|
|
|
env.Install(env['data_dir'], 'Data/User')
|
2010-06-10 08:18:21 -06:00
|
|
|
env.Install(env['binary_dir'] + 'Dolphin.app/Contents/Resources/',
|
2008-11-18 01:33:49 -07:00
|
|
|
'Source/Core/DolphinWX/resources/Dolphin.icns')
|
2010-02-02 14:56:29 -07:00
|
|
|
else:
|
|
|
|
env.InstallAs(env['data_dir'] + 'sys', 'Data/Sys')
|
|
|
|
env.InstallAs(env['data_dir'] + 'user', 'Data/User')
|
|
|
|
|
|
|
|
env.Alias('install', env['prefix'])
|
2008-11-13 03:04:10 -07:00
|
|
|
|
|
|
|
if env['bundle']:
|
2010-05-26 21:51:00 -06:00
|
|
|
if sys.platform == 'linux2':
|
|
|
|
# Make tar ball (TODO put inside normal dir)
|
|
|
|
tar_env = env.Clone()
|
2010-06-26 07:29:44 -06:00
|
|
|
tarball = tar_env.Tar('dolphin-' + rev + '.tar.bz2', env['prefix'])
|
2010-05-26 21:51:00 -06:00
|
|
|
tar_env.Append(TARFLAGS='-j', TARCOMSTR="Creating release tarball")
|
2010-06-26 07:29:44 -06:00
|
|
|
env.Clean(all, tarball)
|
2010-05-26 21:51:00 -06:00
|
|
|
elif sys.platform == 'darwin':
|
2010-06-26 07:29:44 -06:00
|
|
|
app = env['binary_dir'] + 'Dolphin.app'
|
|
|
|
dmg = env['binary_dir'] + 'Dolphin-r' + rev + '.dmg'
|
|
|
|
env.Command('.', app + '/Contents/MacOS/Dolphin', 'rm -f ' + dmg +
|
|
|
|
' && hdiutil create -srcfolder ' + app + ' -format UDBZ ' + dmg +
|
|
|
|
' && hdiutil internet-enable -yes ' + dmg)
|
|
|
|
env.Clean(all, dmg)
|