[vlc-commits] tools: make sure the protoc version is compatible

Steve Lhomme git at videolan.org
Tue May 15 18:34:58 CEST 2018


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Mon May 14 14:04:02 2018 +0200| [0864b20e4ea0ccd59e41c199407284ef0ed0d1ed] | committer: Steve Lhomme

tools: make sure the protoc version is compatible

Only the same major and minor versions are compatible

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=0864b20e4ea0ccd59e41c199407284ef0ed0d1ed
---

 extras/tools/bootstrap | 30 +++++++++++++++++++++++++++++-
 1 file changed, 29 insertions(+), 1 deletion(-)

diff --git a/extras/tools/bootstrap b/extras/tools/bootstrap
index 8467096f27..7856f3538b 100755
--- a/extras/tools/bootstrap
+++ b/extras/tools/bootstrap
@@ -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



More information about the vlc-commits mailing list