mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-07 15:40:18 +00:00
scons fixes
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1464 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
61f6c097f4
commit
8fdfe2583c
@ -193,8 +193,8 @@ 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
|
||||||
env['HAVE_SDL'] = 0
|
# env['HAVE_SDL'] = 0
|
||||||
env['HAVE_WX'] = 0;
|
# env['HAVE_WX'] = 0;
|
||||||
compileFlags += ['-arch' , 'x86_64', '-DOSX64']
|
compileFlags += ['-arch' , 'x86_64', '-DOSX64']
|
||||||
|
|
||||||
# Gui less build
|
# Gui less build
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import os
|
import os
|
||||||
|
import platform
|
||||||
|
|
||||||
# methods that should be added to env
|
# methods that should be added to env
|
||||||
def filterWarnings(self, flags):
|
def filterWarnings(self, flags):
|
||||||
@ -15,14 +16,55 @@ def CheckPKGConfig(context, version):
|
|||||||
context.Result( ret )
|
context.Result( ret )
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
def CheckPKG(context, name):
|
def CheckFramework(context, name):
|
||||||
context.Message( 'Checking for %s... ' % name )
|
ret = 0
|
||||||
|
if (platform.system() == 'darwin'):
|
||||||
|
context.Message( '\nLooking for framework %s... ' % name )
|
||||||
|
lastLINKFLAGS = context.env['LINKFLAGS']
|
||||||
|
context.env.Append(LINKFLAGS = '-Wl,-framework,%s' % name)
|
||||||
|
ret = context.TryLink("""
|
||||||
|
int main(int argc, char **argv) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
""", '.c')
|
||||||
|
if not ret:
|
||||||
|
context.env.Replace(LIBS = lastLIBS)
|
||||||
|
|
||||||
|
return ret
|
||||||
|
|
||||||
|
def CheckLib(context, name):
|
||||||
|
context.Message( 'Looking for lib %s... ' % name )
|
||||||
|
lastLIBS = context.env['LIBS']
|
||||||
|
context.env.Append(LIBS = name)
|
||||||
|
ret = context.TryLink("""
|
||||||
|
int main(int argc, char **argv) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
""",'.c')
|
||||||
|
if not ret:
|
||||||
|
context.env.Replace(LIBS = lastLIBS)
|
||||||
|
|
||||||
|
return ret
|
||||||
|
|
||||||
|
def ConfigPKG(context, name):
|
||||||
|
context.Message( '\nUsing pkg-config for %s... ' % name )
|
||||||
ret = context.TryAction('pkg-config --exists \'%s\'' % name)[0]
|
ret = context.TryAction('pkg-config --exists \'%s\'' % name)[0]
|
||||||
context.Result( ret )
|
context.Result( ret )
|
||||||
if ret:
|
if ret:
|
||||||
context.env.ParseConfig('pkg-config --cflags --libs \'%s\'' % name)
|
context.env.ParseConfig('pkg-config --cflags --libs \'%s\'' % name)
|
||||||
return int(ret)
|
return int(ret)
|
||||||
|
|
||||||
|
def CheckPKG(context, name):
|
||||||
|
context.Message( 'Checking for %s... ' % name )
|
||||||
|
ret = 1
|
||||||
|
if not CheckFramework(context, name):
|
||||||
|
if not ConfigPKG(context, name.lower()):
|
||||||
|
ret = CheckLib(context, name)
|
||||||
|
|
||||||
|
context.Result(ret)
|
||||||
|
return int(ret)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def CheckSDL(context, version):
|
def CheckSDL(context, version):
|
||||||
context.Message( 'Checking for sdl lib version > %s... ' % version)
|
context.Message( 'Checking for sdl lib version > %s... ' % version)
|
||||||
|
@ -5,6 +5,7 @@ Import('env')
|
|||||||
import sys
|
import sys
|
||||||
sys.path.append(env['base_dir']+'SconsTests')
|
sys.path.append(env['base_dir']+'SconsTests')
|
||||||
import utils
|
import utils
|
||||||
|
import platform
|
||||||
|
|
||||||
name = "Plugin_VideoOGL"
|
name = "Plugin_VideoOGL"
|
||||||
|
|
||||||
@ -41,7 +42,7 @@ compileFlags = [
|
|||||||
linkFlags = [
|
linkFlags = [
|
||||||
]
|
]
|
||||||
libs = [
|
libs = [
|
||||||
'videocommon', 'common', 'GLEW',
|
'videocommon', 'common',
|
||||||
]
|
]
|
||||||
|
|
||||||
gfxenv = env.Clone()
|
gfxenv = env.Clone()
|
||||||
@ -59,59 +60,39 @@ if gfxenv['osx64']:
|
|||||||
'-x',
|
'-x',
|
||||||
'objective-c++',
|
'objective-c++',
|
||||||
]
|
]
|
||||||
linkFlags += [
|
|
||||||
'-framework',
|
|
||||||
'cocoa',
|
|
||||||
'-arch',
|
|
||||||
'x86_64'
|
|
||||||
]
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
tests = {'CheckPKG' : utils.CheckPKG}
|
tests = {'CheckPKG' : utils.CheckPKG}
|
||||||
conf = gfxenv.Configure(custom_tests = tests)
|
conf = gfxenv.Configure(custom_tests = tests,
|
||||||
|
config_h="Source/Core/Common/Src/Config.h")
|
||||||
if not conf.CheckPKG('gl'):
|
|
||||||
|
|
||||||
if not conf.CheckLibWithHeader('gl', 'gl.h', 'c', 1):
|
|
||||||
print name + " must have opengl to be build"
|
|
||||||
|
|
||||||
else:
|
|
||||||
gfxenv.ParseConfig("pkg-config gl --cflags --libs")
|
|
||||||
|
|
||||||
#if not conf.CheckPKG('glu')):
|
|
||||||
|
|
||||||
# Return()
|
|
||||||
|
|
||||||
|
|
||||||
# check for xxf86vm
|
|
||||||
|
|
||||||
gfxenv['HAVE_XXF86VM'] = conf.CheckPKG('xxf86vm')
|
|
||||||
|
|
||||||
conf.Finish()
|
|
||||||
|
|
||||||
if gfxenv['HAVE_XXF86VM']:
|
|
||||||
gfxenv.ParseConfig("pkg-config xxf86vm --cflags --libs")
|
|
||||||
|
|
||||||
|
|
||||||
#gfxenv.ParseConfig("pkg-config glu --cflags --libs")
|
|
||||||
|
|
||||||
if sys.platform == 'darwin':
|
if sys.platform == 'darwin':
|
||||||
|
|
||||||
# Use libraries from MacPorts.
|
# Use libraries from MacPorts.
|
||||||
compileFlags.append('-I/opt/local/include')
|
compileFlags.append('-I/opt/local/include')
|
||||||
linkFlags.append('-L/opt/local/lib')
|
linkFlags.append('-L/opt/local/lib')
|
||||||
# Use frameworks instead of plain libs, when possible.
|
conf.CheckPKG('cocoa')
|
||||||
linkFlags += [
|
conf.CheckPKG('OpenGL')
|
||||||
'-Wl,-framework,%s' % framework
|
|
||||||
for framework in [ 'Cg', 'OpenGL' ]
|
|
||||||
]
|
|
||||||
else:
|
else:
|
||||||
# Libraries without pkg-config support.
|
if not (conf.CheckPKG('GL') and conf.CheckPKG('GLU')):
|
||||||
libs += [ 'Cg', 'CgGL', 'GLU' ]
|
print name + " must have opengl and glu to be build"
|
||||||
|
Return()
|
||||||
|
|
||||||
|
if not conf.CheckPKG('Cg') or not conf.CheckPKG('CgGL'):
|
||||||
|
print name + " must have cg and cggl to be build"
|
||||||
|
Return()
|
||||||
|
|
||||||
|
if not conf.CheckPKG('GLEW'):
|
||||||
|
print name + " must have glew to be build"
|
||||||
|
Return()
|
||||||
|
|
||||||
|
# check for xxf86vm
|
||||||
|
|
||||||
|
gfxenv['HAVE_XXF86VM'] = conf.CheckPKG('xxf86vm')
|
||||||
|
conf.Define('HAVE_XXF86VM', gfxenv['HAVE_XXF86VM'])
|
||||||
|
|
||||||
|
conf.Finish()
|
||||||
|
|
||||||
# change to True if you want to compile with SDL
|
# change to True if you want to compile with SDL
|
||||||
useSDL = not (gfxenv['HAVE_X11'] and gfxenv['HAVE_XXF86VM'])
|
useSDL = not (gfxenv['HAVE_X11'] and gfxenv['HAVE_XXF86VM'])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user