In scons recipe, use PkgConfig to check for SDL version.

This commit is contained in:
Eric S. Raymond 2008-03-28 10:08:37 +00:00
parent 7dd3bf7b05
commit 36834b6057
2 changed files with 39 additions and 15 deletions

View file

@ -37,23 +37,13 @@ opts.Add(BoolOption('desktop_entry','Clear to disable desktop-entry', True))
opts.Add(PathOption('icondir', 'sets the icons directory to a non-default location', "icons", PathOption.PathAccept))
opts.Add(PathOption('desktopdir', 'sets the desktop entry directory to a non-default location', "applications", PathOption.PathAccept))
#
# Setup
#
env = Environment(options = opts)
# Omits the 'test' target
all = env.Alias("all", ["wesnoth", "wesnoth_editor", "wesnothd", "campaignd",
"cutter", "exploder"])
env.Default("all")
env.TargetSignatures('content')
#
# Configuration
#
Help("""\
Available build targets include:
@ -69,7 +59,41 @@ Available build targets include:
sanity_check = run a pre-release sanity check on the distrivution
""" + opts.GenerateHelpText(env))
conf = Configure(env)
# Omits the 'test' target
all = env.Alias("all", ["wesnoth", "wesnoth_editor", "wesnothd", "campaignd",
"cutter", "exploder"])
env.Default("all")
env.TargetSignatures('content')
#
# Configuration
#
def CheckPKGConfig(context, version):
context.Message( 'Checking for pkg-config... ' )
ret = context.TryAction('pkg-config --atleast-pkgconfig-version=%s' % version)[0]
context.Result( ret )
return ret
def CheckPKG(context, name):
context.Message( 'Checking for %s... ' % name )
ret = context.TryAction('pkg-config --exists \'%s\'' % name)[0]
context.Result( ret )
return ret
conf = Configure(env, custom_tests = { 'CheckPKGConfig' : CheckPKGConfig,
'CheckPKG' : CheckPKG })
if not conf.CheckPKGConfig('0.15.0'):
print 'pkg-config >= 0.15.0 not found.'
Exit(1)
# FIXME: It would be good to check for SDL_ttf >= 2.0.8 here
if not conf.CheckPKG('SDL >= 1.2.7'):
print 'SDL >= 1.2.7 not found.'
Exit(1)
#
# Check some preconditions
@ -111,6 +135,8 @@ if "all" in targets or "wesnoth" in targets:
print "Needed Python lib for game and didn't find it; exiting!"
Exit(1)
boost_test_dyn_link = boost_auto_test = False
if 'test' in COMMAND_LINE_TARGETS:
boost_test_dyn_link = conf.CheckCXXHeader('boost/test/unit_test.hpp')
@ -749,8 +775,7 @@ env.Precious(sanity_check)
#
# Known problems:
#
# 1. We don't yet check for SDL version too old
# 2. We don't check for Ogg Vorbis support in SDL_mixer
# 1. We don't check for Ogg Vorbis support in SDL_mixer
# FIXME tags other problems
#
# To do:

View file

@ -499,7 +499,6 @@ AC_SUBST([PNG_CFLAGS])
AC_SUBST([PNG_LIBS])
AM_CONDITIONAL([LIBPNG], [test x$pngfound = xyes])
# *** Not yet covered by scons recipe
# Check for SDL version. Taken from sdl.m4
AC_ARG_ENABLE([sdltest],