configure
changeset 1312 dd2afd8765a1
parent 1311 bcd9c49d74ef
child 1313 7f0afd31d602
     1.1 --- a/configure	Fri May 01 16:16:53 2009 +0000
     1.2 +++ b/configure	Sat May 02 18:23:58 2009 +0000
     1.3 @@ -101,6 +101,7 @@
     1.4      local item
     1.5      local where
     1.6      local version
     1.7 +    local status
     1.8  
     1.9      for item in "${@}"; do
    1.10          case "${item}" in
    1.11 @@ -124,49 +125,59 @@
    1.12                  fi
    1.13                  where="$( which "${item}" 2>/dev/null )"
    1.14                  if [ -z "${where}" ]; then
    1.15 -                    printf "not found\n"
    1.16 +                    printf "no\n"
    1.17                      continue
    1.18                  elif [ -n "${ver}" ]; then
    1.19                      version=$( ${where} --version 2>&1 )
    1.20                      str=$( echo "${version}" |grep -E "${ver}" |head -n 1 )
    1.21                      if [ -z "${str}" ]; then
    1.22 -                        printf "not found\n"
    1.23 +                        printf "no\n"
    1.24                          unset where
    1.25                          continue
    1.26                      fi
    1.27                  fi
    1.28 +                status="${where}"
    1.29                  break
    1.30              done
    1.31 -            if [ -z "${where}" ]; then
    1.32 -                printf "\n${err:-${prog}: none found}\n\n"
    1.33 -                printf "Either you are missing entirely the needed tool,\n"
    1.34 -                printf "or the version you have is too old.\n"
    1.35 -                if [ -n "${var}" ]; then
    1.36 -                    printf "You can give the path to this tool using: --with-${var}=PATH\n"
    1.37 -                fi
    1.38 -                # FORCE can be set in the environment
    1.39 -                [ -z "${FORCE}" ] && do_error "Bailing out..."
    1.40 -                printf "\n"
    1.41 -                printf "<*                                          *>\n"
    1.42 -                printf "<*            FORCE in action:              *>\n"
    1.43 -                printf "<* Continuing despite missing pre-requisite *>\n"
    1.44 -                printf "<*          Prepare for breakage            *>\n"
    1.45 -                printf "<*                                          *>\n"
    1.46 -                printf "\n"
    1.47 -            else
    1.48 -                printf "${where}"
    1.49 -                if [ -n "${var}" ]; then
    1.50 -                    eval ${var}='"'"${where}"'"'
    1.51 -                    add_to_var_list "${var}"
    1.52 -                fi
    1.53 -                printf "\n"
    1.54 -            fi
    1.55              ;;
    1.56          :?*:)
    1.57 +            for item in ${inc}; do
    1.58 +                printf "Checking for '${item}'... "
    1.59 +                if printf "#include \"${item}\"" |gcc -x c -c - -o /dev/null >/dev/null 2>&1; then
    1.60 +                    where="${item}"
    1.61 +                    status=yes
    1.62 +                    break;
    1.63 +                fi
    1.64 +                printf "no\n"
    1.65 +            done
    1.66              ;;
    1.67          ::?*)
    1.68              ;;
    1.69      esac
    1.70 +    if [ -z "${status}" ]; then
    1.71 +        printf "\n${err:-${prog}${inc}${lib}: none found}\n\n"
    1.72 +        printf "Either you are missing entirely the needed tool,\n"
    1.73 +        printf "or the version you have is too old.\n"
    1.74 +        if [ -n "${var}" ]; then
    1.75 +            printf "You can give the path to this tool using: --with-${var}=PATH\n"
    1.76 +        fi
    1.77 +        # FORCE can be set in the environment
    1.78 +        [ -z "${FORCE}" ] && do_error "Bailing out..."
    1.79 +        printf "\n"
    1.80 +        printf "<*                                          *>\n"
    1.81 +        printf "<*            FORCE in action:              *>\n"
    1.82 +        printf "<* Continuing despite missing pre-requisite *>\n"
    1.83 +        printf "<*          Prepare for breakage            *>\n"
    1.84 +        printf "<*                                          *>\n"
    1.85 +        printf "\n"
    1.86 +    else
    1.87 +        printf "${status}"
    1.88 +        if [ -n "${var}" ]; then
    1.89 +            eval ${var}='"'"${where}"'"'
    1.90 +            add_to_var_list "${var}"
    1.91 +        fi
    1.92 +        printf "\n"
    1.93 +    fi
    1.94  }
    1.95  
    1.96  do_help() {
    1.97 @@ -325,7 +336,8 @@
    1.98  has_or_abort prog=bzip2
    1.99  has_or_abort prog=lzma
   1.100  
   1.101 -#has_or_abort inc="ncurses/ncurses.h ncurses/curses.h ncurses.h curses.h" err="'ncurses' headers files were not found"
   1.102 +has_or_abort inc="ncurses/ncurses.h ncurses/curses.h ncurses.h curses.h"    \
   1.103 +             err="'ncurses' headers files were not found"
   1.104  #has_or_abort lib="ncursesw ncurses curses" err="'ncurses' library was not found"
   1.105  
   1.106  #---------------------------------------------------------------------