Require pkg-config 0.24 for creating pkgconfig() dependencies
[platform/upstream/rpm.git] / scripts / pkgconfigdeps.sh
index 00cba00..270dd74 100755 (executable)
@@ -11,6 +11,11 @@ test -x $pkgconfig || {
     exit 0
 }
 
+$pkgconfig --atleast-pkgconfig-version="0.24" || {
+    cat > /dev/null
+    exit 0
+}
+
 case $1 in
 -P|--provides)
     while read filename ; do
@@ -39,7 +44,7 @@ case $1 in
        [ $i -eq 1 ] && echo "$pkgconfig"
        DIR="`dirname ${filename}`"
        export PKG_CONFIG_PATH="$DIR:$DIR/../../share/pkgconfig"
-       $pkgconfig --print-requires "$filename" 2> /dev/null | while read n r v ; do
+       $pkgconfig --print-requires --print-requires-private "$filename" 2> /dev/null | while read n r v ; do
            [ -n "$n" ] || continue
            echo -n "pkgconfig($n) "
            [ -n "$r" ] && [ -n "$v" ] && echo -n "$r" "$v"