diff options
author | Darren Salt <linux@youmustbejoking.demon.co.uk> | 2007-04-15 21:03:03 +0100 |
---|---|---|
committer | Darren Salt <linux@youmustbejoking.demon.co.uk> | 2007-04-15 21:03:03 +0100 |
commit | 6c2b67346d5d84462fc0d69687ae5dd592977061 (patch) | |
tree | c55671c66b62c781084f6fcf2b6d94f609c759ff | |
parent | 607d346e969776e6aee8042590f588ba66831b62 (diff) | |
download | xine-lib-6c2b67346d5d84462fc0d69687ae5dd592977061.tar.gz xine-lib-6c2b67346d5d84462fc0d69687ae5dd592977061.tar.bz2 |
Cope with auto* minor & patch numbers >= 10.
Will break if one reaches 100 :-)
-rwxr-xr-x | autogen.sh | 45 |
1 files changed, 20 insertions, 25 deletions
diff --git a/autogen.sh b/autogen.sh index 580ed39de..e228f051b 100755 --- a/autogen.sh +++ b/autogen.sh @@ -51,6 +51,17 @@ detect_configure_ac() { } } +parse_version_no() { + # version no. is extended/truncated to three parts; only digits are handled + perl -e 'my $v = <>; + chomp $v; + my @v = split (" ", $v); + $v = $v[$#v]; + $v =~ s/[^0-9.].*$//; + @v = split (/\./, $v); + push @v, 0 while $#v < 2; + print $v[0] * 10000 + $v[1] * 100 + $v[2], "\n"' +} #-------------------- # AUTOCONF @@ -61,12 +72,8 @@ detect_autoconf() { 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 + AC="`autoconf --version | parse_version_no`" + if [ `expr $AC` -ge "`echo $AUTOCONF_MIN | parse_version_no`" ]; then autoconf_ok=yes fi else @@ -114,12 +121,8 @@ try_libtool_executable() { 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 + LT="`$libtool --version | awk '{ print $4 }' | parse_version_no`" + if [ `expr $LT` -ge "`echo $LIBTOOL_MIN | parse_version_no`" ]; then libtool_ok=yes fi fi @@ -166,12 +169,8 @@ detect_automake() { NUM_RESULT=$# RESULT_FILE=$3 if [ $RETVAL -eq 0 -a $NUM_RESULT -eq 3 -a -f "$RESULT_FILE" ]; then - 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 + AM="`automake --version | parse_version_no`" + if [ `expr $AM` -ge "`echo $AUTOMAKE_MIN | parse_version_no`" ]; then automake_ok=yes fi else @@ -208,17 +207,13 @@ detect_aclocal() { NUM_RESULT=$# RESULT_FILE=$3 if [ $RETVAL -eq 0 -a $NUM_RESULT -eq 3 -a -f "$RESULT_FILE" ]; then - 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 + AC="`aclocal --version | parse_version_no`" + if [ `expr $AC` -ge "`echo $AUTOMAKE_MIN | parse_version_no`" ]; then aclocal_ok=yes fi else echo - echo "**Error**: You must have \`automake' >= $AUTOMAKE_MIN installed to" + echo "**Error**: You must have \`aclocal' >= $AUTOMAKE_MIN installed to" echo " compile $PROG. Download the appropriate package" echo " for your distribution or source from ftp.gnu.org." exit 1 |