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
This commit is contained in:
Soren Jorvang 2010-07-17 19:43:26 +00:00
parent 11d34fa964
commit 3e383aa8eb
5 changed files with 78 additions and 25 deletions

BIN
Externals/Cg/Cg.framework/Cg vendored Executable file

Binary file not shown.

View file

@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="2.1">
<dict>
<key>CFBundleGetInfoString</key>
<string>NVIDIA Cg version 2.2.0017</string>
<key>CFBundleIdentifier</key>
<string>com.nvidia.cg</string>
<key>CFBundleName</key>
<string>NVIDIA Cg</string>
<key>CFBundleShortVersionString</key>
<string>2.2.0017</string>
<key>IFMajorVersion</key>
<integer>2</integer>
<key>IFMinorVersion</key>
<integer>2</integer>
<key>IFPkgFlagAllowBackRev</key>
<false/>
<key>IFPkgFlagAuthorizationAction</key>
<string>RootAuthorization</string>
<key>IFPkgFlagDefaultLocation</key>
<string>/</string>
<key>IFPkgFlagInstallFat</key>
<false/>
<key>IFPkgFlagIsRequired</key>
<false/>
<key>IFPkgFlagOverwritePermissions</key>
<false/>
<key>IFPkgFlagRelocatable</key>
<false/>
<key>IFPkgFlagRestartAction</key>
<string>NoRestart</string>
<key>IFPkgFlagRootVolumeOnly</key>
<true/>
<key>IFPkgFlagUpdateInstalledLanguages</key>
<false/>
<key>IFPkgFlagUseUserMask</key>
<false/>
<key>IFPkgFormatVersion</key>
<real>0.10000000149011612</real>
</dict>
</plist>

View file

