]> git.sesse.net Git - vlc/blobdiff - extras/tools/bootstrap
Extras: add protoc
[vlc] / extras / tools / bootstrap
index 2dd747fd636bf2cfe6fd88ca66291b20e030535f..5d1bd118ebac522fb3357904737768c44e43e0bf 100755 (executable)
@@ -32,6 +32,17 @@ then
 fi
 }
 
+check_sed() {
+tmp="`pwd`/check_sed"
+trap "rm $tmp{,-e} 2>/dev/null" EXIT
+echo "test file for GNU sed" > $tmp
+if ! sed -i -e 's/sed//' $tmp >/dev/null 2>&1
+then
+    echo "sed doesn't do in-place editing (-i option)"
+    NEEDED="$NEEDED .sed"
+fi
+}
+
 check() {
 if ! $1 --version >/dev/null 2>&1
 then
@@ -40,13 +51,18 @@ then
 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`
+    gotmicro=`echo $gotver|cut -d. -f3`
+    [ -z "$gotmicro" ] && gotmicro=0
     needmajor=`echo $2|cut -d. -f1`
     needminor=`echo $2|cut -d. -f2`
-    if [ "$needmajor" -gt "$gotmajor" -o "$needmajor" -eq "$gotmajor" -a "$needminor" -gt "$gotminor" ]
+    needmicro=`echo $2|cut -d. -f3`
+    [ -z "$needmicro" ] && needmicro=0
+    if [ "$needmajor" -gt "$gotmajor" \
+         -o "$needmajor" -eq "$gotmajor" -a "$needminor" -gt "$gotminor" \
+         -o "$needmajor" -eq "$gotmajor" -a "$needminor" -eq "$gotminor" -a "$needmicro" -gt "$gotmicro" ]
     then
         echo "$1 too old"
         NEEDED="$NEEDED .$1"
@@ -54,15 +70,17 @@ else
 fi
 }
 
-check autoconf 2.67
-check automake 1.11
-check m4
-check libtool 2.2
+check autoconf 2.69
+check automake 1.14
+check m4 1.4.16
+check libtool 2.4
 check pkg-config
-check cmake
+check cmake 2.8.8
 check yasm
 check_tar
 check ragel
+check_sed
+check protoc
 
 [ -n "$NEEDED" ] && mkdir -p build/
 
@@ -78,6 +96,9 @@ case `uname` in
         gcc-4.2 --version >/dev/null 2>&1 && CC=CC=gcc-4.2
         g++-4.2 --version >/dev/null 2>&1 && CXX=CXX=g++-4.2
     ;;
+    SunOS)
+        CPUS=`/usr/bin/kstat -p :::state | grep 'on-line$' | wc -l | sed 's/ //g'`
+    ;;
     *)
         CPUS=1  # default
      ;;