some more scons cleanup

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1414 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
nakeee 2008-12-06 22:28:32 +00:00
parent 5a3ee9d7af
commit 5f11ae5dbd
3 changed files with 42 additions and 23 deletions

View File

@ -192,6 +192,9 @@ env['HAVE_AO'] = conf.CheckPKG('ao')
env['HAVE_WX'] = conf.CheckWXConfig('2.8', ['gl', 'adv', 'core', 'base'], env['HAVE_WX'] = conf.CheckWXConfig('2.8', ['gl', 'adv', 'core', 'base'],
env['debug']) env['debug'])
# X11 detection
env['HAVE_X11'] = conf.CheckPKG('x11')
#osx 64 specifics #osx 64 specifics
if env['osx64']: if env['osx64']:
# SDL and WX are broken on osx 64 # SDL and WX are broken on osx 64
@ -208,6 +211,7 @@ conf.Define('HAVE_SDL', env['HAVE_SDL'])
conf.Define('HAVE_BLUEZ', env['HAVE_BLUEZ']) conf.Define('HAVE_BLUEZ', env['HAVE_BLUEZ'])
conf.Define('HAVE_AO', env['HAVE_AO']) conf.Define('HAVE_AO', env['HAVE_AO'])
conf.Define('HAVE_WX', env['HAVE_WX']) conf.Define('HAVE_WX', env['HAVE_WX'])
conf.Define('HAVE_X11', env['HAVE_X11'])
# After all configuration tests are done # After all configuration tests are done
conf.Finish() conf.Finish()
@ -229,6 +233,9 @@ if env['HAVE_AO']:
if env['HAVE_BLUEZ']: if env['HAVE_BLUEZ']:
env.ParseConfig('pkg-config --cflags --libs bluez') env.ParseConfig('pkg-config --cflags --libs bluez')
if env['HAVE_X11']:
env.ParseConfig("pkg-config x11 --cflags --libs")
# add methods from utils to env # add methods from utils to env
env.AddMethod(utils.filterWarnings) env.AddMethod(utils.filterWarnings)

View File

@ -5,6 +5,10 @@ import sys
name = "Plugin_PadSimple" name = "Plugin_PadSimple"
if not env['HAVE_X11']:
print name + " must have X11 to be build"
Return()
files = [ files = [
"PadSimple.cpp", "PadSimple.cpp",
] ]

View File

@ -66,7 +66,28 @@ if gfxenv['osx64']:
'x86_64' 'x86_64'
] ]
useSDL = gfxenv['HAVE_SDL']
tests = {'CheckPKG' : utils.CheckPKG}
conf = gfxenv.Configure(custom_tests = tests)
if not conf.CheckPKG('gl'):
print name + " must have opengl to be build"
Return()
# check for xxf86vm
gfxenv['HAVE_XXF86VM'] = conf.CheckPKG('xxf86vm')
gfxenv = conf.Finish()
if gfxenv['HAVE_XXF86VM']:
gfxenv.ParseConfig("pkg-config xxf86vm --cflags --libs")
gfxenv.ParseConfig("pkg-config gl --cflags --libs")
if sys.platform == 'darwin': if sys.platform == 'darwin':
@ -76,33 +97,20 @@ if sys.platform == 'darwin':
# Use frameworks instead of plain libs, when possible. # Use frameworks instead of plain libs, when possible.
linkFlags += [ linkFlags += [
'-Wl,-framework,%s' % framework '-Wl,-framework,%s' % framework
for framework in [ 'OpenGL', 'Cg' ] for framework in [ 'Cg' ]
] ]
else: else:
# By default, GLX is used on Linux to setup OpenGL, but you can select SDL
# TODO: build both sdl and non X
useSDL = False
# instead if you like, by changing the line below.
tests = {'CheckPKG' : utils.CheckPKG}
conf = gfxenv.Configure(custom_tests = tests)
if not conf.CheckPKG('x11'):
Exit(1)
if not conf.CheckPKG('xxf86vm'):
Exit(1)
gfxenv = conf.Finish()
gfxenv.ParseConfig("pkg-config x11 --cflags --libs")
gfxenv.ParseConfig("pkg-config xxf86vm --cflags --libs")
# Libraries without pkg-config support. # Libraries without pkg-config support.
libs += [ 'GL', 'Cg', 'CgGL' ] libs += [ 'Cg', 'CgGL' ]
# change to True if you want to compile with SDL
useSDL = not (gfxenv['HAVE_X11'] and gfxenv['HAVE_XXF86VM'])
if useSDL and not gfxenv['HAVE_SDL']:
print name + " must have either X11 or sdl to be build"
Return()
if useSDL: if useSDL:
compileFlags += [ '-DUSE_SDL=1' ] compileFlags += [ '-DUSE_SDL=1' ]