Fix OS X Lion build:

Lion no longer includes wxWidgets 2.8, so be prepared to fall back to
Externals/wxWidgets3 even when no wx-config command is found at all.

There are a few new and deprecated symbols in the 10.7 SDK that
conflict with wxWidgets/Dolphin, so just use the 10.6 SDK for now.


git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7325 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Soren Jorvang 2011-03-10 22:06:30 +00:00
parent 83209b4afc
commit 1f42629112
2 changed files with 13 additions and 25 deletions

View File

@ -62,15 +62,10 @@ if unknown:
# Verbose compile # Verbose compile
if not env['verbose']: if not env['verbose']:
env['ARCOMSTR'] = "Archiving $TARGET" env['ARCOMSTR'] = "Archiving $TARGET"
env['ASCOMSTR'] = "Assembling $TARGET"
env['ASPPCOMSTR'] = "Assembling $TARGET"
env['CCCOMSTR'] = "Compiling $TARGET" env['CCCOMSTR'] = "Compiling $TARGET"
env['CXXCOMSTR'] = "Compiling $TARGET" env['CXXCOMSTR'] = "Compiling $TARGET"
env['LINKCOMSTR'] = "Linking $TARGET" env['LINKCOMSTR'] = "Linking $TARGET"
env['RANLIBCOMSTR'] = "Indexing $TARGET" env['RANLIBCOMSTR'] = "Indexing $TARGET"
env['SHCCCOMSTR'] = "Compiling $TARGET"
env['SHCXXCOMSTR'] = "Compiling $TARGET"
env['SHLINKCOMSTR'] = "Linking $TARGET"
env['TARCOMSTR'] = "Creating $TARGET" env['TARCOMSTR'] = "Creating $TARGET"
if not env['flavor'] == 'debug': if not env['flavor'] == 'debug':
@ -84,10 +79,6 @@ env['CCFLAGS'] += ['-fno-exceptions', '-fno-strict-aliasing']
if env['lint']: if env['lint']:
env['CCFLAGS'] += ['-Werror'] env['CCFLAGS'] += ['-Werror']
env['CCFLAGS'] += ['-Wall', '-Wextra', '-Wshadow', '-Wno-unused-parameter'] env['CCFLAGS'] += ['-Wall', '-Wextra', '-Wshadow', '-Wno-unused-parameter']
if env['CCVERSION'] < '4.2.0':
env['CCFLAGS'] += ['-Wno-pragmas']
if env['CCVERSION'] >= '4.3.0':
env['CCFLAGS'] += ['-Wno-array-bounds', '-Wno-unused-result']
env['CPPDEFINES'] = [] env['CPPDEFINES'] = []
if env['flavor'] == 'debug': if env['flavor'] == 'debug':
@ -118,27 +109,20 @@ if sys.platform == 'darwin':
#ccld += ['-arch', 'i386', '-msse3'] #ccld += ['-arch', 'i386', '-msse3']
ccld = ['-arch', 'x86_64', '-arch', 'i386', '-mmacosx-version-min=10.5.4'] ccld = ['-arch', 'x86_64', '-arch', 'i386', '-mmacosx-version-min=10.5.4']
env['CCFLAGS'] += ccld env['CCFLAGS'] += ccld
env['CCFLAGS'] += ['-isysroot', '/Developer/SDKs/MacOSX10.6.sdk']
env['CCFLAGS'] += ['-Xarch_i386', '-msse3', '-Xarch_x86_64', '-mssse3'] env['CCFLAGS'] += ['-Xarch_i386', '-msse3', '-Xarch_x86_64', '-mssse3']
env['CCFLAGS'] += ['-march=core2', '-mdynamic-no-pic'] env['CCFLAGS'] += ['-march=core2', '-mdynamic-no-pic']
env['CCFLAGS'] += ['-Wextra-tokens', '-Wnewline-eof'] env['CCFLAGS'] += ['-Wextra-tokens', '-Wnewline-eof']
env['CC'] = '/Developer/usr/bin/clang' env['CC'] = '/Developer/usr/bin/clang'
env['CC'] = '/Developer/usr/bin/llvm-gcc'
env['CXX'] = '/Developer/usr/bin/clang++' env['CXX'] = '/Developer/usr/bin/clang++'
env['CXX'] = '/Developer/usr/bin/llvm-g++' env['CXX'] = '/Developer/usr/bin/llvm-g++'
env['CXXFLAGS'] += ['-x', 'objective-c++'] env['CXXFLAGS'] += ['-x', 'objective-c++']
env['LINKFLAGS'] += ccld env['LINKFLAGS'] += ccld
env['LINKFLAGS'] += ['-Wl,-dead_strip,-dead_strip_dylibs'] env['LINKFLAGS'] += ['-Wl,-dead_strip,-dead_strip_dylibs']
env['LINKFLAGS'] += ['-Wl,-pagezero_size,0x1000'] env['LINKFLAGS'] += ['-Wl,-pagezero_size,0x1000']
#env['LINKFLAGS'] += ['-Wl,-read_only_relocs,suppress'] env['LINKFLAGS'] += ['-Wl,-syslibroot', '/Developer/SDKs/MacOSX10.6.sdk']
env['LINKFLAGS'] += ['-Xarch_i386', '-Wl,-read_only_relocs,suppress']
#if float(os.popen('xcode-select -version').read()[21:]) < 2000:
# print 'Xcode 4 running on Snow Leopard is required to build Dolphin'
# print 'It is available from http://developer.apple.com/devcenter/mac/'
# Exit(1)
if env['ENV'].has_key('CC'):
env['CC'] = env['ENV']['CC']
if env['ENV'].has_key('CXX'):
env['CXX'] = env['ENV']['CXX']
if env['nowx']: if env['nowx']:
env['HAVE_WX'] = 0 env['HAVE_WX'] = 0
@ -152,8 +136,9 @@ if sys.platform == 'darwin':
env['flavor'] == 'debug') env['flavor'] == 'debug')
conf.Finish() conf.Finish()
if not env['HAVE_WX']: if not env['HAVE_WX']:
print '\nWARNING:' print '\nWARNING:\n' + 'wxWidgets 2.9.2 not found',
print 'wxWidgets 2.9.2 not found using ' + wxenv['wxconfig'] if wxenv.has_key('wxconfig'):
print 'using ' + wxenv['wxconfig']
print '\nwxWidgets r66814 or newer is required to build Dolphin.' print '\nwxWidgets r66814 or newer is required to build Dolphin.'
print 'See http://code.google.com/p/dolphin-emu/wiki/MacOSX_Build' print 'See http://code.google.com/p/dolphin-emu/wiki/MacOSX_Build'
print 'for instructions on building and installing wxWidgets.\n' print 'for instructions on building and installing wxWidgets.\n'
@ -176,9 +161,13 @@ elif sys.platform == 'win32':
else: else:
env['CCFLAGS'] += ['-msse2', '-pthread'] env['CCFLAGS'] += ['-msse2', '-pthread']
if env['CCVERSION'] < '4.2.0':
env['CCFLAGS'] += ['-Wno-pragmas']
if env['CCVERSION'] >= '4.2.0': if env['CCVERSION'] >= '4.2.0':
env['CCFLAGS'] += ['-fvisibility=hidden'] env['CCFLAGS'] += ['-fvisibility=hidden']
env['CXXFLAGS'] += ['-fvisibility-inlines-hidden'] env['CXXFLAGS'] += ['-fvisibility-inlines-hidden']
if env['CCVERSION'] >= '4.3.0':
env['CCFLAGS'] += ['-Wno-array-bounds', '-Wno-unused-result']
env['CPPDEFINES'] += ['HAVE_CONFIG_H'] env['CPPDEFINES'] += ['HAVE_CONFIG_H']
env['CPPPATH'].insert(0, '#') # Make sure we pick up our own config.h env['CPPPATH'].insert(0, '#') # Make sure we pick up our own config.h
env['LINKFLAGS'] += ['-pthread'] env['LINKFLAGS'] += ['-pthread']

View File

@ -126,6 +126,8 @@ elif sys.platform == 'darwin':
CFBundleTypeRole = 'Viewer')] CFBundleTypeRole = 'Viewer')]
))) )))
env.Command('dummy', '#' + env['prefix'],
"find $SOURCES -name .svn -exec rm -rf {} +")
else: else:
files += ['Src/X11Utils.cpp'] files += ['Src/X11Utils.cpp']
exe = env['binary_dir'] + '/dolphin-emu' exe = env['binary_dir'] + '/dolphin-emu'
@ -134,7 +136,4 @@ else:
env.InstallAs(env['data_dir'] + '/sys', '#Data/Sys') env.InstallAs(env['data_dir'] + '/sys', '#Data/Sys')
env.InstallAs(env['data_dir'] + '/user', '#Data/User') env.InstallAs(env['data_dir'] + '/user', '#Data/User')
env.Command('dummy', '#' + env['prefix'],
"find $SOURCES -name .svn -exec rm -rf {} +")
env.Program(exe, files) env.Program(exe, files)