configure
changeset 2480 b2591fe701ef
parent 2479 bce8b2a4bf8f
child 2481 30644208c955
     1.1 --- a/configure	Thu May 26 18:40:53 2011 +0200
     1.2 +++ b/configure	Thu May 26 18:33:53 2011 +0200
     1.3 @@ -96,6 +96,7 @@
     1.4  #     the error message to print if tool is missing
     1.5  #     optional, defaults to: '${prog}: none found'
     1.6  #       eg: err="'bash' 3.x or above was not found"
     1.7 +#     Note: err may be printed by caller, not us
     1.8  check_for() {
     1.9      local val
    1.10      local item
    1.11 @@ -208,6 +209,23 @@
    1.12      fi
    1.13  }
    1.14  
    1.15 +# This function checks for a tool, and warns if not found
    1.16 +# See check_for(), above, for how to call has_or_abort
    1.17 +# Note: if err is not set, then no error message is printed
    1.18 +has_or_warn() {
    1.19 +    # We declare these 6 variables here, although they are
    1.20 +    # set in check_for(), called below
    1.21 +    local prog inc lib
    1.22 +    local var ver err
    1.23 +
    1.24 +    if ! check_for "$@"; then
    1.25 +        printf "${err:+${err}\n}"
    1.26 +        if [ -n "${var}" ]; then
    1.27 +            printf -- "--> You can give the path to this tool using: --with-${var}=PATH\n"
    1.28 +        fi
    1.29 +    fi
    1.30 +}
    1.31 +
    1.32  do_help() {
    1.33      cat <<__EOF__
    1.34  \`configure' configures crosstool-NG-${VERSION} to adapt to many kind of systems.