2008-09-19 15:03:31 +00:00
|
|
|
# -*- python -*-
|
2008-09-20 17:31:54 +00:00
|
|
|
|
2008-07-12 17:40:22 +00:00
|
|
|
import os
|
2008-07-30 09:12:52 +00:00
|
|
|
import sys
|
2008-11-13 08:12:48 +00:00
|
|
|
import platform
|
2008-07-12 17:40:22 +00:00
|
|
|
|
2008-09-21 13:13:20 +00:00
|
|
|
# Home made tests
|
|
|
|
sys.path.append('SconsTests')
|
|
|
|
import wxconfig
|
2008-09-21 19:54:29 +00:00
|
|
|
import utils
|
2008-09-21 13:13:20 +00:00
|
|
|
|
2008-09-21 16:09:59 +00:00
|
|
|
# Some features needs at least scons 0.98
|
2009-06-08 14:36:00 +00:00
|
|
|
EnsureSConsVersion(1, 2)
|
2008-09-21 13:13:20 +00:00
|
|
|
|
2008-09-19 15:03:31 +00:00
|
|
|
# TODO: how do we use it in help?
|
|
|
|
name="Dolphin"
|
|
|
|
version="SVN"
|
|
|
|
description="A wii/gamecube emulator"
|
|
|
|
license="GPL v2"
|
2008-08-12 23:17:29 +00:00
|
|
|
|
2008-08-26 21:02:23 +00:00
|
|
|
warnings = [
|
2008-10-05 18:49:55 +00:00
|
|
|
'all',
|
|
|
|
'write-strings',
|
|
|
|
'shadow',
|
|
|
|
'pointer-arith',
|
|
|
|
'packed',
|
|
|
|
'no-conversion',
|
2009-09-08 21:16:05 +00:00
|
|
|
# 'no-unused-result', (need a newer gcc for this?)
|
2008-10-05 18:49:55 +00:00
|
|
|
]
|
2008-08-26 21:02:23 +00:00
|
|
|
compileFlags = [
|
2008-10-05 18:49:55 +00:00
|
|
|
'-fno-exceptions',
|
|
|
|
'-fno-strict-aliasing',
|
|
|
|
'-msse2',
|
2009-11-11 11:07:04 +00:00
|
|
|
# '-fomit-frame-pointer',
|
|
|
|
# '-flto',
|
2008-10-05 18:49:55 +00:00
|
|
|
]
|
2008-09-18 10:04:03 +00:00
|
|
|
|
2008-09-19 15:03:31 +00:00
|
|
|
cppDefines = [
|
2008-10-05 18:49:55 +00:00
|
|
|
( '_FILE_OFFSET_BITS', 64),
|
|
|
|
'_LARGEFILE_SOURCE',
|
|
|
|
'GCC_HASCLASSVISIBILITY',
|
|
|
|
]
|
2008-09-19 15:03:31 +00:00
|
|
|
|
2009-04-12 21:30:22 +00:00
|
|
|
basedir = os.getcwd()+ '/'
|
|
|
|
|
2008-08-26 21:02:23 +00:00
|
|
|
include_paths = [
|
2009-04-12 21:30:22 +00: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 13:13:58 +00:00
|
|
|
basedir + 'Externals/Lua',
|
2009-04-12 21:30:22 +00:00
|
|
|
basedir + 'Externals/WiiUseSrc/Src',
|
|
|
|
basedir + 'Source/Core/VideoCommon/Src',
|
|
|
|
basedir + 'Source/Core/InputCommon/Src',
|
|
|
|
basedir + 'Source/Core/AudioCommon/Src',
|
2009-07-08 08:29:22 +00:00
|
|
|
basedir + 'Source/Core/DebuggerUICommon/Src',
|
2009-04-12 21:30:22 +00:00
|
|
|
basedir + 'Source/Core/DSPCore/Src',
|
2008-10-05 18:49:55 +00:00
|
|
|
]
|
2008-07-12 17:40:22 +00:00
|
|
|
|
2008-08-20 11:01:29 +00:00
|
|
|
dirs = [
|
2008-10-05 18:49:55 +00:00
|
|
|
'Externals/Bochs_disasm',
|
2009-08-23 13:13:58 +00:00
|
|
|
'Externals/Lua',
|
2008-12-05 13:46:19 +00:00
|
|
|
'Externals/WiiUseSrc/Src',
|
2008-11-19 10:22:29 +00:00
|
|
|
'Source/Core/Common/Src',
|
2008-10-05 18:49:55 +00:00
|
|
|
'Source/Core/Core/Src',
|
|
|
|
'Source/Core/DiscIO/Src',
|
|
|
|
'Source/Core/VideoCommon/Src',
|
2009-01-04 19:54:56 +00:00
|
|
|
'Source/Core/InputCommon/Src',
|
2009-04-08 13:42:30 +00:00
|
|
|
'Source/Core/AudioCommon/Src',
|
2009-07-08 08:29:22 +00:00
|
|
|
'Source/Core/DebuggerUICommon/Src',
|
2009-04-12 19:56:59 +00:00
|
|
|
'Source/Core/DSPCore/Src',
|
2009-04-12 21:30:22 +00:00
|
|
|
'Source/DSPTool/Src',
|
2008-10-05 18:49:55 +00:00
|
|
|
'Source/Plugins/Plugin_VideoOGL/Src',
|
2009-10-12 16:29:32 +00:00
|
|
|
'Source/Plugins/Plugin_VideoSoftware/Src',
|
2008-10-05 18:49:55 +00:00
|
|
|
'Source/Plugins/Plugin_DSP_HLE/Src',
|
2009-04-08 20:21:07 +00:00
|
|
|
'Source/Plugins/Plugin_DSP_LLE/Src',
|
2010-01-23 17:30:40 +00:00
|
|
|
'Source/Plugins/Plugin_GCPad/Src',
|
2010-04-02 02:48:24 +00:00
|
|
|
'Source/Plugins/Plugin_GCPadNew/Src',
|
2009-02-03 22:06:18 +00:00
|
|
|
'Source/Plugins/Plugin_Wiimote/Src',
|
2008-10-05 18:49:55 +00:00
|
|
|
'Source/Core/DolphinWX/Src',
|
2008-12-05 13:46:19 +00:00
|
|
|
'Source/Core/DebuggerWX/Src',
|
2008-10-05 18:49:55 +00:00
|
|
|
]
|
|
|
|
|
2008-08-12 23:17:29 +00:00
|
|
|
builders = {}
|
2008-08-26 21:02:23 +00:00
|
|
|
if sys.platform == 'darwin':
|
2008-10-05 18:49:55 +00: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 09:44:44 +00:00
|
|
|
builders['Plist'] = Builder(action = createPlist)
|
2008-08-12 23:17:29 +00:00
|
|
|
|
2008-09-19 15:03:31 +00:00
|
|
|
# handle command line options
|
2008-09-21 15:55:27 +00:00
|
|
|
vars = Variables('args.cache')
|
2008-12-10 18:33:13 +00:00
|
|
|
|
2008-09-19 15:03:31 +00:00
|
|
|
vars.AddVariables(
|
2008-10-05 18:49:55 +00:00
|
|
|
BoolVariable('verbose', 'Set for compilation line', False),
|
2008-11-13 10:04:10 +00:00
|
|
|
BoolVariable('bundle', 'Set to create bundle', False),
|
2008-10-05 18:49:55 +00:00
|
|
|
BoolVariable('lint', 'Set for lint build (extra warnings)', False),
|
|
|
|
BoolVariable('nowx', 'Set For Building with no WX libs (WIP)', False),
|
2009-10-15 06:50:04 +00:00
|
|
|
BoolVariable('openal', 'Build with OpenAL', False),
|
2009-09-24 22:56:50 +00:00
|
|
|
BoolVariable('noao', 'Build without AO', False),
|
2008-12-10 23:39:59 +00:00
|
|
|
BoolVariable('wxgl', 'Set For Building with WX GL libs (WIP)', False),
|
2009-09-30 12:58:02 +00:00
|
|
|
BoolVariable('opencl', 'Build with OpenCL', False),
|
2010-01-19 20:21:17 +00:00
|
|
|
BoolVariable('nojit', 'Remove entire jit cores', False),
|
2010-03-09 22:17:33 +00:00
|
|
|
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),
|
2010-02-02 21:56:29 +00:00
|
|
|
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',
|
|
|
|
allowed_values = ('local', 'global'),
|
|
|
|
ignorecase = 2
|
|
|
|
),
|
|
|
|
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 18:49:55 +00:00
|
|
|
EnumVariable('flavor', 'Choose a build flavor', 'release',
|
2009-01-04 10:20:38 +00:00
|
|
|
allowed_values = ('release', 'devel', 'debug', 'fastlog', 'prof'),
|
2008-10-05 18:49:55 +00:00
|
|
|
ignorecase = 2
|
2008-11-30 22:05:43 +00:00
|
|
|
),
|
2008-12-10 23:23:05 +00:00
|
|
|
EnumVariable('osx', 'Choose a backend (WIP)', '32cocoa',
|
2010-03-05 09:23:28 +00:00
|
|
|
allowed_values = ('32x11', '32cocoa', '64cocoa', 'universal'),
|
2008-12-10 18:33:13 +00:00
|
|
|
ignorecase = 2
|
|
|
|
),
|
2008-12-09 23:47:18 +00:00
|
|
|
PathVariable('wxconfig', 'Path to the wxconfig', None),
|
2010-02-05 09:53:33 +00:00
|
|
|
EnumVariable('pgo', 'Profile-Guided Optimization (generate or use)', 'none',
|
|
|
|
allowed_values = ('none', 'generate', 'use'),
|
|
|
|
ignorecase = 2
|
|
|
|
),
|
2009-11-19 22:48:14 +00:00
|
|
|
('CC', 'The c compiler', 'gcc'),
|
|
|
|
('CXX', 'The c++ compiler', 'g++'),
|
2008-10-05 18:49:55 +00:00
|
|
|
)
|
2008-09-19 15:03:31 +00:00
|
|
|
|
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-09 00:36:59 +00:00
|
|
|
if sys.platform == 'win32':
|
|
|
|
env = Environment(
|
|
|
|
CPPPATH = include_paths,
|
|
|
|
RPATH = [],
|
|
|
|
LIBS = [],
|
2009-04-12 21:30:22 +00:00
|
|
|
LIBPATH = [],
|
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-09 00:36:59 +00:00
|
|
|
tools = [ 'mingw' ],
|
|
|
|
variables = vars,
|
|
|
|
ENV = os.environ,
|
|
|
|
BUILDERS = builders,
|
|
|
|
DESCRIPTION = description,
|
|
|
|
SUMMARY = description,
|
|
|
|
LICENSE = license,
|
|
|
|
NAME = name,
|
|
|
|
VERSION = version,
|
|
|
|
)
|
|
|
|
else:
|
|
|
|
env = Environment(
|
|
|
|
CPPPATH = include_paths,
|
|
|
|
RPATH = [],
|
|
|
|
LIBS = [],
|
2009-04-12 21:30:22 +00:00
|
|
|
LIBPATH = [],
|
|
|
|
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-09 00:36:59 +00:00
|
|
|
ENV = {
|
|
|
|
'PATH' : os.environ['PATH'],
|
|
|
|
'HOME' : os.environ['HOME']
|
2008-10-05 18:49:55 +00:00
|
|
|
},
|
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-09 00:36:59 +00:00
|
|
|
BUILDERS = builders,
|
|
|
|
DESCRIPTION = description,
|
|
|
|
SUMMARY = description,
|
|
|
|
LICENSE = license,
|
|
|
|
NAME = name,
|
|
|
|
VERSION = version,
|
|
|
|
)
|
2008-07-12 17:40:22 +00:00
|
|
|
|
2008-09-21 19:54:29 +00:00
|
|
|
# save the given command line options
|
2008-09-21 15:55:27 +00:00
|
|
|
vars.Save('args.cache', env)
|
|
|
|
|
2008-09-19 15:03:31 +00:00
|
|
|
# verbose compile
|
2008-09-20 22:06:22 +00:00
|
|
|
if not env['verbose']:
|
2008-10-05 18:49:55 +00: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 19:54:29 +00:00
|
|
|
|
2009-09-08 21:16:05 +00:00
|
|
|
# build flavor
|
2010-03-14 21:01:02 +00:00
|
|
|
flavour = env['flavor']
|
2008-09-20 22:06:22 +00:00
|
|
|
if (flavour == 'debug'):
|
2009-12-02 10:24:15 +00:00
|
|
|
compileFlags.append('-ggdb')
|
2009-03-05 16:26:05 +00:00
|
|
|
cppDefines.append('_DEBUG') #enables LOGGING
|
2008-12-19 09:36:27 +00:00
|
|
|
# FIXME: this disable wx debugging how do we make it work?
|
|
|
|
cppDefines.append('NDEBUG')
|
2008-09-24 17:39:15 +00:00
|
|
|
elif (flavour == 'devel'):
|
2009-12-02 10:24:15 +00:00
|
|
|
compileFlags.append('-ggdb')
|
2008-12-18 00:37:24 +00:00
|
|
|
elif (flavour == 'fastlog'):
|
|
|
|
compileFlags.append('-O3')
|
2009-03-05 16:26:05 +00:00
|
|
|
cppDefines.append('DEBUGFAST')
|
2009-01-04 10:20:38 +00:00
|
|
|
elif (flavour == 'prof'):
|
|
|
|
compileFlags.append('-O3')
|
2009-12-02 10:24:15 +00:00
|
|
|
compileFlags.append('-ggdb')
|
2009-01-04 10:20:38 +00:00
|
|
|
elif (flavour == 'release'):
|
2008-10-05 18:49:55 +00:00
|
|
|
compileFlags.append('-O3')
|
2009-12-02 10:24:15 +00:00
|
|
|
compileFlags.append('-fomit-frame-pointer');
|
2008-09-20 22:06:22 +00:00
|
|
|
# more warnings
|
|
|
|
if env['lint']:
|
2008-10-05 18:49:55 +00:00
|
|
|
warnings.append('error')
|
|
|
|
warnings.append('unreachable-code')
|
|
|
|
warnings.append('float-equal')
|
2008-09-20 22:06:22 +00:00
|
|
|
|
|
|
|
# add the warnings to the compile flags
|
2009-09-08 21:16:05 +00:00
|
|
|
compileFlags += [ ('-W' + warning) for warning in warnings ]
|
2008-09-20 22:06:22 +00:00
|
|
|
|
|
|
|
env['CCFLAGS'] = compileFlags
|
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-09 00:36:59 +00:00
|
|
|
if sys.platform == 'win32':
|
|
|
|
env['CXXFLAGS'] = compileFlags
|
|
|
|
else:
|
|
|
|
env['CXXFLAGS'] = compileFlags + [ '-fvisibility-inlines-hidden' ]
|
2008-09-20 22:06:22 +00:00
|
|
|
env['CPPDEFINES'] = cppDefines
|
|
|
|
|
2010-02-05 09:53:33 +00:00
|
|
|
# pgo - Profile Guided Optimization
|
|
|
|
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 13:13:20 +00:00
|
|
|
|
|
|
|
# Configuration tests section
|
2008-09-24 17:39:15 +00:00
|
|
|
tests = {'CheckWXConfig' : wxconfig.CheckWXConfig,
|
|
|
|
'CheckPKGConfig' : utils.CheckPKGConfig,
|
|
|
|
'CheckPKG' : utils.CheckPKG,
|
2009-03-03 20:14:39 +00:00
|
|
|
'CheckSDL' : utils.CheckSDL,
|
2009-03-03 22:34:32 +00:00
|
|
|
'CheckFink' : utils.CheckFink,
|
|
|
|
'CheckMacports' : utils.CheckMacports,
|
2009-03-03 20:14:39 +00:00
|
|
|
'CheckPortaudio' : utils.CheckPortaudio,
|
|
|
|
}
|
2008-09-23 00:24:28 +00:00
|
|
|
|
2009-04-12 21:30:22 +00:00
|
|
|
#object files
|
|
|
|
env['build_dir'] = os.path.join(basedir, 'Build', platform.system() + '-' + platform.machine() + '-' + env['flavor'] + os.sep)
|
|
|
|
|
|
|
|
|
|
|
|
VariantDir(env['build_dir'], '.', duplicate=0)
|
2008-12-11 00:45:14 +00:00
|
|
|
|
2010-02-02 21:56:29 +00:00
|
|
|
# Where do we run from
|
|
|
|
env['base_dir'] = os.getcwd()+ '/'
|
|
|
|
|
|
|
|
# install paths
|
|
|
|
extra=''
|
|
|
|
if flavour == 'debug':
|
|
|
|
extra = '-debug'
|
|
|
|
elif flavour == 'prof':
|
|
|
|
extra = '-prof'
|
|
|
|
|
2010-02-02 23:21:19 +00:00
|
|
|
# Set up the install locations
|
2010-03-14 21:01:02 +00:00
|
|
|
if (env['install'] == 'global'):
|
2010-02-02 21:56:29 +00:00
|
|
|
env['prefix'] = os.path.join(env['prefix'] + os.sep)
|
|
|
|
env['binary_dir'] = env['prefix'] + 'bin/'
|
|
|
|
env['libs_dir'] = env['prefix'] + 'lib/'
|
2010-02-02 23:21:19 +00:00
|
|
|
env['plugin_dir'] = env['prefix'] + 'lib/dolphin-emu/'
|
2010-02-02 21:56:29 +00:00
|
|
|
env['data_dir'] = env['prefix'] + "share/dolphin-emu/"
|
|
|
|
else:
|
2010-02-02 23:21:19 +00:00
|
|
|
env['prefix'] = os.path.join(env['base_dir'] + 'Binary', platform.system() + '-' + platform.machine() + extra + os.sep)
|
|
|
|
env['binary_dir'] = env['prefix']
|
2010-02-02 21:56:29 +00:00
|
|
|
if sys.platform == 'darwin':
|
2010-02-02 23:21:19 +00:00
|
|
|
env['plugin_dir'] = env['prefix'] + 'Dolphin.app/Contents/PlugIns/'
|
2010-02-02 21:56:29 +00:00
|
|
|
env['data_dir'] = env['prefix'] + 'Dolphin.app/Contents/'
|
2010-02-02 23:21:19 +00:00
|
|
|
env['libs_dir'] = env['prefix'] + 'Libs/'
|
2010-02-02 21:56:29 +00:00
|
|
|
else:
|
2010-02-02 23:21:19 +00:00
|
|
|
env['plugin_dir'] = env['prefix'] + 'plugins/'
|
2010-02-02 21:56:29 +00:00
|
|
|
env['data_dir'] = env['prefix']
|
2010-02-02 23:21:19 +00:00
|
|
|
env['libs_dir'] = env['prefix'] + 'lib/'
|
2010-02-02 21:56:29 +00:00
|
|
|
|
|
|
|
env['RPATH'].append(env['libs_dir'])
|
|
|
|
|
|
|
|
# static libs goes here
|
|
|
|
env['local_libs'] = env['build_dir'] + os.sep + 'libs' + os.sep
|
|
|
|
|
|
|
|
env['LIBPATH'].append(env['local_libs'])
|
|
|
|
env['LIBPATH'].append(env['libs_dir'])
|
|
|
|
|
2008-12-05 13:46:19 +00:00
|
|
|
conf = env.Configure(custom_tests = tests,
|
|
|
|
config_h="Source/Core/Common/Src/Config.h")
|
2008-09-21 13:13:20 +00:00
|
|
|
|
2008-09-24 17:39:15 +00:00
|
|
|
if not conf.CheckPKGConfig('0.15.0'):
|
2008-12-05 13:46:19 +00:00
|
|
|
print "Can't find pkg-config, some tests will fail"
|
2008-09-24 17:39:15 +00:00
|
|
|
|
2009-03-03 22:34:32 +00:00
|
|
|
# find ports/fink for library and include path
|
|
|
|
if sys.platform == 'darwin':
|
|
|
|
#ports usually has newer versions
|
|
|
|
conf.CheckMacports()
|
|
|
|
conf.CheckFink()
|
|
|
|
|
2008-12-05 13:46:19 +00:00
|
|
|
env['HAVE_SDL'] = conf.CheckSDL('1.0.0')
|
2008-09-24 17:39:15 +00:00
|
|
|
|
2008-12-05 13:46:19 +00:00
|
|
|
# Bluetooth for wii support
|
2009-03-07 22:12:01 +00:00
|
|
|
env['HAVE_BLUEZ'] = conf.CheckPKG('bluez')
|
2008-12-04 15:15:21 +00:00
|
|
|
|
2008-12-05 13:46:19 +00:00
|
|
|
# needed for sound
|
2009-10-15 06:50:04 +00:00
|
|
|
env['HAVE_AO'] = 0
|
|
|
|
if not env['noao']:
|
2009-09-24 22:56:50 +00:00
|
|
|
env['HAVE_AO'] = conf.CheckPKG('ao')
|
2009-10-15 06:50:04 +00:00
|
|
|
|
|
|
|
env['HAVE_OPENAL'] = 0
|
|
|
|
if env['openal']:
|
2009-09-24 22:56:50 +00:00
|
|
|
env['HAVE_OPENAL'] = conf.CheckPKG('openal')
|
2009-10-15 06:50:04 +00:00
|
|
|
|
2009-09-15 10:47:19 +00:00
|
|
|
env['HAVE_ALSA'] = conf.CheckPKG('alsa')
|
|
|
|
|
2009-10-15 17:28:23 +00:00
|
|
|
env['HAVE_PULSEAUDIO'] = 0
|
|
|
|
#env['HAVE_PULSEAUDIO'] = conf.CheckPKG('libpulse')
|
|
|
|
|
2009-09-30 12:58:02 +00:00
|
|
|
# OpenCL
|
2009-10-15 06:50:04 +00:00
|
|
|
env['HAVE_OPENCL'] = 0
|
2009-09-30 12:58:02 +00:00
|
|
|
if env['opencl']:
|
2009-10-15 06:50:04 +00:00
|
|
|
env['HAVE_OPENCL'] = conf.CheckPKG('OpenCL')
|
2009-03-30 17:24:55 +00:00
|
|
|
|
2009-10-15 06:50:04 +00:00
|
|
|
env['HAVE_PORTAUDIO'] = 0
|
2009-04-24 09:54:51 +00:00
|
|
|
if sys.platform != 'darwin':
|
2009-03-01 00:07:17 +00:00
|
|
|
# needed for mic
|
2009-04-24 09:54:51 +00:00
|
|
|
env['HAVE_PORTAUDIO'] = conf.CheckPortaudio(1890)
|
2009-03-02 01:28:12 +00:00
|
|
|
|
2010-03-09 22:17:33 +00:00
|
|
|
# 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']
|
|
|
|
|
2008-12-05 13:46:19 +00:00
|
|
|
#osx 64 specifics
|
2008-12-10 18:33:13 +00:00
|
|
|
if sys.platform == 'darwin':
|
2008-12-10 23:23:05 +00:00
|
|
|
if env['osx'] == '64cocoa':
|
2009-09-18 19:56:49 +00:00
|
|
|
compileFlags += ['-arch' , 'x86_64', '-m64' ]
|
2010-03-05 09:23:28 +00:00
|
|
|
env['LINKFLAGS'] += ['-arch' , 'x86_64', '-m64' ]
|
2008-12-10 23:39:59 +00:00
|
|
|
conf.Define('MAP_32BIT', 0)
|
2009-09-18 19:56:49 +00:00
|
|
|
if env['osx'] == '32cocoa':
|
|
|
|
compileFlags += ['-arch' , 'i386', '-m32' ]
|
2010-03-05 09:23:28 +00:00
|
|
|
env['LINKFLAGS'] += ['-arch' , 'i386', '-m32' ]
|
|
|
|
if env['osx'] == 'universal':
|
|
|
|
compileFlags += ['-arch i386', '-arch x86_64']
|
|
|
|
env['LINKFLAGS'] += ['-arch i386', '-arch x86_64']
|
2008-12-10 23:23:05 +00:00
|
|
|
if not env['osx'] == '32x11':
|
2008-12-10 18:33:13 +00:00
|
|
|
env['HAVE_X11'] = 0
|
2009-01-09 12:11:48 +00:00
|
|
|
env['HAVE_COCOA'] = 1
|
2009-03-07 22:12:01 +00:00
|
|
|
|
2008-12-10 18:33:13 +00:00
|
|
|
else:
|
|
|
|
env['HAVE_X11'] = conf.CheckPKG('x11')
|
|
|
|
env['HAVE_COCOA'] = 0
|
2010-02-22 16:10:08 +00:00
|
|
|
|
2008-12-13 23:19:56 +00:00
|
|
|
# handling wx flags CCFLAGS should be created before
|
2010-02-12 12:41:53 +00:00
|
|
|
wxmods = ['aui', 'adv', 'core', 'base']
|
2009-10-09 04:47:36 +00:00
|
|
|
|
2008-12-13 23:19:56 +00:00
|
|
|
env['USE_WX'] = 0
|
|
|
|
if env['wxgl']:
|
|
|
|
wxmods.append('gl')
|
|
|
|
env['USE_WX'] = 1
|
|
|
|
|
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-09 00:36:59 +00:00
|
|
|
if sys.platform == 'win32':
|
|
|
|
env['HAVE_WX'] = 1
|
|
|
|
env['USE_WX'] = 1
|
|
|
|
|
2009-01-08 11:50:49 +00:00
|
|
|
# Gui less build
|
|
|
|
if env['nowx']:
|
|
|
|
env['HAVE_WX'] = 0;
|
|
|
|
else:
|
|
|
|
env['HAVE_WX'] = conf.CheckWXConfig('2.8', wxmods, 0)
|
2008-12-13 23:19:56 +00:00
|
|
|
|
2010-04-12 01:33:10 +00:00
|
|
|
# check for libgtk2.0
|
|
|
|
env['HAVE_GTK2'] = 0
|
|
|
|
if sys.platform == 'linux2':
|
|
|
|
env['HAVE_GTK2'] = env['HAVE_WX'] and conf.CheckPKG('gtk+-2.0')
|
|
|
|
if env['HAVE_WX'] and not env['HAVE_GTK2']:
|
|
|
|
print "gtk+-2.0 developement headers not detected"
|
|
|
|
print "gtk+-2.0 is required to build the WX GUI"
|
|
|
|
Exit(1)
|
|
|
|
|
2009-07-13 06:34:12 +00:00
|
|
|
env['NOJIT'] = 0
|
|
|
|
if env['nojit']:
|
|
|
|
env['NOJIT'] = 1
|
2009-01-04 09:12:12 +00:00
|
|
|
|
2009-07-13 06:34:12 +00:00
|
|
|
conf.Define('NOJIT', env['NOJIT'])
|
2009-01-04 09:12:12 +00:00
|
|
|
|
2008-12-05 13:46:19 +00:00
|
|
|
# Creating config.h defines
|
|
|
|
conf.Define('HAVE_SDL', env['HAVE_SDL'])
|
|
|
|
conf.Define('HAVE_BLUEZ', env['HAVE_BLUEZ'])
|
|
|
|
conf.Define('HAVE_AO', env['HAVE_AO'])
|
2009-10-07 02:48:21 +00:00
|
|
|
conf.Define('HAVE_OPENCL', env['HAVE_OPENCL'])
|
2009-03-30 17:24:55 +00:00
|
|
|
conf.Define('HAVE_OPENAL', env['HAVE_OPENAL'])
|
2009-09-15 10:47:19 +00:00
|
|
|
conf.Define('HAVE_ALSA', env['HAVE_ALSA'])
|
2008-12-05 13:46:19 +00:00
|
|
|
conf.Define('HAVE_WX', env['HAVE_WX'])
|
2008-12-10 23:39:59 +00:00
|
|
|
conf.Define('USE_WX', env['USE_WX'])
|
2008-12-06 22:28:32 +00:00
|
|
|
conf.Define('HAVE_X11', env['HAVE_X11'])
|
2008-12-10 18:33:13 +00:00
|
|
|
conf.Define('HAVE_COCOA', env['HAVE_COCOA'])
|
2009-03-01 00:07:17 +00:00
|
|
|
conf.Define('HAVE_PORTAUDIO', env['HAVE_PORTAUDIO'])
|
2010-03-09 22:17:33 +00:00
|
|
|
conf.Define('SHARED_SOIL', env['SHARED_SOIL'])
|
|
|
|
conf.Define('SHARED_LZO', env['SHARED_LZO'])
|
|
|
|
conf.Define('SHARED_SFML', env['SHARED_SFML'])
|
2010-02-02 21:56:29 +00:00
|
|
|
conf.Define('USER_DIR', "\"" + env['userdir'] + "\"")
|
2010-03-14 21:01:02 +00:00
|
|
|
if (env['install'] == 'global'):
|
2010-02-02 21:56:29 +00:00
|
|
|
conf.Define('DATA_DIR', "\"" + env['data_dir'] + "\"")
|
|
|
|
conf.Define('LIBS_DIR', "\"" + env['libs_dir'] + "\"")
|
2008-09-21 13:13:20 +00:00
|
|
|
|
2009-11-15 21:25:44 +00:00
|
|
|
# lua
|
|
|
|
env['LUA_USE_MACOSX'] = 0
|
|
|
|
env['LUA_USE_LINUX'] = 0
|
|
|
|
env['LUA_USE_POSIX'] = 0
|
|
|
|
if sys.platform == 'darwin':
|
|
|
|
env['LUA_USE_MACOSX'] = 1
|
|
|
|
elif sys.platform == 'linux2':
|
|
|
|
env['LUA_USE_LINUX'] = 1
|
|
|
|
|
|
|
|
conf.Define('LUA_USE_MACOSX', env['LUA_USE_MACOSX'])
|
|
|
|
conf.Define('LUA_USE_LINUX', env['LUA_USE_LINUX'])
|
|
|
|
|
2009-01-04 10:20:38 +00:00
|
|
|
# profile
|
|
|
|
env['USE_OPROFILE'] = 0
|
|
|
|
if (flavour == 'prof'):
|
2009-01-04 10:37:10 +00:00
|
|
|
proflibs = [ '/usr/lib/oprofile', '/usr/local/lib/oprofile' ]
|
|
|
|
env['LIBPATH'].append(proflibs)
|
|
|
|
env['RPATH'].append(proflibs)
|
2009-01-04 10:20:38 +00: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-23 00:07:51 +00:00
|
|
|
# After all configuration tests are done
|
2008-12-05 13:46:19 +00:00
|
|
|
conf.Finish()
|
2008-09-23 00:07:51 +00:00
|
|
|
|
2008-09-24 17:39:15 +00:00
|
|
|
#wx windows flags
|
2008-12-05 13:46:19 +00:00
|
|
|
if env['HAVE_WX']:
|
|
|
|
wxconfig.ParseWXConfig(env)
|
2010-01-16 12:22:53 +00:00
|
|
|
#this smells like a hack, but i dont know any other way to fix this
|
|
|
|
#right now. ParseWXConfig calls wx-config --libs, which returns
|
|
|
|
#"-arch i386" on my box (and probably also tmator's).
|
|
|
|
#SCons.ParseConfig makes this a tuple, which is
|
|
|
|
# 1) a problem for utils.filterWarnings
|
|
|
|
# 2) a duplicate (and conflicting) set of arch specifiers
|
|
|
|
#this mainly affects MacOSX, since darwin builds explicitly get
|
|
|
|
#those set around line 280.
|
|
|
|
if sys.platform == 'darwin':
|
|
|
|
env['CCFLAGS'] = [
|
|
|
|
f
|
|
|
|
for f in filter(lambda x:isinstance(x, basestring), env['CCFLAGS'])
|
|
|
|
]
|
2008-12-06 23:32:10 +00:00
|
|
|
else:
|
|
|
|
print "WX not found or disabled, not building GUI"
|
2008-09-24 17:39:15 +00:00
|
|
|
|
2008-09-21 19:54:29 +00:00
|
|
|
# add methods from utils to env
|
|
|
|
env.AddMethod(utils.filterWarnings)
|
|
|
|
|
2008-11-13 10:04:10 +00:00
|
|
|
rev = utils.GenerateRevFile(env['flavor'],
|
|
|
|
"Source/Core/Common/Src/svnrev_template.h",
|
|
|
|
"Source/Core/Common/Src/svnrev.h")
|
2008-09-20 22:06:22 +00:00
|
|
|
# print a nice progress indication when not compiling
|
2008-09-23 00:24:28 +00:00
|
|
|
Progress(['-\r', '\\\r', '|\r', '/\r'], interval = 5)
|
2008-09-19 15:03:31 +00:00
|
|
|
|
2010-02-02 21:56:29 +00: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['libs_dir'] = env['destdir'] + env['libs_dir']
|
|
|
|
env['data_dir'] = env['destdir'] + env['data_dir']
|
|
|
|
|
2008-09-19 15:03:31 +00:00
|
|
|
# die on unknown variables
|
|
|
|
unknown = vars.UnknownVariables()
|
|
|
|
if unknown:
|
2008-10-05 18:49:55 +00:00
|
|
|
print "Unknown variables:", unknown.keys()
|
|
|
|
Exit(1)
|
2008-09-19 15:03:31 +00:00
|
|
|
|
2008-09-20 22:06:22 +00:00
|
|
|
# generate help
|
2008-09-19 15:03:31 +00:00
|
|
|
Help(vars.GenerateHelpText(env))
|
|
|
|
|
2008-12-05 13:46:19 +00:00
|
|
|
Export('env')
|
|
|
|
|
2008-08-26 21:02:23 +00:00
|
|
|
for subdir in dirs:
|
2008-10-05 18:49:55 +00:00
|
|
|
SConscript(
|
|
|
|
subdir + os.sep + 'SConscript',
|
2009-04-12 21:30:22 +00:00
|
|
|
variant_dir = env[ 'build_dir' ] + subdir + os.sep,
|
2008-12-11 00:45:14 +00:00
|
|
|
duplicate=0
|
2008-10-05 18:49:55 +00:00
|
|
|
)
|
2008-11-13 08:12:48 +00:00
|
|
|
|
|
|
|
# Data install
|
|
|
|
if sys.platform == 'darwin':
|
2010-02-02 21:56:29 +00:00
|
|
|
env.Install(env['data_dir'], 'Data/Sys')
|
|
|
|
env.Install(env['data_dir'], 'Data/User')
|
2008-11-13 08:12:48 +00:00
|
|
|
env.Install(env['binary_dir'] + 'Dolphin.app/Contents/Resources/',
|
2008-11-18 08:33:49 +00:00
|
|
|
'Source/Core/DolphinWX/resources/Dolphin.icns')
|
2010-02-02 21:56:29 +00: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 10:04:10 +00:00
|
|
|
|
|
|
|
if env['bundle']:
|
|
|
|
# Make tar ball (TODO put inside normal dir)
|
|
|
|
tar_env = env.Clone()
|
|
|
|
tarball = tar_env.Tar('dolphin-'+rev +'.tar.bz2', env['prefix'])
|
|
|
|
tar_env.Append(TARFLAGS='-j',
|
|
|
|
TARCOMSTR="Creating release tarball")
|
|
|
|
|
|
|
|
|
|
|
|
#TODO clean all bundles
|
|
|
|
#env.Clean(all, 'dolphin-*'+ '.tar.bz2')
|
|
|
|
|
|
|
|
|