@ -68,18 +68,19 @@ dirs = [
'Source/Core/DebuggerUICommon/Src',
'Source/Core/DSPCore/Src',
'Source/DSPTool/Src',
'Source/Core/InputUICommon/Src/',
'Source/Core/InputUICommon/Src',
'Source/Plugins/Plugin_VideoOGL/Src',
'Source/Plugins/Plugin_VideoSoftware/Src',
'Source/Plugins/Plugin_DSP_HLE/Src',
'Source/Plugins/Plugin_DSP_LLE/Src',
'Source/Plugins/Plugin_Wiimote/Src',
'Source/Plugins/Plugin_WiimoteNew/Src/',
'Source/Plugins/Plugin_WiimoteNew/Src',
'Source/Core/DolphinWX/Src',
'Source/Core/DebuggerWX/Src',
'Source/UnitTests/',
'Source/UnitTests',
]
builders = {}
if sys.platform == 'darwin':
from plistlib import writePlist
@ -254,7 +255,24 @@ env['HAVE_WX'] = 0
# OS X specifics
if sys.platform == 'darwin':
compileFlags.append('-mmacosx-version-min=10.5')
env['CCFLAGS'] += ['-arch', 'x86_64', '-arch', 'i386']
env['CCFLAGS'] += ['-mmacosx-version-min=10.5']
env['CC'] = "gcc-4.2"
env['CFLAGS'] += ['-x', 'objective-c']
env['CXX'] = "g++-4.2"
env['CXXFLAGS'] += ['-x', 'objective-c++']
env['FRAMEWORKS'] += ['AppKit', 'CoreFoundation', 'CoreServices']
env['FRAMEWORKS'] += ['AudioUnit', 'CoreAudio']
env['FRAMEWORKS'] += ['IOBluetooth', 'IOKit', 'OpenGL']
env['LIBS'] += ['gcc_s.10.5', 'iconv']
env['LINKFLAGS'] += ['-arch', 'x86_64', '-arch', 'i386']
# XXX env['LINKFLAGS'] += ['-mmacosx-version-min=10.5']
env['LINKFLAGS'] += ['-Z', '-L/Developer/SDKs/MacOSX10.5.sdk/usr/lib',
'-F/Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks',
'-F/Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks']
if platform.mac_ver()[0] >= '10.6.0':
env['HAVE_OPENCL'] = 1
env['LINKFLAGS'] += ['-weak_framework', 'OpenCL']
if not env['nowx']:
conf = env.Configure(custom_tests = tests)
env['HAVE_WX'] = conf.CheckWXConfig(2.9, wxmods, 0)
@ -263,23 +281,17 @@ if sys.platform == 'darwin':
# 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.
# In the 10.5 SDK, Carbon is only partially built for x86_64.
if env['CPPDEFINES'].count('WXUSINGDLL'):
if env['FRAMEWORKS'].count('AudioToolbox'):
env['FRAMEWORKS'].remove('AudioToolbox')
if env['FRAMEWORKS'].count('Carbon'):
env['FRAMEWORKS'].remove('Carbon')
if env['FRAMEWORKS'].count('QuickTime'):
env['FRAMEWORKS'].remove('QuickTime')
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['LIBS'] += ['iconv']
env['LINKFLAGS'] += ['-arch', 'x86_64', '-arch', 'i386']
env['FRAMEWORKS'] += ['AppKit', 'CoreFoundation', 'CoreServices']
env['FRAMEWORKS'] += ['IOBluetooth', 'IOKit', 'OpenGL']
env['FRAMEWORKS'] += ['AudioUnit', 'CoreAudio']
if platform.mac_ver()[0] >= '10.6.0':
env['HAVE_OPENCL'] = 1
env['LINKFLAGS'] += ['-weak_framework', 'OpenCL']
env['CPPPATH'] += ['#Externals']
env['FRAMEWORKS'] += ['Cg']
env['LINKFLAGS'] += ['-FExternals/Cg']
shared['zlib'] = 1
if not sys.platform == 'win32' and not sys.platform == 'darwin':
@ -314,13 +326,12 @@ if not sys.platform == 'win32' and not sys.platform == 'darwin':
# wxGLCanvas does not play well with wxGTK
wxmods.remove('gl')
env['HAVE_WX'] = conf.CheckWXConfig(2.8, wxmods, 0)
conf.Define('HAVE_WX', env['HAVE_WX'])
wxconfig.ParseWXConfig(env)
if not env['HAVE_WX']:
print "WX libraries not found - see config.log"
Exit(1)
conf.Define('HAVE_WX', env['HAVE_WX'])
env['HAVE_BLUEZ'] = conf.CheckPKG('bluez')
conf.Define('HAVE_BLUEZ', env['HAVE_BLUEZ'])

View file

@ -57,18 +57,18 @@ else:
if sys.platform == 'win32':
files += [ "stdafx.cpp" ]
elif sys.platform == 'darwin':
elif sys.platform == 'darwin' and not wxenv['HAVE_WX']:
files += [ 'cocoaApp.m' ]
exeGUI = env['binary_dir'] + 'Dolphin.app/Contents/MacOS/Dolphin'
exeNoGUI = env['binary_dir'] + 'DolphinNoGUI'
elif sys.platform == 'darwin' and wxenv['HAVE_WX']:
exeGUI = env['binary_dir'] + 'Dolphin.app/Contents/MacOS/Dolphin'
wxenv.Install(env['binary_dir'] + 'Dolphin.app/Contents/' +
'Library/Frameworks/Cg.framework',
'/Library/Frameworks/Cg.framework/Cg')
'#Externals/Cg/Cg.framework/Cg')
wxenv.Install(env['binary_dir'] + 'Dolphin.app/Contents/Resources/',
'#/Source/Core/DolphinWX/resources/Dolphin.icns')
'#Source/Core/DolphinWX/resources/Dolphin.icns')
wxenv.Plist(
env['binary_dir'] + 'Dolphin.app/Contents/Info.plist',

View file

@ -40,7 +40,7 @@ if gfxenv['HAVE_WX']:
'Debugger/Debugger.cpp',
]
if sys.platform == 'darwin':
if sys.platform == 'darwin' and not gfxenv['HAVE_WX']:
files += [ 'cocoaGL.m' ]
if sys.platform == 'win32':