]> git.sesse.net Git - vlc/blobdiff - extras/tools/bootstrap
extras/tools: update gas-pp
[vlc] / extras / tools / bootstrap
index 9a185ebd0f5ce76bdf568ddaca0d9839b09e559d..905d12814f6f08be6f69637fd4f251674e3e995a 100755 (executable)
@@ -24,6 +24,25 @@ then
        exit 1
 fi
 
+check_tar() {
+if ! tar PcJ /dev/null >/dev/null 2>&1
+then
+    echo "tar doesn't support xz (J option)"
+    NEEDED="$NEEDED .tar .xz"
+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
@@ -32,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"
@@ -46,23 +70,33 @@ else
 fi
 }
 
-check autoconf 2.67
-check automake 1.11
-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 xz
-check cmake
+check cmake 2.8.8
 check yasm
+check_tar
+check ragel
+check_sed
 
 [ -n "$NEEDED" ] && mkdir -p build/
 
 CPUS=
+CC=
+CXX=
 case `uname` in
     Linux)
         CPUS=`grep -c ^processor /proc/cpuinfo`
      ;;
     Darwin)
         CPUS=`sysctl hw.ncpu|cut -d: -f2`
+        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
@@ -72,12 +106,12 @@ esac
 
 cat > Makefile << EOF
 MAKEFLAGS += -j$CPUS
+$CC
+$CXX
 PREFIX=\$(abspath ./build)
 
 all: $NEEDED
        @echo "You are ready to build VLC and its contribs"
 
-automake: .autoconf
-
 include tools.mak
 EOF