gst-plugins-nuvdemux/autogen.sh
author rosfran
Fri Apr 20 16:01:39 2007 +0100 (2007-04-20)
branchtrunk
changeset 580 7efc73147f5e
parent 47 8bff300ebf50
permissions -rwxr-xr-x
[svn r585] New function to get the channel list from database.
     1 #!/bin/sh
     2 # Run this to generate all the initial makefiles, etc.
     3 
     4 # Not all echo versions allow -n, so we check what is possible. This test is
     5 # based on the one in autoconf.
     6 case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
     7   *c*,-n*) ECHO_N= ;;
     8   *c*,*  ) ECHO_N=-n ;;
     9   *)       ECHO_N= ;;
    10 esac
    11 
    12 
    13 # some terminal codes ...
    14 boldface="`tput bold 2>/dev/null`"
    15 normal="`tput sgr0 2>/dev/null`"
    16 printbold() {
    17     echo $ECHO_N "$boldface"
    18     echo "$@"
    19     echo $ECHO_N "$normal"
    20 }    
    21 printerr() {
    22     echo "$@" >&2
    23 }
    24 
    25 # Usage:
    26 #     compare_versions MIN_VERSION ACTUAL_VERSION
    27 # returns true if ACTUAL_VERSION >= MIN_VERSION
    28 compare_versions() {
    29     ch_min_version=$1
    30     ch_actual_version=$2
    31     ch_status=0
    32     IFS="${IFS=         }"; ch_save_IFS="$IFS"; IFS="."
    33     set $ch_actual_version
    34     for ch_min in $ch_min_version; do
    35         ch_cur=`echo $1 | sed 's/[^0-9].*$//'`; shift # remove letter suffixes
    36         if [ -z "$ch_min" ]; then break; fi
    37         if [ -z "$ch_cur" ]; then ch_status=1; break; fi
    38         if [ $ch_cur -gt $ch_min ]; then break; fi
    39         if [ $ch_cur -lt $ch_min ]; then ch_status=1; break; fi
    40     done
    41     IFS="$ch_save_IFS"
    42     return $ch_status
    43 }
    44 
    45 # Usage:
    46 #     version_check PACKAGE VARIABLE CHECKPROGS MIN_VERSION SOURCE
    47 # checks to see if the package is available
    48 version_check() {
    49     vc_package=$1
    50     vc_variable=$2
    51     vc_checkprogs=$3
    52     vc_min_version=$4
    53     vc_source=$5
    54     vc_status=1
    55 
    56     vc_checkprog=`eval echo "\\$$vc_variable"`
    57     if [ -n "$vc_checkprog" ]; then
    58 	printbold "using $vc_checkprog for $vc_package"
    59 	return 0
    60     fi
    61 
    62     printbold "checking for $vc_package >= $vc_min_version..."
    63     for vc_checkprog in $vc_checkprogs; do
    64 	echo $ECHO_N "  testing $vc_checkprog... "
    65 	if $vc_checkprog --version < /dev/null > /dev/null 2>&1; then
    66 	    vc_actual_version=`$vc_checkprog --version | head -n 1 | \
    67                                sed 's/^.*[ 	]\([0-9.]*[a-z]*\).*$/\1/'`
    68 	    if compare_versions $vc_min_version $vc_actual_version; then
    69 		echo "found $vc_actual_version"
    70 		# set variable
    71 		eval "$vc_variable=$vc_checkprog"
    72 		vc_status=0
    73 		break
    74 	    else
    75 		echo "too old (found version $vc_actual_version)"
    76 	    fi
    77 	else
    78 	    echo "not found."
    79 	fi
    80     done
    81     if [ "$vc_status" != 0 ]; then
    82 	printerr "***Error***: You must have $vc_package >= $vc_min_version installed"
    83 	printerr "  to build $PKG_NAME.  Download the appropriate package for"
    84 	printerr "  from your distribution or get the source tarball at"
    85         printerr "    $vc_source"
    86 	printerr
    87     fi
    88     return $vc_status
    89 }
    90 
    91 #tell Mandrake autoconf wrapper we want autoconf 2.5x, not 2.13
    92 WANT_AUTOCONF_2_5=1
    93 export WANT_AUTOCONF_2_5
    94 version_check autoreconf AUTORECONF 'autoreconf' 2.50 \
    95     "http://ftp.gnu.org/pub/gnu/autoconf/autoconf-2.50.tar.gz" || DIE=1
    96 
    97 automake_progs="automake automake-1.9 automake-1.8 automake-1.7 automake-1.6 automake-1.5"
    98 
    99 version_check automake AUTOMAKE "$automake_progs" 1.5 \
   100     "http://ftp.gnu.org/pub/gnu/automake/automake-1.5.tar.gz" || DIE=1
   101 ACLOCAL=`echo $AUTOMAKE | sed s/automake/aclocal/`
   102 
   103 export AUTOMAKE ACLOCAL
   104 # gtkdocize
   105 autoreconf --install --force || exit 1
   106 
   107 #conf_flags="--enable-maintainer-mode"
   108 
   109 if test x$NOCONFIGURE = x; then
   110     printbold Running $srcdir/configure $conf_flags "$@" ...
   111     ./configure $conf_flags "$@" \
   112 	&& echo Now type \`make\' to compile $PKG_NAME || exit 1
   113 else
   114     echo Skipping configure process.
   115 fi