gst-plugins-nuvdemux/autogen.sh
branchtrunk
changeset 51 3e490ac963ce
child 57 c83c59b22fe1
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/gst-plugins-nuvdemux/autogen.sh	Wed Oct 25 00:26:33 2006 +0100
     1.3 @@ -0,0 +1,115 @@
     1.4 +#!/bin/sh
     1.5 +# Run this to generate all the initial makefiles, etc.
     1.6 +
     1.7 +# Not all echo versions allow -n, so we check what is possible. This test is
     1.8 +# based on the one in autoconf.
     1.9 +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
    1.10 +  *c*,-n*) ECHO_N= ;;
    1.11 +  *c*,*  ) ECHO_N=-n ;;
    1.12 +  *)       ECHO_N= ;;
    1.13 +esac
    1.14 +
    1.15 +
    1.16 +# some terminal codes ...
    1.17 +boldface="`tput bold 2>/dev/null`"
    1.18 +normal="`tput sgr0 2>/dev/null`"
    1.19 +printbold() {
    1.20 +    echo $ECHO_N "$boldface"
    1.21 +    echo "$@"
    1.22 +    echo $ECHO_N "$normal"
    1.23 +}    
    1.24 +printerr() {
    1.25 +    echo "$@" >&2
    1.26 +}
    1.27 +
    1.28 +# Usage:
    1.29 +#     compare_versions MIN_VERSION ACTUAL_VERSION
    1.30 +# returns true if ACTUAL_VERSION >= MIN_VERSION
    1.31 +compare_versions() {
    1.32 +    ch_min_version=$1
    1.33 +    ch_actual_version=$2
    1.34 +    ch_status=0
    1.35 +    IFS="${IFS=         }"; ch_save_IFS="$IFS"; IFS="."
    1.36 +    set $ch_actual_version
    1.37 +    for ch_min in $ch_min_version; do
    1.38 +        ch_cur=`echo $1 | sed 's/[^0-9].*$//'`; shift # remove letter suffixes
    1.39 +        if [ -z "$ch_min" ]; then break; fi
    1.40 +        if [ -z "$ch_cur" ]; then ch_status=1; break; fi
    1.41 +        if [ $ch_cur -gt $ch_min ]; then break; fi
    1.42 +        if [ $ch_cur -lt $ch_min ]; then ch_status=1; break; fi
    1.43 +    done
    1.44 +    IFS="$ch_save_IFS"
    1.45 +    return $ch_status
    1.46 +}
    1.47 +
    1.48 +# Usage:
    1.49 +#     version_check PACKAGE VARIABLE CHECKPROGS MIN_VERSION SOURCE
    1.50 +# checks to see if the package is available
    1.51 +version_check() {
    1.52 +    vc_package=$1
    1.53 +    vc_variable=$2
    1.54 +    vc_checkprogs=$3
    1.55 +    vc_min_version=$4
    1.56 +    vc_source=$5
    1.57 +    vc_status=1
    1.58 +
    1.59 +    vc_checkprog=`eval echo "\\$$vc_variable"`
    1.60 +    if [ -n "$vc_checkprog" ]; then
    1.61 +	printbold "using $vc_checkprog for $vc_package"
    1.62 +	return 0
    1.63 +    fi
    1.64 +
    1.65 +    printbold "checking for $vc_package >= $vc_min_version..."
    1.66 +    for vc_checkprog in $vc_checkprogs; do
    1.67 +	echo $ECHO_N "  testing $vc_checkprog... "
    1.68 +	if $vc_checkprog --version < /dev/null > /dev/null 2>&1; then
    1.69 +	    vc_actual_version=`$vc_checkprog --version | head -n 1 | \
    1.70 +                               sed 's/^.*[ 	]\([0-9.]*[a-z]*\).*$/\1/'`
    1.71 +	    if compare_versions $vc_min_version $vc_actual_version; then
    1.72 +		echo "found $vc_actual_version"
    1.73 +		# set variable
    1.74 +		eval "$vc_variable=$vc_checkprog"
    1.75 +		vc_status=0
    1.76 +		break
    1.77 +	    else
    1.78 +		echo "too old (found version $vc_actual_version)"
    1.79 +	    fi
    1.80 +	else
    1.81 +	    echo "not found."
    1.82 +	fi
    1.83 +    done
    1.84 +    if [ "$vc_status" != 0 ]; then
    1.85 +	printerr "***Error***: You must have $vc_package >= $vc_min_version installed"
    1.86 +	printerr "  to build $PKG_NAME.  Download the appropriate package for"
    1.87 +	printerr "  from your distribution or get the source tarball at"
    1.88 +        printerr "    $vc_source"
    1.89 +	printerr
    1.90 +    fi
    1.91 +    return $vc_status
    1.92 +}
    1.93 +
    1.94 +#tell Mandrake autoconf wrapper we want autoconf 2.5x, not 2.13
    1.95 +WANT_AUTOCONF_2_5=1
    1.96 +export WANT_AUTOCONF_2_5
    1.97 +version_check autoreconf AUTORECONF 'autoreconf' 2.50 \
    1.98 +    "http://ftp.gnu.org/pub/gnu/autoconf/autoconf-2.50.tar.gz" || DIE=1
    1.99 +
   1.100 +automake_progs="automake automake-1.9 automake-1.8 automake-1.7 automake-1.6 automake-1.5"
   1.101 +
   1.102 +version_check automake AUTOMAKE "$automake_progs" 1.5 \
   1.103 +    "http://ftp.gnu.org/pub/gnu/automake/automake-1.5.tar.gz" || DIE=1
   1.104 +ACLOCAL=`echo $AUTOMAKE | sed s/automake/aclocal/`
   1.105 +
   1.106 +export AUTOMAKE ACLOCAL
   1.107 +# gtkdocize
   1.108 +autoreconf --install || exit 1
   1.109 +
   1.110 +#conf_flags="--enable-maintainer-mode"
   1.111 +
   1.112 +if test x$NOCONFIGURE = x; then
   1.113 +    printbold Running $srcdir/configure $conf_flags "$@" ...
   1.114 +    ./configure $conf_flags "$@" \
   1.115 +	&& echo Now type \`make\' to compile $PKG_NAME || exit 1
   1.116 +else
   1.117 +    echo Skipping configure process.
   1.118 +fi