From 4c59be2b0d00afdc6bfe58fa813cb3570657b3d4 Mon Sep 17 00:00:00 2001 From: Karl MacMillan Date: Thu, 18 Oct 2007 15:16:07 -0400 Subject: Fix autogen.sh to correctly compare versions and removed .la files from packages. --- ipa-client/autogen.sh | 55 +++++++++++++++++++++++++++++++++++---------------- 1 file changed, 38 insertions(+), 17 deletions(-) (limited to 'ipa-client') diff --git a/ipa-client/autogen.sh b/ipa-client/autogen.sh index 072bd15aa..c95b6dbc6 100755 --- a/ipa-client/autogen.sh +++ b/ipa-client/autogen.sh @@ -2,7 +2,7 @@ # Run this to generate all the initial makefiles, etc. set -e -PACKAGE=freeipa-client +PACKAGE=freeipa-server LIBTOOLIZE=${LIBTOOLIZE-libtoolize} LIBTOOLIZE_FLAGS="--copy --force" @@ -33,6 +33,26 @@ ORIGDIR=`pwd` cd $srcdir +# Usage: +# compare_versions MIN_VERSION ACTUAL_VERSION +# returns true if ACTUAL_VERSION >= MIN_VERSION +compare_versions() { + ch_min_version=$1 + ch_actual_version=$2 + ch_status=0 + IFS="${IFS= }"; ch_save_IFS="$IFS"; IFS="." + set $ch_actual_version + for ch_min in $ch_min_version; do + ch_cur=`echo $1 | sed 's/[^0-9].*$//'`; shift # remove letter suffixes + if [ -z "$ch_min" ]; then break; fi + if [ -z "$ch_cur" ]; then ch_status=1; break; fi + if [ $ch_cur -gt $ch_min ]; then break; fi + if [ $ch_cur -lt $ch_min ]; then ch_status=1; break; fi + done + IFS="$ch_save_IFS" + return $ch_status +} + if ($AUTOCONF --version) < /dev/null > /dev/null 2>&1 ; then if ($AUTOCONF --version | head -n 1 | awk 'NR==1 { if( $(NF) >= '$autoconf_min_vers') \ exit 1; exit 0; }'); @@ -78,23 +98,24 @@ fi # aren't sufficiently new. # if ($AUTOMAKE --version) < /dev/null > /dev/null 2>&1 ; then - if ($AUTOMAKE --version | head -n 1 | awk 'NR==1 { if( $(NF) >= '$automake_min_vers') \ - exit 1; exit 0; }'); - then - echo "$ARGV0: ERROR: \`$AUTOMAKE' is too old." - $AUTOMAKE --version - echo " (version $automake_min_vers or newer is required)" - DIE="yes" - fi + automake_actual_version=`$AUTOMAKE --version | head -n 1 | \ + sed 's/^.*[ ]\([0-9.]*[a-z]*\).*$/\1/'` + if ! compare_versions $automake_min_vers $automake_actual_version; then + echo "$ARGV0: ERROR: \`$AUTOMAKE' is too old." + $AUTOMAKE --version + echo " (version $automake_min_vers or newer is required)" + DIE="yes" + fi if ($ACLOCAL --version) < /dev/null > /dev/null 2>&1; then - if ($ACLOCAL --version | head -n 1 | awk 'NR==1 { if( $(NF) >= '$aclocal_min_vers' ) \ - exit 1; exit 0; }' ); - then - echo "$ARGV0: ERROR: \`$ACLOCAL' is too old." - $ACLOCAL --version - echo " (version $aclocal_min_vers or newer is required)" - DIE="yes" - fi + aclocal_actual_version=`$ACLOCAL --version | head -n 1 | \ + sed 's/^.*[ ]\([0-9.]*[a-z]*\).*$/\1/'` + + if ! compare_versions $aclocal_min_vers $aclocal_actual_version; then + echo "$ARGV0: ERROR: \`$ACLOCAL' is too old." + $ACLOCAL --version + echo " (version $aclocal_min_vers or newer is required)" + DIE="yes" + fi else echo $ACLOCAL: command not found echo -- cgit