summaryrefslogtreecommitdiff
path: root/devel/mate-common/files/patch-macros_mate-autogen
blob: cab3850fce83048028c45ed95320c7aaefa9d0dc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
https://bugs.gentoo.org/show_bug.cgi?id=427432
https://bugzilla.gnome.org/show_bug.cgi?id=680363

--- macros/mate-autogen.orig	2016-09-17 07:36:20.000000000 +0200
+++ macros/mate-autogen	2016-11-23 20:00:33.508805000 +0100
@@ -94,6 +94,7 @@
     vc_min_version=$4
     vc_source=$5
     vc_status=1
+    vc_option="--version"
     local ${vc_variable}_VERSION
 
     vc_checkprog=`eval echo "\\$$vc_variable"`
@@ -102,11 +103,18 @@
 	return 0
     fi
 
-    printbold "checking for $vc_package >= $vc_min_version..."
+    # The most reliable way to check pkg-config version is to query the actual
+    # virtual
+    # pkg-config package entry's modversion.  This works in all known
+    # implementations.
+    if test "x$vc_package" = "xpkg-config"; then
+	vc_option="--modversion pkg-config"
+    fi
+    printbold "checking for $vc_package $vc_comparator $vc_min_version..."
     for vc_checkprog in $vc_checkprogs; do
 	echo $ECHO_N "  testing $vc_checkprog... " $ECHO_C
-	if $vc_checkprog --version < /dev/null > /dev/null 2>&1; then
-	    vc_actual_version=`$vc_checkprog --version | head -n 1 | \
+	if $vc_checkprog $vc_option < /dev/null > /dev/null 2>&1; then
+	    vc_actual_version=`$vc_checkprog $vc_option | head -n 1 | \
                                sed 's/^.*[ 	]\([0-9.]*[a-z]*\).*$/\1/'`
 	    if compare_versions $vc_min_version $vc_actual_version; then
 		echo "found $vc_actual_version"