From e0291e735cd44972603528bf68b690d52bb1dcc3 Mon Sep 17 00:00:00 2001 From: nakeee Date: Sun, 21 Sep 2008 19:54:29 +0000 Subject: [PATCH] cleaned up SConscripts git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@602 8ced0084-cf51-0410-be5f-012b33b47a6e --- Externals/Bochs_disasm/SConscript | 13 +++++-------- Externals/LZO/SConscript | 12 ++++-------- SConstruct | 15 +++++++++++++-- Source/Core/Common/Src/SConscript | 2 ++ Source/Core/Core/Src/SConscript | 2 ++ Source/Core/DebuggerWX/src/SConscript | 14 +++++++++----- Source/Core/DiscIO/Src/SConscript | 7 ++++++- Source/Core/DolphinWX/Src/SConscript | 9 +++++---- Source/Core/VideoCommon/Src/SConscript | 2 ++ Source/Plugins/Plugin_DSP_HLE/Src/SConscript | 2 ++ Source/Plugins/Plugin_DSP_LLE/Src/SConscript | 2 ++ Source/Plugins/Plugin_PadSimple/Src/SConscript | 2 ++ Source/Plugins/Plugin_VideoOGL/Src/SConscript | 5 ++++- Source/Plugins/Plugin_Wiimote_Test/Src/SConscript | 2 ++ Source/Plugins/Plugin_nJoy_SDL/Src/SConscript | 2 ++ 15 files changed, 62 insertions(+), 29 deletions(-) diff --git a/Externals/Bochs_disasm/SConscript b/Externals/Bochs_disasm/SConscript index 40ba3f3e38..4050db0764 100644 --- a/Externals/Bochs_disasm/SConscript +++ b/Externals/Bochs_disasm/SConscript @@ -1,3 +1,5 @@ +# -*- python -*- + Import('env') files = [ @@ -8,14 +10,9 @@ files = [ "PowerPCDisasm.cpp", ] -def filterWarnings(flags): - return ' '.join( - flag - for flag in flags - if not flag.startswith('-W') - ) env_bochs = env.Clone( - CCFLAGS = filterWarnings(env['CCFLAGS']), - CXXFLAGS = filterWarnings(env['CXXFLAGS']), + CCFLAGS = env.filterWarnings(env['CCFLAGS']), + CXXFLAGS = env.filterWarnings(env['CXXFLAGS']), ) + env_bochs.StaticLibrary("bdisasm", files) diff --git a/Externals/LZO/SConscript b/Externals/LZO/SConscript index 5f1a451232..527d235409 100644 --- a/Externals/LZO/SConscript +++ b/Externals/LZO/SConscript @@ -1,17 +1,13 @@ +# -*- python -*- + Import('env') files = [ "minilzo.c", ] -def filterWarnings(flags): - return ' '.join( - flag - for flag in flags - if not flag.startswith('-W') - ) env_lzo = env.Clone( - CCFLAGS = filterWarnings(env['CCFLAGS']), - CXXFLAGS = filterWarnings(env['CXXFLAGS']), + CCFLAGS = env.filterWarnings(env['CCFLAGS']), + CXXFLAGS = env.filterWarnings(env['CXXFLAGS']), ) env_lzo.StaticLibrary("minilzo", files) diff --git a/SConstruct b/SConstruct index 6b514d0c1f..c0d1e878eb 100644 --- a/SConstruct +++ b/SConstruct @@ -6,6 +6,7 @@ import sys # Home made tests sys.path.append('SconsTests') import wxconfig +import utils # Some features needs at least scons 0.98 EnsureSConsVersion(0, 98) @@ -115,15 +116,22 @@ env = Environment( VERSION = version, ) +# save the given command line options vars.Save('args.cache', env) # verbose compile if not env['verbose']: env['CCCOMSTR'] = "Compiling $TARGET" env['CXXCOMSTR'] = "Compiling $TARGET" - env['ARCOMSTR'] = "AR $TARGET" + env['ARCOMSTR'] = "Archiving $TARGET" env['LINKCOMSTR'] = "Linking $TARGET" - + env['ASCOMSTR'] = "Assembling $TARGET" + env['ASPPCOMSTR'] = "Assembling $TARGET" + env['SHCCCOMSTR'] = "Compiling shared $TARGET" + env['SHCXXCOMSTR'] = "Compiling shared $TARGET" + env['SHLINKCOMSTR'] = "Linking shared $TARGET" + env['RANLIBCOMSTR'] = "Indexing $TARGET" + # build falvuor flavour = ARGUMENTS.get('flavor') if (flavour == 'debug'): @@ -173,6 +181,9 @@ env.ParseConfig("pkg-config --cflags --libs ao") # After all configuration tests are done env = conf.Finish() +# add methods from utils to env +env.AddMethod(utils.filterWarnings) + Export('env') # print a nice progress indication when not compiling diff --git a/Source/Core/Common/Src/SConscript b/Source/Core/Common/Src/SConscript index 972376849a..9bc27b69c4 100644 --- a/Source/Core/Common/Src/SConscript +++ b/Source/Core/Common/Src/SConscript @@ -1,3 +1,5 @@ +# -*- python -*- + Import('env') files = [ diff --git a/Source/Core/Core/Src/SConscript b/Source/Core/Core/Src/SConscript index 5a4e0eef80..ce98ee2e53 100644 --- a/Source/Core/Core/Src/SConscript +++ b/Source/Core/Core/Src/SConscript @@ -1,3 +1,5 @@ +# -*- python -*- + Import('env') files = ["Console.cpp", diff --git a/Source/Core/DebuggerWX/src/SConscript b/Source/Core/DebuggerWX/src/SConscript index f5a0a2b9c8..005b8f4b65 100644 --- a/Source/Core/DebuggerWX/src/SConscript +++ b/Source/Core/DebuggerWX/src/SConscript @@ -1,3 +1,5 @@ +# -*- python -*- + Import('env') files = ["LogWindow.cpp", @@ -17,14 +19,16 @@ files = ["LogWindow.cpp", ] wxenv = env.Clone() wxenv.Append( - CXXFLAGS = [ - '-DUSE_XPM_BITMAPS', - '-DwxNEEDS_CHARPP' + CPPDEFINES = [ + 'USE_XPM_BITMAPS', + 'wxNEEDS_CHARPP' ], LINKFLAGS = [ - '-L/usr/local/lib', '-pthread', ] ) +libs = [ + 'common' +] -wxenv.StaticLibrary("debwx", files, LIBS = [ "common" ]) +wxenv.StaticLibrary("debwx", files, LIBS = libs) diff --git a/Source/Core/DiscIO/Src/SConscript b/Source/Core/DiscIO/Src/SConscript index 411eee2fe5..1f54fc8d78 100644 --- a/Source/Core/DiscIO/Src/SConscript +++ b/Source/Core/DiscIO/Src/SConscript @@ -1,3 +1,5 @@ +# -*- python -*- + Import('env') files = ["BannerLoader.cpp", @@ -16,4 +18,7 @@ files = ["BannerLoader.cpp", "AES/aes_cbc.c", "AES/aes_core.c", ] -env.StaticLibrary("discio", files, LIBS = ["common"]) +libs = [ + 'common' +] +env.StaticLibrary("discio", files, LIBS = libs) diff --git a/Source/Core/DolphinWX/Src/SConscript b/Source/Core/DolphinWX/Src/SConscript index 42ceafe6a5..d5ff36c5cf 100644 --- a/Source/Core/DolphinWX/Src/SConscript +++ b/Source/Core/DolphinWX/Src/SConscript @@ -1,3 +1,5 @@ +# -*- python -*- + Import('env') import sys @@ -23,12 +25,11 @@ libs = [ wxenv = env.Clone() wxenv.Append( - CXXFLAGS = [ - '-DUSE_XPM_BITMAPS', - '-DwxNEEDS_CHARPP', + CPPDEFINES = [ + 'USE_XPM_BITMAPS', + 'wxNEEDS_CHARPP', ], LINKFLAGS = [ - '-L/usr/local/lib', '-pthread', ] ) diff --git a/Source/Core/VideoCommon/Src/SConscript b/Source/Core/VideoCommon/Src/SConscript index f9af771339..39187ad818 100644 --- a/Source/Core/VideoCommon/Src/SConscript +++ b/Source/Core/VideoCommon/Src/SConscript @@ -1,3 +1,5 @@ +# -*- python -*- + Import('env') files = [ diff --git a/Source/Plugins/Plugin_DSP_HLE/Src/SConscript b/Source/Plugins/Plugin_DSP_HLE/Src/SConscript index 8bb1373946..3cc52e5f0a 100644 --- a/Source/Plugins/Plugin_DSP_HLE/Src/SConscript +++ b/Source/Plugins/Plugin_DSP_HLE/Src/SConscript @@ -1,3 +1,5 @@ +# -*- python -*- + Import('env') import sys diff --git a/Source/Plugins/Plugin_DSP_LLE/Src/SConscript b/Source/Plugins/Plugin_DSP_LLE/Src/SConscript index 6226ae1f05..adb328079e 100644 --- a/Source/Plugins/Plugin_DSP_LLE/Src/SConscript +++ b/Source/Plugins/Plugin_DSP_LLE/Src/SConscript @@ -1,3 +1,5 @@ +# -*- python -*- + Import('env') output = "../../../../Binary/linux/Plugins/dsplle.so" diff --git a/Source/Plugins/Plugin_PadSimple/Src/SConscript b/Source/Plugins/Plugin_PadSimple/Src/SConscript index ceb07378f2..7540cc73a6 100644 --- a/Source/Plugins/Plugin_PadSimple/Src/SConscript +++ b/Source/Plugins/Plugin_PadSimple/Src/SConscript @@ -1,3 +1,5 @@ +# -*- python -*- + Import('env') import sys diff --git a/Source/Plugins/Plugin_VideoOGL/Src/SConscript b/Source/Plugins/Plugin_VideoOGL/Src/SConscript index 582906c003..0dac6be092 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/SConscript +++ b/Source/Plugins/Plugin_VideoOGL/Src/SConscript @@ -1,3 +1,5 @@ +# -*- python -*- + Import('env') import sys @@ -37,6 +39,7 @@ if sys.platform == 'darwin': platform = 'mac' # SDL is currently the only way to get video on Mac OS X. useSDL = True + # TODO: clean it up (use incpath and libpath) # Use libraries from MacPorts. compileFlags.append('-I/opt/local/include') linkFlags.append('-L/opt/local/lib') @@ -50,7 +53,7 @@ else: # By default, GLX is used on Linux to setup OpenGL, but you can select SDL # instead if you like, by changing the line below. useSDL = False - gfxenv.ParseConfig("pkg-config --libs ao") + gfxenv.ParseConfig("pkg-config x11 --cflags --libs") # Libraries without pkg-config support. libs += [ 'GL', 'Cg', 'CgGL', 'X11' ] diff --git a/Source/Plugins/Plugin_Wiimote_Test/Src/SConscript b/Source/Plugins/Plugin_Wiimote_Test/Src/SConscript index ba7dbd8f6c..944bc33508 100644 --- a/Source/Plugins/Plugin_Wiimote_Test/Src/SConscript +++ b/Source/Plugins/Plugin_Wiimote_Test/Src/SConscript @@ -1,3 +1,5 @@ +# -*- python -*- + Import('env') import sys diff --git a/Source/Plugins/Plugin_nJoy_SDL/Src/SConscript b/Source/Plugins/Plugin_nJoy_SDL/Src/SConscript index db6895dfce..41e296a5f5 100644 --- a/Source/Plugins/Plugin_nJoy_SDL/Src/SConscript +++ b/Source/Plugins/Plugin_nJoy_SDL/Src/SConscript @@ -1,3 +1,5 @@ +# -*- python -*- + Import('env') import sys