]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - test/configure
ncurses 5.5
[ncurses.git] / test / configure
index 2266114152d66617e4f3a602e840054b3382459b..0eff2626f83fcb7475f9ccf7c1df80f20fb39d5b 100755 (executable)
@@ -1,7 +1,7 @@
 #! /bin/sh
 
 # Guess values for system-dependent variables and create Makefiles.
-# Generated automatically using autoconf version 2.13.1999011
+# Generated automatically using autoconf version 2.13.2003092
 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
 #
 # This configure script is free software; the Free Software Foundation
@@ -181,9 +181,11 @@ Features and packages:
   --x-includes=DIR        X include files are in DIR
   --x-libraries=DIR       X library files are in DIR
 EOF
-cat <<EOF
+cat <<\EOF
 --enable and --with options recognized:
+  --with-curses-dir=DIR   directory in which (n)curses is installed
   --with-5lib             use SunOS sysv-libraries
+  --with-ncursesw         use wide ncurses-libraries (installed)
   --with-ncurses          use ncurses-libraries (installed)
 EOF
     exit 0 ;;
@@ -335,7 +337,7 @@ EOF
     verbose=yes ;;
 
   -version | --version | --versio | --versi | --vers)
-    echo "configure generated by autoconf version 2.13.19990117"
+    echo "configure generated by autoconf version 2.13.20030927"
     exit 0 ;;
 
   -with-* | --with-*)
@@ -525,10 +527,118 @@ fi
 
 
 
+
+test -f config.guess || ( test -f ../config.guess && cp ../config.guess ./ )
+
+
+test -f config.sub || ( test -f ../config.sub && cp ../config.sub ./ )
+
+ac_aux_dir=
+for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
+  if test -f $ac_dir/install-sh; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install-sh -c"
+    break
+  elif test -f $ac_dir/install.sh; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install.sh -c"
+    break
+  fi
+done
+if test -z "$ac_aux_dir"; then
+  { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
+fi
+ac_config_guess=$ac_aux_dir/config.guess
+ac_config_sub=$ac_aux_dir/config.sub
+ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
+
+
+if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then
+       
+# Make sure we can run config.sub.
+if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
+else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
+fi
+
+echo $ac_n "checking host system type""... $ac_c" 1>&6
+echo "configure:565: checking host system type" >&5
+
+host_alias=$host
+case "$host_alias" in
+NONE)
+  case $nonopt in
+  NONE)
+    if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
+    else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
+    fi ;;
+  *) host_alias=$nonopt ;;
+  esac ;;
+esac
+
+host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
+host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$host" 1>&6
+
+       system_name="$host_os"
+else
+       system_name="`(uname -s -r) 2>/dev/null`"
+       if test -z "$system_name" ; then
+               system_name="`(hostname) 2>/dev/null`"
+       fi
+fi
+test -n "$system_name" && cat >> confdefs.h <<EOF
+#define SYSTEM_NAME "$system_name"
+EOF
+
+if eval "test \"`echo '$''{'cf_cv_system_name'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cf_cv_system_name="$system_name"
+fi
+
+
+test -z "$system_name" && system_name="$cf_cv_system_name"
+test -n "$cf_cv_system_name" && echo "$ac_t""Configuring for $cf_cv_system_name" 1>&6
+
+if test ".$system_name" != ".$cf_cv_system_name" ; then
+       echo "$ac_t""Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" 1>&6
+       { echo "configure: error: "Please remove config.cache and try again."" 1>&2; exit 1; }
+fi
+
+
+echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
+echo "configure:613: checking whether ${MAKE-make} sets \${MAKE}" >&5
+set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftestmake <<\EOF
+all:
+       @echo 'ac_maketemp="${MAKE}"'
+EOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
+if test -n "$ac_maketemp"; then
+  eval ac_cv_prog_make_${ac_make}_set=yes
+else
+  eval ac_cv_prog_make_${ac_make}_set=no
+fi
+rm -f conftestmake
+fi
+if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  SET_MAKE=
+else
+  echo "$ac_t""no" 1>&6
+  SET_MAKE="MAKE=${MAKE-make}"
+fi
+
 # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:532: checking for $ac_word" >&5
+echo "configure:642: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -558,7 +668,7 @@ if test -z "$CC"; then
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:562: checking for $ac_word" >&5
+echo "configure:672: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -609,7 +719,7 @@ fi
       # Extract the first word of "cl", so it can be a program name with args.
 set dummy cl; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:613: checking for $ac_word" >&5
+echo "configure:723: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -641,7 +751,7 @@ fi
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:645: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:755: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -652,12 +762,12 @@ cross_compiling=$ac_cv_prog_cc_cross
 
 cat > conftest.$ac_ext << EOF
 
-#line 656 "configure"
+#line 766 "configure"
 #include "confdefs.h"
 
 main(){return(0);}
 EOF
-if { (eval echo configure:661: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:771: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -683,12 +793,12 @@ if test $ac_cv_prog_cc_works = no; then
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:687: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:797: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:692: checking whether we are using GNU C" >&5
+echo "configure:802: checking whether we are using GNU C" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -697,7 +807,7 @@ else
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:701: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:811: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -716,7 +826,7 @@ ac_test_CFLAGS="${CFLAGS+set}"
 ac_save_CFLAGS="$CFLAGS"
 CFLAGS=
 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:720: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:830: checking whether ${CC-cc} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -747,6 +857,86 @@ else
   fi
 fi
 
+echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
+echo "configure:862: checking how to run the C preprocessor" >&5
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+  CPP=
+fi
+if test -z "$CPP"; then
+if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+    # This must be in double quotes, not single quotes, because CPP may get
+  # substituted into the Makefile and "${CC-cc}" will confuse make.
+  CPP="${CC-cc} -E"
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp.
+  cat > conftest.$ac_ext <<EOF
+#line 877 "configure"
+#include "confdefs.h"
+#include <assert.h>
+Syntax Error
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:883: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+  :
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  CPP="${CC-cc} -E -traditional-cpp"
+  cat > conftest.$ac_ext <<EOF
+#line 894 "configure"
+#include "confdefs.h"
+#include <assert.h>
+Syntax Error
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:900: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+  :
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  CPP="${CC-cc} -nologo -E"
+  cat > conftest.$ac_ext <<EOF
+#line 911 "configure"
+#include "confdefs.h"
+#include <assert.h>
+Syntax Error
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:917: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+  :
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  CPP=/lib/cpp
+fi
+rm -f conftest*
+fi
+rm -f conftest*
+fi
+rm -f conftest*
+  ac_cv_prog_CPP="$CPP"
+fi
+  CPP="$ac_cv_prog_CPP"
+else
+  ac_cv_prog_CPP="$CPP"
+fi
+echo "$ac_t""$CPP" 1>&6
+
 
 CC_G_OPT="-g"                          
 CC_SHARED_OPTS=unknown                 
@@ -755,11 +945,14 @@ DFT_DEP_SUFFIX=""
 DFT_OBJ_SUBDIR=`pwd|sed -e's:.*/::'`   
 DFT_UPR_MODEL="NORMAL"                 
 ECHO_LINK='@ echo linking $@ ... ;'    
-EXTRA_LIBS=""                          
 LD="ld"                                        
 LDFLAGS_SHARED=""                      
 LD_MODEL=""                            
 LD_SHARED_OPTS=""                      
+LIBTOOL=""                             
+LIB_CLEAN=""                           
+LIB_COMPILE=""                         
+LIB_LINK=""                            
 LIB_NAME=curses                                
 LIB_PREFIX="-l"                                
 LINK_TESTS=""                          
@@ -767,262 +960,2940 @@ LINT=lint
 LINT_OPTS=""                           
 LOCAL_LDFLAGS=""                       
 MATH_LIB="-lm"                         
-PROG_EXT=""                            
 TEST_ARGS=""                           
 TEST_DEPS=""                           
+TINFO_ARGS='$(LIBS_CURSES)'            
 cf_cv_abi_version=""                   
 cf_cv_rel_version=""                   
 
+cf_cv_screen=curses
+cf_cv_libtype=
 
-# Check whether --with-5lib or --without-5lib was given.
-if test "${with_5lib+set}" = set; then
-  withval="$with_5lib"
-  LIBS="-L/usr/5lib $LIBS"
-        CPPFLAGS="$CPPFLAGS -I/usr/5include"
-fi
-
-
-
-# Check whether --with-ncurses or --without-ncurses was given.
-if test "${with_ncurses+set}" = set; then
-  withval="$with_ncurses"
-  echo $ac_n "checking for initscr""... $ac_c" 1>&6
-echo "configure:791: checking for initscr" >&5
-if eval "test \"`echo '$''{'ac_cv_func_initscr'+set}'`\" = set"; then
+echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
+echo "configure:974: checking for Cygwin environment" >&5
+if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 796 "configure"
+#line 979 "configure"
 #include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char initscr(); below.  */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char initscr();
 
 int main() {
 
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined (__stub_initscr) || defined (__stub___initscr)
-choke me
-#else
-initscr();
+#ifndef __CYGWIN__
+#define __CYGWIN__ __CYGWIN32__
 #endif
-
+return __CYGWIN__;
 ; return 0; }
 EOF
-if { (eval echo configure:819: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:990: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
-  eval "ac_cv_func_initscr=yes"
+  ac_cv_cygwin=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  eval "ac_cv_func_initscr=no"
+  ac_cv_cygwin=no
 fi
 rm -f conftest*
+rm -f conftest*
 fi
 
-if eval "test \"`echo '$ac_cv_func_'initscr`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  :
-else
-  echo "$ac_t""no" 1>&6
-
-        echo $ac_n "checking for Gpm_Open in -lgpm""... $ac_c" 1>&6
-echo "configure:838: checking for Gpm_Open in -lgpm" >&5
-ac_lib_var=`echo gpm'_'Gpm_Open | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+echo "$ac_t""$ac_cv_cygwin" 1>&6
+CYGWIN=
+test "$ac_cv_cygwin" = yes && CYGWIN=yes
+echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
+echo "configure:1007: checking for mingw32 environment" >&5
+if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  ac_save_LIBS="$LIBS"
-LIBS="-lgpm  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 846 "configure"
+  cat > conftest.$ac_ext <<EOF
+#line 1012 "configure"
 #include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char Gpm_Open();
 
 int main() {
-Gpm_Open()
+return __MINGW32__;
 ; return 0; }
 EOF
-if { (eval echo configure:857: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1019: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+  ac_cv_mingw32=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+  ac_cv_mingw32=no
 fi
 rm -f conftest*
-LIBS="$ac_save_LIBS"
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_mingw32" 1>&6
+MINGW32=
+test "$ac_cv_mingw32" = yes && MINGW32=yes
+
 
+echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
+echo "configure:1038: checking for executable suffix" >&5
+if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test "$CYGWIN" = yes || test "$MINGW32" = yes; then
+  ac_cv_exeext=.exe
+else
+  rm -f conftest*
+  echo 'int main () { return 0; }' > conftest.$ac_ext
+  ac_cv_exeext=
+  if { (eval echo configure:1048: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+    for file in conftest.*; do
+      case $file in
+      *.c | *.o | *.obj) ;;
+      *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
+      esac
+    done
+  else
+    { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
+  fi
+  rm -f conftest*
+  test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
+fi
 fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_lib=HAVE_LIB`echo gpm | sed -e 's/[^a-zA-Z0-9_]/_/g' \
-    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_lib 1
-EOF
 
-  LIBS="-lgpm $LIBS"
+EXEEXT=""
+test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
+echo "$ac_t""${ac_cv_exeext}" 1>&6
+ac_exeext=$EXEEXT
 
+echo $ac_n "checking for object suffix""... $ac_c" 1>&6
+echo "configure:1069: checking for object suffix" >&5
+if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
 else
-  echo "$ac_t""no" 1>&6
+  rm -f conftest*
+echo 'int i = 1;' > conftest.$ac_ext
+if { (eval echo configure:1075: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  for ac_file in conftest.*; do
+    case $ac_file in
+    *.c) ;;
+    *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;;
+    esac
+  done
+else
+  { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; }
+fi
+rm -f conftest*
 fi
 
-        LIB_NAME=ncurses
-        for p in $HOME /usr/local /usr
-        do
-               if test -f $p/include/ncurses/curses.h
-               then
-                       CPPFLAGS="$CPPFLAGS -I$p/include/ncurses"
-                       test $p != /usr && LIBS="-L$p/lib $LIBS"
-                       break
-               elif test $p != /usr
-               then
-                       if test -f $p/include/curses.h
-                       then
-                               CPPFLAGS="$CPPFLAGS -I$p/include"
-                               LIBS="-L$p/lib $LIBS"
-                               break
+echo "$ac_t""$ac_cv_objext" 1>&6
+OBJEXT=$ac_cv_objext
+ac_objext=$ac_cv_objext
+
+
+
+echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6
+echo "configure:1095: checking for ${CC-cc} option to accept ANSI C" >&5
+if eval "test \"`echo '$''{'cf_cv_ansi_cc'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+cf_cv_ansi_cc=no
+cf_save_CFLAGS="$CFLAGS"
+cf_save_CPPFLAGS="$CPPFLAGS"
+# Don't try gcc -ansi; that turns off useful extensions and
+# breaks some systems' header files.
+# AIX                  -qlanglvl=ansi
+# Ultrix and OSF/1     -std1
+# HP-UX                        -Aa -D_HPUX_SOURCE
+# SVR4                 -Xc
+# UnixWare 1.2         (cannot use -Xc, since ANSI/POSIX clashes)
+for cf_arg in "-DCC_HAS_PROTOS" \
+       "" \
+       -qlanglvl=ansi \
+       -std1 \
+       -Ae \
+       "-Aa -D_HPUX_SOURCE" \
+       -Xc
+do
+       
+cf_fix_cppflags=no
+cf_new_cflags=
+cf_new_cppflags=
+cf_new_extra_cppflags=
+
+for cf_add_cflags in $cf_arg
+do
+case $cf_fix_cppflags in
+no)
+       case $cf_add_cflags in #(vi
+       -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
+               case $cf_add_cflags in
+               -D*)
+                       cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
+
+                       test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+                       && test -z "${cf_tst_cflags}" \
+                       && cf_fix_cppflags=yes
+
+                       if test $cf_fix_cppflags = yes ; then
+                               cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+                               continue
+                       elif test "${cf_tst_cflags}" = "\"'" ; then
+                               cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+                               continue
                        fi
-               fi
-        done
+                       ;;
+               esac
+               case "$CPPFLAGS" in
+               *$cf_add_cflags) #(vi
+                       ;;
+               *) #(vi
+                       cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
+                       ;;
+               esac
+               ;;
+       *)
+               cf_new_cflags="$cf_new_cflags $cf_add_cflags"
+               ;;
+       esac
+       ;;
+yes)
+       cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+
+       cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
+
+       test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+       && test -z "${cf_tst_cflags}" \
+       && cf_fix_cppflags=no
+       ;;
+esac
+done
+
+if test -n "$cf_new_cflags" ; then
        
