Commit 0864b20e authored by Steve Lhomme's avatar Steve Lhomme

tools: make sure the protoc version is compatible

Only the same major and minor versions are compatible
parent 8a7df337
......@@ -44,6 +44,21 @@ check_version() {
}
check_version_majmin() {
gotver=$2
gotmajor=`echo $gotver|cut -d. -f1`
gotminor=`echo $gotver|cut -d. -f2`
needmajor=`echo $3|cut -d. -f1`
needminor=`echo $3|cut -d. -f2`
if [ "$needmajor" -ne "$gotmajor" \
-o "$needminor" -ne "$gotminor" ]
then
echo "$1 not compatible"
NEEDED="$NEEDED .$1"
fi
}
check_tar() {
if ! tar PcJ /dev/null >/dev/null 2>&1
then
......@@ -89,6 +104,19 @@ else
fi
}
check_majmin() {
if ! $1 --version >/dev/null 2>&1 && ! $1 -version >/dev/null 2>&1 && ! $1 --version 2>/dev/null
then
echo "$1 not found"
NEEDED="$NEEDED .$1"
else
# found, need to check version ?
[ -z "$2" ] && return # no
gotver=`$1 --version | head -1 | sed s/'.* '//`
check_version_majmin $1 $gotver $2
fi
}
check autoconf 2.69
check automake 1.15
check m4 1.4.16
......@@ -99,7 +127,7 @@ check yasm
check_tar
check ragel
check_sed
check protoc 3.1.0
check_majmin protoc 3.1.0
check ant
check xz
check bison 3.0.0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment