From 5f11ae5dbd97bf478994011f6bd14ae2521a1cc9 Mon Sep 17 00:00:00 2001 From: nakeee Date: Sat, 6 Dec 2008 22:28:32 +0000 Subject: [PATCH] some more scons cleanup git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1414 8ced0084-cf51-0410-be5f-012b33b47a6e --- SConstruct | 7 +++ .../Plugins/Plugin_PadSimple/Src/SConscript | 4 ++ Source/Plugins/Plugin_VideoOGL/Src/SConscript | 54 +++++++++++-------- 3 files changed, 42 insertions(+), 23 deletions(-) diff --git a/SConstruct b/SConstruct index 62b829608a..8115f3dd26 100644 --- a/SConstruct +++ b/SConstruct @@ -192,6 +192,9 @@ env['HAVE_AO'] = conf.CheckPKG('ao') env['HAVE_WX'] = conf.CheckWXConfig('2.8', ['gl', 'adv', 'core', 'base'], env['debug']) +# X11 detection +env['HAVE_X11'] = conf.CheckPKG('x11') + #osx 64 specifics if env['osx64']: # 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_AO', env['HAVE_AO']) conf.Define('HAVE_WX', env['HAVE_WX']) +conf.Define('HAVE_X11', env['HAVE_X11']) # After all configuration tests are done conf.Finish() @@ -229,6 +233,9 @@ if env['HAVE_AO']: if env['HAVE_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 env.AddMethod(utils.filterWarnings) diff --git a/Source/Plugins/Plugin_PadSimple/Src/SConscript b/Source/Plugins/Plugin_PadSimple/Src/SConscript index a3430103da..0141df719a 100644 --- a/Source/Plugins/Plugin_PadSimple/Src/SConscript +++ b/Source/Plugins/Plugin_PadSimple/Src/SConscript @@ -5,6 +5,10 @@ import sys name = "Plugin_PadSimple" +if not env['HAVE_X11']: + print name + " must have X11 to be build" + Return() + files = [ "PadSimple.cpp", ] diff --git a/Source/Plugins/Plugin_VideoOGL/Src/SConscript b/Source/Plugins/Plugin_VideoOGL/Src/SConscript index b98973138c..7eaaa1aa14 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/SConscript +++ b/Source/Plugins/Plugin_VideoOGL/Src/SConscript @@ -66,7 +66,28 @@ if gfxenv['osx64']: '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': @@ -76,33 +97,20 @@ if sys.platform == 'darwin': # Use frameworks instead of plain libs, when possible. linkFlags += [ '-Wl,-framework,%s' % framework - for framework in [ 'OpenGL', 'Cg' ] + for framework in [ 'Cg' ] ] 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. - 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: compileFlags += [ '-DUSE_SDL=1' ]