summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/libcroco/tests/valgrind-version.sh
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/libcroco/tests/valgrind-version.sh')
-rwxr-xr-xsrc/3rdparty/libcroco/tests/valgrind-version.sh48
1 files changed, 48 insertions, 0 deletions
diff --git a/src/3rdparty/libcroco/tests/valgrind-version.sh b/src/3rdparty/libcroco/tests/valgrind-version.sh
new file mode 100755
index 0000000..55cbfc2
--- /dev/null
+++ b/src/3rdparty/libcroco/tests/valgrind-version.sh
@@ -0,0 +1,48 @@
+#! /bin/sh
+
+valgrind=`which valgrind`
+awk=`which awk`
+if test "x$valgrind" = "x" ; then
+ echo "valgrind-not-present" ;
+ exit ;
+fi
+
+
+valgrind_version=`$valgrind --version`
+if test "x$valgrind_version" = x ; then
+ echo "not-present" ;
+ exit
+fi
+
+if test "x$awk" = x ; then
+ echo "awk-not-present"
+ exit
+fi
+
+string_version=`echo $valgrind_version | $awk -F '-' '{print $2}'`
+
+if test "x$string_version" = "x" ; then
+ echo "valgrind-version-unknown"
+ exit
+fi
+
+major=`echo $string_version | $awk -F '.' '{print $1}'`
+minor=`echo $string_version | $awk -F '.' '{print $2}'`
+micro=`echo $string_version | $awk -F '.' '{print $3}'`
+
+version=`expr $major \* 10000 + $minor \* 100 + $micro`
+
+if test "x$version" = "x" ; then
+ echo "valgrind-version-unknown"
+ exit ;
+fi
+
+if test "$version" -ge "20101" ; then
+ echo "okay"
+ exit ;
+else
+ echo "valgrind-version-lower"
+ exit ;
+fi
+
+