Added option to specify location of GTK SDK to scons.
Use env.ParseConfig in pango check instead of TryAction("pkg-config ...
This commit is contained in:
parent
90f8831665
commit
d4bae581b0
2 changed files with 10 additions and 8 deletions
|
@ -77,6 +77,7 @@ opts.AddOptions(
|
|||
PathOption('boostlibdir', 'Directory where boost libraries are installed.', "", OptionalPath),
|
||||
('boost_suffix', 'Suffix of boost libraries.'),
|
||||
PathOption('gettextdir', 'Root directory of Gettext\'s installation.', "", OptionalPath),
|
||||
PathOption('gtkdir', 'Directory where GTK SDK is installed.', "", OptionalPath),
|
||||
('host', 'Cross-compile host.', ''),
|
||||
BoolOption('distcc', "Use distcc", False),
|
||||
BoolOption('ccache', "Use ccache", False),
|
||||
|
|
|
@ -1,21 +1,22 @@
|
|||
# vi: syntax=python:et:ts=4
|
||||
import os
|
||||
from os.path import join
|
||||
from os import environ
|
||||
from SCons.Util import AppendPath
|
||||
|
||||
def CheckPango(context, backend):
|
||||
context.Message("Checking for Pango with " + backend + " backend... ")
|
||||
env = context.env
|
||||
env["ENV"]["PKG_CONFIG_PATH"] = os.environ.get("PKG_CONFIG_PATH", "")
|
||||
gtkdir = os.environ.get("GTK_BASEPATH")
|
||||
gtkdir = env.get("gtkdir", os.environ.get("GTK_BASEPATH"))
|
||||
if gtkdir:
|
||||
env.AppendENVPath("PATH", join(gtkdir, "bin"))
|
||||
env.AppendENVPath("PKG_CONFIG_PATH", join(gtkdir, "lib/pkgconfig"))
|
||||
result, output = context.TryAction("pkg-config --libs --cflags pango" + backend + " > $TARGET")
|
||||
if result:
|
||||
env.MergeFlags(output)
|
||||
environ["PATH"] = AppendPath(environ["PATH"], join(gtkdir, "bin"))
|
||||
environ["PKG_CONFIG_PATH"] = AppendPath(environ.get("PKG_CONFIG_PATH", ""), join(gtkdir, "lib/pkgconfig"))
|
||||
|
||||
try:
|
||||
env.ParseConfig("pkg-config --libs --cflags pango" + backend)
|
||||
context.Result("yes")
|
||||
return True
|
||||
else:
|
||||
except OSError:
|
||||
context.Result("no")
|
||||
return False
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue