From: vernier Date: Wed, 23 May 2007 14:50:19 +0000 (+0000) Subject: autodetect amver 1.9 or 1.10 X-Git-Tag: v3.3~1824 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/f9631dc25e2590fe99c43918d153f6624b6a809d autodetect amver 1.9 or 1.10 git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@3536 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/bootstrap b/bootstrap index edef272f7f..185c9f17e8 100755 --- a/bootstrap +++ b/bootstrap @@ -1,8 +1,34 @@ #!/bin/sh # Run this to generate all the initial makefiles, etc. -amver=1.9 +amversions="${amver:-1.10 1.9}" +check_version() +{ + eval $2 --version 2>/dev/null | grep -i "$1.*$3" >/dev/null +} + +find_version() +{ + tool=$1 + found="NOT_FOUND" + shift + versions="$*" + + for version in $versions; do + if check_version $tool ${tool}${variant} $version; then + found="${version}" + echo ${version} >&2 + break + fi + done + if [ "x$found" = "xNOT_FOUND" ]; then + found="-" + fi + echo $found +} + +amver=`find_version automake ${amversions}` lt=`which libtoolize` if [ "x$lt" = "x" ] ; then @@ -12,7 +38,7 @@ fi am=`which automake-$amver` if [ "x$am" = "x" ] ; then - echo "automake version $amver not found. Please install the relevant package to proceed with a CVS checkout" + echo "automake versions $amversions not found. Please install the relevant package to proceed with a CVS checkout" exit 1 fi