]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
configure: check if pkg-config is available
authorMiroslav Lichvar <mlichvar@redhat.com>
Tue, 9 Sep 2014 10:23:14 +0000 (12:23 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Tue, 9 Sep 2014 15:08:26 +0000 (17:08 +0200)
This is needed with some shells to prevent "pkg-config: not found"
errors from being displayed.

configure

index e4dab64e730b7d1e091feafdc126caaef5e516cd..e82d1dd5df9cfb3780f5023fcd39760aed7fa40b 100755 (executable)
--- a/configure
+++ b/configure
@@ -160,6 +160,13 @@ add_def () {
   fi
 }
 #}}}
+#{{{ pkg_config
+pkg_config () {
+  type pkg-config > /dev/null 2> /dev/null || return 1
+
+  pkg-config $@ 2> /dev/null
+}
+#}}}
 
 # ======================================================================
 
@@ -604,8 +611,8 @@ HASH_COMPILE=""
 HASH_LINK=""
 
 if [ $try_nss = "1" ]; then
-  test_cflags="`pkg-config --cflags nss 2> /dev/null`"
-  test_link="`pkg-config --libs-only-L nss 2> /dev/null` -lfreebl3"
+  test_cflags="`pkg_config --cflags nss`"
+  test_link="`pkg_config --libs-only-L nss` -lfreebl3"
   if test_code 'NSS' 'nss.h hasht.h nsslowhash.h' \
     "$test_cflags" "$test_link" \
     'NSSLOWHASH_Begin(NSSLOWHASH_NewContext(NSSLOW_Init(), HASH_AlgSHA512));'