+       CFLAGS="$CFLAGS $cf_new_cflags"
 fi
 
+if test -n "$cf_new_cppflags" ; then
+       
+       CPPFLAGS="$cf_new_cppflags $CPPFLAGS"
 fi
 
+if test -n "$cf_new_extra_cppflags" ; then
+       
+       EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
+fi
 
 
 
-echo $ac_n "checking for initscr""... $ac_c" 1>&6
-echo "configure:911: checking for initscr" >&5
-if eval "test \"`echo '$''{'ac_cv_func_initscr'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 916 "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char initscr(); below.  */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char initscr();
 
-int main() {
+       cat > conftest.$ac_ext <<EOF
+#line 1191 "configure"
+#include "confdefs.h"
 
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined (__stub_initscr) || defined (__stub___initscr)
+#ifndef CC_HAS_PROTOS
+#if !defined(__STDC__) || (__STDC__ != 1)
 choke me
-#else
-initscr();
 #endif
+#endif
+
+int main() {
 
+       int test (int i, double x);
+       struct s1 {int (*f) (int a);};
+       struct s2 {int (*f) (double a);};
 ; return 0; }
 EOF
-if { (eval echo configure:939: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1207: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
-  eval "ac_cv_func_initscr=yes"
+  cf_cv_ansi_cc="$cf_arg"; break
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_func_initscr=no"
 fi
 rm -f conftest*
+done
+CFLAGS="$cf_save_CFLAGS"
+CPPFLAGS="$cf_save_CPPFLAGS"
+
 fi
 
-if eval "test \"`echo '$ac_cv_func_'initscr`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  :
+echo "$ac_t""$cf_cv_ansi_cc" 1>&6
+
+if test "$cf_cv_ansi_cc" != "no"; then
+if test ".$cf_cv_ansi_cc" != ".-DCC_HAS_PROTOS"; then
+       
+cf_fix_cppflags=no
+cf_new_cflags=
+cf_new_cppflags=
+cf_new_extra_cppflags=
+
+for cf_add_cflags in $cf_cv_ansi_cc
+do
+case $cf_fix_cppflags in
+no)
+       case $cf_add_cflags in #(vi
+       -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
+               case $cf_add_cflags in
+               -D*)
+                       cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
+
+                       test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+                       && test -z "${cf_tst_cflags}" \
+                       && cf_fix_cppflags=yes
+
+                       if test $cf_fix_cppflags = yes ; then
+                               cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+                               continue
+                       elif test "${cf_tst_cflags}" = "\"'" ; then
+                               cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+                               continue
+                       fi
+                       ;;
+               esac
+               case "$CPPFLAGS" in
+               *$cf_add_cflags) #(vi
+                       ;;
+               *) #(vi
+                       cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
+                       ;;
+               esac
+               ;;
+       *)
+               cf_new_cflags="$cf_new_cflags $cf_add_cflags"
+               ;;
+       esac
+       ;;
+yes)
+       cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+
+       cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
+
+       test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+       && test -z "${cf_tst_cflags}" \
+       && cf_fix_cppflags=no
+       ;;
+esac
+done
+
+if test -n "$cf_new_cflags" ; then
+       
+       CFLAGS="$CFLAGS $cf_new_cflags"
+fi
+
+if test -n "$cf_new_cppflags" ; then
+       
+       CPPFLAGS="$cf_new_cppflags $CPPFLAGS"
+fi
+
+if test -n "$cf_new_extra_cppflags" ; then
+       
+       EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
+fi
+
+
+
+
 else
