1
0
Fork 0
mirror of https://github.com/dolphin-emu/dolphin.git synced 2025-03-06 21:00:21 +01:00

Always build a universal binary on OS X. This requires wxWidgets >= 2.9.

Enable -Werror (OS X only so far - please test and enable on other platforms).
Clean up library handling a bit.


git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5504 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Soren Jorvang 2010-05-26 21:31:50 +00:00
parent 5f9cdad7cd
commit 774035d715
3 changed files with 31 additions and 64 deletions

View file

@ -41,6 +41,6 @@ libs = [
'm', 'm',
] ]
env_wiiuse.StaticLibrary(env['libs_dir']+"wiiuse", files, LIBS=libs) env_wiiuse.StaticLibrary(env['local_libs'] + "wiiuse", files, LIBS=libs)
env['HAVE_WIIUSE'] = 1 env['HAVE_WIIUSE'] = 1

View file

@ -25,14 +25,11 @@ warnings = [
'pointer-arith', 'pointer-arith',
'packed', 'packed',
'no-conversion', 'no-conversion',
# 'no-unused-result', (need a newer gcc for this?)
] ]
compileFlags = [ compileFlags = [
'-fno-exceptions', '-fno-exceptions',
'-fno-strict-aliasing', '-fno-strict-aliasing',
'-msse2', '-msse2',
# '-fomit-frame-pointer',
# '-flto',
] ]
cppDefines = [ cppDefines = [
@ -125,10 +122,6 @@ vars.AddVariables(
allowed_values = ('release', 'devel', 'debug', 'fastlog', 'prof'), allowed_values = ('release', 'devel', 'debug', 'fastlog', 'prof'),
ignorecase = 2 ignorecase = 2
), ),
EnumVariable('osx', 'Choose a backend (WIP)', '32cocoa',
allowed_values = ('32x11', '32cocoa', '64cocoa', 'universal'),
ignorecase = 2
),
PathVariable('wxconfig', 'Path to the wxconfig', None), PathVariable('wxconfig', 'Path to the wxconfig', None),
EnumVariable('pgo', 'Profile-Guided Optimization (generate or use)', 'none', EnumVariable('pgo', 'Profile-Guided Optimization (generate or use)', 'none',
allowed_values = ('none', 'generate', 'use'), allowed_values = ('none', 'generate', 'use'),
@ -207,9 +200,11 @@ elif (flavour == 'prof'):
elif (flavour == 'release'): elif (flavour == 'release'):
compileFlags.append('-O3') compileFlags.append('-O3')
compileFlags.append('-fomit-frame-pointer'); compileFlags.append('-fomit-frame-pointer');
# XXX please test -Werror builds on Linux and Windows and remove this condition
if sys.platform == 'darwin':
warnings.append('error')
# more warnings # more warnings
if env['lint']: if env['lint']:
warnings.append('error')
warnings.append('unreachable-code') warnings.append('unreachable-code')
warnings.append('float-equal') warnings.append('float-equal')
@ -245,8 +240,8 @@ tests = {'CheckWXConfig' : wxconfig.CheckWXConfig,
#object files #object files
env['build_dir'] = os.path.join(basedir, 'Build', platform.system() + '-' + platform.machine() + '-' + env['flavor'] + os.sep) env['build_dir'] = os.path.join(basedir, 'Build', platform.system() + '-' + platform.machine() + '-' + env['flavor'] + os.sep)
# Static libs go here
VariantDir(env['build_dir'], '.', duplicate=0) env['local_libs'] = env['build_dir'] + os.sep + 'libs' + os.sep
# Where do we run from # Where do we run from
env['base_dir'] = os.getcwd()+ '/' env['base_dir'] = os.getcwd()+ '/'
@ -262,28 +257,18 @@ elif flavour == 'prof':
if (env['install'] == 'global'): if (env['install'] == 'global'):
env['prefix'] = os.path.join(env['prefix'] + os.sep) env['prefix'] = os.path.join(env['prefix'] + os.sep)
env['binary_dir'] = env['prefix'] + 'bin/' env['binary_dir'] = env['prefix'] + 'bin/'
env['libs_dir'] = env['prefix'] + 'lib/'
env['plugin_dir'] = env['prefix'] + 'lib/dolphin-emu/' env['plugin_dir'] = env['prefix'] + 'lib/dolphin-emu/'
env['data_dir'] = env['prefix'] + "share/dolphin-emu/" env['data_dir'] = env['prefix'] + "share/dolphin-emu/"
else: else:
env['prefix'] = os.path.join(env['base_dir'] + 'Binary', platform.system() + '-' + platform.machine() + extra + os.sep) env['prefix'] = os.path.join(env['base_dir'] + 'Binary', platform.system() + '-' + platform.machine() + extra + os.sep)
env['binary_dir'] = env['prefix'] env['binary_dir'] = env['prefix']
if sys.platform == 'darwin': env['plugin_dir'] = env['prefix'] + 'plugins/'
env['plugin_dir'] = env['prefix'] + 'Dolphin.app/Contents/PlugIns/' env['data_dir'] = env['prefix']
env['data_dir'] = env['prefix'] + 'Dolphin.app/Contents/' if sys.platform == 'darwin':
env['libs_dir'] = env['prefix'] + 'Libs/' env['plugin_dir'] = env['prefix'] + 'Dolphin.app/Contents/PlugIns/'
else: env['data_dir'] = env['prefix'] + 'Dolphin.app/Contents/'
env['plugin_dir'] = env['prefix'] + 'plugins/'
env['data_dir'] = env['prefix']
env['libs_dir'] = env['prefix'] + 'lib/'
env['RPATH'].append(env['libs_dir']) env['LIBPATH'].append(env['local_libs'])
# 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'])
conf = env.Configure(custom_tests = tests, conf = env.Configure(custom_tests = tests,
config_h="Source/Core/Common/Src/Config.h") config_h="Source/Core/Common/Src/Config.h")
@ -360,23 +345,18 @@ if not env['SHARED_SFML']:
env['CPPPATH'] += [ basedir + 'Externals/SFML/include' ] env['CPPPATH'] += [ basedir + 'Externals/SFML/include' ]
dirs += ['Externals/SFML/src'] dirs += ['Externals/SFML/src']
#osx 64 specifics #osx specifics
if sys.platform == 'darwin': if sys.platform == 'darwin':
compileFlags.append('-mmacosx-version-min=10.5')
env['HAVE_COCOA'] = 1
env['HAVE_XRANDR'] = 0 env['HAVE_XRANDR'] = 0
if env['osx'] == '64cocoa': env['HAVE_X11'] = 0
compileFlags += ['-arch' , 'x86_64', '-m64' ] env['CC'] = "gcc-4.2"
env['LINKFLAGS'] += ['-arch' , 'x86_64', '-m64' ] env['CXX'] = "g++-4.2"
conf.Define('MAP_32BIT', 0) env['CFLAGS'] += ['-arch' , 'x86_64' , '-arch' , 'i386']
if env['osx'] == '32cocoa': env['CXXFLAGS'] += ['-arch' , 'x86_64' , '-arch' , 'i386']
compileFlags += ['-arch' , 'i386', '-m32' ] env['LINKFLAGS'] += ['-arch' , 'x86_64' , '-arch' , 'i386']
env['LINKFLAGS'] += ['-arch' , 'i386', '-m32' ] conf.Define('MAP_32BIT', 0)
if env['osx'] == 'universal':
compileFlags += ['-arch i386', '-arch x86_64']
env['LINKFLAGS'] += ['-arch i386', '-arch x86_64']
if not env['osx'] == '32x11':
env['HAVE_X11'] = 0
env['HAVE_COCOA'] = 1
else: else:
env['HAVE_X11'] = conf.CheckPKG('x11') env['HAVE_X11'] = conf.CheckPKG('x11')
env['HAVE_XRANDR'] = env['HAVE_X11'] and conf.CheckPKG('xrandr') env['HAVE_XRANDR'] = env['HAVE_X11'] and conf.CheckPKG('xrandr')
@ -398,7 +378,11 @@ if sys.platform == 'win32':
if env['nowx']: if env['nowx']:
env['HAVE_WX'] = 0; env['HAVE_WX'] = 0;
else: else:
env['HAVE_WX'] = conf.CheckWXConfig('2.8', wxmods, 0) if sys.platform == 'darwin':
# 2.9 is needed for 64-bit support on OS X
env['HAVE_WX'] = conf.CheckWXConfig('2.9', wxmods, 0)
else:
env['HAVE_WX'] = conf.CheckWXConfig('2.8', wxmods, 0)
# check for libgtk2.0 # check for libgtk2.0
env['HAVE_GTK2'] = 0 env['HAVE_GTK2'] = 0
@ -434,7 +418,6 @@ conf.Define('SHARED_SFML', env['SHARED_SFML'])
conf.Define('USER_DIR', "\"" + env['userdir'] + "\"") conf.Define('USER_DIR', "\"" + env['userdir'] + "\"")
if (env['install'] == 'global'): if (env['install'] == 'global'):
conf.Define('DATA_DIR', "\"" + env['data_dir'] + "\"") conf.Define('DATA_DIR', "\"" + env['data_dir'] + "\"")
conf.Define('LIBS_DIR', "\"" + env['libs_dir'] + "\"")
# lua # lua
env['LUA_USE_MACOSX'] = 0 env['LUA_USE_MACOSX'] = 0
@ -466,19 +449,6 @@ conf.Finish()
#wx windows flags #wx windows flags
if env['HAVE_WX']: if env['HAVE_WX']:
wxconfig.ParseWXConfig(env) wxconfig.ParseWXConfig(env)
#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'])
]
else: else:
print "WX not found or disabled, not building GUI" print "WX not found or disabled, not building GUI"
@ -498,7 +468,6 @@ if env.has_key('destdir'):
env['prefix'] = env['destdir'] + env['prefix'] env['prefix'] = env['destdir'] + env['prefix']
env['plugin_dir'] = env['destdir'] + env['plugin_dir'] env['plugin_dir'] = env['destdir'] + env['plugin_dir']
env['binary_dir'] = env['destdir'] + env['binary_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'] env['data_dir'] = env['destdir'] + env['data_dir']
# die on unknown variables # die on unknown variables
@ -538,8 +507,5 @@ if env['bundle']:
tar_env.Append(TARFLAGS='-j', tar_env.Append(TARFLAGS='-j',
TARCOMSTR="Creating release tarball") TARCOMSTR="Creating release tarball")
#TODO clean all bundles #TODO clean all bundles
#env.Clean(all, 'dolphin-*'+ '.tar.bz2') #env.Clean(all, 'dolphin-*' + '.tar.bz2', 'Binary/Dolphin-r*' + '.dmg')

View file

@ -30,7 +30,7 @@ fix_shared_object_depends() {
done done
done done
# wxw shoves all the paths into one stringso the looping is really just for dealing with wxw crap # wxw shoves all the paths into one string, so the looping is really just for dealing with wxw crap
orig_paths=(`otool -L $temp_dir/Dolphin.app/Contents/MacOS/Dolphin | grep ${search_string} | awk '{print $1}'`) orig_paths=(`otool -L $temp_dir/Dolphin.app/Contents/MacOS/Dolphin | grep ${search_string} | awk '{print $1}'`)
for orig_path in ${orig_paths[@]}; do for orig_path in ${orig_paths[@]}; do
@ -51,6 +51,7 @@ cp -r Darwin-i386/Dolphin.app $temp_dir
fix_shared_object_depends libwx fix_shared_object_depends libwx
fix_shared_object_depends libSDL fix_shared_object_depends libSDL
fix_shared_object_depends libGLEW fix_shared_object_depends libGLEW
fix_shared_object_depends libz
mkdir -p $temp_dir/Dolphin.app/Contents/Library/Frameworks/Cg.framework mkdir -p $temp_dir/Dolphin.app/Contents/Library/Frameworks/Cg.framework
cp /Library/Frameworks/Cg.framework/Cg $temp_dir/Dolphin.app/Contents/Library/Frameworks/Cg.framework/Cg cp /Library/Frameworks/Cg.framework/Cg $temp_dir/Dolphin.app/Contents/Library/Frameworks/Cg.framework/Cg
@ -59,4 +60,4 @@ find $temp_dir -name .svn -exec rm -fr {} \; 2>/dev/null
rm $temp_dir.dmg 2>/dev/null rm $temp_dir.dmg 2>/dev/null
echo "Creating dmg" echo "Creating dmg"
hdiutil create -srcfolder $temp_dir -format UDBZ $temp_dir.dmg hdiutil create -srcfolder $temp_dir -format UDBZ $temp_dir.dmg
rm -rf $temp_dir rm -rf $temp_dir