[Scons-users] Would some helper functions for working with pkg-config be useful?
Bill Deegan
bill at baddogconsulting.com
Thu Oct 1 23:21:35 EDT 2015
I'm working my way through all bugs in scons' bug tracker which have
patches.
Would people find this useful?
http://scons.tigris.org/issues/show_bug.cgi?id=1078
def ParsePkgConfig(self, name):
+ """
+ Pass the output of pkg-config --cflags --libs <name> to ParseConfig
+ """
+
+ return self.ParseConfig('pkg-config --cflags --libs %s' % name)
+
+def CheckPkgConfig(context, version):
+ """
+ Check whether at least the specified version of pkg-config is available
+ """
+ context.Message('Checking for pkg-config version %s... ' % version)
+ ret = context.TryAction('pkg-config
--atleast-pkgconfig-version=%s' % version)[0]
+ context.Result(ret)
+ return ret
+
+def CheckPkgConfigPackage(context, desc):
+ """
+ Check to see if a pkg-config package exists. desc should be something
+ like 'GTK+-2.0 >= 2.4.9'.
+ """
+ context.Message('Checking for %s... ' % desc)
+ ret = context.TryAction('pkg-config --exists \'%s\'' % desc)[0]
+ context.Result(ret)
+ return ret
+
-Bill
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20151001/bb0be237/attachment.html>
More information about the Scons-users
mailing list