-  echo "$ac_t""no" 1>&6
+       cat >> confdefs.h <<\EOF
+#define CC_HAS_PROTOS 1
+EOF
+
+fi
+fi
+
+
+if test "$cf_cv_ansi_cc" = "no"; then
+       { echo "configure: error: Your compiler does not appear to recognize prototypes.
+You have the following choices:
+       a. adjust your compiler options
+       b. get an up-to-date compiler
+       c. use a wrapper such as unproto" 1>&2; exit 1; }
+fi
+
+
+
+
+INTEL_COMPILER=no
+
+if test "$GCC" = yes ; then
+       case $host_os in
+       linux*|gnu*)
+               echo $ac_n "checking if this is really Intel compiler""... $ac_c" 1>&6
+echo "configure:1323: checking if this is really Intel compiler" >&5
+               cf_save_CFLAGS="$CFLAGS"
+               CFLAGS="$CFLAGS -no-gcc"
+               cat > conftest.$ac_ext <<EOF
+#line 1327 "configure"
+#include "confdefs.h"
+
+int main() {
+
+#ifdef __INTEL_COMPILER
+#else
+make an error
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:1339: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  INTEL_COMPILER=yes
+cf_save_CFLAGS="$cf_save_CFLAGS -we147 -no-gcc"
+
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+fi
+rm -f conftest*
+               CFLAGS="$cf_save_CFLAGS"
+               echo "$ac_t""$INTEL_COMPILER" 1>&6
+               ;;
+       esac
+fi
+
+
+
+cf_XOPEN_SOURCE=500
+cf_POSIX_C_SOURCE=199506L
+
+case $host_os in #(vi
+aix[45]*) #(vi
+       CPPFLAGS="$CPPFLAGS -D_ALL_SOURCE"
+       ;;
+freebsd*) #(vi
+       # 5.x headers associate
+       #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
+       #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
+       cf_POSIX_C_SOURCE=200112L
+       cf_XOPEN_SOURCE=600
+       CPPFLAGS="$CPPFLAGS -D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
+       ;;
+hpux*) #(vi
+       CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE"
+       ;;
+irix[56].*) #(vi
+       CPPFLAGS="$CPPFLAGS -D_SGI_SOURCE"
+       ;;
+linux*|gnu*) #(vi
+       
+
+
+if test "$INTEL_COMPILER" = no ; then
+echo $ac_n "checking if we must define _GNU_SOURCE""... $ac_c" 1>&6
+echo "configure:1384: checking if we must define _GNU_SOURCE" >&5
+if eval "test \"`echo '$''{'cf_cv_gnu_source'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+cat > conftest.$ac_ext <<EOF
+#line 1390 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+int main() {
+
+#ifndef _XOPEN_SOURCE
+make an error
+#endif
+; return 0; }
+EOF
+if { (eval echo configure:1400: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  cf_cv_gnu_source=no
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  cf_save="$CPPFLAGS"
+        CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
+        cat > conftest.$ac_ext <<EOF
+#line 1410 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+int main() {
+
+#ifdef _XOPEN_SOURCE
+make an error
+#endif
+; return 0; }
+EOF
+if { (eval echo configure:1420: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  cf_cv_gnu_source=no
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  cf_cv_gnu_source=yes
+fi
+rm -f conftest*
+       CPPFLAGS="$cf_save"
+       
+fi
+rm -f conftest*
+
+fi
+
+echo "$ac_t""$cf_cv_gnu_source" 1>&6
+test "$cf_cv_gnu_source" = yes && CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
+fi
+
+       ;;
+mirbsd*) #(vi
+       # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <arpa/inet.h>
+       ;;
+netbsd*) #(vi
+       # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
+       ;;
+openbsd*) #(vi
+       # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
+       ;;
+osf[45]*) #(vi
+       CPPFLAGS="$CPPFLAGS -D_OSF_SOURCE"
+       ;;
+sco*) #(vi
+       # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
+       ;;
+solaris*) #(vi
+       CPPFLAGS="$CPPFLAGS -D__EXTENSIONS__"
+       ;;
+*)
+       echo $ac_n "checking if we should define _XOPEN_SOURCE""... $ac_c" 1>&6
+echo "configure:1462: checking if we should define _XOPEN_SOURCE" >&5
+if eval "test \"`echo '$''{'cf_cv_xopen_source'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+       cat > conftest.$ac_ext <<EOF
+#line 1468 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+int main() {
+
+#ifndef _XOPEN_SOURCE
+make an error
+#endif
+; return 0; }
+EOF
+if { (eval echo configure:1478: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  cf_cv_xopen_source=no
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  cf_save="$CPPFLAGS"
+        CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
+        cat > conftest.$ac_ext <<EOF
+#line 1488 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+int main() {
+
+#ifdef _XOPEN_SOURCE
+make an error
+#endif
+; return 0; }
+EOF
+if { (eval echo configure:1498: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  cf_cv_xopen_source=no
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  cf_cv_xopen_source=$cf_XOPEN_SOURCE
+fi
+rm -f conftest*
+       CPPFLAGS="$cf_save"
+       
+fi
+rm -f conftest*
+
+fi
+
+echo "$ac_t""$cf_cv_xopen_source" 1>&6
+test "$cf_cv_xopen_source" != no && CPPFLAGS="$CPPFLAGS -U_XOPEN_SOURCE -D_XOPEN_SOURCE=$cf_cv_xopen_source"
+       
+cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
+echo $ac_n "checking if we should define _POSIX_C_SOURCE""... $ac_c" 1>&6
+echo "configure:1520: checking if we should define _POSIX_C_SOURCE" >&5
+if eval "test \"`echo '$''{'cf_cv_posix_c_source'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+       
+echo "(line 1526) testing if the symbol is already defined go no further ..." 1>&5
+
+       cat > conftest.$ac_ext <<EOF
+#line 1529 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+int main() {
+
+#ifndef _POSIX_C_SOURCE
+make an error
+#endif
+; return 0; }
+EOF
+if { (eval echo configure:1539: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  cf_cv_posix_c_source=no
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  cf_want_posix_source=no
+        case .$cf_POSIX_C_SOURCE in
+        .[12]??*)
+               cf_cv_posix_c_source="-U_POSIX_C_SOURCE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
+               ;;
+        .2)
+               cf_cv_posix_c_source="-U_POSIX_C_SOURCE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
+               cf_want_posix_source=yes
+               ;;
+        .*)
+               cf_want_posix_source=yes
+               ;;
+        esac
+        if test "$cf_want_posix_source" = yes ; then
+               cat > conftest.$ac_ext <<EOF
+#line 1561 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+int main() {
+
+#ifdef _POSIX_SOURCE
+make an error
+#endif
+; return 0; }
+EOF
+if { (eval echo configure:1571: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  :
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  cf_cv_posix_c_source="$cf_cv_posix_c_source -U_POSIX_SOURCE -D_POSIX_SOURCE"
+fi
+rm -f conftest*
+        fi
+        
+echo "(line 1582) testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
+
+        cf_save="$CPPFLAGS"
+        CPPFLAGS="$CPPFLAGS $cf_cv_posix_c_source"
+        
+echo "(line 1587) testing if the second compile does not leave our definition intact error ..." 1>&5
+
+        cat > conftest.$ac_ext <<EOF
+#line 1590 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+int main() {
+
+#ifndef _POSIX_C_SOURCE
+make an error
+#endif
+; return 0; }
+EOF
+if { (eval echo configure:1600: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  :
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  cf_cv_posix_c_source=no
+fi
+rm -f conftest*
+       CPPFLAGS="$cf_save"
+       
+fi
+rm -f conftest*
+
+fi
+
+echo "$ac_t""$cf_cv_posix_c_source" 1>&6
+test "$cf_cv_posix_c_source" != no && CPPFLAGS="$CPPFLAGS $cf_cv_posix_c_source"
+
+       ;;
+esac
+
+
+
+
+# Check whether --with-curses-dir or --without-curses-dir was given.
+if test "${with_curses_dir+set}" = set; then
+  withval="$with_curses_dir"
+  
+case ".$withval" in #(vi
+.\$\(*\)*|.\'*\'*) #(vi
+  ;;
+..|./*|.\\*) #(vi
+  ;;
+.[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
+  ;;
+.\${*prefix}*) #(vi
+  eval withval="$withval"
+  case ".$withval" in #(vi
+  .NONE/*)
+    withval=`echo $withval | sed -e s%NONE%$ac_default_prefix%`
+    ;;
+  esac
+  ;; #(vi
+.NONE/*)
+  withval=`echo $withval | sed -e s%NONE%$ac_default_prefix%`
+  ;;
+*)
+  { echo "configure: error: expected a pathname, not \"$withval\"" 1>&2; exit 1; }
+  ;;
+esac
+
+        cf_cv_curses_dir=$withval
+else
+  cf_cv_curses_dir=no
+fi
+
+
+
+
+# Check whether --with-5lib or --without-5lib was given.
+if test "${with_5lib+set}" = set; then
+  withval="$with_5lib"
+  LIBS="-L/usr/5lib $LIBS"
+        CPPFLAGS="$CPPFLAGS -I/usr/5include"
+fi
+
+
+
+# Check whether --with-ncursesw or --without-ncursesw was given.
+if test "${with_ncursesw+set}" = set; then
+  withval="$with_ncursesw"
+  cf_cv_screen=ncursesw
+fi
+
+
+
+# Check whether --with-ncurses or --without-ncurses was given.
+if test "${with_ncurses+set}" = set; then
+  withval="$with_ncurses"
+  cf_cv_screen=ncurses
+fi
+
+
+case $cf_cv_screen in
+curses)
+       
+
+echo $ac_n "checking for extra include directories""... $ac_c" 1>&6
+echo "configure:1689: checking for extra include directories" >&5
+if eval "test \"`echo '$''{'cf_cv_curses_incdir'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+cf_cv_curses_incdir=no
+case $host_os in #(vi
+hpux10.*|hpux11.*) #(vi
+       test -d /usr/include/curses_colr && \
+       cf_cv_curses_incdir="-I/usr/include/curses_colr"
+       ;;
+sunos3*|sunos4*)
+       test -d /usr/5lib && \
+       test -d /usr/5include && \
+       cf_cv_curses_incdir="-I/usr/5include"
+       ;;
+esac
+
+fi
+
+echo "$ac_t""$cf_cv_curses_incdir" 1>&6
+test "$cf_cv_curses_incdir" != no && CPPFLAGS="$cf_cv_curses_incdir $CPPFLAGS"
+
+echo $ac_n "checking if we have identified curses headers""... $ac_c" 1>&6
+echo "configure:1713: checking if we have identified curses headers" >&5
+if eval "test \"`echo '$''{'cf_cv_ncurses_header'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+cf_cv_ncurses_header=none
+for cf_header in \
+       curses.h \
+       ncurses.h \
+       ncurses/curses.h \
+       ncurses/ncurses.h
+do
+cat > conftest.$ac_ext <<EOF
+#line 1726 "configure"
+#include "confdefs.h"
+#include <${cf_header}>
+int main() {
+initscr(); tgoto("?", 0,0)
+; return 0; }
+EOF
+if { (eval echo configure:1733: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  cf_cv_ncurses_header=$cf_header; break
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+fi
+rm -f conftest*
+done
+
+fi
+
+echo "$ac_t""$cf_cv_ncurses_header" 1>&6
+
+if test "$cf_cv_ncurses_header" = none ; then
+       { echo "configure: error: No curses header-files found" 1>&2; exit 1; }
+fi
+
+# cheat, to get the right #define's for HAVE_NCURSES_H, etc.
+for ac_hdr in $cf_cv_ncurses_header
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:1756: checking for $ac_hdr" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 1761 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:1766: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=yes"
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+else
+  echo "$ac_t""no" 1>&6
+fi
+done
+
+
+
+       
+echo $ac_n "checking for ncurses version""... $ac_c" 1>&6
+echo "configure:1796: checking for ncurses version" >&5
+if eval "test \"`echo '$''{'cf_cv_ncurses_version'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+       cf_cv_ncurses_version=no
+       cf_tempfile=out$$
+       rm -f $cf_tempfile
+       if test "$cross_compiling" = yes; then
+  
+
+       # This will not work if the preprocessor splits the line after the
+       # Autoconf token.  The 'unproto' program does that.
+       cat > conftest.$ac_ext <<EOF
+#include <${cf_cv_ncurses_header-curses.h}>
+#undef Autoconf
+#ifdef NCURSES_VERSION
+Autoconf NCURSES_VERSION
+#else
+#ifdef __NCURSES_H
+Autoconf "old"
+#endif
+;
+#endif
+EOF
+       cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
+       { (eval echo configure:1822: \"$cf_try\") 1>&5; (eval $cf_try) 2>&5; }
+       if test -f conftest.out ; then
+               cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
+               test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
+               rm -f conftest.out
+       fi
+
+else
+  cat > conftest.$ac_ext <<EOF
+#line 1831 "configure"
+#include "confdefs.h"
+
+#include <${cf_cv_ncurses_header-curses.h}>
+#include <stdio.h>
+int main()
+{
+       FILE *fp = fopen("$cf_tempfile", "w");
+#ifdef NCURSES_VERSION
+# ifdef NCURSES_VERSION_PATCH
+       fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
+# else
+       fprintf(fp, "%s\n", NCURSES_VERSION);
+# endif
+#else
+# ifdef __NCURSES_H
+       fprintf(fp, "old\n");
+# else
+       make an error
+# endif
+#endif
+       exit(0);
+}
+EOF
+if { (eval echo configure:1855: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+  
+       cf_cv_ncurses_version=`cat $cf_tempfile`
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+fi
+rm -fr conftest*
+fi
+
+       rm -f $cf_tempfile
+
+fi
+
+echo "$ac_t""$cf_cv_ncurses_version" 1>&6
+test "$cf_cv_ncurses_version" = no || cat >> confdefs.h <<\EOF
+#define NCURSES 1
+EOF
+
+
+       
+
+echo $ac_n "checking if we have identified curses libraries""... $ac_c" 1>&6
+echo "configure:1879: checking if we have identified curses libraries" >&5
+cat > conftest.$ac_ext <<EOF
+#line 1881 "configure"
+#include "confdefs.h"
+#include <${cf_cv_ncurses_header-curses.h}>
+int main() {
+initscr(); tgoto("?", 0,0)
+; return 0; }
+EOF
+if { (eval echo configure:1888: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  cf_result=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  cf_result=no
+fi
+rm -f conftest*
+echo "$ac_t""$cf_result" 1>&6
+
+if test "$cf_result" = no ; then
+case $host_os in #(vi
+freebsd*) #(vi
+       echo $ac_n "checking for tgoto in -lmytinfo""... $ac_c" 1>&6
+echo "configure:1904: checking for tgoto in -lmytinfo" >&5
+ac_lib_var=`echo mytinfo'_'tgoto | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-lmytinfo  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 1912 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char tgoto();
+
+int main() {
+tgoto()
+; return 0; }
+EOF
+if { (eval echo configure:1923: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  LIBS="-lmytinfo $LIBS"
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+       ;;
+hpux10.*|hpux11.*) #(vi
+       echo $ac_n "checking for initscr in -lcur_colr""... $ac_c" 1>&6
+echo "configure:1946: checking for initscr in -lcur_colr" >&5
+ac_lib_var=`echo cur_colr'_'initscr | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-lcur_colr  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 1954 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char initscr();
+
+int main() {
+initscr()
+; return 0; }
+EOF
+if { (eval echo configure:1965: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  
+               LIBS="-lcur_colr $LIBS"
+               ac_cv_func_initscr=yes
+               
+else
+  echo "$ac_t""no" 1>&6
+
+       echo $ac_n "checking for initscr in -lHcurses""... $ac_c" 1>&6
+echo "configure:1988: checking for initscr in -lHcurses" >&5
+ac_lib_var=`echo Hcurses'_'initscr | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-lHcurses  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 1996 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char initscr();
+
+int main() {
+initscr()
+; return 0; }
+EOF
+if { (eval echo configure:2007: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  
+               # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
+               LIBS="-lHcurses $LIBS"
+               CPPFLAGS="-D__HP_CURSES -D_HP_CURSES $CPPFLAGS"
+               ac_cv_func_initscr=yes
+               
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+fi
+
+       ;;
+linux*) # Suse Linux does not follow /usr/lib convention
+       LIBS="$LIBS -L/lib"
+       ;;
+sunos3*|sunos4*)
+       test -d /usr/5lib && \
+       LIBS="$LIBS -L/usr/5lib -lcurses -ltermcap"
+       ac_cv_func_initscr=yes
+       ;;
+esac
+
+if test ".$ac_cv_func_initscr" != .yes ; then
+       cf_save_LIBS="$LIBS"
+       cf_term_lib=""
+       cf_curs_lib=""
+
+       if test ".${cf_cv_ncurses_version-no}" != .no
+       then
+               cf_check_list="ncurses curses cursesX"
+       else
+               cf_check_list="cursesX curses ncurses"
+       fi
+
+       # Check for library containing tgoto.  Do this before curses library
+       # because it may be needed to link the test-case for initscr.
+       echo $ac_n "checking for tgoto""... $ac_c" 1>&6
+echo "configure:2060: checking for tgoto" >&5
+if eval "test \"`echo '$''{'ac_cv_func_tgoto'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 2065 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char tgoto(); below.  */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char tgoto();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_tgoto) || defined (__stub___tgoto)
+choke me
+#else
+tgoto();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:2088: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_func_tgoto=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_func_tgoto=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'tgoto`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  cf_term_lib=predefined
+else
+  echo "$ac_t""no" 1>&6
+
+               for cf_term_lib in $cf_check_list termcap termlib unknown
+               do
+                       echo $ac_n "checking for tgoto in -l$cf_term_lib""... $ac_c" 1>&6
+echo "configure:2109: checking for tgoto in -l$cf_term_lib" >&5
+ac_lib_var=`echo $cf_term_lib'_'tgoto | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-l$cf_term_lib  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 2117 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char tgoto();
+
+int main() {
+tgoto()
+; return 0; }
+EOF
+if { (eval echo configure:2128: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  break
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+               done
+       
+fi
+
+
+       # Check for library containing initscr
+       test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
+       for cf_curs_lib in $cf_check_list xcurses jcurses unknown
+       do
+               echo $ac_n "checking for initscr in -l$cf_curs_lib""... $ac_c" 1>&6
+echo "configure:2158: checking for initscr in -l$cf_curs_lib" >&5
+ac_lib_var=`echo $cf_curs_lib'_'initscr | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-l$cf_curs_lib  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 2166 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char initscr();
+
+int main() {
+initscr()
+; return 0; }
+EOF
+if { (eval echo configure:2177: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  break
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+       done
+       test $cf_curs_lib = unknown && { echo "configure: error: no curses library found" 1>&2; exit 1; }
+
+       LIBS="-l$cf_curs_lib $cf_save_LIBS"
+       if test "$cf_term_lib" = unknown ; then
+               echo $ac_n "checking if we can link with $cf_curs_lib library""... $ac_c" 1>&6
+echo "configure:2203: checking if we can link with $cf_curs_lib library" >&5
+               cat > conftest.$ac_ext <<EOF
+#line 2205 "configure"
+#include "confdefs.h"
+#include <${cf_cv_ncurses_header-curses.h}>
+int main() {
+initscr()
+; return 0; }
+EOF
+if { (eval echo configure:2212: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  cf_result=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  cf_result=no
+fi
+rm -f conftest*
+               echo "$ac_t""$cf_result" 1>&6
+               test $cf_result = no && { echo "configure: error: Cannot link curses library" 1>&2; exit 1; }
+       elif test "$cf_curs_lib" = "$cf_term_lib" ; then
+               :
+       elif test "$cf_term_lib" != predefined ; then
+               echo $ac_n "checking if we need both $cf_curs_lib and $cf_term_lib libraries""... $ac_c" 1>&6
+echo "configure:2228: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
+               cat > conftest.$ac_ext <<EOF
+#line 2230 "configure"
+#include "confdefs.h"
+#include <${cf_cv_ncurses_header-curses.h}>
+int main() {
+initscr(); tgoto((char *)0, 0, 0);
+; return 0; }
+EOF
+if { (eval echo configure:2237: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  cf_result=no
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  
+                       LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
+                       cat > conftest.$ac_ext <<EOF
+#line 2247 "configure"
+#include "confdefs.h"
+#include <${cf_cv_ncurses_header-curses.h}>
+int main() {
+initscr()
+; return 0; }
+EOF
+if { (eval echo configure:2254: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  cf_result=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  cf_result=error
+fi
+rm -f conftest*
+                       
+fi
+rm -f conftest*
+               echo "$ac_t""$cf_result" 1>&6
+       fi
+fi
+fi
+
+
+       ;;
+ncurses)
+       
+
+cf_ncuhdr_root=ncurses
+
+test -n "$cf_cv_curses_dir" && \
+test "$cf_cv_curses_dir" != "no" && \
+CPPFLAGS="-I$cf_cv_curses_dir/include -I$cf_cv_curses_dir/include/$cf_ncuhdr_root $CPPFLAGS"
+
+echo $ac_n "checking for $cf_ncuhdr_root header in include-path""... $ac_c" 1>&6
+echo "configure:2284: checking for $cf_ncuhdr_root header in include-path" >&5
+if eval "test \"`echo '$''{'cf_cv_ncurses_h'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+       cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
+       ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
+       for cf_header in $cf_header_list
+       do
+               
+       cat > conftest.$ac_ext <<EOF
+#line 2295 "configure"
+#include "confdefs.h"
+
+
+#include <$cf_header>
+int main() {
+
+#ifdef NCURSES_VERSION
+
+printf("%s\n", NCURSES_VERSION);
+#else
+#ifdef __NCURSES_H
+printf("old\n");
+#else
+       make an error
+#endif
+#endif
+       
+       
+; return 0; }
+EOF
+if { (eval echo configure:2316: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  cf_cv_ncurses_h=$cf_header
+       
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  cf_cv_ncurses_h=no
+fi
+rm -f conftest*
+
+               test "$cf_cv_ncurses_h" != no && break
+       done
+
+fi
+
+echo "$ac_t""$cf_cv_ncurses_h" 1>&6
+
+if test "$cf_cv_ncurses_h" != no ; then
+       cf_cv_ncurses_header=$cf_cv_ncurses_h
+else
+echo $ac_n "checking for $cf_ncuhdr_root include-path""... $ac_c" 1>&6
+echo "configure:2339: checking for $cf_ncuhdr_root include-path" >&5
+if eval "test \"`echo '$''{'cf_cv_ncurses_h2'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+       test -n "$verbose" && echo
+       cf_search=""
+
+test -d $HOME && {
+       test -n "$verbose" && echo "    ... testing include-directories under $HOME"
+       test -d $HOME/include &&          cf_search="$cf_search $HOME/include"
+       test -d $HOME/include/$cf_ncuhdr_root &&       cf_search="$cf_search $HOME/include/$cf_ncuhdr_root"
+       test -d $HOME/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $HOME/include/$cf_ncuhdr_root/include"
+}
+
+# For other stuff under the home directory, it should be sufficient to put
+# a symbolic link for $HOME/$cf_ncuhdr_root to the actual package location:
+test -d $HOME/$cf_ncuhdr_root && {
+       test -n "$verbose" && echo "    ... testing include-directories under $HOME/$cf_ncuhdr_root"
+       test -d $HOME/$cf_ncuhdr_root/include &&       cf_search="$cf_search $HOME/$cf_ncuhdr_root/include"
+       test -d $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
+}
+
+test "$prefix" != /usr/local && \
+test -d /usr/local && {
+       test -n "$verbose" && echo "    ... testing include-directories under /usr/local"
+       test -d /usr/local/include &&       cf_search="$cf_search /usr/local/include"
+       test -d /usr/local/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root"
+       test -d /usr/local/include/$cf_ncuhdr_root/include && cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root/include"
+       test -d /usr/local/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include"
+       test -d /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
+}
+
+test "$prefix" != NONE && \
+test -d $prefix && {
+       test -n "$verbose" && echo "    ... testing include-directories under $prefix"
+       test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
+       test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
+       test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
+       test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
+       test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
+}
+
+test "$prefix" != /opt && \
+test -d /opt && {
+       test -n "$verbose" && echo "    ... testing include-directories under /opt"
+       test -d /opt/include &&             cf_search="$cf_search /opt/include"
+       test -d /opt/include/$cf_ncuhdr_root &&          cf_search="$cf_search /opt/include/$cf_ncuhdr_root"
+       test -d /opt/include/$cf_ncuhdr_root/include &&       cf_search="$cf_search /opt/include/$cf_ncuhdr_root/include"
+       test -d /opt/$cf_ncuhdr_root/include &&          cf_search="$cf_search /opt/$cf_ncuhdr_root/include"
+       test -d /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&       cf_search="$cf_search /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
+}
+
+test "$prefix" != /usr && \
+test -d /usr && {
+       test -n "$verbose" && echo "    ... testing include-directories under /usr"
+       test -d /usr/include &&             cf_search="$cf_search /usr/include"
+       test -d /usr/include/$cf_ncuhdr_root &&          cf_search="$cf_search /usr/include/$cf_ncuhdr_root"
+       test -d /usr/include/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/include/$cf_ncuhdr_root/include"
+       test -d /usr/$cf_ncuhdr_root/include &&          cf_search="$cf_search /usr/$cf_ncuhdr_root/include"
+}
+
+test "$includedir" != NONE && \
+test "$includedir" != "/usr/include" && \
+test -d "$includedir" && {
+       test -d $includedir &&    cf_search="$cf_search $includedir"
+       test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
+}
+
+test "$oldincludedir" != NONE && \
+test "$oldincludedir" != "/usr/include" && \
+test -d "$oldincludedir" && {
+       test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
+       test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
+}
+
+
+       test -n "$verbose" && echo search path $cf_search
+       cf_save2_CPPFLAGS="$CPPFLAGS"
+       for cf_incdir in $cf_search
+       do
+               
+for cf_add_incdir in $cf_incdir
+do
+       while true
+       do
+               case $cf_add_incdir in
+               /usr/include) # (vi
+                       ;;
+               /usr/local/include) # (vi
+                       if test "$GCC" = yes
+                       then
+                               cf_save_CPPFLAGS="$CPPFLAGS"
+                               CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
+                               cat > conftest.$ac_ext <<EOF
+#line 2434 "configure"
+#include "confdefs.h"
+#include <stdio.h>
+int main() {
+printf("Hello")
+; return 0; }
+EOF
+if { (eval echo configure:2441: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  :
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  CPPFLAGS="$cf_save_CPPFLAGS"
+fi
+rm -f conftest*
+                       fi
+                       ;;
+               *) # (vi
+                       CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
+                       ;;
+               esac
+               cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
+               test "$cf_top_incdir" = "$cf_add_incdir" && break
+               cf_add_incdir="$cf_top_incdir"
+       done
+done
+
+               for cf_header in \
+                       ncurses.h \
+                       curses.h
+               do
+                       
+       cat > conftest.$ac_ext <<EOF
+#line 2468 "configure"
+#include "confdefs.h"
+
+
+#include <$cf_header>
+int main() {
+
+#ifdef NCURSES_VERSION
+
+printf("%s\n", NCURSES_VERSION);
+#else
+#ifdef __NCURSES_H
+printf("old\n");
+#else
+       make an error
+#endif
+#endif
+       
+       
+; return 0; }
+EOF
+if { (eval echo configure:2489: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  cf_cv_ncurses_h2=$cf_header
+       
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  cf_cv_ncurses_h2=no
+fi
+rm -f conftest*
+
+                       if test "$cf_cv_ncurses_h2" != no ; then
+                               cf_cv_ncurses_h2=$cf_incdir/$cf_header
+                               test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
+                               break
+                       fi
+                       test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
+               done
+               CPPFLAGS="$cf_save2_CPPFLAGS"
+               test "$cf_cv_ncurses_h2" != no && break
+       done
+       test "$cf_cv_ncurses_h2" = no && { echo "configure: error: not found" 1>&2; exit 1; }
+       
+fi
+
+echo "$ac_t""$cf_cv_ncurses_h2" 1>&6
+
+       cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
+       cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
+       if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
+               cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
+       fi
+       
+for cf_add_incdir in $cf_1st_incdir
+do
+       while true
+       do
+               case $cf_add_incdir in
+               /usr/include) # (vi
+                       ;;
+               /usr/local/include) # (vi
+                       if test "$GCC" = yes
+                       then
+                               cf_save_CPPFLAGS="$CPPFLAGS"
+                               CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
+                               cat > conftest.$ac_ext <<EOF
+#line 2536 "configure"
+#include "confdefs.h"
+#include <stdio.h>
+int main() {
+printf("Hello")
+; return 0; }
+EOF
+if { (eval echo configure:2543: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  :
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  CPPFLAGS="$cf_save_CPPFLAGS"
+fi
+rm -f conftest*
+                       fi
+                       ;;
+               *) # (vi
+                       CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
+                       ;;
+               esac
+               cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
+               test "$cf_top_incdir" = "$cf_add_incdir" && break
+               cf_add_incdir="$cf_top_incdir"
+       done
+done
+
+
+fi
+
+cat >> confdefs.h <<\EOF
+#define NCURSES 1
+EOF
+
+
+case $cf_cv_ncurses_header in # (vi
+*ncurses.h)
+       cat >> confdefs.h <<\EOF
+#define HAVE_NCURSES_H 1
+EOF
+
+       ;;
+esac
+
+case $cf_cv_ncurses_header in # (vi
+ncurses/curses.h|ncurses/ncurses.h)
+       cat >> confdefs.h <<\EOF
+#define HAVE_NCURSES_NCURSES_H 1
+EOF
+
+       ;;
+ncursesw/curses.h|ncursesw/ncurses.h)
+       cat >> confdefs.h <<\EOF
+#define HAVE_NCURSESW_NCURSES_H 1
+EOF
+
+       ;;
+esac
+
+
+echo $ac_n "checking for ncurses version""... $ac_c" 1>&6
+echo "configure:2598: checking for ncurses version" >&5
+if eval "test \"`echo '$''{'cf_cv_ncurses_version'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+       cf_cv_ncurses_version=no
+       cf_tempfile=out$$
+       rm -f $cf_tempfile
+       if test "$cross_compiling" = yes; then
+  
+
+       # This will not work if the preprocessor splits the line after the
+       # Autoconf token.  The 'unproto' program does that.
+       cat > conftest.$ac_ext <<EOF
+#include <${cf_cv_ncurses_header-curses.h}>
+#undef Autoconf
+#ifdef NCURSES_VERSION
+Autoconf NCURSES_VERSION
+#else
+#ifdef __NCURSES_H
+Autoconf "old"
+#endif
+;
+#endif
+EOF
+       cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
+       { (eval echo configure:2624: \"$cf_try\") 1>&5; (eval $cf_try) 2>&5; }
+       if test -f conftest.out ; then
+               cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
+               test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
+               rm -f conftest.out
+       fi
+
+else
+  cat > conftest.$ac_ext <<EOF
+#line 2633 "configure"
+#include "confdefs.h"
+
+#include <${cf_cv_ncurses_header-curses.h}>
+#include <stdio.h>
+int main()
+{
+       FILE *fp = fopen("$cf_tempfile", "w");
+#ifdef NCURSES_VERSION
+# ifdef NCURSES_VERSION_PATCH
+       fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
+# else
+       fprintf(fp, "%s\n", NCURSES_VERSION);
+# endif
+#else
+# ifdef __NCURSES_H
+       fprintf(fp, "old\n");
+# else
+       make an error
+# endif
+#endif
+       exit(0);
+}
+EOF
+if { (eval echo configure:2657: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+  
+       cf_cv_ncurses_version=`cat $cf_tempfile`
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+fi
+rm -fr conftest*
+fi
+
+       rm -f $cf_tempfile
+
+fi
+
+echo "$ac_t""$cf_cv_ncurses_version" 1>&6
+test "$cf_cv_ncurses_version" = no || cat >> confdefs.h <<\EOF
+#define NCURSES 1
+EOF
+
+
+
+       
+
+cf_nculib_root=ncurses
+       # This works, except for the special case where we find gpm, but
+       # ncurses is in a nonstandard location via $LIBS, and we really want
+       # to link gpm.
+cf_ncurses_LIBS=""
+cf_ncurses_SAVE="$LIBS"
+echo $ac_n "checking for Gpm_Open in -lgpm""... $ac_c" 1>&6
+echo "configure:2688: checking for Gpm_Open in -lgpm" >&5
+ac_lib_var=`echo gpm'_'Gpm_Open | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-lgpm  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 2696 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char Gpm_Open();
+
+int main() {
+Gpm_Open()
+; return 0; }
+EOF
+if { (eval echo configure:2707: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  echo $ac_n "checking for initscr in -lgpm""... $ac_c" 1>&6
+echo "configure:2723: checking for initscr in -lgpm" >&5
+ac_lib_var=`echo gpm'_'initscr | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-lgpm  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 2731 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char initscr();
+
+int main() {
+initscr()
+; return 0; }
+EOF
+if { (eval echo configure:2742: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  LIBS="$cf_ncurses_SAVE"
+else
+  echo "$ac_t""no" 1>&6
+cf_ncurses_LIBS="-lgpm"
+fi
+
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+
+case $host_os in #(vi
+freebsd*)
+       # This is only necessary if you are linking against an obsolete
+       # version of ncurses (but it should do no harm, since it's static).
+       if test "$cf_nculib_root" = ncurses ; then
+               echo $ac_n "checking for tgoto in -lmytinfo""... $ac_c" 1>&6
+echo "configure:2774: checking for tgoto in -lmytinfo" >&5
+ac_lib_var=`echo mytinfo'_'tgoto | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-lmytinfo  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 2782 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char tgoto();
+
+int main() {
+tgoto()
+; return 0; }
+EOF
+if { (eval echo configure:2793: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+       fi
+       ;;
+esac
+
+LIBS="$cf_ncurses_LIBS $LIBS"
+
+if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
+then
+       LIBS="-L$cf_cv_curses_dir/lib -l$cf_nculib_root $LIBS"
+else
+       
+       eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
+       cf_libdir=""
+       echo $ac_n "checking for initscr""... $ac_c" 1>&6
+echo "configure:2827: checking for initscr" >&5
+if eval "test \"`echo '$''{'ac_cv_func_initscr'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 2832 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char initscr(); below.  */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char initscr();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_initscr) || defined (__stub___initscr)
+choke me
+#else
+initscr();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:2855: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_func_initscr=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_func_initscr=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'initscr`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
+else
+  echo "$ac_t""no" 1>&6
+
+               cf_save_LIBS="$LIBS"
+               echo $ac_n "checking for initscr in -l$cf_nculib_root""... $ac_c" 1>&6
+echo "configure:2875: checking for initscr in -l$cf_nculib_root" >&5
+               LIBS="-l$cf_nculib_root $LIBS"
+               cat > conftest.$ac_ext <<EOF
+#line 2878 "configure"
+#include "confdefs.h"
+#include <${cf_cv_ncurses_header-curses.h}>
+int main() {
+initscr()
+; return 0; }
+EOF
+if { (eval echo configure:2885: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  echo "$ac_t""yes" 1>&6
+                        eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
+                       
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  echo "$ac_t""no" 1>&6
+                       cf_search=""
+
+test -d $HOME && {
+       test -n "$verbose" && echo "    ... testing lib-directories under $HOME"
+       test -d $HOME/lib &&          cf_search="$cf_search $HOME/lib"
+       test -d $HOME/lib/$cf_nculib_root &&       cf_search="$cf_search $HOME/lib/$cf_nculib_root"
+       test -d $HOME/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $HOME/lib/$cf_nculib_root/lib"
+}
+
+# For other stuff under the home directory, it should be sufficient to put
+# a symbolic link for $HOME/$cf_nculib_root to the actual package location:
+test -d $HOME/$cf_nculib_root && {
+       test -n "$verbose" && echo "    ... testing lib-directories under $HOME/$cf_nculib_root"
+       test -d $HOME/$cf_nculib_root/lib &&       cf_search="$cf_search $HOME/$cf_nculib_root/lib"
+       test -d $HOME/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $HOME/$cf_nculib_root/lib/$cf_nculib_root"
+}
+
+test "$prefix" != /usr/local && \
+test -d /usr/local && {
+       test -n "$verbose" && echo "    ... testing lib-directories under /usr/local"
+       test -d /usr/local/lib &&       cf_search="$cf_search /usr/local/lib"
+       test -d /usr/local/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/local/lib/$cf_nculib_root"
+       test -d /usr/local/lib/$cf_nculib_root/lib && cf_search="$cf_search /usr/local/lib/$cf_nculib_root/lib"
+       test -d /usr/local/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/local/$cf_nculib_root/lib"
+       test -d /usr/local/$cf_nculib_root/lib/$cf_nculib_root && cf_search="$cf_search /usr/local/$cf_nculib_root/lib/$cf_nculib_root"
+}
+
+test "$prefix" != NONE && \
+test -d $prefix && {
+       test -n "$verbose" && echo "    ... testing lib-directories under $prefix"
+       test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
+       test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
+       test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
+       test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
+       test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
+}
+
+test "$prefix" != /opt && \
+test -d /opt && {
+       test -n "$verbose" && echo "    ... testing lib-directories under /opt"
+       test -d /opt/lib &&             cf_search="$cf_search /opt/lib"
+       test -d /opt/lib/$cf_nculib_root &&          cf_search="$cf_search /opt/lib/$cf_nculib_root"
+       test -d /opt/lib/$cf_nculib_root/lib &&       cf_search="$cf_search /opt/lib/$cf_nculib_root/lib"
+       test -d /opt/$cf_nculib_root/lib &&          cf_search="$cf_search /opt/$cf_nculib_root/lib"
+       test -d /opt/$cf_nculib_root/lib/$cf_nculib_root &&       cf_search="$cf_search /opt/$cf_nculib_root/lib/$cf_nculib_root"
+}
+
+test "$prefix" != /usr && \
+test -d /usr && {
+       test -n "$verbose" && echo "    ... testing lib-directories under /usr"
+       test -d /usr/lib &&             cf_search="$cf_search /usr/lib"
+       test -d /usr/lib/$cf_nculib_root &&          cf_search="$cf_search /usr/lib/$cf_nculib_root"
+       test -d /usr/lib/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/lib/$cf_nculib_root/lib"
+       test -d /usr/$cf_nculib_root/lib &&          cf_search="$cf_search /usr/$cf_nculib_root/lib"
+}
+
+                       for cf_libdir in $cf_search
+                       do
+                               echo $ac_n "checking for -l$cf_nculib_root in $cf_libdir""... $ac_c" 1>&6
+echo "configure:2954: checking for -l$cf_nculib_root in $cf_libdir" >&5
+                               LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
+                               cat > conftest.$ac_ext <<EOF
+#line 2957 "configure"
+#include "confdefs.h"
+#include <${cf_cv_ncurses_header-curses.h}>
+int main() {
+initscr()
+; return 0; }
+EOF
+if { (eval echo configure:2964: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  echo "$ac_t""yes" 1>&6
+                                        eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
+                                        break
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  echo "$ac_t""no" 1>&6
+                                        LIBS="$cf_save_LIBS"
+fi
+rm -f conftest*
+                       done
+                       
+fi
+rm -f conftest*
+               
+fi
+
+eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
+
+if test $cf_found_library = no ; then
+       { echo "configure: error: Cannot link $cf_nculib_root library" 1>&2; exit 1; }
+fi
+
+
+fi
+
+if test -n "$cf_ncurses_LIBS" ; then
+       echo $ac_n "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS""... $ac_c" 1>&6
+echo "configure:2995: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
+       cf_ncurses_SAVE="$LIBS"
+       for p in $cf_ncurses_LIBS ; do
+               q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
+               if test "$q" != "$LIBS" ; then
+                       LIBS="$q"
+               fi
+       done
+       cat > conftest.$ac_ext <<EOF
+#line 3004 "configure"
+#include "confdefs.h"
+#include <${cf_cv_ncurses_header-curses.h}>
+int main() {
+initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
+; return 0; }
+EOF
+if { (eval echo configure:3011: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  echo "$ac_t""yes" 1>&6
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  echo "$ac_t""no" 1>&6
+                LIBS="$cf_ncurses_SAVE"
+fi
+rm -f conftest*
+fi
+
+
+cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
+
+cat >> confdefs.h <<EOF
+#define $cf_nculib_ROOT 1
+EOF
+
+
+       LIB_NAME=ncurses
+       ;;
+ncursesw)
+       cf_cv_libtype=w
+       
+echo $ac_n "checking for multibyte character support""... $ac_c" 1>&6
+echo "configure:3038: checking for multibyte character support" >&5
+if eval "test \"`echo '$''{'cf_cv_utf8_lib'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+       cf_save_LIBS="$LIBS"
+       cat > conftest.$ac_ext <<EOF
+#line 3045 "configure"
+#include "confdefs.h"
+
+#include <stdlib.h>
+int main() {
+putwc(0,0);
+; return 0; }
+EOF
+if { (eval echo configure:3053: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  cf_cv_utf8_lib=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  LIBS="-lutf8 $LIBS"
+        cat > conftest.$ac_ext <<EOF
+#line 3062 "configure"
+#include "confdefs.h"
+
+#include <libutf8.h>
+int main() {
+putwc(0,0);
+; return 0; }
+EOF
+if { (eval echo configure:3070: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  cf_cv_utf8_lib=add-on
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  cf_cv_utf8_lib=no
+fi
+rm -f conftest*
+       LIBS="$cf_save_LIBS"
+
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$cf_cv_utf8_lib" 1>&6
+
+# HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
+# ncurses/ncursesw:
+if test "$cf_cv_utf8_lib" = "add-on" ; then
+       cat >> confdefs.h <<\EOF
+#define HAVE_LIBUTF8_H 1
+EOF
+
+       LIBS="-lutf8 $LIBS"
+fi
+
+       
+
+cf_ncuhdr_root=ncursesw
+
+test -n "$cf_cv_curses_dir" && \
+test "$cf_cv_curses_dir" != "no" && \
+CPPFLAGS="-I$cf_cv_curses_dir/include -I$cf_cv_curses_dir/include/$cf_ncuhdr_root $CPPFLAGS"
+
+echo $ac_n "checking for $cf_ncuhdr_root header in include-path""... $ac_c" 1>&6
+echo "configure:3107: checking for $cf_ncuhdr_root header in include-path" >&5
+if eval "test \"`echo '$''{'cf_cv_ncurses_h'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+       cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
+       ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
+       for cf_header in $cf_header_list
+       do
+               
+       cat > conftest.$ac_ext <<EOF
+#line 3118 "configure"
+#include "confdefs.h"
+
+
+#define _XOPEN_SOURCE_EXTENDED
+#undef  HAVE_LIBUTF8_H /* in case we used CF_UTF8_LIB */
+#define HAVE_LIBUTF8_H /* to force ncurses' header file to use cchar_t */
+
+#include <$cf_header>
+int main() {
+
+#ifdef NCURSES_VERSION
+
+#ifndef WACS_BSSB
+       make an error
+#endif
+
+printf("%s\n", NCURSES_VERSION);
+#else
+#ifdef __NCURSES_H
+printf("old\n");
+#else
+       make an error
+#endif
+#endif
+       
+       
+; return 0; }
+EOF
+if { (eval echo configure:3147: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  cf_cv_ncurses_h=$cf_header
+       
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  cf_cv_ncurses_h=no
+fi
+rm -f conftest*
+
+               test "$cf_cv_ncurses_h" != no && break
+       done
+
+fi
+
+echo "$ac_t""$cf_cv_ncurses_h" 1>&6
+
+if test "$cf_cv_ncurses_h" != no ; then
+       cf_cv_ncurses_header=$cf_cv_ncurses_h
+else
+echo $ac_n "checking for $cf_ncuhdr_root include-path""... $ac_c" 1>&6
+echo "configure:3170: checking for $cf_ncuhdr_root include-path" >&5
+if eval "test \"`echo '$''{'cf_cv_ncurses_h2'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+       test -n "$verbose" && echo
+       cf_search=""
+
+test -d $HOME && {
+       test -n "$verbose" && echo "    ... testing include-directories under $HOME"
+       test -d $HOME/include &&          cf_search="$cf_search $HOME/include"
+       test -d $HOME/include/$cf_ncuhdr_root &&       cf_search="$cf_search $HOME/include/$cf_ncuhdr_root"
+       test -d $HOME/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $HOME/include/$cf_ncuhdr_root/include"
+}
+
+# For other stuff under the home directory, it should be sufficient to put
+# a symbolic link for $HOME/$cf_ncuhdr_root to the actual package location:
+test -d $HOME/$cf_ncuhdr_root && {
+       test -n "$verbose" && echo "    ... testing include-directories under $HOME/$cf_ncuhdr_root"
+       test -d $HOME/$cf_ncuhdr_root/include &&       cf_search="$cf_search $HOME/$cf_ncuhdr_root/include"
+       test -d $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
+}
+
+test "$prefix" != /usr/local && \
+test -d /usr/local && {
+       test -n "$verbose" && echo "    ... testing include-directories under /usr/local"
+       test -d /usr/local/include &&       cf_search="$cf_search /usr/local/include"
+       test -d /usr/local/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root"
+       test -d /usr/local/include/$cf_ncuhdr_root/include && cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root/include"
+       test -d /usr/local/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include"
+       test -d /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
+}
+
+test "$prefix" != NONE && \
+test -d $prefix && {
+       test -n "$verbose" && echo "    ... testing include-directories under $prefix"
+       test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
+       test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
+       test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
+       test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
+       test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
+}
+
+test "$prefix" != /opt && \
+test -d /opt && {
+       test -n "$verbose" && echo "    ... testing include-directories under /opt"
+       test -d /opt/include &&             cf_search="$cf_search /opt/include"
+       test -d /opt/include/$cf_ncuhdr_root &&          cf_search="$cf_search /opt/include/$cf_ncuhdr_root"
+       test -d /opt/include/$cf_ncuhdr_root/include &&       cf_search="$cf_search /opt/include/$cf_ncuhdr_root/include"
+       test -d /opt/$cf_ncuhdr_root/include &&          cf_search="$cf_search /opt/$cf_ncuhdr_root/include"
+       test -d /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&       cf_search="$cf_search /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
+}
+
+test "$prefix" != /usr && \
+test -d /usr && {
+       test -n "$verbose" && echo "    ... testing include-directories under /usr"
+       test -d /usr/include &&             cf_search="$cf_search /usr/include"
+       test -d /usr/include/$cf_ncuhdr_root &&          cf_search="$cf_search /usr/include/$cf_ncuhdr_root"
+       test -d /usr/include/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/include/$cf_ncuhdr_root/include"
+       test -d /usr/$cf_ncuhdr_root/include &&          cf_search="$cf_search /usr/$cf_ncuhdr_root/include"
+}
+
+test "$includedir" != NONE && \
+test "$includedir" != "/usr/include" && \
+test -d "$includedir" && {
+       test -d $includedir &&    cf_search="$cf_search $includedir"
+       test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
+}
+
+test "$oldincludedir" != NONE && \
+test "$oldincludedir" != "/usr/include" && \
+test -d "$oldincludedir" && {
+       test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
+       test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
+}
+
+
+       test -n "$verbose" && echo search path $cf_search
+       cf_save2_CPPFLAGS="$CPPFLAGS"
+       for cf_incdir in $cf_search
+       do
+               
+for cf_add_incdir in $cf_incdir
+do
+       while true
+       do
+               case $cf_add_incdir in
+               /usr/include) # (vi
+                       ;;
+               /usr/local/include) # (vi
+                       if test "$GCC" = yes
+                       then
+                               cf_save_CPPFLAGS="$CPPFLAGS"
+                               CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
+                               cat > conftest.$ac_ext <<EOF
+#line 3265 "configure"
+#include "confdefs.h"
+#include <stdio.h>
+int main() {
+printf("Hello")
+; return 0; }
+EOF
+if { (eval echo configure:3272: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  :
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  CPPFLAGS="$cf_save_CPPFLAGS"
+fi
+rm -f conftest*
+                       fi
+                       ;;
+               *) # (vi
+                       CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
+                       ;;
+               esac
+               cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
+               test "$cf_top_incdir" = "$cf_add_incdir" && break
+               cf_add_incdir="$cf_top_incdir"
+       done
+done
+
+               for cf_header in \
+                       ncurses.h \
+                       curses.h
+               do
+                       
+       cat > conftest.$ac_ext <<EOF
+#line 3299 "configure"
+#include "confdefs.h"
+
+
+#define _XOPEN_SOURCE_EXTENDED
+#undef  HAVE_LIBUTF8_H /* in case we used CF_UTF8_LIB */
+#define HAVE_LIBUTF8_H /* to force ncurses' header file to use cchar_t */
+
+#include <$cf_header>
+int main() {
+
+#ifdef NCURSES_VERSION
+
+#ifndef WACS_BSSB
+       make an error
+#endif
+
+printf("%s\n", NCURSES_VERSION);
+#else
+#ifdef __NCURSES_H
+printf("old\n");
+#else
+       make an error
+#endif
+#endif
+       
+       
+; return 0; }
+EOF
+if { (eval echo configure:3328: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  cf_cv_ncurses_h2=$cf_header
+       
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  cf_cv_ncurses_h2=no
+fi
+rm -f conftest*
+
+                       if test "$cf_cv_ncurses_h2" != no ; then
+                               cf_cv_ncurses_h2=$cf_incdir/$cf_header
+                               test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
+                               break
+                       fi
+                       test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
+               done
+               CPPFLAGS="$cf_save2_CPPFLAGS"
+               test "$cf_cv_ncurses_h2" != no && break
+       done
+       test "$cf_cv_ncurses_h2" = no && { echo "configure: error: not found" 1>&2; exit 1; }
+       
+fi
+
+echo "$ac_t""$cf_cv_ncurses_h2" 1>&6
+
+       cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
+       cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
+       if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
+               cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
+       fi
+       
+for cf_add_incdir in $cf_1st_incdir
+do
+       while true
+       do
+               case $cf_add_incdir in
+               /usr/include) # (vi
+                       ;;
+               /usr/local/include) # (vi
+                       if test "$GCC" = yes
+                       then
+                               cf_save_CPPFLAGS="$CPPFLAGS"
+                               CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
+                               cat > conftest.$ac_ext <<EOF
+#line 3375 "configure"
+#include "confdefs.h"
+#include <stdio.h>
+int main() {
+printf("Hello")
+; return 0; }
+EOF
+if { (eval echo configure:3382: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  :
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  CPPFLAGS="$cf_save_CPPFLAGS"
+fi
+rm -f conftest*
+                       fi
+                       ;;
+               *) # (vi
+                       CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
+                       ;;
+               esac
+               cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
+               test "$cf_top_incdir" = "$cf_add_incdir" && break
+               cf_add_incdir="$cf_top_incdir"
+       done
+done
+
+
+fi
+
+cat >> confdefs.h <<\EOF
+#define NCURSES 1
+EOF
+
+
+case $cf_cv_ncurses_header in # (vi
+*ncurses.h)
+       cat >> confdefs.h <<\EOF
+#define HAVE_NCURSES_H 1
+EOF
+
+       ;;
+esac
+
+case $cf_cv_ncurses_header in # (vi
+ncurses/curses.h|ncurses/ncurses.h)
+       cat >> confdefs.h <<\EOF
+#define HAVE_NCURSES_NCURSES_H 1
+EOF
+
+       ;;
+ncursesw/curses.h|ncursesw/ncurses.h)
+       cat >> confdefs.h <<\EOF
+#define HAVE_NCURSESW_NCURSES_H 1
+EOF
+
+       ;;
+esac
+
+
+echo $ac_n "checking for ncurses version""... $ac_c" 1>&6
+echo "configure:3437: checking for ncurses version" >&5
+if eval "test \"`echo '$''{'cf_cv_ncurses_version'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+       cf_cv_ncurses_version=no
+       cf_tempfile=out$$
+       rm -f $cf_tempfile
+       if test "$cross_compiling" = yes; then
+  
+
+       # This will not work if the preprocessor splits the line after the
+       # Autoconf token.  The 'unproto' program does that.
+       cat > conftest.$ac_ext <<EOF
+#include <${cf_cv_ncurses_header-curses.h}>
+#undef Autoconf
+#ifdef NCURSES_VERSION
+Autoconf NCURSES_VERSION
+#else
+#ifdef __NCURSES_H
+Autoconf "old"
+#endif
+;
+#endif
+EOF
+       cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
+       { (eval echo configure:3463: \"$cf_try\") 1>&5; (eval $cf_try) 2>&5; }
+       if test -f conftest.out ; then
+               cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
+               test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
+               rm -f conftest.out
+       fi
+
+else
+  cat > conftest.$ac_ext <<EOF
+#line 3472 "configure"
+#include "confdefs.h"
+
+#include <${cf_cv_ncurses_header-curses.h}>
+#include <stdio.h>
+int main()
+{
+       FILE *fp = fopen("$cf_tempfile", "w");
+#ifdef NCURSES_VERSION
+# ifdef NCURSES_VERSION_PATCH
+       fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
+# else
+       fprintf(fp, "%s\n", NCURSES_VERSION);
+# endif
+#else
+# ifdef __NCURSES_H
+       fprintf(fp, "old\n");
+# else
+       make an error
+# endif
+#endif
+       exit(0);
+}
+EOF
+if { (eval echo configure:3496: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+  
+       cf_cv_ncurses_version=`cat $cf_tempfile`
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+fi
+rm -fr conftest*
+fi
+
+       rm -f $cf_tempfile
+
+fi
+
+echo "$ac_t""$cf_cv_ncurses_version" 1>&6
+test "$cf_cv_ncurses_version" = no || cat >> confdefs.h <<\EOF
+#define NCURSES 1
+EOF
+
+
+
+       
+
+cf_nculib_root=ncursesw
+       # This works, except for the special case where we find gpm, but
+       # ncurses is in a nonstandard location via $LIBS, and we really want
+       # to link gpm.
+cf_ncurses_LIBS=""
+cf_ncurses_SAVE="$LIBS"
+echo $ac_n "checking for Gpm_Open in -lgpm""... $ac_c" 1>&6
+echo "configure:3527: checking for Gpm_Open in -lgpm" >&5
+ac_lib_var=`echo gpm'_'Gpm_Open | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-lgpm  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 3535 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char Gpm_Open();
+
+int main() {
+Gpm_Open()
+; return 0; }
+EOF
+if { (eval echo configure:3546: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  echo $ac_n "checking for initscr in -lgpm""... $ac_c" 1>&6
+echo "configure:3562: checking for initscr in -lgpm" >&5
+ac_lib_var=`echo gpm'_'initscr | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-lgpm  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 3570 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char initscr();
+
+int main() {
+initscr()
+; return 0; }
+EOF
+if { (eval echo configure:3581: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  LIBS="$cf_ncurses_SAVE"
+else
+  echo "$ac_t""no" 1>&6
+cf_ncurses_LIBS="-lgpm"
+fi
+
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+
+case $host_os in #(vi
+freebsd*)
+       # This is only necessary if you are linking against an obsolete
+       # version of ncurses (but it should do no harm, since it's static).
+       if test "$cf_nculib_root" = ncurses ; then
+               echo $ac_n "checking for tgoto in -lmytinfo""... $ac_c" 1>&6
+echo "configure:3613: checking for tgoto in -lmytinfo" >&5
+ac_lib_var=`echo mytinfo'_'tgoto | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-lmytinfo  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 3621 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char tgoto();
+
+int main() {
+tgoto()
+; return 0; }
+EOF
+if { (eval echo configure:3632: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+       fi
+       ;;
+esac
+
+LIBS="$cf_ncurses_LIBS $LIBS"
+
+if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
+then
+       LIBS="-L$cf_cv_curses_dir/lib -l$cf_nculib_root $LIBS"
+else
+       
+       eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
+       cf_libdir=""
+       echo $ac_n "checking for initscr""... $ac_c" 1>&6
+echo "configure:3666: checking for initscr" >&5
+if eval "test \"`echo '$''{'ac_cv_func_initscr'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 3671 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char initscr(); below.  */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char initscr();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_initscr) || defined (__stub___initscr)
+choke me
+#else
+initscr();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:3694: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_func_initscr=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_func_initscr=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'initscr`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
+else
+  echo "$ac_t""no" 1>&6
+
+               cf_save_LIBS="$LIBS"
+               echo $ac_n "checking for initscr in -l$cf_nculib_root""... $ac_c" 1>&6
+echo "configure:3714: checking for initscr in -l$cf_nculib_root" >&5
+               LIBS="-l$cf_nculib_root $LIBS"
+               cat > conftest.$ac_ext <<EOF
+#line 3717 "configure"
+#include "confdefs.h"
+#include <${cf_cv_ncurses_header-curses.h}>
+int main() {
+initscr()
+; return 0; }
+EOF
+if { (eval echo configure:3724: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  echo "$ac_t""yes" 1>&6
+                        eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
+                       
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  echo "$ac_t""no" 1>&6
+                       cf_search=""
+
+test -d $HOME && {
+       test -n "$verbose" && echo "    ... testing lib-directories under $HOME"
+       test -d $HOME/lib &&          cf_search="$cf_search $HOME/lib"
+       test -d $HOME/lib/$cf_nculib_root &&       cf_search="$cf_search $HOME/lib/$cf_nculib_root"
+       test -d $HOME/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $HOME/lib/$cf_nculib_root/lib"
+}
+
+# For other stuff under the home directory, it should be sufficient to put
+# a symbolic link for $HOME/$cf_nculib_root to the actual package location:
+test -d $HOME/$cf_nculib_root && {
+       test -n "$verbose" && echo "    ... testing lib-directories under $HOME/$cf_nculib_root"
+       test -d $HOME/$cf_nculib_root/lib &&       cf_search="$cf_search $HOME/$cf_nculib_root/lib"
+       test -d $HOME/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $HOME/$cf_nculib_root/lib/$cf_nculib_root"
+}
+
+test "$prefix" != /usr/local && \
+test -d /usr/local && {
+       test -n "$verbose" && echo "    ... testing lib-directories under /usr/local"
+       test -d /usr/local/lib &&       cf_search="$cf_search /usr/local/lib"
+       test -d /usr/local/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/local/lib/$cf_nculib_root"
+       test -d /usr/local/lib/$cf_nculib_root/lib && cf_search="$cf_search /usr/local/lib/$cf_nculib_root/lib"
+       test -d /usr/local/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/local/$cf_nculib_root/lib"
+       test -d /usr/local/$cf_nculib_root/lib/$cf_nculib_root && cf_search="$cf_search /usr/local/$cf_nculib_root/lib/$cf_nculib_root"
+}
+
+test "$prefix" != NONE && \
+test -d $prefix && {
+       test -n "$verbose" && echo "    ... testing lib-directories under $prefix"
+       test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
+       test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
+       test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
+       test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
+       test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
+}
+
+test "$prefix" != /opt && \
+test -d /opt && {
+       test -n "$verbose" && echo "    ... testing lib-directories under /opt"
+       test -d /opt/lib &&             cf_search="$cf_search /opt/lib"
+       test -d /opt/lib/$cf_nculib_root &&          cf_search="$cf_search /opt/lib/$cf_nculib_root"
+       test -d /opt/lib/$cf_nculib_root/lib &&       cf_search="$cf_search /opt/lib/$cf_nculib_root/lib"
+       test -d /opt/$cf_nculib_root/lib &&          cf_search="$cf_search /opt/$cf_nculib_root/lib"
+       test -d /opt/$cf_nculib_root/lib/$cf_nculib_root &&       cf_search="$cf_search /opt/$cf_nculib_root/lib/$cf_nculib_root"
+}
+
+test "$prefix" != /usr && \
+test -d /usr && {
+       test -n "$verbose" && echo "    ... testing lib-directories under /usr"
+       test -d /usr/lib &&             cf_search="$cf_search /usr/lib"
+       test -d /usr/lib/$cf_nculib_root &&          cf_search="$cf_search /usr/lib/$cf_nculib_root"
+       test -d /usr/lib/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/lib/$cf_nculib_root/lib"
+       test -d /usr/$cf_nculib_root/lib &&          cf_search="$cf_search /usr/$cf_nculib_root/lib"
+}
+
+                       for cf_libdir in $cf_search
+                       do
+                               echo $ac_n "checking for -l$cf_nculib_root in $cf_libdir""... $ac_c" 1>&6
+echo "configure:3793: checking for -l$cf_nculib_root in $cf_libdir" >&5
+                               LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
+                               cat > conftest.$ac_ext <<EOF
+#line 3796 "configure"
+#include "confdefs.h"
+#include <${cf_cv_ncurses_header-curses.h}>
+int main() {
+initscr()
+; return 0; }
+EOF
+if { (eval echo configure:3803: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  echo "$ac_t""yes" 1>&6
+                                        eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
+                                        break
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  echo "$ac_t""no" 1>&6
+                                        LIBS="$cf_save_LIBS"
+fi
+rm -f conftest*
+                       done
+                       
+fi
+rm -f conftest*
+               
+fi
+
+eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
+
+if test $cf_found_library = no ; then
+       { echo "configure: error: Cannot link $cf_nculib_root library" 1>&2; exit 1; }
+fi
+
+
+fi
 
-echo $ac_n "checking for initscr in -l$LIB_NAME""... $ac_c" 1>&6
-echo "configure:958: checking for initscr in -l$LIB_NAME" >&5
-ac_lib_var=`echo $LIB_NAME'_'initscr | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  ac_save_LIBS="$LIBS"
-LIBS="-l$LIB_NAME  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 966 "configure"
+if test -n "$cf_ncurses_LIBS" ; then
+       echo $ac_n "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS""... $ac_c" 1>&6
+echo "configure:3834: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
+       cf_ncurses_SAVE="$LIBS"
+       for p in $cf_ncurses_LIBS ; do
+               q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
+               if test "$q" != "$LIBS" ; then
+                       LIBS="$q"
+               fi
+       done
+       cat > conftest.$ac_ext <<EOF
+#line 3843 "configure"
 #include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char initscr();
-
+#include <${cf_cv_ncurses_header-curses.h}>
 int main() {
-initscr()
+initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
 ; return 0; }
 EOF
-if { (eval echo configure:977: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3850: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+  echo "$ac_t""yes" 1>&6
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+  echo "$ac_t""no" 1>&6
+                LIBS="$cf_ncurses_SAVE"
 fi
 rm -f conftest*
-LIBS="$ac_save_LIBS"
-
 fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_lib=HAVE_LIB`echo $LIB_NAME | sed -e 's/[^a-zA-Z0-9_]/_/g' \
-    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_lib 1
+
+
+cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
+
+cat >> confdefs.h <<EOF
+#define $cf_nculib_ROOT 1
 EOF
 
-  LIBS="-l$LIB_NAME $LIBS"
 
-else
-  echo "$ac_t""no" 1>&6
-fi
+       LIB_NAME=ncursesw
+       ;;
+esac
+
 
-fi
 
-echo $ac_n "checking for form_driver in -lform""... $ac_c" 1>&6
-echo "configure:1007: checking for form_driver in -lform" >&5
-ac_lib_var=`echo form'_'form_driver | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for new_panel in -lpanel$cf_cv_libtype""... $ac_c" 1>&6
+echo "configure:3878: checking for new_panel in -lpanel$cf_cv_libtype" >&5
+ac_lib_var=`echo panel$cf_cv_libtype'_'new_panel | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_save_LIBS="$LIBS"
-LIBS="-lform  $LIBS"
+LIBS="-lpanel$cf_cv_libtype  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1015 "configure"
+#line 3886 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
     builtin and then its argument prototype would still apply.  */
-char form_driver();
+char new_panel();
 
 int main() {
-form_driver()
+new_panel()
 ; return 0; }
 EOF
-if { (eval echo configure:1026: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3897: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1037,28 +3908,28 @@ LIBS="$ac_save_LIBS"
 fi
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-    ac_tr_lib=HAVE_LIB`echo form | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+    ac_tr_lib=HAVE_LIB`echo panel$cf_cv_libtype | sed -e 's/[^a-zA-Z0-9_]/_/g' \
     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
   cat >> confdefs.h <<EOF
 #define $ac_tr_lib 1
 EOF
 
-  LIBS="-lform $LIBS"
+  LIBS="-lpanel$cf_cv_libtype $LIBS"
 
 else
   echo "$ac_t""no" 1>&6
 fi
 
-echo $ac_n "checking for menu_driver in -lmenu""... $ac_c" 1>&6
-echo "configure:1054: checking for menu_driver in -lmenu" >&5
-ac_lib_var=`echo menu'_'menu_driver | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for menu_driver in -lmenu$cf_cv_libtype""... $ac_c" 1>&6
+echo "configure:3925: checking for menu_driver in -lmenu$cf_cv_libtype" >&5
+ac_lib_var=`echo menu$cf_cv_libtype'_'menu_driver | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_save_LIBS="$LIBS"
-LIBS="-lmenu  $LIBS"
+LIBS="-lmenu$cf_cv_libtype  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1062 "configure"
+#line 3933 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -1069,7 +3940,7 @@ int main() {
 menu_driver()
 ; return 0; }
 EOF
-if { (eval echo configure:1073: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3944: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1084,39 +3955,39 @@ LIBS="$ac_save_LIBS"
 fi
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-    ac_tr_lib=HAVE_LIB`echo menu | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+    ac_tr_lib=HAVE_LIB`echo menu$cf_cv_libtype | sed -e 's/[^a-zA-Z0-9_]/_/g' \
     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
   cat >> confdefs.h <<EOF
 #define $ac_tr_lib 1
 EOF
 
-  LIBS="-lmenu $LIBS"
+  LIBS="-lmenu$cf_cv_libtype $LIBS"
 
 else
   echo "$ac_t""no" 1>&6
 fi
 
-echo $ac_n "checking for new_panel in -lpanel""... $ac_c" 1>&6
-echo "configure:1101: checking for new_panel in -lpanel" >&5
-ac_lib_var=`echo panel'_'new_panel | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for form_driver in -lform$cf_cv_libtype""... $ac_c" 1>&6
+echo "configure:3972: checking for form_driver in -lform$cf_cv_libtype" >&5
+ac_lib_var=`echo form$cf_cv_libtype'_'form_driver | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_save_LIBS="$LIBS"
-LIBS="-lpanel  $LIBS"
+LIBS="-lform$cf_cv_libtype  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1109 "configure"
+#line 3980 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
     builtin and then its argument prototype would still apply.  */
-char new_panel();
+char form_driver();
 
 int main() {
-new_panel()
+form_driver()
 ; return 0; }
 EOF
-if { (eval echo configure:1120: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3991: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1131,13 +4002,13 @@ LIBS="$ac_save_LIBS"
 fi
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-    ac_tr_lib=HAVE_LIB`echo panel | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+    ac_tr_lib=HAVE_LIB`echo form$cf_cv_libtype | sed -e 's/[^a-zA-Z0-9_]/_/g' \
     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
   cat >> confdefs.h <<EOF
 #define $ac_tr_lib 1
 EOF
 
-  LIBS="-lpanel $LIBS"
+  LIBS="-lform$cf_cv_libtype $LIBS"
 
 else
   echo "$ac_t""no" 1>&6
@@ -1145,12 +4016,12 @@ fi
 
 
 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:1149: checking return type of signal handlers" >&5
+echo "configure:4020: checking return type of signal handlers" >&5
 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1154 "configure"
+#line 4025 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <signal.h>
@@ -1167,7 +4038,7 @@ int main() {
 int i;
 ; return 0; }
 EOF
-if { (eval echo configure:1171: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4042: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_type_signal=void
 else
@@ -1186,93 +4057,13 @@ EOF
 
 
 
-echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:1191: checking how to run the C preprocessor" >&5
-# On Suns, sometimes $CPP names a directory.
-if test -n "$CPP" && test -d "$CPP"; then
-  CPP=
-fi
-if test -z "$CPP"; then
-if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-    # This must be in double quotes, not single quotes, because CPP may get
-  # substituted into the Makefile and "${CC-cc}" will confuse make.
-  CPP="${CC-cc} -E"
-  # On the NeXT, cc -E runs the code through the compiler's parser,
-  # not just through cpp.
-  cat > conftest.$ac_ext <<EOF
-#line 1206 "configure"
-#include "confdefs.h"
-#include <assert.h>
-Syntax Error
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1212: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  :
-else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  CPP="${CC-cc} -E -traditional-cpp"
-  cat > conftest.$ac_ext <<EOF
-#line 1223 "configure"
-#include "confdefs.h"
-#include <assert.h>
-Syntax Error
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1229: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  :
-else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  CPP="${CC-cc} -nologo -E"
-  cat > conftest.$ac_ext <<EOF
-#line 1240 "configure"
-#include "confdefs.h"
-#include <assert.h>
-Syntax Error
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1246: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  :
-else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  CPP=/lib/cpp
-fi
-rm -f conftest*
-fi
-rm -f conftest*
-fi
-rm -f conftest*
-  ac_cv_prog_CPP="$CPP"
-fi
-  CPP="$ac_cv_prog_CPP"
-else
-  ac_cv_prog_CPP="$CPP"
-fi
-echo "$ac_t""$CPP" 1>&6
-
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:1271: checking for ANSI C header files" >&5
+echo "configure:4062: checking for ANSI C header files" >&5
 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1276 "configure"
+#line 4067 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -1280,7 +4071,7 @@ else
 #include <float.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1284: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4075: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -1297,7 +4088,7 @@ rm -f conftest*
 if test $ac_cv_header_stdc = yes; then
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 1301 "configure"
+#line 4092 "configure"
 #include "confdefs.h"
 #include <string.h>
 EOF
@@ -1315,7 +4106,7 @@ fi
 if test $ac_cv_header_stdc = yes; then
   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 1319 "configure"
+#line 4110 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
@@ -1336,7 +4127,7 @@ if test "$cross_compiling" = yes; then
   :
 else
   cat > conftest.$ac_ext <<EOF
-#line 1340 "configure"
+#line 4131 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -1347,7 +4138,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
 exit (0); }
 
 EOF
-if { (eval echo configure:1351: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:4142: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   :
 else
@@ -1371,12 +4162,12 @@ EOF
 fi
 
 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:1375: checking whether time.h and sys/time.h may both be included" >&5
+echo "configure:4166: checking whether time.h and sys/time.h may both be included" >&5
 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1380 "configure"
+#line 4171 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/time.h>
@@ -1385,7 +4176,7 @@ int main() {
 struct tm *tp;
 ; return 0; }
 EOF
-if { (eval echo configure:1389: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4180: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_time=yes
 else
@@ -1408,8 +4199,10 @@ fi
 for ac_hdr in \
 form.h \
 getopt.h \
+locale.h \
 menu.h \
 nc_alloc.h \
+nomacros.h \
 panel.h \
 sys/ioctl.h \
 sys/select.h \
@@ -1420,17 +4213,17 @@ unistd.h \
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1424: checking for $ac_hdr" >&5
+echo "configure:4217: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1429 "configure"
+#line 4222 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1434: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4227: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -1458,22 +4251,27 @@ done
 
 
 for ac_func in \
+color_set \
+getnstr \
 gettimeofday \
 napms \
+resize_term \
 resizeterm \
+slk_color \
 strdup \
 use_default_colors \
 vsscanf \
+wchgat \
 wresize \
 
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1472: checking for $ac_func" >&5
+echo "configure:4270: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1477 "configure"
+#line 4275 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -1496,7 +4294,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:1500: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4298: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -1521,8 +4319,85 @@ fi
 done
 
 
+cat > conftest.$ac_ext <<EOF
+#line 4324 "configure"
+#include "confdefs.h"
+
+#include <${cf_cv_ncurses_header-curses.h}>
+int main() {
+
+       (void) assume_default_colors (0, 0);
+       (void) curses_version ();
+       (void) define_key (0, 0);
+       (void) is_term_resized (0, 0);
+       (void) key_defined (0);
+       (void) keybound (0, 0);
+       (void) keyok (0, 0);
+       (void) resize_term (0, 0);
+       (void) resizeterm (0, 0);
+       (void) use_default_colors ();
+       (void) use_extended_names (0);
+       (void) wresize (0, 0, 0);
+       
+; return 0; }
+EOF
+if { (eval echo configure:4345: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  cat >> confdefs.h <<\EOF
+#define NCURSES_EXT_FUNCS 1
+EOF
+
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+fi
+rm -f conftest*
+
+
+echo $ac_n "checking if sys/time.h works with sys/select.h""... $ac_c" 1>&6
+echo "configure:4359: checking if sys/time.h works with sys/select.h" >&5
+if eval "test \"`echo '$''{'cf_cv_sys_time_select'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+cat > conftest.$ac_ext <<EOF
+#line 4365 "configure"
+#include "confdefs.h"
+
+#include <sys/types.h>
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#ifdef HAVE_SYS_SELECT_H
+#include <sys/select.h>
+#endif
+
+int main() {
+
+; return 0; }
+EOF
+if { (eval echo configure:4380: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  cf_cv_sys_time_select=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  cf_cv_sys_time_select=no
+fi
+rm -f conftest*
+     
+fi
+
+echo "$ac_t""$cf_cv_sys_time_select" 1>&6
+test "$cf_cv_sys_time_select" = yes && cat >> confdefs.h <<\EOF
+#define HAVE_SYS_TIME_SELECT 1
+EOF
+
+
+
 echo $ac_n "checking for function curses_version""... $ac_c" 1>&6
-echo "configure:1526: checking for function curses_version" >&5
+echo "configure:4401: checking for function curses_version" >&5
 if eval "test \"`echo '$''{'cf_cv_func_curses_version'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1531,10 +4406,10 @@ if test "$cross_compiling" = yes; then
   cf_cv_func_curses_version=unknown
 else
   cat > conftest.$ac_ext <<EOF
-#line 1535 "configure"
+#line 4410 "configure"
 #include "confdefs.h"
 
-#include <curses.h>
+#include <${cf_cv_ncurses_header-curses.h}>
 int main()
 {
        char temp[1024];
@@ -1543,7 +4418,7 @@ int main()
 }
 
 EOF
-if { (eval echo configure:1547: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:4422: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   cf_cv_func_curses_version=yes
 
@@ -1566,45 +4441,173 @@ test "$cf_cv_func_curses_version" = yes && cat >> confdefs.h <<\EOF
 EOF
 
 
-echo $ac_n "checking if sys/time.h conflicts with sys/select.h""... $ac_c" 1>&6
-echo "configure:1571: checking if sys/time.h conflicts with sys/select.h" >&5
-if eval "test \"`echo '$''{'cf_cv_sys_time_select'+set}'`\" = set"; then
+
+echo $ac_n "checking for alternate character set array""... $ac_c" 1>&6
+echo "configure:4447: checking for alternate character set array" >&5
+if eval "test \"`echo '$''{'cf_cv_curses_acs_map'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
+cf_cv_curses_acs_map=unknown
+for name in acs_map _acs_map __acs_map _nc_acs_map
+do
 cat > conftest.$ac_ext <<EOF
-#line 1577 "configure"
+#line 4456 "configure"
 #include "confdefs.h"
 
-#if HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
-#if HAVE_SYS_SELECT_H
-#include <sys/select.h>
+#include <${cf_cv_ncurses_header-curses.h}>
+
+int main() {
+
+$name['k'] = ACS_PLUS
+
+; return 0; }
+EOF
+if { (eval echo configure:4467: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  cf_cv_curses_acs_map=$name; break
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+fi
+rm -f conftest*
+done
+
+fi
+
+echo "$ac_t""$cf_cv_curses_acs_map" 1>&6
+
+test "$cf_cv_curses_acs_map" != unknown && cat >> confdefs.h <<EOF
+#define CURSES_ACS_ARRAY $cf_cv_curses_acs_map
+EOF
+
+
+
+echo $ac_n "checking for wide alternate character set array""... $ac_c" 1>&6
+echo "configure:4488: checking for wide alternate character set array" >&5
+if eval "test \"`echo '$''{'cf_cv_curses_wacs_map'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+       cf_cv_curses_wacs_map=unknown
+       for name in wacs_map _wacs_map __wacs_map _nc_wacs
+       do
+       cat > conftest.$ac_ext <<EOF
+#line 4497 "configure"
+#include "confdefs.h"
+
+#ifndef _XOPEN_SOURCE_EXTENDED
+#define _XOPEN_SOURCE_EXTENDED
 #endif
+#include <${cf_cv_ncurses_header-curses.h}>
+int main() {
+$name['k'] = *WACS_PLUS
+; return 0; }
+EOF
+if { (eval echo configure:4508: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  cf_cv_curses_wacs_map=$name
+        break
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+fi
+rm -f conftest*
+       done
+fi
+
+echo "$ac_t""$cf_cv_curses_wacs_map" 1>&6
+
+
+echo $ac_n "checking for type attr_t in ${cf_cv_ncurses_header-curses.h}""... $ac_c" 1>&6
+echo "configure:4524: checking for type attr_t in ${cf_cv_ncurses_header-curses.h}" >&5
+cat > conftest.$ac_ext <<EOF
+#line 4526 "configure"
+#include "confdefs.h"
 
+#ifndef _XOPEN_SOURCE_EXTENDED
+#define _XOPEN_SOURCE_EXTENDED
+#endif
+#include <${cf_cv_ncurses_header-curses.h}>
 int main() {
 
+attr_t foo
+
 ; return 0; }
 EOF
-if { (eval echo configure:1591: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4539: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
-  cf_cv_sys_time_select=yes
+  cf_result=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  cf_cv_sys_time_select=no
+  cf_result=no
 fi
 rm -f conftest*
-     
+echo "$ac_t""$cf_result" 1>&6
+if test $cf_result = yes ; then
+       
+cf_result=`echo "have_type_attr_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
+
+       cat >> confdefs.h <<EOF
+#define $cf_result 1
+EOF
+
+else
+       cat >> confdefs.h <<EOF
+#define attr_t long
+EOF
+
 fi
 
-echo "$ac_t""$cf_cv_sys_time_select" 1>&6
-test $cf_cv_sys_time_select = yes && cat >> confdefs.h <<\EOF
-#define HAVE_SYS_TIME_SELECT 1
+
+echo $ac_n "checking for type mbstate_t in ${cf_cv_ncurses_header-curses.h}""... $ac_c" 1>&6
+echo "configure:4567: checking for type mbstate_t in ${cf_cv_ncurses_header-curses.h}" >&5
+cat > conftest.$ac_ext <<EOF
+#line 4569 "configure"
+#include "confdefs.h"
+
+#ifndef _XOPEN_SOURCE_EXTENDED
+#define _XOPEN_SOURCE_EXTENDED
+#endif
+#include <${cf_cv_ncurses_header-curses.h}>
+int main() {
+
+mbstate_t foo
+
+; return 0; }
+EOF
+if { (eval echo configure:4582: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  cf_result=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  cf_result=no
+fi
+rm -f conftest*
+echo "$ac_t""$cf_result" 1>&6
+if test $cf_result = yes ; then
+       
+cf_result=`echo "have_type_mbstate_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
+
+       cat >> confdefs.h <<EOF
+#define $cf_result 1
+EOF
+
+else
+       cat >> confdefs.h <<EOF
+#define mbstate_t long
 EOF
 
+fi
+
+
+TEST_ARGS="$LIBS"
+LIBS=
+
 
 trap '' 1 2 15
 cat > confcache <<\EOF
@@ -1696,7 +4699,7 @@ do
     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
-    echo "$CONFIG_STATUS generated by autoconf version 2.13.19990117"
+    echo "$CONFIG_STATUS generated by autoconf version 2.13.20030927"
     exit 0 ;;
   -help | --help | --hel | --he | --h)
     echo "\$ac_cs_usage"; exit 0 ;;
@@ -1738,18 +4741,28 @@ s%@includedir@%$includedir%g
 s%@oldincludedir@%$oldincludedir%g
 s%@infodir@%$infodir%g
 s%@mandir@%$mandir%g
+s%@host@%$host%g
+s%@host_alias@%$host_alias%g
+s%@host_cpu@%$host_cpu%g
+s%@host_vendor@%$host_vendor%g
+s%@host_os@%$host_os%g
+s%@SET_MAKE@%$SET_MAKE%g
 s%@CC@%$CC%g
+s%@CPP@%$CPP%g
 s%@CC_G_OPT@%$CC_G_OPT%g
 s%@CC_SHARED_OPTS@%$CC_SHARED_OPTS%g
 s%@DFT_DEP_SUFFIX@%$DFT_DEP_SUFFIX%g
 s%@DFT_OBJ_SUBDIR@%$DFT_OBJ_SUBDIR%g
 s%@DFT_UPR_MODEL@%$DFT_UPR_MODEL%g
 s%@ECHO_LINK@%$ECHO_LINK%g
-s%@EXTRA_LIBS@%$EXTRA_LIBS%g
 s%@LD@%$LD%g
 s%@LDFLAGS_SHARED@%$LDFLAGS_SHARED%g
 s%@LD_MODEL@%$LD_MODEL%g
 s%@LD_SHARED_OPTS@%$LD_SHARED_OPTS%g
+s%@LIBTOOL@%$LIBTOOL%g
+s%@LIB_CLEAN@%$LIB_CLEAN%g
+s%@LIB_COMPILE@%$LIB_COMPILE%g
+s%@LIB_LINK@%$LIB_LINK%g
 s%@LIB_NAME@%$LIB_NAME%g
 s%@LIB_PREFIX@%$LIB_PREFIX%g
 s%@LINK_TESTS@%$LINK_TESTS%g
@@ -1757,12 +4770,14 @@ s%@LINT@%$LINT%g
 s%@LINT_OPTS@%$LINT_OPTS%g
 s%@LOCAL_LDFLAGS@%$LOCAL_LDFLAGS%g
 s%@MATH_LIB@%$MATH_LIB%g
-s%@PROG_EXT@%$PROG_EXT%g
 s%@TEST_ARGS@%$TEST_ARGS%g
 s%@TEST_DEPS@%$TEST_DEPS%g
+s%@TINFO_ARGS@%$TINFO_ARGS%g
 s%@cf_cv_abi_version@%$cf_cv_abi_version%g
 s%@cf_cv_rel_version@%$cf_cv_rel_version%g
-s%@CPP@%$CPP%g
+s%@EXEEXT@%$EXEEXT%g
+s%@OBJEXT@%$OBJEXT%g
+s%@EXTRA_CPPFLAGS@%$EXTRA_CPPFLAGS%g
 
 CEOF
 EOF
@@ -1973,11 +4988,9 @@ cat >> $CONFIG_STATUS <<\EOF
 # work consistently for different make-programs (the '\$(MODEL)/' confuses
 # some, and the '\$x' confuses others).
 TEST_EOF
-LIST=`make echo_tests`
-LAST=`make echo_suffix`
-for n in $LIST
+LIST=`sed -e 's/[      ].*//' -e '/^[#@]/d' $srcdir/modules`
+for N in $LIST
 do
-       N=`echo $n | sed -e s/${LAST}\$//`
        cat >>Makefile <<TEST_EOF
 
 \$(MODEL)/$N.o : $N.c \\