summaryrefslogtreecommitdiff
path: root/autogen.sh
diff options
context:
space:
mode:
authorMartyn Russell <martyn@lanedo.com>2010-07-19 11:04:14 +0100
committerJürg Billeter <j@bitron.ch>2010-08-09 17:56:46 +0200
commitd57c5a5f94731c17c335c8a1c984b2de98a31c5b (patch)
tree298cd964bd80e5b57da13bb18bd27f20cf80ab90 /autogen.sh
parente2ed509fbe1663958b5d6beb6804727415efaada (diff)
downloadtracker-d57c5a5f94731c17c335c8a1c984b2de98a31c5b.tar.gz
build: Require Vala 0.9.4 for libtracker-sparql
Vala 0.9.3 required for abstract async methods and 0.9.4 required for gtk-doc documentation in Vala files.
Diffstat (limited to 'autogen.sh')
-rwxr-xr-xautogen.sh31
1 files changed, 28 insertions, 3 deletions
diff --git a/autogen.sh b/autogen.sh
index 038c496c4..0b9f7d750 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -1,11 +1,14 @@
#!/bin/sh
# Run this to generate all the initial makefiles, etc.
+#
+# NOTE: compare_versions() is stolen from gnome-autogen.sh
srcdir=`dirname $0`
test -z "$srcdir" && srcdir=.
PKG_NAME="tracker"
REQUIRED_AUTOMAKE_VERSION=1.9
+REQUIRED_VALA_VERSION=0.9.4
(test -f $srcdir/configure.ac \
&& test -f $srcdir/README) || {
@@ -14,11 +17,33 @@ REQUIRED_AUTOMAKE_VERSION=1.9
exit 1
}
+# Usage:
+# compare_versions MIN_VERSION ACTUAL_VERSION
+# returns true if ACTUAL_VERSION >= MIN_VERSION
+compare_versions() {
+ ch_min_version=$1
+ ch_actual_version=$2
+ ch_status=0
+ IFS="${IFS= }"; ch_save_IFS="$IFS"; IFS="."
+ set $ch_actual_version
+ for ch_min in $ch_min_version; do
+ ch_cur=`echo $1 | sed 's/[^0-9].*$//'`; shift # remove letter suffixes
+ if [ -z "$ch_min" ]; then break; fi
+ if [ -z "$ch_cur" ]; then ch_status=1; break; fi
+ if [ $ch_cur -gt $ch_min ]; then break; fi
+ if [ $ch_cur -lt $ch_min ]; then ch_status=1; break; fi
+ done
+ IFS="$ch_save_IFS"
+ return $ch_status
+}
+
+# Vala version check
test -z "$VALAC" && VALAC=valac
+VALA_VERSION=`$VALAC --version | cut -d" " -f2`
+echo $VALA_VERSION
-if ! $VALAC --version | sed -e 's/^.*\([0-9]\+\.[0-9]\+\)\.[0-9]\+.*$/\1/' | grep -vq '^0\.[0-6]$'
-then
- echo "**Error**: You must have valac >= 0.7.6 installed to build $PKG_NAME"
+if ! compare_versions $REQUIRED_VALA_VERSION $VALA_VERSION; then
+ echo "**Error**: You must have valac >= $REQUIRED_VALA_VERSION installed to build $PKG_NAME, you have $VALA_VERSION"
exit 1
fi