fixed scons=parsing

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@591 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
nakeee 2008-09-20 22:06:22 +00:00
parent d9e4b55f15
commit 3e2419776f
12 changed files with 78 additions and 91 deletions

View File

@ -11,7 +11,7 @@ files = [
def filterWarnings(flags):
return ' '.join(
flag
for flag in flags.split()
for flag in flags
if not flag.startswith('-W')
)
env_bochs = env.Clone(

View File

@ -7,7 +7,7 @@ files = [
def filterWarnings(flags):
return ' '.join(
flag
for flag in flags.split()
for flag in flags
if not flag.startswith('-W')
)
env_lzo = env.Clone(

View File

@ -83,54 +83,22 @@ vars.AddVariables(
BoolVariable('verbose', 'Set for compilation line', False),
BoolVariable('debug', 'Set for debug build', False),
BoolVariable('lint', 'Set for lint build (extra warnings)', False),
BoolVariable('nowx', 'Set For Building with no WX libs', False),
BoolVariable('nowx', 'Set For Building with no WX libs (WIP)', False),
EnumVariable('flavor', 'Choose a build flavor', 'release',
allowed_values=('release', 'devel', 'debug'),
ignorecase=2)
)
# build falvuor
flavour = ARGUMENTS.get('flavor')
if (flavour == 'debug'):
compileFlags.append('-g')
cppDefines.append('LOGGING')
else:
compileFlags.append('-O3')
# more warnings
lint = ARGUMENTS.get('lint', False)
if bool(lint):
warnings.append('error')
warnings.append('unreachable-code')
warnings.append('float-equal')
nowx = ARGUMENTS.get('nowx', 0)
if int(nowx):
WxCppFlags = ''
WxLibFlags = ''
else:
WxCppFlags = os.popen('wx-config --cppflags').read()
if WxCppFlags[-1] == "\n":
WxCppFlags = WxCppFlags[:-1]
WxLibFlags = os.popen('wx-config --libs').read()
if WxLibFlags[-1] == "\n":
WxLibFlags = WxLibFlags[:-1]
compileFlags += [ '-W' + warning for warning in warnings ]
#compileFlags += [ '-W' + warning for warning in warnings ]
env = Environment(
CC = 'gcc',
CXX = 'g++',
CCFLAGS = ' '.join(compileFlags),
CXXFLAGS = ' '.join(compileFlags + [ '-fvisibility-inlines-hidden' ]),
CPPDEFINES = cppDefines,
CPPPATH = include_paths,
LIBPATH = lib_paths,
variables = vars,
WXCPPFLAGS = WxCppFlags,
WXLIBFLAGS = WxLibFlags,
ENV = {
'PATH' : os.environ['PATH'],
'HOME' : os.environ['HOME']
@ -144,17 +112,48 @@ env = Environment(
)
# verbose compile
verbose = ARGUMENTS.get('verbose', False)
if not bool(verbose):
if not env['verbose']:
env['CCCOMSTR'] = "Compiling $TARGET"
env['CXXCOMSTR'] = "Compiling $TARGET"
env['ARCOMSTR'] = " ar $TARGET"
env['ARCOMSTR'] = "AR $TARGET"
env['LINKCOMSTR'] = "Linking $TARGET"
# build falvuor
flavour = ARGUMENTS.get('flavor')
if (flavour == 'debug'):
compileFlags.append('-g')
cppDefines.append('LOGGING')
else:
compileFlags.append('-O3')
# more warnings
if env['lint']:
warnings.append('error')
warnings.append('unreachable-code')
warnings.append('float-equal')
# add the warnings to the compile flags
compileFlags += [ '-W' + warning for warning in warnings ]
env['CCFLAGS'] = compileFlags
env['CXXFLAGS'] = compileFlags + [ '-fvisibility-inlines-hidden' ]
env['CPPDEFINES'] = cppDefines
# handling wx flags CCFLAGS should be created before
# TODO: add version check
if not env['nowx']:
env.ParseConfig('wx-config --cflags --libs')
#get sdl stuff
env.ParseConfig("sdl-config --cflags --libs")
# lib ao (needed for sound plugins)
env.ParseConfig("pkg-config --cflags --libs ao")
Export('env')
# print a nice progress indication when not compiling
Progress(['-\r', '\\\r', '|\r', '/\r'], interval=5)
# die on unknown variables

View File

@ -25,5 +25,5 @@ files = [
]
env_common = env.Clone()
env_common.Append(CXXFLAGS = ' ' + ' '.join([ '-fPIC' ]))
env_common.Append(CXXFLAGS = [ '-fPIC' ])
env_common.StaticLibrary("common", files)

View File

@ -17,15 +17,14 @@ files = ["LogWindow.cpp",
]
wxenv = env.Clone()
wxenv.Append(
CXXFLAGS = ' ' + ' '.join([
env['WXCPPFLAGS'],
CXXFLAGS = [
'-DUSE_XPM_BITMAPS',
'-DwxNEEDS_CHARPP'
]),
LINKFLAGS = ' ' + ' '.join([
],
LINKFLAGS = [
'-L/usr/local/lib',
'-pthread',
env['WXLIBFLAGS'],
])
]
)
wxenv.StaticLibrary("debwx", files, LIBS = [ "common" ])

View File

@ -23,18 +23,14 @@ libs = [
wxenv = env.Clone()
wxenv.Append(
CXXFLAGS = ' ' + ' '.join([
env['WXCPPFLAGS'],
CXXFLAGS = [
'-DUSE_XPM_BITMAPS',
'-DwxNEEDS_CHARPP',
'`sdl-config --cflags`',
]),
LINKFLAGS = ' ' + ' '.join([
],
LINKFLAGS = [
'-L/usr/local/lib',
'-pthread',
env['WXLIBFLAGS'],
'`sdl-config --libs`'
])
]
)
if sys.platform == 'darwin':
@ -66,5 +62,5 @@ else:
exeNoGUI = '../../../../Binary/linux/DolphinNoGUI'
objects = [ wxenv.Object(srcFile) for srcFile in files ]
wxenv.Program(exeGUI, objects + [ 'Main.cpp' ], LIBS = libs)
wxenv.Program(exeNoGUI, objects + [ 'MainNoGUI.cpp' ], LIBS = libs)
wxenv.Program(exeGUI, objects + [ 'Main.cpp' ], LIBS=wxenv['LIBS']+libs)
wxenv.Program(exeNoGUI, objects + [ 'MainNoGUI.cpp' ], LIBS=wxenv['LIBS']+libs)

View File

@ -13,5 +13,5 @@ files = [
]
env_common = env.Clone()
env_common.Append(CXXFLAGS = ' ' + ' '.join([ '-fPIC' ]))
env_common.Append(CXXFLAGS = [ '-fPIC' ])
env_common.StaticLibrary("videocommon", files)

View File

@ -20,8 +20,7 @@ files = [
dspenv = env.Clone()
dspenv.Append(
CXXFLAGS = ' ' + ' '.join([ '-fPIC', '`pkg-config --cflags ao`' ]),
LINKFLAGS = ' ' + ' '.join([ '`pkg-config --libs ao`' ])
CXXFLAGS = [ '-fPIC', ],
)
if sys.platform == 'darwin':

View File

@ -17,9 +17,10 @@ files = [
"main.cpp",
]
dspenv = env.Clone()
dspenv.Append(
CXXFLAGS = ' ' + ' '.join([ '-fPIC', '`pkg-config --cflags ao`' ]),
LINKFLAGS = ' ' + ' '.join([ '`pkg-config --libs ao`' ])
lleenv = env.Clone()
lleenv.Append(
CXXFLAGS = [ '-fPIC', ],
)
dspenv.SharedLibrary(output, files, LIBS = ["common"])
lleenv.SharedLibrary(output, files, LIBS = ["common"])

View File

@ -24,14 +24,15 @@ files = [
]
compileFlags = [
'-fPIC',
env['WXCPPFLAGS'],
]
linkFlags = [
env['WXLIBFLAGS'],
]
libs = [
'videocommon', 'common', 'GLEW',
]
gfxenv = env.Clone()
if sys.platform == 'darwin':
platform = 'mac'
# SDL is currently the only way to get video on Mac OS X.
@ -49,23 +50,20 @@ 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
# Libraries with pkg-config support.
compileFlags.append('`pkg-config --cflags xxf86vm`')
linkFlags.append('`pkg-config --libs xxf86vm`')
gfxenv.ParseConfig("pkg-config --libs ao")
# Libraries without pkg-config support.
libs += [ 'GL', 'Cg', 'CgGL', 'X11' ]
if useSDL:
compileFlags += [ '`sdl-config --cflags`', '-DUSE_SDL=1' ]
linkFlags += [ '`sdl-config --libs`' ]
compileFlags += [ '-DUSE_SDL=1' ]
gfxenv = env.Clone()
gfxenv.Append(
CXXFLAGS = ' ' + ' '.join(compileFlags),
LINKFLAGS = ' ' + ' '.join(linkFlags)
CXXFLAGS = compileFlags,
)
gfxenv.SharedLibrary(
'../../../../Binary/%s/Plugins/zeroogl.so' % platform,
files,
LIBS = libs
LIBS = gfxenv['LIBS'] + libs
)

View File

@ -12,12 +12,9 @@ files = [
padenv = env.Clone()
padenv.Append(
CXXFLAGS = ' ' + ' '.join([
'-fPIC', env['WXCPPFLAGS'], '`pkg-config --cflags sdl`'
]),
LINKFLAGS = ' ' + ' '.join([
env['WXLIBFLAGS'], '`pkg-config --libs sdl`'
])
CXXFLAGS = [
'-fPIC',
],
)
padenv.SharedLibrary(output, files, LIBS = [ "common" ])

View File

@ -14,11 +14,9 @@ files = [
padenv = env.Clone()
padenv.Append(
CXXFLAGS = ' ' + ' '.join([
'-fPIC', env['WXCPPFLAGS'], '`pkg-config --cflags sdl`'
]),
LINKFLAGS = ' ' + ' '.join([
env['WXLIBFLAGS'], '`pkg-config --libs sdl`'
])
CXXFLAGS = [
'-fPIC',
],
)
padenv.SharedLibrary(output, files, LIBS = [ "common" ])