waf: backport finding of pkg-config
authorUri Simchoni <uri@samba.org>
Thu, 19 Jan 2017 05:46:57 +0000 (07:46 +0200)
committerJeremy Allison <jra@samba.org>
Wed, 25 Jan 2017 03:23:00 +0000 (04:23 +0100)
Allow the builder to customize the location of pkg-config
utility by setting PKGCONFIG environment variable.

This is backported from upstream waf.

Thanks to Zentaro Kavanagh <zentaro@google.com> for
pointing that out and proposing the fix.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12529

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Jan 25 04:23:00 CET 2017 on sn-devel-144

third_party/waf/wafadmin/Tools/config_c.py

index 3ab447ccf424c17b684f8862973deb505caa6f32..cdf3b3ebb681501a2179b2f09a1b8472ff35615e 100644 (file)
@@ -106,7 +106,9 @@ def ret_msg(self, f, kw):
 @conf
 def validate_cfg(self, kw):
        if not 'path' in kw:
-               kw['path'] = 'pkg-config --errors-to-stdout --print-errors'
+               if not self.env.PKGCONFIG:
+                       self.find_program('pkg-config', var='PKGCONFIG')
+               kw['path'] = self.env.PKGCONFIG
 
        # pkg-config version
        if 'atleast_pkgconfig_version' in kw: