Added check for fink/macports paths in osx

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2540 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
nakeee 2009-03-03 22:34:32 +00:00
parent 935cf770b0
commit d410b768c3
2 changed files with 43 additions and 3 deletions

View File

@ -187,6 +187,8 @@ tests = {'CheckWXConfig' : wxconfig.CheckWXConfig,
'CheckPKGConfig' : utils.CheckPKGConfig,
'CheckPKG' : utils.CheckPKG,
'CheckSDL' : utils.CheckSDL,
'CheckFink' : utils.CheckFink,
'CheckMacports' : utils.CheckMacports,
'CheckPortaudio' : utils.CheckPortaudio,
}
@ -199,6 +201,12 @@ conf = env.Configure(custom_tests = tests,
if not conf.CheckPKGConfig('0.15.0'):
print "Can't find pkg-config, some tests will fail"
# find ports/fink for library and include path
if sys.platform == 'darwin':
#ports usually has newer versions
conf.CheckMacports()
conf.CheckFink()
env['HAVE_SDL'] = conf.CheckSDL('1.0.0')
# Bluetooth for wii support

View File

@ -20,18 +20,50 @@ def CheckFramework(context, name):
ret = 0
if (platform.system().lower() == 'darwin'):
context.Message( '\nLooking for framework %s... ' % name )
lastLINKFLAGS = context.env['LINKFLAGS']
context.env.Append(LINKFLAGS = [ '-framework', name ])
lastFRAMEWORKS = context.env['FRAMEWORKS']
context.env.Append(FRAMEWORKS = [name])
ret = context.TryLink("""
int main(int argc, char **argv) {
return 0;
}
""", '.c')
if not ret:
context.env.Replace(LINKFLAGS = lastLINKFLAGS)
context.env.Replace(FRAMEWORKS = lastFRAMEWORKS
)
return ret
def CheckFink(context):
context.Message( 'Looking for fink... ')
prog = context.env.WhereIs('fink')
if prog:
ret = 1
prefix = prog.rsplit(os.sep, 2)[0]
context.env.Append(LIBPATH = [prefix + os.sep +'lib'],
CPPPATH = [prefix + os.sep +'include'])
context.Message( 'Adding fink lib and include path')
else:
ret = 0
context.Result(ret)
return int(ret)
def CheckMacports(context):
context.Message( 'Looking for macports... ')
prog = context.env.WhereIs('port')
if prog:
ret = 1
prefix = prog.rsplit(os.sep, 2)[0]
context.env.Append(LIBPATH = [prefix + os.sep + 'lib'],
CPPPATH = [prefix + os.sep + 'include'])
context.Message( 'Adding port lib and include path')
else:
ret = 0
context.Result(ret)
return int(ret)
# TODO: We should use the scons one instead
def CheckLib(context, name):
context.Message( 'Looking for lib %s... ' % name )