2011-03-20 12:35:07 -06:00
|
|
|
#!/usr/bin/env python Externals/scons-local/scons.py
|
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
|
|
|
|
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
|
|
|
|
2010-08-01 10:30:22 -06:00
|
|
|
# Construction presets for platform
|
|
|
|
env = Environment(ENV = os.environ)
|
|
|
|
|
2010-06-09 13:41:17 -06:00
|
|
|
# Handle command line options
|
2011-03-20 12:35:07 -06:00
|
|
|
vars = Variables()
|
2008-12-10 11:33:13 -07:00
|
|
|
|
2008-09-19 09:03:31 -06:00
|
|
|
vars.AddVariables(
|
2010-07-08 19:26:53 -06:00
|
|
|
BoolVariable('verbose', 'Set to show compilation lines', False),
|
|
|
|
BoolVariable('bundle', 'Set to create distribution bundle', False),
|
2010-07-23 17:16:28 -06:00
|
|
|
BoolVariable('lint', 'Set for lint build (fail on warnings)', False),
|
2010-08-01 10:30:22 -06:00
|
|
|
BoolVariable('nowx', 'Set for building without wxWidgets', False),
|
|
|
|
EnumVariable('flavor', 'Choose a build flavor', 'release', allowed_values =
|
|
|
|
('release','devel','debug','fastlog','prof'), ignorecase = 2),
|
|
|
|
)
|
|
|
|
|
|
|
|
if env['PLATFORM'] == 'posix': vars.AddVariables(
|
|
|
|
PathVariable('destdir', 'Temporary install location (for package building)',
|
|
|
|
None, PathVariable.PathAccept),
|
2011-03-20 12:35:07 -06:00
|
|
|
EnumVariable('install', 'Choose a local or global installation', 'global',
|
2010-08-01 10:30:22 -06:00
|
|
|
allowed_values = ('local', 'global'), ignorecase = 2),
|
|
|
|
PathVariable('prefix', 'Installation prefix (only used for a global build)',
|
2011-03-20 12:35:07 -06:00
|
|
|
'/usr/local', PathVariable.PathAccept),
|
2010-08-01 10:30:22 -06:00
|
|
|
PathVariable('userdir', 'Set the name of the user data directory in home',
|
|
|
|
'.dolphin-emu', PathVariable.PathAccept),
|
|
|
|
EnumVariable('pgo', 'Profile-Guided Optimization (generate or use)', 'none',
|
|
|
|
allowed_values = ('none', 'generate', 'use'), ignorecase = 2),
|
|
|
|
BoolVariable('shared_glew', 'Use system shared libGLEW', True),
|
|
|
|
BoolVariable('shared_lzo', 'Use system shared liblzo2', True),
|
2011-02-14 14:25:08 -07:00
|
|
|
BoolVariable('shared_png', 'Use system shared libpng', True),
|
2010-08-01 10:30:22 -06:00
|
|
|
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),
|
|
|
|
PathVariable('CC', 'The C compiler', 'gcc', PathVariable.PathAccept),
|
|
|
|
PathVariable('CXX', 'The C++ compiler', 'g++', PathVariable.PathAccept),
|
2008-10-05 12:49:55 -06:00
|
|
|
)
|
2008-09-19 09:03:31 -06:00
|
|
|
|
2010-07-24 07:10:54 -06:00
|
|
|
# Die on unknown variables
|
|
|
|
unknown = vars.UnknownVariables()
|
|
|
|
if unknown:
|
|
|
|
print "Unknown variables:", unknown.keys()
|
|
|
|
Exit(1)
|
2011-03-20 12:35:07 -06:00
|
|
|
else:
|
|
|
|
vars.Update(env)
|
2010-07-24 07:10:54 -06:00
|
|
|
|
|
|
|
# Verbose compile
|
|
|
|
if not env['verbose']:
|
|
|
|
env['ARCOMSTR'] = "Archiving $TARGET"
|
2010-07-24 17:09:43 -06:00
|
|
|
env['CCCOMSTR'] = "Compiling $TARGET"
|
|
|
|
env['CXXCOMSTR'] = "Compiling $TARGET"
|
|
|
|
env['LINKCOMSTR'] = "Linking $TARGET"
|
2010-07-24 07:10:54 -06:00
|
|
|
env['RANLIBCOMSTR'] = "Indexing $TARGET"
|
2010-07-24 17:09:43 -06:00
|
|
|
env['TARCOMSTR'] = "Creating $TARGET"
|
2010-07-24 07:10:54 -06:00
|
|
|
|
2011-03-20 12:35:07 -06:00
|
|
|
env['CCFLAGS'] = ['-fno-exceptions', '-fno-strict-aliasing']
|
2010-08-01 10:30:22 -06:00
|
|
|
if env['flavor'] == 'release':
|
2011-03-20 12:35:07 -06:00
|
|
|
env['CCFLAGS'] += ['-O3', '-fomit-frame-pointer']
|
|
|
|
else:
|
|
|
|
env['CCFLAGS'] += ['-O3', '-ggdb']
|
2010-08-01 10:30:22 -06:00
|
|
|
|
|
|
|
if env['lint']:
|
|
|
|
env['CCFLAGS'] += ['-Werror']
|
2011-02-14 14:58:53 -07:00
|
|
|
env['CCFLAGS'] += ['-Wall', '-Wextra', '-Wshadow', '-Wno-unused-parameter']
|
2010-08-01 10:30:22 -06:00
|
|
|
|
2010-11-04 15:27:03 -06:00
|
|
|
env['CPPDEFINES'] = []
|
2010-08-01 10:30:22 -06:00
|
|
|
if env['flavor'] == 'debug':
|
|
|
|
env['CPPDEFINES'] += ['_DEBUG']
|
|
|
|
elif env['flavor'] == 'fastlog':
|
|
|
|
env['CPPDEFINES'] += ['DEBUGFAST']
|
2011-02-01 21:40:27 -07:00
|
|
|
env['CPPPATH'] = []
|
2010-08-01 10:30:22 -06:00
|
|
|
env['LIBPATH'] = []
|
|
|
|
env['LIBS'] = []
|
|
|
|
|
2010-06-09 13:41:17 -06:00
|
|
|
# Object files
|
2010-07-24 07:10:54 -06:00
|
|
|
env['build_dir'] = 'Build' + os.sep + platform.system() + \
|
|
|
|
'-' + platform.machine() + '-' + env['flavor']
|
2009-04-12 15:30:22 -06:00
|
|
|
|
2010-07-24 11:39:17 -06:00
|
|
|
# Default install path
|
|
|
|
if not env.has_key('install') or env['install'] == 'local':
|
|
|
|
env['prefix'] = 'Binary' + os.sep + platform.system() + \
|
2010-08-01 10:30:22 -06:00
|
|
|
'-' + platform.machine()
|
2010-08-10 02:30:04 -06:00
|
|
|
if env['flavor'] == 'debug' or env['flavor'] == 'prof':
|
|
|
|
env['prefix'] += '-' + env['flavor']
|
2010-08-01 10:30:22 -06:00
|
|
|
|
2011-03-20 12:35:07 -06:00
|
|
|
env['svnrev'] = os.popen('svnversion -n .').read().split(':')[0]
|
2010-07-23 17:16:28 -06:00
|
|
|
|
2010-06-14 12:07:29 -06:00
|
|
|
# OS X specifics
|
|
|
|
if sys.platform == 'darwin':
|
2011-02-08 05:26:47 -07:00
|
|
|
#ccld = ['-mmacosx-version-min=10.5.4']
|
|
|
|
#ccld += ['-arch', 'x86_64', '-mssse3']
|
|
|
|
#ccld += ['-arch', 'i386', '-msse3']
|
2010-12-05 09:18:09 -07:00
|
|
|
ccld = ['-arch', 'x86_64', '-arch', 'i386', '-mmacosx-version-min=10.5.4']
|
2010-08-01 10:30:22 -06:00
|
|
|
env['CCFLAGS'] += ccld
|
2011-03-10 15:06:30 -07:00
|
|
|
env['CCFLAGS'] += ['-isysroot', '/Developer/SDKs/MacOSX10.6.sdk']
|
2011-01-29 04:40:20 -07:00
|
|
|
env['CCFLAGS'] += ['-Xarch_i386', '-msse3', '-Xarch_x86_64', '-mssse3']
|
2011-02-08 05:26:47 -07:00
|
|
|
env['CCFLAGS'] += ['-march=core2', '-mdynamic-no-pic']
|
|
|
|
env['CCFLAGS'] += ['-Wextra-tokens', '-Wnewline-eof']
|
2011-02-14 14:58:53 -07:00
|
|
|
env['CC'] = '/Developer/usr/bin/clang'
|
2011-03-10 15:06:30 -07:00
|
|
|
env['CC'] = '/Developer/usr/bin/llvm-gcc'
|
2011-02-14 14:58:53 -07:00
|
|
|
env['CXX'] = '/Developer/usr/bin/clang++'
|
|
|
|
env['CXX'] = '/Developer/usr/bin/llvm-g++'
|
2011-01-26 22:01:00 -07:00
|
|
|
env['CXXFLAGS'] += ['-x', 'objective-c++']
|
2010-08-01 10:30:22 -06:00
|
|
|
env['LINKFLAGS'] += ccld
|
2011-02-05 09:06:05 -07:00
|
|
|
env['LINKFLAGS'] += ['-Wl,-dead_strip,-dead_strip_dylibs']
|
2011-01-28 21:52:19 -07:00
|
|
|
env['LINKFLAGS'] += ['-Wl,-pagezero_size,0x1000']
|
2011-03-20 12:35:07 -06:00
|
|
|
env['LINKFLAGS'] += ['-Wl,-syslibroot,/Developer/SDKs/MacOSX10.6.sdk']
|
2011-03-10 15:06:30 -07:00
|
|
|
env['LINKFLAGS'] += ['-Xarch_i386', '-Wl,-read_only_relocs,suppress']
|
2011-02-03 17:46:56 -07:00
|
|
|
|
2011-03-20 12:35:07 -06:00
|
|
|
if not env['nowx']:
|
2011-02-08 08:30:32 -07:00
|
|
|
env['CPPDEFINES'] += ['__WXOSX_COCOA__']
|
2010-08-01 10:30:22 -06:00
|
|
|
|
2010-07-24 11:39:17 -06:00
|
|
|
env['data_dir'] = '#' + env['prefix'] + '/Dolphin.app/Contents/Resources'
|
2010-08-01 10:30:22 -06:00
|
|
|
|
2010-07-24 07:10:54 -06:00
|
|
|
if env['bundle']:
|
2010-07-24 11:39:17 -06:00
|
|
|
app = env['prefix'] + '/Dolphin.app'
|
2011-03-20 12:35:07 -06:00
|
|
|
dmg = env['prefix'] + '/Dolphin-r' + env['svnrev'] + '.dmg'
|
2010-07-24 07:10:54 -06:00
|
|
|
env.Command(dmg, app, 'rm -f ' + dmg +
|
|
|
|
' && hdiutil create -srcfolder ' + app + ' -format UDBZ ' + dmg +
|
|
|
|
' && hdiutil internet-enable -yes ' + dmg)
|
2010-07-08 19:26:53 -06:00
|
|
|
|
2010-07-19 20:45:31 -06:00
|
|
|
elif sys.platform == 'win32':
|
2010-08-01 10:30:22 -06:00
|
|
|
pass
|
2010-07-19 20:45:31 -06:00
|
|
|
|
|
|
|
else:
|
2011-01-30 20:02:23 -07:00
|
|
|
env['CCFLAGS'] += ['-msse2', '-pthread']
|
2011-03-10 15:06:30 -07:00
|
|
|
if env['CCVERSION'] < '4.2.0':
|
|
|
|
env['CCFLAGS'] += ['-Wno-pragmas']
|
2010-11-13 23:02:44 -07:00
|
|
|
if env['CCVERSION'] >= '4.2.0':
|
2010-11-14 08:31:10 -07:00
|
|
|
env['CCFLAGS'] += ['-fvisibility=hidden']
|
2010-11-13 23:02:44 -07:00
|
|
|
env['CXXFLAGS'] += ['-fvisibility-inlines-hidden']
|
2011-03-10 15:06:30 -07:00
|
|
|
if env['CCVERSION'] >= '4.3.0':
|
|
|
|
env['CCFLAGS'] += ['-Wno-array-bounds', '-Wno-unused-result']
|
2010-11-04 15:27:03 -06:00
|
|
|
env['CPPDEFINES'] += ['HAVE_CONFIG_H']
|
2010-08-01 10:30:22 -06:00
|
|
|
env['CPPPATH'].insert(0, '#') # Make sure we pick up our own config.h
|
2011-03-20 12:35:07 -06:00
|
|
|
env['CPPPATH'] += ['/usr/pkg/include', '/usr/local/include']
|
|
|
|
env['LIBPATH'] += ['/usr/pkg/lib', '/usr/local/lib']
|
2010-11-13 13:02:01 -07:00
|
|
|
env['LINKFLAGS'] += ['-pthread']
|
|
|
|
env['RPATH'] = []
|
2010-08-01 10:30:22 -06:00
|
|
|
if sys.platform == 'linux2':
|
|
|
|
env['CPPDEFINES'] += [('_FILE_OFFSET_BITS', 64), '_LARGEFILE_SOURCE']
|
|
|
|
env['CXXFLAGS'] += ['-Wno-deprecated'] # XXX <hash_map>
|
2010-11-13 13:02:01 -07:00
|
|
|
env['LIBS'] += ['dl']
|
2010-08-01 10:30:22 -06:00
|
|
|
|
2011-03-20 12:35:07 -06:00
|
|
|
conf = env.Configure(config_h = "#config.h")
|
2010-06-14 12:07:29 -06:00
|
|
|
|
2011-03-20 12:35:07 -06:00
|
|
|
conf.CheckLib('iconv')
|
2011-02-15 13:18:50 -07:00
|
|
|
|
2010-06-16 19:18:22 -06:00
|
|
|
if env['shared_glew']:
|
2011-03-20 12:35:07 -06:00
|
|
|
env['shared_glew'] = conf.CheckLib('GLEW')
|
2011-02-14 14:25:08 -07:00
|
|
|
if env['shared_png']:
|
2011-03-20 12:35:07 -06:00
|
|
|
env['shared_png'] = conf.CheckLib('png')
|
2010-06-16 19:18:22 -06:00
|
|
|
if env['shared_sdl']:
|
2011-03-20 12:35:07 -06:00
|
|
|
env['shared_sdl'] = conf.CheckLib('SDL')
|
2010-06-16 19:18:22 -06:00
|
|
|
if env['shared_zlib']:
|
2011-03-20 12:35:07 -06:00
|
|
|
env['shared_zlib'] = conf.CheckLib('z')
|
2010-06-16 19:18:22 -06:00
|
|
|
if env['shared_lzo']:
|
2011-03-20 12:35:07 -06:00
|
|
|
env['shared_lzo'] = conf.CheckLib('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']:
|
2011-03-20 12:35:07 -06:00
|
|
|
env['shared_sfml'] = conf.CheckLib('sfml-network') and \
|
2010-07-24 17:09:43 -06:00
|
|
|
conf.CheckCXXHeader("SFML/Network/Ftp.hpp")
|
2010-06-16 19:18:22 -06:00
|
|
|
if env['shared_soil']:
|
2011-03-20 12:35:07 -06:00
|
|
|
env['shared_soil'] = conf.CheckLib('SOIL')
|
2010-07-24 11:39:17 -06:00
|
|
|
for var in env.items():
|
|
|
|
if var[0].startswith('shared_') and var[1] == False:
|
|
|
|
print "Shared library " + var[0][7:] + " not detected, " \
|
2010-06-16 05:39:23 -06:00
|
|
|
"falling back to the static library"
|
|
|
|
|
2010-07-24 11:39:17 -06:00
|
|
|
if env['nowx']:
|
2011-03-20 12:35:07 -06:00
|
|
|
conf.Define('HAVE_WX', 0)
|
2010-07-24 11:39:17 -06:00
|
|
|
else:
|
2011-03-20 12:35:07 -06:00
|
|
|
if not conf.CheckLib('gtk-x11-2.0'):
|
2011-02-12 15:31:57 -07:00
|
|
|
print "gtk+-2.0 developement headers not detected"
|
|
|
|
print "gtk+-2.0 is required to build the WX GUI"
|
|
|
|
Exit(1)
|
|
|
|
env['CPPDEFINES'] += ['__WXGTK__']
|
2011-03-20 12:35:07 -06:00
|
|
|
env['CPPPATH'] += ['/usr/include/atk-1.0']
|
|
|
|
env['CPPPATH'] += ['/usr/include/cairo']
|
|
|
|
env['CPPPATH'] += ['/usr/include/glib-2.0']
|
|
|
|
env['CPPPATH'] += ['/usr/include/gtk-2.0']
|
|
|
|
env['CPPPATH'] += ['/usr/include/pango-1.0']
|
|
|
|
env['CPPPATH'] += ['/usr/pkg/include/atk-1.0']
|
|
|
|
env['CPPPATH'] += ['/usr/pkg/include/cairo']
|
|
|
|
env['CPPPATH'] += ['/usr/pkg/include/glib-2.0']
|
|
|
|
env['CPPPATH'] += ['/usr/pkg/include/gtk-2.0']
|
|
|
|
env['CPPPATH'] += ['/usr/pkg/include/pango-1.0']
|
|
|
|
env['CPPPATH'] += ['/usr/local/include/atk-1.0']
|
|
|
|
env['CPPPATH'] += ['/usr/local/include/cairo']
|
|
|
|
env['CPPPATH'] += ['/usr/local/include/glib-2.0']
|
|
|
|
env['CPPPATH'] += ['/usr/local/include/gtk-2.0']
|
|
|
|
env['CPPPATH'] += ['/usr/local/include/pango-1.0']
|
2011-02-12 15:31:57 -07:00
|
|
|
conf.Define('HAVE_WX', 1)
|
2011-03-20 12:35:07 -06:00
|
|
|
|
|
|
|
env['HAVE_BLUEZ'] = conf.CheckLib('bluez')
|
|
|
|
conf.Define('HAVE_BLUEZ', int(env['HAVE_BLUEZ']))
|
|
|
|
|
|
|
|
env['HAVE_ALSA'] = conf.CheckLib('alsa')
|
|
|
|
conf.Define('HAVE_ALSA', int(env['HAVE_ALSA']))
|
|
|
|
env['HAVE_AO'] = conf.CheckLib('ao')
|
|
|
|
conf.Define('HAVE_AO', int(env['HAVE_AO']))
|
|
|
|
env['HAVE_OPENAL'] = conf.CheckLib('openal')
|
|
|
|
conf.Define('HAVE_OPENAL', int(env['HAVE_OPENAL']))
|
|
|
|
env['HAVE_PORTAUDIO'] = conf.CheckLib('portaudio')
|
|
|
|
conf.Define('HAVE_PORTAUDIO', int(env['HAVE_PORTAUDIO']))
|
|
|
|
env['HAVE_PULSEAUDIO'] = conf.CheckLib('libpulse')
|
|
|
|
conf.Define('HAVE_PULSEAUDIO', int(env['HAVE_PULSEAUDIO']))
|
|
|
|
|
|
|
|
env['HAVE_X11'] = conf.CheckLib('X11')
|
|
|
|
env['HAVE_XRANDR'] = env['HAVE_X11'] and conf.CheckLib('Xrandr')
|
|
|
|
conf.Define('HAVE_XRANDR', int(env['HAVE_XRANDR']))
|
|
|
|
conf.Define('HAVE_X11', int(env['HAVE_X11']))
|
|
|
|
|
|
|
|
if not conf.CheckLib('GL'):
|
2010-06-10 08:18:21 -06:00
|
|
|
print "Must have OpenGL to build"
|
|
|
|
Exit(1)
|
2011-03-20 12:35:07 -06:00
|
|
|
if not conf.CheckLib('GLU'):
|
2010-06-10 08:18:21 -06:00
|
|
|
print "Must have GLU to build"
|
|
|
|
Exit(1)
|
2011-03-20 12:35:07 -06:00
|
|
|
if not conf.CheckLib('Cg') and sys.platform == 'linux2':
|
2010-07-23 17:16:28 -06:00
|
|
|
print "Must have Cg toolkit from NVidia to build"
|
|
|
|
Exit(1)
|
2011-03-20 12:35:07 -06:00
|
|
|
if not conf.CheckLib('CgGL') and sys.platform == 'linux2':
|
2010-07-23 17:16:28 -06:00
|
|
|
print "Must have CgGL to build"
|
|
|
|
Exit(1)
|
2010-07-08 19:26:53 -06:00
|
|
|
|
|
|
|
# PGO - Profile Guided Optimization
|
2010-08-01 10:30:22 -06:00
|
|
|
if env['pgo'] == 'generate':
|
|
|
|
env['CCFLAGS'] += ['-fprofile-generate']
|
|
|
|
env['LINKFLAGS'] += ['-fprofile-generate']
|
|
|
|
if env['pgo'] == 'use':
|
|
|
|
env['CCFLAGS'] += ['-fprofile-use']
|
|
|
|
env['LINKFLAGS'] += ['-fprofile-use']
|
2010-07-08 19:26:53 -06:00
|
|
|
|
|
|
|
# Profiling
|
2010-08-01 10:30:22 -06:00
|
|
|
if env['flavor'] == 'prof':
|
|
|
|
proflibs = ['/usr/lib/oprofile', '/usr/local/lib/oprofile']
|
|
|
|
env['LIBPATH'] += ['proflibs']
|
|
|
|
env['RPATH'] += ['proflibs']
|
2011-03-20 12:35:07 -06:00
|
|
|
if conf.CheckLib('opagent'):
|
2010-07-08 19:26:53 -06:00
|
|
|
conf.Define('USE_OPROFILE', 1)
|
|
|
|
else:
|
|
|
|
print "Can't build prof without oprofile, disabling"
|
|
|
|
|
2011-03-20 12:35:07 -06:00
|
|
|
tarname = 'dolphin-' + env['svnrev']
|
2010-07-24 17:09:43 -06:00
|
|
|
env['TARFLAGS'] = '-cj'
|
|
|
|
env['TARSUFFIX'] = '.tar.bz2'
|
|
|
|
|
2010-07-24 11:39:17 -06:00
|
|
|
if env['install'] == 'local':
|
2010-07-24 07:10:54 -06:00
|
|
|
env['binary_dir'] = '#' + env['prefix']
|
|
|
|
env['data_dir'] = '#' + env['prefix']
|
2010-07-24 17:09:43 -06:00
|
|
|
if env['bundle']:
|
|
|
|
env.Tar(tarname, env['prefix'])
|
2010-07-24 11:39:17 -06:00
|
|
|
else:
|
|
|
|
env['prefix'] = Dir(env['prefix']).abspath
|
|
|
|
env['binary_dir'] = env['prefix'] + '/bin'
|
|
|
|
env['data_dir'] = env['prefix'] + "/share/dolphin-emu"
|
2010-08-17 20:24:02 -06:00
|
|
|
conf.Define('DATA_DIR', "\"" + env['data_dir'] + "/\"")
|
2010-11-04 07:47:17 -06:00
|
|
|
conf.Define('LIBS_DIR', "\"" + env['prefix'] + '/lib/dolphin-emu/' + "\"")
|
2010-07-24 11:39:17 -06: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.
|
|
|
|
if env.has_key('destdir'):
|
|
|
|
env['destdir'] = Dir(env['destdir']).abspath
|
|
|
|
env['binary_dir'] = env['destdir'] + env['binary_dir']
|
|
|
|
env['data_dir'] = env['destdir'] + env['data_dir']
|
|
|
|
env['prefix'] = env['destdir'] + env['prefix']
|
2010-07-24 17:09:43 -06:00
|
|
|
if env['bundle']:
|
|
|
|
env.Command(tarname + env['TARSUFFIX'], env['prefix'],
|
|
|
|
'tar ' + env['TARFLAGS'] + 'C ' + env['destdir'] + \
|
|
|
|
' -f ' + tarname + env['TARSUFFIX'] + ' ' + \
|
|
|
|
env['prefix'].split(env['destdir'], 1)[1][1:])
|
2010-07-24 07:10:54 -06:00
|
|
|
|
|
|
|
conf.Define('USER_DIR', "\"" + env['userdir'] + "\"")
|
2010-07-23 17:16:28 -06:00
|
|
|
|
2010-07-08 19:26:53 -06:00
|
|
|
# After all configuration tests are done
|
|
|
|
conf.Finish()
|
|
|
|
|
2010-07-24 11:39:17 -06:00
|
|
|
env.Alias('install', env['prefix'])
|
2010-07-24 07:10:54 -06:00
|
|
|
|
2010-08-01 10:30:22 -06:00
|
|
|
dirs = [
|
2011-03-03 12:44:56 -07:00
|
|
|
'Source/Core/Core',
|
|
|
|
'Source/Core/Common',
|
|
|
|
'Source/Core/DiscIO',
|
|
|
|
'Source/Core/DolphinWX',
|
|
|
|
'Source/Plugins/Plugin_VideoOGL',
|
|
|
|
'Source/Plugins/Plugin_VideoSoftware',
|
|
|
|
'Source/Core/AudioCommon',
|
|
|
|
'Source/Core/InputCommon',
|
|
|
|
'Source/Core/VideoCommon',
|
|
|
|
'Source/DSPTool',
|
2011-03-02 21:35:03 -07:00
|
|
|
'Source/UnitTests',
|
2010-07-29 11:52:43 -06:00
|
|
|
'Externals/Bochs_disasm',
|
2011-01-05 18:11:32 -07:00
|
|
|
'Externals/CLRun',
|
2010-08-01 10:30:22 -06:00
|
|
|
'Externals/GLew',
|
|
|
|
'Externals/LZO',
|
|
|
|
'Externals/SDL',
|
|
|
|
'Externals/SOIL',
|
2011-03-02 21:35:03 -07:00
|
|
|
'Externals/SFML',
|
2011-02-14 14:25:08 -07:00
|
|
|
'Externals/libpng',
|
2011-02-08 08:30:32 -07:00
|
|
|
'Externals/wxWidgets3',
|
2010-08-01 10:30:22 -06:00
|
|
|
'Externals/zlib',
|
2010-07-29 11:52:43 -06:00
|
|
|
]
|
|
|
|
|
2010-08-01 10:30:22 -06:00
|
|
|
# Now that platform configuration is done, propagate it to modules
|
2008-08-26 15:02:23 -06:00
|
|
|
for subdir in dirs:
|
2010-07-29 11:52:43 -06:00
|
|
|
SConscript(dirs = subdir, duplicate = 0, exports = 'env',
|
|
|
|
variant_dir = env['build_dir'] + os.sep + subdir)
|
2010-08-01 10:30:22 -06:00
|
|
|
if subdir.startswith('Source/Core'):
|
2011-03-03 12:44:56 -07:00
|
|
|
env['CPPPATH'] += ['#' + subdir + os.sep + 'Src']
|
2010-02-02 14:56:29 -07:00
|
|
|
|
2010-07-24 07:10:54 -06:00
|
|
|
# Print a nice progress indication when not compiling
|
|
|
|
Progress(['-\r', '\\\r', '|\r', '/\r'], interval = 5)
|
2010-07-24 11:39:17 -06:00
|
|
|
|
2010-08-01 10:30:22 -06:00
|
|
|
# Generate help, printing current status of options
|
2010-07-24 11:39:17 -06:00
|
|
|
Help(vars.GenerateHelpText(env))
|