From 66be9f5713ecdc649071820829af972460616abf Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN\"" Date: Sat, 2 May 2009 18:23:58 +0000 Subject: When running ./configure, check for the {n,}curses headers. -------- diffstat follows -------- /trunk/configure | 66 39 27 0 +++++++++++++++++++++++++++++++++++++------------------------- 1 file changed, 39 insertions(+), 27 deletions(-) diff --git a/configure b/configure index b777a2b..1feed1b 100755 --- a/configure +++ b/configure @@ -101,6 +101,7 @@ has_or_abort() { local item local where local version + local status for item in "${@}"; do case "${item}" in @@ -124,49 +125,59 @@ has_or_abort() { fi where="$( which "${item}" 2>/dev/null )" if [ -z "${where}" ]; then - printf "not found\n" + printf "no\n" continue elif [ -n "${ver}" ]; then version=$( ${where} --version 2>&1 ) str=$( echo "${version}" |grep -E "${ver}" |head -n 1 ) if [ -z "${str}" ]; then - printf "not found\n" + printf "no\n" unset where continue fi fi + status="${where}" break done - if [ -z "${where}" ]; then - printf "\n${err:-${prog}: none found}\n\n" - printf "Either you are missing entirely the needed tool,\n" - printf "or the version you have is too old.\n" - if [ -n "${var}" ]; then - printf "You can give the path to this tool using: --with-${var}=PATH\n" - fi - # FORCE can be set in the environment - [ -z "${FORCE}" ] && do_error "Bailing out..." - printf "\n" - printf "<* *>\n" - printf "<* FORCE in action: *>\n" - printf "<* Continuing despite missing pre-requisite *>\n" - printf "<* Prepare for breakage *>\n" - printf "<* *>\n" - printf "\n" - else - printf "${where}" - if [ -n "${var}" ]; then - eval ${var}='"'"${where}"'"' - add_to_var_list "${var}" - fi - printf "\n" - fi ;; :?*:) + for item in ${inc}; do + printf "Checking for '${item}'... " + if printf "#include \"${item}\"" |gcc -x c -c - -o /dev/null >/dev/null 2>&1; then + where="${item}" + status=yes + break; + fi + printf "no\n" + done ;; ::?*) ;; esac + if [ -z "${status}" ]; then + printf "\n${err:-${prog}${inc}${lib}: none found}\n\n" + printf "Either you are missing entirely the needed tool,\n" + printf "or the version you have is too old.\n" + if [ -n "${var}" ]; then + printf "You can give the path to this tool using: --with-${var}=PATH\n" + fi + # FORCE can be set in the environment + [ -z "${FORCE}" ] && do_error "Bailing out..." + printf "\n" + printf "<* *>\n" + printf "<* FORCE in action: *>\n" + printf "<* Continuing despite missing pre-requisite *>\n" + printf "<* Prepare for breakage *>\n" + printf "<* *>\n" + printf "\n" + else + printf "${status}" + if [ -n "${var}" ]; then + eval ${var}='"'"${where}"'"' + add_to_var_list "${var}" + fi + printf "\n" + fi } do_help() { @@ -325,7 +336,8 @@ has_or_abort prog=gzip has_or_abort prog=bzip2 has_or_abort prog=lzma -#has_or_abort inc="ncurses/ncurses.h ncurses/curses.h ncurses.h curses.h" err="'ncurses' headers files were not found" +has_or_abort inc="ncurses/ncurses.h ncurses/curses.h ncurses.h curses.h" \ + err="'ncurses' headers files were not found" #has_or_abort lib="ncursesw ncurses curses" err="'ncurses' library was not found" #--------------------------------------------------------------------- -- cgit v0.10.2-6-g49f6