2009-01-15 06:48:15 +00:00
|
|
|
# -*- python -*-
|
2008-09-21 19:54:29 +00:00
|
|
|
|
2008-09-07 20:26:38 +00:00
|
|
|
Import('env')
|
2010-05-31 16:18:40 +00:00
|
|
|
import os
|
2008-09-07 20:26:38 +00:00
|
|
|
import sys
|
2010-08-01 16:30:22 +00:00
|
|
|
from SconsTests import utils
|
2008-09-07 20:26:38 +00:00
|
|
|
|
2011-01-30 01:58:54 +00:00
|
|
|
files = ['BootManager.cpp']
|
2011-02-04 00:46:56 +00:00
|
|
|
frameworksflags = []
|
2011-01-31 03:58:18 +00:00
|
|
|
|
2011-01-30 01:58:54 +00:00
|
|
|
if not env['HAVE_WX']:
|
|
|
|
files += ['MainNoGUI.cpp']
|
|
|
|
else:
|
2011-02-04 00:46:56 +00:00
|
|
|
files += [
|
2008-10-31 05:40:52 +00:00
|
|
|
'AboutDolphin.cpp',
|
2008-12-17 04:14:24 +00:00
|
|
|
'ARCodeAddEdit.cpp',
|
2010-07-22 01:48:48 +00:00
|
|
|
'GeckoCodeDiag.cpp',
|
2008-11-01 17:07:35 +00:00
|
|
|
'ConfigMain.cpp',
|
|
|
|
'Frame.cpp',
|
2009-09-01 15:16:44 +00:00
|
|
|
'FrameAui.cpp',
|
2009-01-04 21:53:41 +00:00
|
|
|
'FrameTools.cpp',
|
2009-09-01 15:16:44 +00:00
|
|
|
'LogWindow.cpp',
|
2008-11-01 17:07:35 +00:00
|
|
|
'GameListCtrl.cpp',
|
2010-04-12 01:33:10 +00:00
|
|
|
'HotkeyDlg.cpp',
|
2010-10-12 19:42:29 +00:00
|
|
|
'InputConfigDiag.cpp',
|
|
|
|
'InputConfigDiagBitmaps.cpp',
|
2008-11-01 17:07:35 +00:00
|
|
|
'ISOFile.cpp',
|
2008-11-11 19:09:52 +00:00
|
|
|
'ISOProperties.cpp',
|
2008-12-17 04:14:24 +00:00
|
|
|
'PatchAddEdit.cpp',
|
2011-02-03 19:55:30 +00:00
|
|
|
'PHackSettings.cpp',
|
2008-11-30 11:13:14 +00:00
|
|
|
'CheatsWindow.cpp',
|
2011-02-04 00:46:56 +00:00
|
|
|
'Main.cpp',
|
2010-10-30 10:54:41 +00:00
|
|
|
'MemcardManager.cpp',
|
|
|
|
'MemoryCards/GCMemcard.cpp',
|
2010-01-05 08:07:06 +00:00
|
|
|
'MemoryCards/WiiSaveCrypted.cpp',
|
2010-05-01 19:10:35 +00:00
|
|
|
'NetPlay.cpp',
|
2010-05-05 04:31:21 +00:00
|
|
|
'NetPlayClient.cpp',
|
|
|
|
'NetPlayServer.cpp',
|
2010-02-21 20:09:49 +00:00
|
|
|
'NetWindow.cpp',
|
2010-11-14 13:34:41 +00:00
|
|
|
'UDPConfigDiag.cpp',
|
2010-10-12 19:42:29 +00:00
|
|
|
'WiimoteConfigDiag.cpp',
|
2011-01-15 14:36:32 +00:00
|
|
|
'WXInputBase.cpp',
|
2010-10-30 10:54:41 +00:00
|
|
|
'WxUtils.cpp',
|
2008-10-20 17:32:15 +00:00
|
|
|
]
|
|
|
|
|
2010-06-14 18:07:29 +00:00
|
|
|
if sys.platform == 'win32':
|
2011-02-04 00:46:56 +00:00
|
|
|
files += ["stdafx.cpp"]
|
2011-01-15 10:33:07 +00:00
|
|
|
elif sys.platform == 'darwin':
|
2011-02-05 16:06:05 +00:00
|
|
|
env['CPPPATH'] += ['#Externals']
|
|
|
|
env['FRAMEWORKPATH'] += ['Externals/Cg']
|
|
|
|
frameworksflags += ['-Wl,-weak_framework,Cg']
|
|
|
|
frameworksflags += ['-Wl,-weak_framework,OpenCL']
|
2011-01-29 08:11:49 +00:00
|
|
|
|
2011-01-15 10:33:07 +00:00
|
|
|
exe = '#' + env['prefix'] + '/Dolphin.app/Contents/MacOS/Dolphin'
|
2010-11-14 03:10:11 +00:00
|
|
|
|
2011-01-16 17:00:17 +00:00
|
|
|
if env['HAVE_WX']:
|
2011-02-04 00:46:56 +00:00
|
|
|
env['LIBS'] += env['wxconfiglibs']
|
2011-02-08 11:02:34 +00:00
|
|
|
frameworksflags += ['-Wl,-weak_framework,AudioToolbox']
|
|
|
|
frameworksflags += ['-Wl,-weak_framework,Carbon']
|
|
|
|
frameworksflags += ['-Wl,-weak_framework,QuickTime']
|
|
|
|
frameworksflags += ['-Wl,-weak_framework,WebKit']
|
|
|
|
frameworksflags += ['-Wl,-no_arch_warnings']
|
2011-01-16 17:00:17 +00:00
|
|
|
else:
|
2011-02-04 00:46:56 +00:00
|
|
|
env['LIBS'] += ['iconv']
|
2011-01-16 17:00:17 +00:00
|
|
|
exe += 'NoGUI'
|
|
|
|
|
2010-07-24 17:39:17 +00:00
|
|
|
env.Install('#' + env['prefix'] + '/Dolphin.app/Contents/' +
|
2011-01-24 00:26:39 +00:00
|
|
|
'Frameworks/Cg.framework', source = [
|
2011-01-11 04:09:11 +00:00
|
|
|
'#Externals/Cg/Cg.framework/Cg',
|
|
|
|
'#Externals/Cg/Cg.framework/Resources'
|
|
|
|
])
|
2010-06-26 13:29:44 +00:00
|
|
|
|
2010-08-01 16:30:22 +00:00
|
|
|
env.Install(env['data_dir'], '#Data/Sys')
|
|
|
|
env.Install(env['data_dir'], '#Data/User')
|
2010-07-24 10:24:16 +00:00
|
|
|
env.Install(env['data_dir'],
|
Maintaining Leopard binary compatibility turns out be a a bit cumbersome.
For a typical OS X app, one only needs to specify the SDK version and the
target OS version range.
Because we use OpenCL which is new in 10.6, however, we must be somewhat
more verbose in order to make use of the forward compatibility facilities.
Unfortunately, the critical bit that is required to have binaries built
on 10.6 work on 10.5, namely disabling the new compact __LINKEDIT format,
causes stack alignment crashes at emulation time on 10.6, so for now
Leopard users still have to build Dolphin themselves.
Hopefully, this stack alignment problem will turn out to be coincident
with lingering alignment issues.
Include the OS X version of the Cg framework in Externals as with the
Windows one. The header files appear to be the same in the Windows and the
OS X builds of the February 2.2 Cg toolkit, although they are differently
munged by what appears to be some automatic process, so no new duplicates.
Any upgrades to the Cg libraries will of course need to be done in sync.
I do hope that Sonicadvance1's GLSL work will enable us to get rid of Cg.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5893 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-07-17 19:43:26 +00:00
|
|
|
'#Source/Core/DolphinWX/resources/Dolphin.icns')
|
2010-07-09 01:26:53 +00:00
|
|
|
|
2011-02-01 02:22:15 +00:00
|
|
|
languages = []
|
2011-01-10 19:26:36 +00:00
|
|
|
msgfmt = env.WhereIs('msgfmt')
|
|
|
|
if not msgfmt == None:
|
2011-01-11 04:09:11 +00:00
|
|
|
po_files = Glob('#Languages/*.po', strings = True)
|
2011-01-10 19:26:36 +00:00
|
|
|
for po in po_files:
|
|
|
|
index_lo = po.find('Languages/') + len('Languages/')
|
|
|
|
index_hi = po.find('.po')
|
2011-02-01 02:22:15 +00:00
|
|
|
lang = po[index_lo:index_hi]
|
|
|
|
lproj = os.sep + lang + '.lproj'
|
2011-01-11 00:07:22 +00:00
|
|
|
mo_dir = env['build_dir'] + '/Languages' + lproj
|
2011-01-10 19:26:36 +00:00
|
|
|
mo_file = mo_dir + '/dolphin-emu.mo'
|
|
|
|
env.Command('#' + mo_file, po, 'mkdir -p ' + mo_dir +
|
2011-01-11 00:07:22 +00:00
|
|
|
' && ' + msgfmt + ' -o ' + mo_file + ' ' + po)
|
|
|
|
env.Install(env['data_dir'] + lproj, '#' + mo_file)
|
2011-02-01 02:22:15 +00:00
|
|
|
languages += [lang]
|
2011-01-05 16:33:44 +00:00
|
|
|
|
2010-07-24 10:24:16 +00:00
|
|
|
from plistlib import writePlist
|
|
|
|
def createPlist(target, source, env):
|
|
|
|
for srcNode in source:
|
|
|
|
writePlist(srcNode.value, str(target[0]))
|
|
|
|
env.Append(BUILDERS = {'Plist' : Builder(action = createPlist)})
|
2010-07-24 17:39:17 +00:00
|
|
|
env.Plist('#' + env['prefix'] + '/Dolphin.app/Contents/Info.plist',
|
2010-07-24 13:10:54 +00:00
|
|
|
Value(dict(
|
2010-07-24 10:24:16 +00:00
|
|
|
CFBundleExecutable = 'Dolphin',
|
|
|
|
CFBundleIconFile = 'Dolphin.icns',
|
2011-01-29 14:06:48 +00:00
|
|
|
CFBundleIdentifier = 'com.dolphin-emulator.dolphin',
|
2011-02-01 02:22:15 +00:00
|
|
|
CFBundleLocalizations = languages,
|
2010-07-24 10:24:16 +00:00
|
|
|
CFBundlePackageType = 'APPL',
|
|
|
|
CFBundleShortVersionString =
|
2010-08-01 16:30:22 +00:00
|
|
|
utils.GenerateRevFile('', Dir('#None').abspath, None),
|
2010-12-05 16:18:09 +00:00
|
|
|
CFBundleVersion = '3.0',
|
|
|
|
LSMinimumSystemVersion = '10.5.4',
|
2010-07-24 10:24:16 +00:00
|
|
|
LSRequiresCarbon = True,
|
2011-01-20 03:26:51 +00:00
|
|
|
CFBundleDocumentTypes = [
|
|
|
|
dict(CFBundleTypeExtensions =
|
|
|
|
('ciso', 'dol', 'elf', 'gcm', 'gcz', 'iso', 'wad'),
|
|
|
|
CFBundleTypeIconFile = 'Dolphin.icns',
|
|
|
|
CFBundleTypeName = 'Nintendo GC/Wii file',
|
|
|
|
CFBundleTypeRole = 'Viewer')]
|
2010-07-24 10:24:16 +00:00
|
|
|
)))
|
2011-01-11 04:09:11 +00:00
|
|
|
|
2008-09-07 20:26:38 +00:00
|
|
|
else:
|
2011-02-04 00:46:56 +00:00
|
|
|
files += ['X11Utils.cpp']
|
|
|
|
exe = env['binary_dir'] + '/dolphin-emu'
|
|
|
|
if not env['HAVE_WX']:
|
|
|
|
exe += '-nogui'
|
2010-11-13 19:53:24 +00:00
|
|
|
env.InstallAs(env['data_dir'] + '/sys', '#Data/Sys')
|
|
|
|
env.InstallAs(env['data_dir'] + '/user', '#Data/User')
|
2008-09-07 20:26:38 +00:00
|
|
|
|
2011-02-04 00:46:56 +00:00
|
|
|
env.Command('dummy', '#' + env['prefix'],
|
|
|
|
"find $SOURCES -name .svn -exec rm -rf {} +")
|
2011-01-09 14:09:27 +00:00
|
|
|
|
2011-02-04 00:46:56 +00:00
|
|
|
env.Program(exe, files, FRAMEWORKSFLAGS = frameworksflags)
|