diff options
author | Karl MacMillan <kmacmill@redhat.com> | 2007-10-18 15:16:07 -0400 |
---|---|---|
committer | Karl MacMillan <kmacmill@redhat.com> | 2007-10-18 15:16:07 -0400 |
commit | 4c59be2b0d00afdc6bfe58fa813cb3570657b3d4 (patch) | |
tree | 4ef11fba63c2d0f8d114414626e89f1e61e589a2 /ipa-server/autogen.sh | |
parent | 6249f20526006c3576fb099491132d403bb66cbe (diff) | |
download | freeipa-4c59be2b0d00afdc6bfe58fa813cb3570657b3d4.tar.gz freeipa-4c59be2b0d00afdc6bfe58fa813cb3570657b3d4.tar.xz freeipa-4c59be2b0d00afdc6bfe58fa813cb3570657b3d4.zip |
Fix autogen.sh to correctly compare versions and removed .la files from packages.
Diffstat (limited to 'ipa-server/autogen.sh')
-rwxr-xr-x | ipa-server/autogen.sh | 53 |
1 files changed, 37 insertions, 16 deletions
diff --git a/ipa-server/autogen.sh b/ipa-server/autogen.sh index 2e80fc21..c95b6dbc 100755 --- a/ipa-server/autogen.sh +++ b/ipa-server/autogen.sh @@ -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 |