./configure: fix the tools pattern recognition
author"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sun Jan 25 19:26:40 2009 +0000 (2009-01-25)
changeset 115106893705782f
parent 1150 218f7a0e8d71
child 1152 73a8bb20ccf2
./configure: fix the tools pattern recognition
- when a variable name was given, with no regexp, the pattern did not correctly extract the variable name

/trunk/configure | 11 8 3 0 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
configure
     1.1 --- a/configure	Sun Jan 25 17:53:14 2009 +0000
     1.2 +++ b/configure	Sun Jan 25 19:26:40 2009 +0000
     1.3 @@ -84,7 +84,7 @@
     1.4      local tool_pattern
     1.5      local field
     1.6  
     1.7 -    var_name="$( echo "${1}" |"${sed}" -r -e 's/^((([^=:]+):.+|[^:=]+)=.+|[^:=]+)$/\3/;' )"
     1.8 +    var_name="$( echo "${1}" |"${sed}" -r -e 's/^(([^=:]+):.+|[^:=]+=.+|[^:=]+)$/\2/;' )"
     1.9      field="${var_name:+2}"
    1.10      field="${field:-1}"
    1.11      tool_pattern="$( echo "${1}" |cut -d : -f ${field}- |"${sed}" -r -e 's/ *\|\| */\n/g;' )"
    1.12 @@ -139,10 +139,15 @@
    1.13                      regexp=
    1.14                      ;;
    1.15              esac
    1.16 -            echo "  could not find '${tool}' matching regexp '${regexp}'"
    1.17 +            printf "  could not find '${tool}'"
    1.18 +            [ -n "${regexp}" ] && printf " matching regexp '${regexp}'"
    1.19 +            echo
    1.20          done
    1.21          echo "Either you are missing entirely the needed tool,"
    1.22          echo "or the version you have is tool old."
    1.23 +        if [ -n "${var_name}" ]; then
    1.24 +            echo "You can give the path to this tool using: --with-${var_name}=PATH"
    1.25 +        fi
    1.26          # FORCE can be set in the environment
    1.27          [ -z "${FORCE}" ] && do_error "Bailing out..."
    1.28      else
    1.29 @@ -369,7 +374,7 @@
    1.30  var_list="grep
    1.31            sed
    1.32            $( printf "${TOOLS_TO_CHECK}"                                 \
    1.33 -             |"${sed}" -r -e 's/^((([^=:]+):.+|[^:=]+)=.+|[^:=]+)$/\3/;'
    1.34 +             |"${sed}" -r -e 's/^(([^=:]+):.+|[^:=]+=.+|[^:=]+)$/\2/;'
    1.35             )"
    1.36  var_sed="$( for var_name in ${var_list}; do
    1.37                  eval echo 's,@@${var_name}@@,${'"${var_name}"'},g'