From 9e41eb5e6272b6c08f79ee0cb73fd363dd1d30fd Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Sun, 11 Oct 2009 01:57:57 +0200 Subject: Automake version detection in autogen.sh --- VERSION | 2 +- autogen.sh | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 56f54a8..1866a36 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.2.9CVS +0.2.9 diff --git a/autogen.sh b/autogen.sh index e04ab90..98a4d5c 100755 --- a/autogen.sh +++ b/autogen.sh @@ -81,6 +81,23 @@ die() { exit 1 } +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 +} + REQUIRED_M4MACROS=${REQUIRED_M4MACROS:-} FORBIDDEN_M4MACROS=${FORBIDDEN_M4MACROS:-} require_m4macro() { @@ -110,6 +127,7 @@ check_m4macros() { # aclocal also searches a version specific dir, eg. /usr/share/aclocal-1.9 # but it contains only Automake's own macros, so we can ignore it. + AUTOMAKE_VERSION=`$AUTOMAKE --version | sed -e '2,$ d' -e 's/ *([^()]*)$//' -e 's/.* \(.*\)/\1/' -e 's/-p[0-9]\+//'` # Read the dirlist file, supported by Automake >= 1.7. if compare_versions 1.7 $AUTOMAKE_VERSION && [ -s $cm_macrodirs/dirlist ]; then cm_dirlist=`sed 's/[ ]*#.*//;/^$/d' $cm_macrodirs/dirlist` -- cgit v1.2.3