[Widelands-cvs] SF.net SVN: widelands:[4908] branches/cmake-migration
Status: Beta
Brought to you by:
sirver
From: <si...@us...> - 2010-01-07 22:22:10
|
Revision: 4908 http://widelands.svn.sourceforge.net/widelands/?rev=4908&view=rev Author: sirver Date: 2010-01-07 22:22:01 +0000 (Thu, 07 Jan 2010) Log Message: ----------- More stable lua detection Modified Paths: -------------- branches/cmake-migration/SConstruct branches/cmake-migration/build/scons-tools/scons_configure.py Added Paths: ----------- branches/cmake-migration/.gitignore Added: branches/cmake-migration/.gitignore =================================================================== --- branches/cmake-migration/.gitignore (rev 0) +++ branches/cmake-migration/.gitignore 2010-01-07 22:22:01 UTC (rev 4908) @@ -0,0 +1,2 @@ +*.pyc +*.sw? Property changes on: branches/cmake-migration/.gitignore ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + native Modified: branches/cmake-migration/SConstruct =================================================================== --- branches/cmake-migration/SConstruct 2010-01-07 22:21:41 UTC (rev 4907) +++ branches/cmake-migration/SConstruct 2010-01-07 22:22:01 UTC (rev 4908) @@ -83,6 +83,7 @@ opts.Add('build', 'debug / profile / release(default)', 'debug') opts.Add('build_id', 'To get a default value (SVN revision), leave this empty', '') #change this before/after preparing a release opts.Add('sdlconfig', 'On some systems (e.g. BSD) this is called sdl12-config', 'sdl-config') + opts.Add('pkgconfig', 'On some systems (e.g. BSD) this is called pkg-config13', 'pkg-config') opts.Add('paraguiconfig', '', 'paragui-config') opts.Add('install_prefix', '', '/usr/local') opts.Add('bindir', '(absolute or relative to install_prefix)', 'games') Modified: branches/cmake-migration/build/scons-tools/scons_configure.py =================================================================== --- branches/cmake-migration/build/scons-tools/scons_configure.py 2010-01-07 22:21:41 UTC (rev 4907) +++ branches/cmake-migration/build/scons-tools/scons_configure.py 2010-01-07 22:22:01 UTC (rev 4908) @@ -136,13 +136,27 @@ def CheckPKG(context, name): context.Message( 'Checking for %s... ' % name ) ret = context.TryAction('pkg-config --exists \'%s\'' % name)[0] - context.Result( ret ) + context.Result( not ret ) return ret -def CheckPKGConfig(context, version): +def CheckPKGConfig(context, version, env): context.Message( 'Checking for pkg-config... ' ) ret = context.TryAction('pkg-config --atleast-pkgconfig-version=%s' % version)[0] context.Result( ret ) + if env['PLATFORM'] == 'win32': + for p in env['PATH']: + ret = context.TryAction('sh.exe '+os.path.join(p, env['pkgconfig'])+' --version')[0] + if ret==1: + env['pkgconfig']='sh.exe '+os.path.join(p, env['pkgconfig']) + context.Result( ret ) + break + else: + for p in env['PATH']: + ret = context.TryAction(os.path.join(p, env['pkgconfig'])+' --version')[0] + if ret==1: + env['pkgconfig']=os.path.join(p, env['pkgconfig']) + context.Result( ret ) + break return ret def CheckSDLConfig(context, env): @@ -325,6 +339,10 @@ print 'Could not find sdl-config! Is SDL installed?' env.Exit(1) + if not conf.CheckPKGConfig(0.15, env): + print 'Could not find pkg-config! Is it installed?' + env.Exit(1) + if not conf.CheckSDLVersionAtLeast(1, 2, 8, env): print 'Could not find an SDL version >= 1.2.8!' env.Exit(1) @@ -353,12 +371,11 @@ print 'Could not find the png library! Is it installed?' env.Exit(1) - if not conf.CheckLibWithHeader('lua', header='lua.h', language='C++', autoadd=1): - # Try to find 'lua5.1' - conf.CheckCompilerFlag('-I/usr/include/lua5.1', env) - if not conf.CheckLibWithHeader('lua5.1', header='lua.h', language='C', autoadd=1): - print 'Could not find the lua library! Is it installed?' - env.Exit(1) + if conf.CheckPKG("lua"): + print 'Could not find the lua library! Is it installed?' + env.Exit(1) + else: + env.ParseConfig(env["pkgconfig"] + " lua --libs --cflags") if not conf.CheckLib(library='SDL_image', symbol='IMG_Load', autoadd=1): print 'Could not find the SDL_image library! Is it installed?' This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |