]> git.sesse.net Git - vlc/commitdiff
extras/tools: check if autotools are recent enough
authorRafaël Carré <funman@videolan.org>
Tue, 15 Nov 2011 04:25:45 +0000 (23:25 -0500)
committerRafaël Carré <funman@videolan.org>
Tue, 15 Nov 2011 04:25:45 +0000 (23:25 -0500)
extras/tools/bootstrap

index 5fe72a0cfc5f007cfc2676b6ec8c8304e3e935bd..9a185ebd0f5ce76bdf568ddaca0d9839b09e559d 100755 (executable)
@@ -25,17 +25,30 @@ then
 fi
 
 check() {
-# FIXME : add version check: automake 1.11, autoconf 2.67 libtool 2.2
 if ! $1 --version >/dev/null 2>&1
 then
     echo "$1 not found"
     NEEDED="$NEEDED .$1"
+else
+    # found, need to check version ?
+    [ -z "$2" ] && return # no
+    # we only check GNU tools, their version have the form MAJOR.MINOR
+    gotver=`$1 --version | head -1 | sed s/'.* '//`
+    gotmajor=`echo $gotver|cut -d. -f1`
+    gotminor=`echo $gotver|cut -d. -f2`
+    needmajor=`echo $2|cut -d. -f1`
+    needminor=`echo $2|cut -d. -f2`
+    if [ "$needmajor" -gt "$gotmajor" -o "$needmajor" -eq "$gotmajor" -a "$needminor" -gt "$gotminor" ]
+    then
+        echo "$1 too old"
+        NEEDED="$NEEDED .$1"
+    fi
 fi
 }
 
-check autoconf
-check automake
-check libtool
+check autoconf 2.67
+check automake 1.11
+check libtool 2.2
 check pkg-config
 check xz
 check cmake