diff options
-rwxr-xr-x | autogen.sh | 189 |
1 files changed, 128 insertions, 61 deletions
diff --git a/autogen.sh b/autogen.sh index b272ff68d..8bf4d7663 100755 --- a/autogen.sh +++ b/autogen.sh @@ -1,8 +1,36 @@ #!/bin/sh +# +# Copyright (C) 2000-2002 the xine project +# +# This file is part of xine, a unix video player. +# +# xine is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# xine is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA +# +# $Id: autogen.sh,v 1.7 2003/01/05 19:32:34 storri Exp $ +# +# Maintained by Stephen Torri <storri@users.sourceforge.net> +# # run this to generate all the initial makefiles, etc. PROG=xine-lib +# Minimum value required to build +AUTOMAKE_MIN=1.6.0 +AUTOCONF_MIN=2.53 +LIBTOOL_MIN=1.4.0 + # Check how echo works in this /bin/sh case `echo -n` in -n) _echo_n= _echo_c='\c';; @@ -26,22 +54,49 @@ detect_configure_ac() { # AUTOCONF #------------------- detect_autoconf() { - (autoconf --version) < /dev/null > /dev/null 2>&1 || { + set -- `type autoconf 2>/dev/null` + RETVAL=$? + NUM_RESULT=$# + RESULT_FILE=$3 + if [ $RETVAL -eq 0 -a $NUM_RESULT -eq 3 -a -f "$RESULT_FILE" ]; then + AC="`autoconf --version | sed -n 1p | sed -e 's/[a-zA-Z\ \.\(\)\-]//g'`" + AUTOCONF_MIN="`echo $AUTOCONF_MIN | sed -e 's/[a-zA-Z\ \.\(\)\-]//g'`" + if test $AC -lt 100 ; then + AC=`expr $AC \* 10` + fi + if [ `expr $AC` -ge $AUTOCONF_MIN ]; then + autoconf_ok=yes + fi + else echo - echo "**Error**: You must have \`autoconf' installed to compile xine-lib." - echo "Download the appropriate package for your distribution," - echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/" + echo "**Error**: You must have \`autoconf' >= $AUTOCONF_MIN installed to" + echo " compile $PROG. Download the appropriate package" + echo " for your distribution or source from ftp.gnu.org." exit 1 - } + fi } run_autoheader () { + if test x"$autoconf_ok" != x"yes"; then + echo + echo "**Warning**: Version of autoconf is less than $AUTOCONF_MIN." + echo " Some warning message might occur from autoconf" + echo + fi + echo $_echo_n " + Running autoheader: $_echo_c"; autoheader; echo "done." } run_autoconf () { + if test x"$autoconf_ok" != x"yes"; then + echo + echo "**Warning**: Version of autoconf is less than $AUTOCONF_MIN." + echo " Some warning message might occur from autoconf" + echo + fi + echo $_echo_n " + Running autoconf: $_echo_c"; autoconf; echo "done." @@ -51,16 +106,36 @@ run_autoconf () { # LIBTOOL #------------------- detect_libtool() { - (libtool --version) < /dev/null > /dev/null 2>&1 || { + set -- `type libtool 2>/dev/null` + RETVAL=$? + NUM_RESULT=$# + RESULT_FILE=$3 + if [ $RETVAL -eq 0 -a $NUM_RESULT -eq 3 -a -f "$RESULT_FILE" ]; then + LT="`libtool --version | awk '{ print $4 }' | sed -e 's/[a-zA-Z\ \.\(\)\-]//g'`" + LIBTOOL_MIN="`echo $LIBTOOL_MIN | sed -e 's/[a-zA-Z\ \.\(\)\-]//g'`" + if test $LT -lt 100 ; then + LT=`expr $LT \* 10` + fi + if [ `expr $LT` -ge $LIBTOOL_MIN ]; then + libtool_ok=yes + fi + else echo - echo "**Error**: You must have \`libtool' installed to compile xine-lib." - echo "Get ftp://ftp.gnu.org/pub/gnu/libtool-1.4.tar.gz" - echo "(or a newer version if it is available)" + echo "**Error**: You must have \`libtool' >= $LIBTOOL_MIN installed to" + echo " compile $PROG. Download the appropriate package" + echo " for your distribution or source from ftp.gnu.org." exit 1 - } + fi } run_libtoolize() { + if test x"$libtool_ok" != x"yes"; then + echo + echo "**Warning**: Version of libtool is less than $LIBTOOL_MIN." + echo " Some warning message might occur from libtool" + echo + fi + echo $_echo_n " + Running libtoolize: $_echo_c"; libtoolize --force --copy >/dev/null 2>&1; echo "done." @@ -74,46 +149,39 @@ detect_automake() { # expected output from 'type' is # automake is /usr/local/bin/automake # - set -- `type automake-1.6 2>/dev/null` + set -- `type automake 2>/dev/null` RETVAL=$? NUM_RESULT=$# RESULT_FILE=$3 if [ $RETVAL -eq 0 -a $NUM_RESULT -eq 3 -a -f "$RESULT_FILE" ]; then - automake_1_6x=yes - automake=automake-1.6 - else - set -- `type automake 2>/dev/null` - RETVAL=$? - NUM_RESULT=$# - RESULT_FILE=$3 - if [ $RETVAL -eq 0 -a $NUM_RESULT -eq 3 -a -f "$RESULT_FILE" ]; then - automake=automake - AM="`automake --version | sed -n 1p | sed -e 's/[a-zA-Z\ \.\(\)\-]//g'`" - if test $AM -lt 100 ; then - AM=`expr $AM \* 10` - fi - if [ `expr $AM` -ge 160 ]; then - automake_1_6x=yes - fi - else - echo - echo "You must have automake installed to compile $PROG." - echo "Get ftp://ftp.gnu.org/pub/gnu/automake-1.6.tar.gz" - echo "(or a newer version if it is available)" - exit 1 + AM="`automake --version | sed -n 1p | sed -e 's/[a-zA-Z\ \.\(\)\-]//g'`" + AUTOMAKE_MIN="`echo $AUTOMAKE_MIN | sed -e 's/[a-zA-Z\ \.\(\)\-]//g'`" + if test $AM -lt 100 ; then + AM=`expr $AM \* 10` + fi + if [ `expr $AM` -ge $AUTOMAKE_MIN ]; then + automake_ok=yes fi + else + echo + echo "**Error**: You must have \`automake' >= $AUTOMAKE_MIN installed to" + echo " compile $PROG. Download the appropriate package" + echo " for your distribution or source from ftp.gnu.org." + exit 1 fi } run_automake () { - if test x"$automake_1_6x" != x"yes"; then - echo "Warning: automake < 1.6. Some warning message might occur from automake" + if test x"$automake_ok" != x"yes"; then + echo + echo "**Warning**: Version of automake is less than $AUTOMAKE_MIN." + echo " Some warning message might occur from automake" echo fi echo $_echo_n " + Running automake: $_echo_c"; - $automake --gnu --add-missing --copy; + automake --gnu --add-missing --copy; echo "done." } @@ -123,42 +191,40 @@ run_automake () { detect_aclocal() { # if no automake, don't bother testing for aclocal - set -- `type aclocal-1.6 2>/dev/null` + set -- `type aclocal 2>/dev/null` RETVAL=$? NUM_RESULT=$# RESULT_FILE=$3 if [ $RETVAL -eq 0 -a $NUM_RESULT -eq 3 -a -f "$RESULT_FILE" ]; then - aclocal_1_6x=yes - aclocal=aclocal-1.6 - else - set -- `type aclocal 2>/dev/null` - RETVAL=$? - NUM_RESULT=$# - RESULT_FILE=$3 - if [ $RETVAL -eq 0 -a $NUM_RESULT -eq 3 -a -f "$RESULT_FILE" ]; then - aclocal=aclocal - AC="`aclocal --version | sed -n 1p | sed -e 's/[a-zA-Z\ \.\(\)\-]//g'`" - if test $AC -lt 100 ; then - AC=`expr $AC \* 10` - fi - if [ `expr $AC` -ge 160 ]; then - aclocal_1_6x=yes - fi - else - echo - echo "**Error**: Missing \`aclocal'. The version of \`automake'" - echo "installed doesn't appear recent enough." - echo "Get ftp://ftp.gnu.org/pub/gnu/automake-1.3.tar.gz" - echo "(or a newer version if it is available)" - exit 1 + AC="`aclocal --version | sed -n 1p | sed -e 's/[a-zA-Z\ \.\(\)\-]//g'`" + ACLOCAL_MIN="`echo $AUTOMAKE_MIN | sed -e 's/[a-zA-Z\ \.\(\)\-]//g'`" + if test $AC -lt 100 ; then + AC=`expr $AC \* 10` + fi + if [ `expr $AC` -ge $ACLOCAL_MIN ]; then + aclocal_ok=yes fi + else + echo + echo "**Error**: You must have \`automake' >= $AUTOMAKE_MIN installed to" + echo " compile $PROG. Download the appropriate package" + echo " for your distribution or source from ftp.gnu.org." + exit 1 fi } run_aclocal () { + + if test x"$aclocal_ok" != x"yes"; then + echo + echo "**Warning**: Version of aclocal is less than $AUTOMAKE_MIN." + echo " Some warning message might occur from aclocal" + echo + fi + echo $_echo_n " + Running aclocal: $_echo_c" - $aclocal -I m4 + aclocal -I m4 echo "done." } @@ -196,6 +262,7 @@ case "$1" in run_autoheader ;; automake) + run_aclocal run_automake ;; autoconf) |