Author: loonycyborg
Date: Sun Jul 13 12:24:33 2008
New Revision: 27978

URL: http://svn.gna.org/viewcvs/wesnoth?rev=27978&view=rev
Log:
- Added option to specify location of GTK SDK to scons.
- Use env.ParseConfig in pango check instead of TryAction("pkg-config ...

Modified:
    trunk/SConstruct
    trunk/scons/pango.py

Modified: trunk/SConstruct
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/SConstruct?rev=27978&r1=27977&r2=27978&view=diff
==============================================================================
--- trunk/SConstruct (original)
+++ trunk/SConstruct Sun Jul 13 12:24:33 2008
@@ -77,6 +77,7 @@
     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),

Modified: trunk/scons/pango.py
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/scons/pango.py?rev=27978&r1=27977&r2=27978&view=diff
==============================================================================
--- trunk/scons/pango.py (original)
+++ trunk/scons/pango.py Sun Jul 13 12:24:33 2008
@@ -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
 


_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits

Reply via email to