]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - test/configure
ncurses 5.9 - patch 20120811
[ncurses.git] / test / configure
index a33f9f75b839dd3b656795558eca158850559a6a..6e79c17724a51bb09dd892c6590e1116f9e8223f 100755 (executable)
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by Autoconf 2.52.20101001.
+# Generated by Autoconf 2.52.20120811.
 #
 # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
 # Free Software Foundation, Inc.
@@ -105,42 +105,6 @@ SHELL=${CONFIG_SHELL-/bin/sh}
 : ${ac_max_here_lines=38}
 
 ac_unique_file="ncurses.c"
-# Factoring default headers for most tests.
-ac_includes_default="\
-#include <stdio.h>
-#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-#if HAVE_SYS_STAT_H
-# include <sys/stat.h>
-#endif
-#if STDC_HEADERS
-# include <stdlib.h>
-# include <stddef.h>
-#else
-# if HAVE_STDLIB_H
-#  include <stdlib.h>
-# endif
-#endif
-#if HAVE_STRING_H
-# if !STDC_HEADERS && HAVE_MEMORY_H
-#  include <memory.h>
-# endif
-# include <string.h>
-#endif
-#if HAVE_STRINGS_H
-# include <strings.h>
-#endif
-#if HAVE_INTTYPES_H
-# include <inttypes.h>
-#else
-# if HAVE_STDINT_H
-#  include <stdint.h>
-# endif
-#endif
-#if HAVE_UNISTD_H
-# include <unistd.h>
-#endif"
 
 # Initialize some variables set by options.
 ac_init_help=
@@ -170,15 +134,16 @@ x_libraries=NONE
 bindir='${exec_prefix}/bin'
 sbindir='${exec_prefix}/sbin'
 libexecdir='${exec_prefix}/libexec'
-datadir='${prefix}/share'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
 sysconfdir='${prefix}/etc'
 sharedstatedir='${prefix}/com'
 localstatedir='${prefix}/var'
 libdir='${exec_prefix}/lib'
 includedir='${prefix}/include'
 oldincludedir='/usr/include'
-infodir='${prefix}/info'
-mandir='${prefix}/man'
+infodir='${datarootdir}/info'
+mandir='${datarootdir}/man'
 
 # Identity of this package.
 PACKAGE_NAME=
@@ -229,6 +194,13 @@ do
   | --da=*)
     datadir=$ac_optarg ;;
 
+  -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+  | --dataroo | --dataro | --datar)
+    ac_prev=datarootdir ;;
+  -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+  | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+    datarootdir=$ac_optarg ;;
+
   -disable-* | --disable-*)
     ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
     # Reject names that are not valid shell variable names.
@@ -504,7 +476,7 @@ do
 done
 
 # Be sure to have absolute paths.
-for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
+for ac_var in bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir \
               localstatedir libdir includedir oldincludedir infodir mandir
 do
   eval ac_val=$`echo $ac_var`
@@ -641,15 +613,16 @@ Fine tuning of the installation directories:
   --bindir=DIR            user executables [EPREFIX/bin]
   --sbindir=DIR           system admin executables [EPREFIX/sbin]
   --libexecdir=DIR        program executables [EPREFIX/libexec]
-  --datadir=DIR           read-only architecture-independent data [PREFIX/share]
+  --datarootdir=DIR       read-only architecture-independent data [PREFIX/share]
+  --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
   --libdir=DIR            object code libraries [EPREFIX/lib]
   --includedir=DIR        C header files [PREFIX/include]
   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
-  --infodir=DIR           info documentation [PREFIX/info]
-  --mandir=DIR            man documentation [PREFIX/man]
+  --infodir=DIR           info documentation [DATAROOTDIR/info]
+  --mandir=DIR            man documentation [DATAROOTDIR/man]
 EOF
 
   cat <<\EOF
@@ -683,17 +656,24 @@ Optional Packages:
 
   --disable-echo          display "compiling" commands
   --enable-warnings       test: turn on gcc compiler warnings
+  --with-dmalloc          test: use Gray Watson's dmalloc library
+  --with-dbmalloc         test: use Conor Cahill's dbmalloc library
+  --with-valgrind         test: use valgrind
+  --disable-leaks         test: free permanent memory, analyze leaks
+  --disable-widec           disable checks for wide-character functions
   --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)
+  --with-ncursesw         use wide ncurses-libraries
+  --with-ncurses          use ncurses-libraries
   --with-pdcurses         compile/link with pdcurses X11 library
+  --with-curses-colr      compile/link with HPUX 10.x color-curses
+  --with-curses-5lib      compile/link with SunOS 5lib curses
   --with-Xaw3d            link with Xaw 3d library
   --with-neXtaw           link with neXT Athena library
   --with-XawPlus          link with Athena-Plus library
   --with-pkg-config{=path} enable/disable use of pkg-config
   --with-x                use the X Window System
   --with-ncurses-wrap-prefix naming-prefix for ncurses wrapped-variables
+  --disable-rpath-hack    don't add rpath options for additional libraries
 
 Some influential environment variables:
   CC          C compiler command
@@ -763,7 +743,7 @@ This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
 It was created by $as_me, which was
-generated by GNU Autoconf 2.52.20101001.  Invocation command line was
+generated by GNU Autoconf 2.52.20120811.  Invocation command line was
 
   $ $0 $@
 
@@ -887,7 +867,7 @@ if test -z "$CONFIG_SITE"; then
 fi
 for ac_site_file in $CONFIG_SITE; do
   if test -r "$ac_site_file"; then
-    { echo "$as_me:890: loading site script $ac_site_file" >&5
+    { echo "$as_me:870: loading site script $ac_site_file" >&5
 echo "$as_me: loading site script $ac_site_file" >&6;}
     cat "$ac_site_file" >&5
     . "$ac_site_file"
@@ -898,7 +878,7 @@ if test -r "$cache_file"; then
   # Some versions of bash will fail to source /dev/null (special
   # files actually), so we avoid doing that.
   if test -f "$cache_file"; then
-    { echo "$as_me:901: loading cache $cache_file" >&5
+    { echo "$as_me:881: loading cache $cache_file" >&5
 echo "$as_me: loading cache $cache_file" >&6;}
     case $cache_file in
       [\\/]* | ?:[\\/]* ) . $cache_file;;
@@ -906,7 +886,7 @@ echo "$as_me: loading cache $cache_file" >&6;}
     esac
   fi
 else
-  { echo "$as_me:909: creating cache $cache_file" >&5
+  { echo "$as_me:889: creating cache $cache_file" >&5
 echo "$as_me: creating cache $cache_file" >&6;}
   >$cache_file
 fi
@@ -922,21 +902,21 @@ for ac_var in `(set) 2>&1 |
   eval ac_new_val="\$ac_env_${ac_var}_value"
   case $ac_old_set,$ac_new_set in
     set,)
-      { echo "$as_me:925: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+      { echo "$as_me:905: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
       ac_cache_corrupted=: ;;
     ,set)
-      { echo "$as_me:929: error: \`$ac_var' was not set in the previous run" >&5
+      { echo "$as_me:909: error: \`$ac_var' was not set in the previous run" >&5
 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
       ac_cache_corrupted=: ;;
     ,);;
     *)
       if test "x$ac_old_val" != "x$ac_new_val"; then
-        { echo "$as_me:935: error: \`$ac_var' has changed since the previous run:" >&5
+        { echo "$as_me:915: error: \`$ac_var' has changed since the previous run:" >&5
 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
-        { echo "$as_me:937:   former value:  $ac_old_val" >&5
+        { echo "$as_me:917:   former value:  $ac_old_val" >&5
 echo "$as_me:   former value:  $ac_old_val" >&2;}
-        { echo "$as_me:939:   current value: $ac_new_val" >&5
+        { echo "$as_me:919:   current value: $ac_new_val" >&5
 echo "$as_me:   current value: $ac_new_val" >&2;}
         ac_cache_corrupted=:
       fi;;
@@ -955,9 +935,9 @@ echo "$as_me:   current value: $ac_new_val" >&2;}
   fi
 done
 if $ac_cache_corrupted; then
-  { echo "$as_me:958: error: changes in the environment can compromise the build" >&5
+  { echo "$as_me:938: error: changes in the environment can compromise the build" >&5
 echo "$as_me: error: changes in the environment can compromise the build" >&2;}
-  { { echo "$as_me:960: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
+  { { echo "$as_me:940: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
    { (exit 1); exit 1; }; }
 fi
@@ -978,10 +958,10 @@ esac
 echo "#! $SHELL" >conftest.sh
 echo  "exit 0"   >>conftest.sh
 chmod +x conftest.sh
-if { (echo "$as_me:981: PATH=\".;.\"; conftest.sh") >&5
+if { (echo "$as_me:961: PATH=\".;.\"; conftest.sh") >&5
   (PATH=".;."; conftest.sh) 2>&5
   ac_status=$?
-  echo "$as_me:984: \$? = $ac_status" >&5
+  echo "$as_me:964: \$? = $ac_status" >&5
   (exit $ac_status); }; then
   ac_path_separator=';'
 else
@@ -1013,7 +993,7 @@ for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
   fi
 done
 if test -z "$ac_aux_dir"; then
-  { { echo "$as_me:1016: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
+  { { echo "$as_me:996: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
    { (exit 1); exit 1; }; }
 fi
@@ -1023,11 +1003,11 @@ ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
 
 # Make sure we can run config.sub.
 $ac_config_sub sun4 >/dev/null 2>&1 ||
-  { { echo "$as_me:1026: error: cannot run $ac_config_sub" >&5
+  { { echo "$as_me:1006: error: cannot run $ac_config_sub" >&5
 echo "$as_me: error: cannot run $ac_config_sub" >&2;}
    { (exit 1); exit 1; }; }
 
-echo "$as_me:1030: checking build system type" >&5
+echo "$as_me:1010: checking build system type" >&5
 echo $ECHO_N "checking build system type... $ECHO_C" >&6
 if test "${ac_cv_build+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -1036,16 +1016,16 @@ else
 test -z "$ac_cv_build_alias" &&
   ac_cv_build_alias=`$ac_config_guess`
 test -z "$ac_cv_build_alias" &&
-  { { echo "$as_me:1039: error: cannot guess build type; you must specify one" >&5
+  { { echo "$as_me:1019: error: cannot guess build type; you must specify one" >&5
 echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
    { (exit 1); exit 1; }; }
 ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
-  { { echo "$as_me:1043: error: $ac_config_sub $ac_cv_build_alias failed." >&5
+  { { echo "$as_me:1023: error: $ac_config_sub $ac_cv_build_alias failed." >&5
 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;}
    { (exit 1); exit 1; }; }
 
 fi
-echo "$as_me:1048: result: $ac_cv_build" >&5
+echo "$as_me:1028: result: $ac_cv_build" >&5
 echo "${ECHO_T}$ac_cv_build" >&6
 build=$ac_cv_build
 build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
@@ -1053,7 +1033,7 @@ build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
 build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
 
 if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then
-       echo "$as_me:1056: checking host system type" >&5
+       echo "$as_me:1036: checking host system type" >&5
 echo $ECHO_N "checking host system type... $ECHO_C" >&6
 if test "${ac_cv_host+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -1062,12 +1042,12 @@ else
 test -z "$ac_cv_host_alias" &&
   ac_cv_host_alias=$ac_cv_build_alias
 ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
-  { { echo "$as_me:1065: error: $ac_config_sub $ac_cv_host_alias failed" >&5
+  { { echo "$as_me:1045: error: $ac_config_sub $ac_cv_host_alias failed" >&5
 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
    { (exit 1); exit 1; }; }
 
 fi
-echo "$as_me:1070: result: $ac_cv_host" >&5
+echo "$as_me:1050: result: $ac_cv_host" >&5
 echo "${ECHO_T}$ac_cv_host" >&6
 host=$ac_cv_host
 host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
@@ -1092,13 +1072,13 @@ else
 fi
 
 test -z "$system_name" && system_name="$cf_cv_system_name"
-test -n "$cf_cv_system_name" && echo "$as_me:1095: result: Configuring for $cf_cv_system_name" >&5
+test -n "$cf_cv_system_name" && echo "$as_me:1075: result: Configuring for $cf_cv_system_name" >&5
 echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6
 
 if test ".$system_name" != ".$cf_cv_system_name" ; then
-       echo "$as_me:1099: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5
+       echo "$as_me:1079: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5
 echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6
-       { { echo "$as_me:1101: error: \"Please remove config.cache and try again.\"" >&5
+       { { echo "$as_me:1081: error: \"Please remove config.cache and try again.\"" >&5
 echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;}
    { (exit 1); exit 1; }; }
 fi
@@ -1116,7 +1096,7 @@ _ACEOF
 program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
 rm conftest.sed
 
-echo "$as_me:1119: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "$as_me:1099: checking whether ${MAKE-make} sets \${MAKE}" >&5
 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
@@ -1136,11 +1116,11 @@ fi
 rm -f conftest.make
 fi
 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
-  echo "$as_me:1139: result: yes" >&5
+  echo "$as_me:1119: result: yes" >&5
 echo "${ECHO_T}yes" >&6
   SET_MAKE=
 else
-  echo "$as_me:1143: result: no" >&5
+  echo "$as_me:1123: result: no" >&5
 echo "${ECHO_T}no" >&6
   SET_MAKE="MAKE=${MAKE-make}"
 fi
@@ -1154,7 +1134,7 @@ ac_main_return=return
 if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
 set dummy ${ac_tool_prefix}gcc; ac_word=$2
-echo "$as_me:1157: checking for $ac_word" >&5
+echo "$as_me:1137: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_prog_CC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -1169,7 +1149,7 @@ for ac_dir in $ac_dummy; do
   test -z "$ac_dir" && ac_dir=.
   $as_executable_p "$ac_dir/$ac_word" || continue
 ac_cv_prog_CC="${ac_tool_prefix}gcc"
-echo "$as_me:1172: found $ac_dir/$ac_word" >&5
+echo "$as_me:1152: found $ac_dir/$ac_word" >&5
 break
 done
 
@@ -1177,10 +1157,10 @@ fi
 fi
 CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  echo "$as_me:1180: result: $CC" >&5
+  echo "$as_me:1160: result: $CC" >&5
 echo "${ECHO_T}$CC" >&6
 else
-  echo "$as_me:1183: result: no" >&5
+  echo "$as_me:1163: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -1189,7 +1169,7 @@ if test -z "$ac_cv_prog_CC"; then
   ac_ct_CC=$CC
   # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
-echo "$as_me:1192: checking for $ac_word" >&5
+echo "$as_me:1172: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -1204,7 +1184,7 @@ for ac_dir in $ac_dummy; do
   test -z "$ac_dir" && ac_dir=.
   $as_executable_p "$ac_dir/$ac_word" || continue
 ac_cv_prog_ac_ct_CC="gcc"
-echo "$as_me:1207: found $ac_dir/$ac_word" >&5
+echo "$as_me:1187: found $ac_dir/$ac_word" >&5
 break
 done
 
@@ -1212,10 +1192,10 @@ fi
 fi
 ac_ct_CC=$ac_cv_prog_ac_ct_CC
 if test -n "$ac_ct_CC"; then
-  echo "$as_me:1215: result: $ac_ct_CC" >&5
+  echo "$as_me:1195: result: $ac_ct_CC" >&5
 echo "${ECHO_T}$ac_ct_CC" >&6
 else
-  echo "$as_me:1218: result: no" >&5
+  echo "$as_me:1198: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -1228,7 +1208,7 @@ if test -z "$CC"; then
   if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
 set dummy ${ac_tool_prefix}cc; ac_word=$2
-echo "$as_me:1231: checking for $ac_word" >&5
+echo "$as_me:1211: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_prog_CC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -1243,7 +1223,7 @@ for ac_dir in $ac_dummy; do
   test -z "$ac_dir" && ac_dir=.
   $as_executable_p "$ac_dir/$ac_word" || continue
 ac_cv_prog_CC="${ac_tool_prefix}cc"
-echo "$as_me:1246: found $ac_dir/$ac_word" >&5
+echo "$as_me:1226: found $ac_dir/$ac_word" >&5
 break
 done
 
@@ -1251,10 +1231,10 @@ fi
 fi
 CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  echo "$as_me:1254: result: $CC" >&5
+  echo "$as_me:1234: result: $CC" >&5
 echo "${ECHO_T}$CC" >&6
 else
-  echo "$as_me:1257: result: no" >&5
+  echo "$as_me:1237: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -1263,7 +1243,7 @@ if test -z "$ac_cv_prog_CC"; then
   ac_ct_CC=$CC
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
-echo "$as_me:1266: checking for $ac_word" >&5
+echo "$as_me:1246: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -1278,7 +1258,7 @@ for ac_dir in $ac_dummy; do
   test -z "$ac_dir" && ac_dir=.
   $as_executable_p "$ac_dir/$ac_word" || continue
 ac_cv_prog_ac_ct_CC="cc"
-echo "$as_me:1281: found $ac_dir/$ac_word" >&5
+echo "$as_me:1261: found $ac_dir/$ac_word" >&5
 break
 done
 
@@ -1286,10 +1266,10 @@ fi
 fi
 ac_ct_CC=$ac_cv_prog_ac_ct_CC
 if test -n "$ac_ct_CC"; then
-  echo "$as_me:1289: result: $ac_ct_CC" >&5
+  echo "$as_me:1269: result: $ac_ct_CC" >&5
 echo "${ECHO_T}$ac_ct_CC" >&6
 else
-  echo "$as_me:1292: result: no" >&5
+  echo "$as_me:1272: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -1302,7 +1282,7 @@ fi
 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 "$as_me:1305: checking for $ac_word" >&5
+echo "$as_me:1285: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_prog_CC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -1322,7 +1302,7 @@ if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
   continue
 fi
 ac_cv_prog_CC="cc"
-echo "$as_me:1325: found $ac_dir/$ac_word" >&5
+echo "$as_me:1305: found $ac_dir/$ac_word" >&5
 break
 done
 
@@ -1344,10 +1324,10 @@ fi
 fi
 CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  echo "$as_me:1347: result: $CC" >&5
+  echo "$as_me:1327: result: $CC" >&5
 echo "${ECHO_T}$CC" >&6
 else
-  echo "$as_me:1350: result: no" >&5
+  echo "$as_me:1330: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -1358,7 +1338,7 @@ if test -z "$CC"; then
   do
     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-echo "$as_me:1361: checking for $ac_word" >&5
+echo "$as_me:1341: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_prog_CC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -1373,7 +1353,7 @@ for ac_dir in $ac_dummy; do
   test -z "$ac_dir" && ac_dir=.
   $as_executable_p "$ac_dir/$ac_word" || continue
 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
-echo "$as_me:1376: found $ac_dir/$ac_word" >&5
+echo "$as_me:1356: found $ac_dir/$ac_word" >&5
 break
 done
 
@@ -1381,10 +1361,10 @@ fi
 fi
 CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  echo "$as_me:1384: result: $CC" >&5
+  echo "$as_me:1364: result: $CC" >&5
 echo "${ECHO_T}$CC" >&6
 else
-  echo "$as_me:1387: result: no" >&5
+  echo "$as_me:1367: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -1397,7 +1377,7 @@ if test -z "$CC"; then
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-echo "$as_me:1400: checking for $ac_word" >&5
+echo "$as_me:1380: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -1412,7 +1392,7 @@ for ac_dir in $ac_dummy; do
   test -z "$ac_dir" && ac_dir=.
   $as_executable_p "$ac_dir/$ac_word" || continue
 ac_cv_prog_ac_ct_CC="$ac_prog"
-echo "$as_me:1415: found $ac_dir/$ac_word" >&5
+echo "$as_me:1395: found $ac_dir/$ac_word" >&5
 break
 done
 
@@ -1420,10 +1400,10 @@ fi
 fi
 ac_ct_CC=$ac_cv_prog_ac_ct_CC
 if test -n "$ac_ct_CC"; then
-  echo "$as_me:1423: result: $ac_ct_CC" >&5
+  echo "$as_me:1403: result: $ac_ct_CC" >&5
 echo "${ECHO_T}$ac_ct_CC" >&6
 else
-  echo "$as_me:1426: result: no" >&5
+  echo "$as_me:1406: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -1435,32 +1415,32 @@ fi
 
 fi
 
-test -z "$CC" && { { echo "$as_me:1438: error: no acceptable cc found in \$PATH" >&5
+test -z "$CC" && { { echo "$as_me:1418: error: no acceptable cc found in \$PATH" >&5
 echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
    { (exit 1); exit 1; }; }
 
 # Provide some information about the compiler.
-echo "$as_me:1443:" \
+echo "$as_me:1423:" \
      "checking for C compiler version" >&5
 ac_compiler=`set X $ac_compile; echo $2`
-{ (eval echo "$as_me:1446: \"$ac_compiler --version </dev/null >&5\"") >&5
+{ (eval echo "$as_me:1426: \"$ac_compiler --version </dev/null >&5\"") >&5
   (eval $ac_compiler --version </dev/null >&5) 2>&5
   ac_status=$?
-  echo "$as_me:1449: \$? = $ac_status" >&5
+  echo "$as_me:1429: \$? = $ac_status" >&5
   (exit $ac_status); }
-{ (eval echo "$as_me:1451: \"$ac_compiler -v </dev/null >&5\"") >&5
+{ (eval echo "$as_me:1431: \"$ac_compiler -v </dev/null >&5\"") >&5
   (eval $ac_compiler -v </dev/null >&5) 2>&5
   ac_status=$?
-  echo "$as_me:1454: \$? = $ac_status" >&5
+  echo "$as_me:1434: \$? = $ac_status" >&5
   (exit $ac_status); }
-{ (eval echo "$as_me:1456: \"$ac_compiler -V </dev/null >&5\"") >&5
+{ (eval echo "$as_me:1436: \"$ac_compiler -V </dev/null >&5\"") >&5
   (eval $ac_compiler -V </dev/null >&5) 2>&5
   ac_status=$?
-  echo "$as_me:1459: \$? = $ac_status" >&5
+  echo "$as_me:1439: \$? = $ac_status" >&5
   (exit $ac_status); }
 
 cat >conftest.$ac_ext <<_ACEOF
-#line 1463 "configure"
+#line 1443 "configure"
 #include "confdefs.h"
 
 int
@@ -1476,13 +1456,13 @@ ac_clean_files="$ac_clean_files a.out a.exe"
 # Try to create an executable without -o first, disregard a.out.
 # It will help us diagnose broken compilers, and finding out an intuition
 # of exeext.
-echo "$as_me:1479: checking for C compiler default output" >&5
+echo "$as_me:1459: checking for C compiler default output" >&5
 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
-if { (eval echo "$as_me:1482: \"$ac_link_default\"") >&5
+if { (eval echo "$as_me:1462: \"$ac_link_default\"") >&5
   (eval $ac_link_default) 2>&5
   ac_status=$?
-  echo "$as_me:1485: \$? = $ac_status" >&5
+  echo "$as_me:1465: \$? = $ac_status" >&5
   (exit $ac_status); }; then
   # Find the output, starting from the most likely.  This scheme is
 # not robust to junk in `.', hence go to wildcards (a.*) only as a last
@@ -1505,34 +1485,34 @@ done
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
-{ { echo "$as_me:1508: error: C compiler cannot create executables" >&5
+{ { echo "$as_me:1488: error: C compiler cannot create executables" >&5
 echo "$as_me: error: C compiler cannot create executables" >&2;}
    { (exit 77); exit 77; }; }
 fi
 
 ac_exeext=$ac_cv_exeext
-echo "$as_me:1514: result: $ac_file" >&5
+echo "$as_me:1494: result: $ac_file" >&5
 echo "${ECHO_T}$ac_file" >&6
 
 # Check the compiler produces executables we can run.  If not, either
 # the compiler is broken, or we cross compile.
-echo "$as_me:1519: checking whether the C compiler works" >&5
+echo "$as_me:1499: checking whether the C compiler works" >&5
 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
 # If not cross compiling, check that we can run a simple program.
 if test "$cross_compiling" != yes; then
   if { ac_try='./$ac_file'
-  { (eval echo "$as_me:1525: \"$ac_try\"") >&5
+  { (eval echo "$as_me:1505: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:1528: \$? = $ac_status" >&5
+  echo "$as_me:1508: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
     cross_compiling=no
   else
     if test "$cross_compiling" = maybe; then
        cross_compiling=yes
     else
-       { { echo "$as_me:1535: error: cannot run C compiled programs.
+       { { echo "$as_me:1515: error: cannot run C compiled programs.
 If you meant to cross compile, use \`--host'." >&5
 echo "$as_me: error: cannot run C compiled programs.
 If you meant to cross compile, use \`--host'." >&2;}
@@ -1540,24 +1520,24 @@ If you meant to cross compile, use \`--host'." >&2;}
     fi
   fi
 fi
-echo "$as_me:1543: result: yes" >&5
+echo "$as_me:1523: result: yes" >&5
 echo "${ECHO_T}yes" >&6
 
 rm -f a.out a.exe conftest$ac_cv_exeext
 ac_clean_files=$ac_clean_files_save
 # Check the compiler produces executables we can run.  If not, either
 # the compiler is broken, or we cross compile.
-echo "$as_me:1550: checking whether we are cross compiling" >&5
+echo "$as_me:1530: checking whether we are cross compiling" >&5
 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
-echo "$as_me:1552: result: $cross_compiling" >&5
+echo "$as_me:1532: result: $cross_compiling" >&5
 echo "${ECHO_T}$cross_compiling" >&6
 
-echo "$as_me:1555: checking for executable suffix" >&5
+echo "$as_me:1535: checking for executable suffix" >&5
 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6
-if { (eval echo "$as_me:1557: \"$ac_link\"") >&5
+if { (eval echo "$as_me:1537: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:1560: \$? = $ac_status" >&5
+  echo "$as_me:1540: \$? = $ac_status" >&5
   (exit $ac_status); }; then
   # If both `conftest.exe' and `conftest' are `present' (well, observable)
 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
@@ -1573,25 +1553,25 @@ for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
   esac
 done
 else
-  { { echo "$as_me:1576: error: cannot compute EXEEXT: cannot compile and link" >&5
+  { { echo "$as_me:1556: error: cannot compute EXEEXT: cannot compile and link" >&5
 echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;}
    { (exit 1); exit 1; }; }
 fi
 
 rm -f conftest$ac_cv_exeext
-echo "$as_me:1582: result: $ac_cv_exeext" >&5
+echo "$as_me:1562: result: $ac_cv_exeext" >&5
 echo "${ECHO_T}$ac_cv_exeext" >&6
 
 rm -f conftest.$ac_ext
 EXEEXT=$ac_cv_exeext
 ac_exeext=$EXEEXT
-echo "$as_me:1588: checking for object suffix" >&5
+echo "$as_me:1568: checking for object suffix" >&5
 echo $ECHO_N "checking for object suffix... $ECHO_C" >&6
 if test "${ac_cv_objext+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 1594 "configure"
+#line 1574 "configure"
 #include "confdefs.h"
 
 int
@@ -1603,10 +1583,10 @@ main ()
 }
 _ACEOF
 rm -f conftest.o conftest.obj
-if { (eval echo "$as_me:1606: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:1586: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:1609: \$? = $ac_status" >&5
+  echo "$as_me:1589: \$? = $ac_status" >&5
   (exit $ac_status); }; then
   for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
   case $ac_file in
@@ -1618,24 +1598,24 @@ done
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
-{ { echo "$as_me:1621: error: cannot compute OBJEXT: cannot compile" >&5
+{ { echo "$as_me:1601: error: cannot compute OBJEXT: cannot compile" >&5
 echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;}
    { (exit 1); exit 1; }; }
 fi
 
 rm -f conftest.$ac_cv_objext conftest.$ac_ext
 fi
-echo "$as_me:1628: result: $ac_cv_objext" >&5
+echo "$as_me:1608: result: $ac_cv_objext" >&5
 echo "${ECHO_T}$ac_cv_objext" >&6
 OBJEXT=$ac_cv_objext
 ac_objext=$OBJEXT
-echo "$as_me:1632: checking whether we are using the GNU C compiler" >&5
+echo "$as_me:1612: checking whether we are using the GNU C compiler" >&5
 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
 if test "${ac_cv_c_compiler_gnu+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 1638 "configure"
+#line 1618 "configure"
 #include "confdefs.h"
 
 int
@@ -1650,16 +1630,16 @@ main ()
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:1653: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:1633: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:1656: \$? = $ac_status" >&5
+  echo "$as_me:1636: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:1659: \"$ac_try\"") >&5
+  { (eval echo "$as_me:1639: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:1662: \$? = $ac_status" >&5
+  echo "$as_me:1642: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_compiler_gnu=yes
 else
@@ -1671,19 +1651,19 @@ rm -f conftest.$ac_objext conftest.$ac_ext
 ac_cv_c_compiler_gnu=$ac_compiler_gnu
 
 fi
-echo "$as_me:1674: result: $ac_cv_c_compiler_gnu" >&5
+echo "$as_me:1654: result: $ac_cv_c_compiler_gnu" >&5
 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
 GCC=`test $ac_compiler_gnu = yes && echo yes`
 ac_test_CFLAGS=${CFLAGS+set}
 ac_save_CFLAGS=$CFLAGS
 CFLAGS="-g"
-echo "$as_me:1680: checking whether $CC accepts -g" >&5
+echo "$as_me:1660: checking whether $CC accepts -g" >&5
 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
 if test "${ac_cv_prog_cc_g+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 1686 "configure"
+#line 1666 "configure"
 #include "confdefs.h"
 
 int
@@ -1695,16 +1675,16 @@ main ()
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:1698: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:1678: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:1701: \$? = $ac_status" >&5
+  echo "$as_me:1681: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:1704: \"$ac_try\"") >&5
+  { (eval echo "$as_me:1684: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:1707: \$? = $ac_status" >&5
+  echo "$as_me:1687: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_prog_cc_g=yes
 else
@@ -1714,7 +1694,7 @@ ac_cv_prog_cc_g=no
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:1717: result: $ac_cv_prog_cc_g" >&5
+echo "$as_me:1697: result: $ac_cv_prog_cc_g" >&5
 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
 if test "$ac_test_CFLAGS" = set; then
   CFLAGS=$ac_save_CFLAGS
@@ -1741,16 +1721,16 @@ cat >conftest.$ac_ext <<_ACEOF
 #endif
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:1744: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:1724: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:1747: \$? = $ac_status" >&5
+  echo "$as_me:1727: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:1750: \"$ac_try\"") >&5
+  { (eval echo "$as_me:1730: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:1753: \$? = $ac_status" >&5
+  echo "$as_me:1733: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   for ac_declaration in \
    ''\
@@ -1762,7 +1742,7 @@ if { (eval echo "$as_me:1744: \"$ac_compile\"") >&5
    'void exit (int);'
 do
   cat >conftest.$ac_ext <<_ACEOF
-#line 1765 "configure"
+#line 1745 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 $ac_declaration
@@ -1775,16 +1755,16 @@ exit (42);
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:1778: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:1758: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:1781: \$? = $ac_status" >&5
+  echo "$as_me:1761: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:1784: \"$ac_try\"") >&5
+  { (eval echo "$as_me:1764: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:1787: \$? = $ac_status" >&5
+  echo "$as_me:1767: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   :
 else
@@ -1794,7 +1774,7 @@ continue
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
   cat >conftest.$ac_ext <<_ACEOF
-#line 1797 "configure"
+#line 1777 "configure"
 #include "confdefs.h"
 $ac_declaration
 int
@@ -1806,16 +1786,16 @@ exit (42);
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:1809: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:1789: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:1812: \$? = $ac_status" >&5
+  echo "$as_me:1792: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:1815: \"$ac_try\"") >&5
+  { (eval echo "$as_me:1795: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:1818: \$? = $ac_status" >&5
+  echo "$as_me:1798: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   break
 else
@@ -1849,7 +1829,7 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 ac_main_return=return
-echo "$as_me:1852: checking how to run the C preprocessor" >&5
+echo "$as_me:1832: checking how to run the C preprocessor" >&5
 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
@@ -1870,18 +1850,18 @@ do
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp. "Syntax error" is here to catch this case.
   cat >conftest.$ac_ext <<_ACEOF
-#line 1873 "configure"
+#line 1853 "configure"
 #include "confdefs.h"
 #include <assert.h>
                      Syntax error
 _ACEOF
-if { (eval echo "$as_me:1878: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:1858: \"$ac_cpp conftest.$ac_ext\"") >&5
   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
   ac_status=$?
   egrep -v '^ *\+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:1884: \$? = $ac_status" >&5
+  echo "$as_me:1864: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
@@ -1904,17 +1884,17 @@ rm -f conftest.err conftest.$ac_ext
   # OK, works on sane cases.  Now check whether non-existent headers
   # can be detected and how.
   cat >conftest.$ac_ext <<_ACEOF
-#line 1907 "configure"
+#line 1887 "configure"
 #include "confdefs.h"
 #include <ac_nonexistent.h>
 _ACEOF
-if { (eval echo "$as_me:1911: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:1891: \"$ac_cpp conftest.$ac_ext\"") >&5
   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
   ac_status=$?
   egrep -v '^ *\+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:1917: \$? = $ac_status" >&5
+  echo "$as_me:1897: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
@@ -1951,7 +1931,7 @@ fi
 else
   ac_cv_prog_CPP=$CPP
 fi
-echo "$as_me:1954: result: $CPP" >&5
+echo "$as_me:1934: result: $CPP" >&5
 echo "${ECHO_T}$CPP" >&6
 ac_preproc_ok=false
 for ac_c_preproc_warn_flag in '' yes
@@ -1961,18 +1941,18 @@ do
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp. "Syntax error" is here to catch this case.
   cat >conftest.$ac_ext <<_ACEOF
-#line 1964 "configure"
+#line 1944 "configure"
 #include "confdefs.h"
 #include <assert.h>
                      Syntax error
 _ACEOF
-if { (eval echo "$as_me:1969: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:1949: \"$ac_cpp conftest.$ac_ext\"") >&5
   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
   ac_status=$?
   egrep -v '^ *\+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:1975: \$? = $ac_status" >&5
+  echo "$as_me:1955: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
@@ -1995,17 +1975,17 @@ rm -f conftest.err conftest.$ac_ext
   # OK, works on sane cases.  Now check whether non-existent headers
   # can be detected and how.
   cat >conftest.$ac_ext <<_ACEOF
-#line 1998 "configure"
+#line 1978 "configure"
 #include "confdefs.h"
 #include <ac_nonexistent.h>
 _ACEOF
-if { (eval echo "$as_me:2002: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:1982: \"$ac_cpp conftest.$ac_ext\"") >&5
   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
   ac_status=$?
   egrep -v '^ *\+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:2008: \$? = $ac_status" >&5
+  echo "$as_me:1988: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
@@ -2033,7 +2013,7 @@ rm -f conftest.err conftest.$ac_ext
 if $ac_preproc_ok; then
   :
 else
-  { { echo "$as_me:2036: error: C preprocessor \"$CPP\" fails sanity check" >&5
+  { { echo "$as_me:2016: error: C preprocessor \"$CPP\" fails sanity check" >&5
 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
    { (exit 1); exit 1; }; }
 fi
@@ -2049,7 +2029,7 @@ for ac_prog in mawk gawk nawk awk
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-echo "$as_me:2052: checking for $ac_word" >&5
+echo "$as_me:2032: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_prog_AWK+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -2064,7 +2044,7 @@ for ac_dir in $ac_dummy; do
   test -z "$ac_dir" && ac_dir=.
   $as_executable_p "$ac_dir/$ac_word" || continue
 ac_cv_prog_AWK="$ac_prog"
-echo "$as_me:2067: found $ac_dir/$ac_word" >&5
+echo "$as_me:2047: found $ac_dir/$ac_word" >&5
 break
 done
 
@@ -2072,10 +2052,10 @@ fi
 fi
 AWK=$ac_cv_prog_AWK
 if test -n "$AWK"; then
-  echo "$as_me:2075: result: $AWK" >&5
+  echo "$as_me:2055: result: $AWK" >&5
 echo "${ECHO_T}$AWK" >&6
 else
-  echo "$as_me:2078: result: no" >&5
+  echo "$as_me:2058: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -2094,7 +2074,7 @@ done
 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # ./install, which can be erroneously created by make from ./install.sh.
-echo "$as_me:2097: checking for a BSD compatible install" >&5
+echo "$as_me:2077: checking for a BSD compatible install" >&5
 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
 if test -z "$INSTALL"; then
 if test "${ac_cv_path_install+set}" = set; then
@@ -2143,7 +2123,7 @@ fi
     INSTALL=$ac_install_sh
   fi
 fi
-echo "$as_me:2146: result: $INSTALL" >&5
+echo "$as_me:2126: result: $INSTALL" >&5
 echo "${ECHO_T}$INSTALL" >&6
 
 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
@@ -2168,7 +2148,7 @@ for ac_prog in tdlint lint alint splint lclint
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-echo "$as_me:2171: checking for $ac_word" >&5
+echo "$as_me:2151: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_prog_LINT+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -2183,7 +2163,7 @@ for ac_dir in $ac_dummy; do
   test -z "$ac_dir" && ac_dir=.
   $as_executable_p "$ac_dir/$ac_word" || continue
 ac_cv_prog_LINT="$ac_prog"
-echo "$as_me:2186: found $ac_dir/$ac_word" >&5
+echo "$as_me:2166: found $ac_dir/$ac_word" >&5
 break
 done
 
@@ -2191,17 +2171,17 @@ fi
 fi
 LINT=$ac_cv_prog_LINT
 if test -n "$LINT"; then
-  echo "$as_me:2194: result: $LINT" >&5
+  echo "$as_me:2174: result: $LINT" >&5
 echo "${ECHO_T}$LINT" >&6
 else
-  echo "$as_me:2197: result: no" >&5
+  echo "$as_me:2177: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
   test -n "$LINT" && break
 done
 
-echo "$as_me:2204: checking if filesystem supports mixed-case filenames" >&5
+echo "$as_me:2184: checking if filesystem supports mixed-case filenames" >&5
 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
 if test "${cf_cv_mixedcase+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -2228,7 +2208,7 @@ else
 fi
 
 fi
-echo "$as_me:2231: result: $cf_cv_mixedcase" >&5
+echo "$as_me:2211: result: $cf_cv_mixedcase" >&5
 echo "${ECHO_T}$cf_cv_mixedcase" >&6
 test "$cf_cv_mixedcase" = yes && cat >>confdefs.h <<\EOF
 #define MIXEDCASE_FILENAMES 1
@@ -2238,7 +2218,7 @@ for ac_prog in exctags ctags
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-echo "$as_me:2241: checking for $ac_word" >&5
+echo "$as_me:2221: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_prog_CTAGS+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -2253,7 +2233,7 @@ for ac_dir in $ac_dummy; do
   test -z "$ac_dir" && ac_dir=.
   $as_executable_p "$ac_dir/$ac_word" || continue
 ac_cv_prog_CTAGS="$ac_prog"
-echo "$as_me:2256: found $ac_dir/$ac_word" >&5
+echo "$as_me:2236: found $ac_dir/$ac_word" >&5
 break
 done
 
@@ -2261,10 +2241,10 @@ fi
 fi
 CTAGS=$ac_cv_prog_CTAGS
 if test -n "$CTAGS"; then
-  echo "$as_me:2264: result: $CTAGS" >&5
+  echo "$as_me:2244: result: $CTAGS" >&5
 echo "${ECHO_T}$CTAGS" >&6
 else
-  echo "$as_me:2267: result: no" >&5
+  echo "$as_me:2247: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -2275,7 +2255,7 @@ for ac_prog in exetags etags
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-echo "$as_me:2278: checking for $ac_word" >&5
+echo "$as_me:2258: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_prog_ETAGS+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -2290,7 +2270,7 @@ for ac_dir in $ac_dummy; do
   test -z "$ac_dir" && ac_dir=.
   $as_executable_p "$ac_dir/$ac_word" || continue
 ac_cv_prog_ETAGS="$ac_prog"
-echo "$as_me:2293: found $ac_dir/$ac_word" >&5
+echo "$as_me:2273: found $ac_dir/$ac_word" >&5
 break
 done
 
@@ -2298,10 +2278,10 @@ fi
 fi
 ETAGS=$ac_cv_prog_ETAGS
 if test -n "$ETAGS"; then
-  echo "$as_me:2301: result: $ETAGS" >&5
+  echo "$as_me:2281: result: $ETAGS" >&5
 echo "${ECHO_T}$ETAGS" >&6
 else
-  echo "$as_me:2304: result: no" >&5
+  echo "$as_me:2284: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -2310,7 +2290,7 @@ done
 
 # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
 set dummy ${CTAGS:-ctags}; ac_word=$2
-echo "$as_me:2313: checking for $ac_word" >&5
+echo "$as_me:2293: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -2325,7 +2305,7 @@ for ac_dir in $ac_dummy; do
   test -z "$ac_dir" && ac_dir=.
   $as_executable_p "$ac_dir/$ac_word" || continue
 ac_cv_prog_MAKE_LOWER_TAGS="yes"
-echo "$as_me:2328: found $ac_dir/$ac_word" >&5
+echo "$as_me:2308: found $ac_dir/$ac_word" >&5
 break
 done
 
@@ -2334,17 +2314,17 @@ fi
 fi
 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
 if test -n "$MAKE_LOWER_TAGS"; then
-  echo "$as_me:2337: result: $MAKE_LOWER_TAGS" >&5
+  echo "$as_me:2317: result: $MAKE_LOWER_TAGS" >&5
 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
 else
-  echo "$as_me:2340: result: no" >&5
+  echo "$as_me:2320: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
 if test "$cf_cv_mixedcase" = yes ; then
        # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
 set dummy ${ETAGS:-etags}; ac_word=$2
-echo "$as_me:2347: checking for $ac_word" >&5
+echo "$as_me:2327: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -2359,7 +2339,7 @@ for ac_dir in $ac_dummy; do
   test -z "$ac_dir" && ac_dir=.
   $as_executable_p "$ac_dir/$ac_word" || continue
 ac_cv_prog_MAKE_UPPER_TAGS="yes"
-echo "$as_me:2362: found $ac_dir/$ac_word" >&5
+echo "$as_me:2342: found $ac_dir/$ac_word" >&5
 break
 done
 
@@ -2368,10 +2348,10 @@ fi
 fi
 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
 if test -n "$MAKE_UPPER_TAGS"; then
-  echo "$as_me:2371: result: $MAKE_UPPER_TAGS" >&5
+  echo "$as_me:2351: result: $MAKE_UPPER_TAGS" >&5
 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
 else
-  echo "$as_me:2374: result: no" >&5
+  echo "$as_me:2354: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -2391,14 +2371,14 @@ else
        MAKE_LOWER_TAGS="#"
 fi
 
-echo "$as_me:2394: checking if -lm needed for math functions" >&5
+echo "$as_me:2374: checking if -lm needed for math functions" >&5
 echo $ECHO_N "checking if -lm needed for math functions... $ECHO_C" >&6
 if test "${cf_cv_need_libm+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
        cat >conftest.$ac_ext <<_ACEOF
-#line 2401 "configure"
+#line 2381 "configure"
 #include "confdefs.h"
 
        #include <stdio.h>
@@ -2413,16 +2393,16 @@ double x = rand(); printf("result = %g\n", sin(x))
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:2416: \"$ac_link\"") >&5
+if { (eval echo "$as_me:2396: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:2419: \$? = $ac_status" >&5
+  echo "$as_me:2399: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:2422: \"$ac_try\"") >&5
+  { (eval echo "$as_me:2402: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:2425: \$? = $ac_status" >&5
+  echo "$as_me:2405: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_need_libm=no
 else
@@ -2432,13 +2412,15 @@ cf_cv_need_libm=yes
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:2435: result: $cf_cv_need_libm" >&5
+echo "$as_me:2415: result: $cf_cv_need_libm" >&5
 echo "${ECHO_T}$cf_cv_need_libm" >&6
 if test "$cf_cv_need_libm" = yes
 then
 MATH_LIB=-lm
 fi
 
+top_builddir=`pwd`
+
 CC_G_OPT="-g"
 CC_SHARED_OPTS=unknown
 CPPFLAGS="$CPPFLAGS"
@@ -2460,14 +2442,118 @@ PTHREAD="-lm"
 TEST_ARGS=""
 TEST_DEPS=""
 TEST_LIBS=""
-TINFO_ARGS='$(LIBS_CURSES)'
+TINFO_LDFLAGS=''
+TINFO_LIBS='$(LIBS_CURSES)'
 cf_cv_abi_version=""
 cf_cv_rel_version=""
 
 cf_cv_screen=curses
 cf_cv_libtype=
 
-echo "$as_me:2470: checking for ${CC:-cc} option to accept ANSI C" >&5
+# This should have been defined by AC_PROG_CC
+: ${CC:=cc}
+
+# Check for user's environment-breakage by stuffing CFLAGS/CPPFLAGS content
+# into CC.  This will not help with broken scripts that wrap the compiler with
+# options, but eliminates a more common category of user confusion.
+echo "$as_me:2459: checking \$CC variable" >&5
+echo $ECHO_N "checking \$CC variable... $ECHO_C" >&6
+case "$CC" in #(vi
+*[\ \  ]-[IUD]*)
+       echo "$as_me:2463: result: broken" >&5
+echo "${ECHO_T}broken" >&6
+       { echo "$as_me:2465: WARNING: your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options" >&5
+echo "$as_me: WARNING: your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options" >&2;}
+       # humor him...
+       cf_flags=`echo "$CC" | sed -e 's/^[^    ]*[     ]//'`
+       CC=`echo "$CC" | sed -e 's/[    ].*//'`
+
+cf_fix_cppflags=no
+cf_new_cflags=
+cf_new_cppflags=
+cf_new_extra_cppflags=
+
+for cf_add_cflags in $cf_flags
+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
+                       case $cf_add_cflags in #(vi
+                       -D*)
+                               cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
+
+CPPFLAGS=`echo "$CPPFLAGS" | \
+       sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
+               -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
+
+                               ;;
+                       esac
+                       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="$CPPFLAGS $cf_new_cppflags"
+fi
+
+if test -n "$cf_new_extra_cppflags" ; then
+
+       EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
+fi
+
+       ;;
+*)
+       echo "$as_me:2551: result: ok" >&5
+echo "${ECHO_T}ok" >&6
+       ;;
+esac
+
+echo "$as_me:2556: checking for ${CC:-cc} option to accept ANSI C" >&5
 echo $ECHO_N "checking for ${CC:-cc} option to accept ANSI C... $ECHO_C" >&6
 if test "${cf_cv_ansi_cc+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -2571,7 +2657,7 @@ if test -n "$cf_new_extra_cppflags" ; then
 fi
 
        cat >conftest.$ac_ext <<_ACEOF
-#line 2574 "configure"
+#line 2660 "configure"
 #include "confdefs.h"
 
 #ifndef CC_HAS_PROTOS
@@ -2592,16 +2678,16 @@ main ()
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:2595: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:2681: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:2598: \$? = $ac_status" >&5
+  echo "$as_me:2684: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:2601: \"$ac_try\"") >&5
+  { (eval echo "$as_me:2687: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:2604: \$? = $ac_status" >&5
+  echo "$as_me:2690: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_ansi_cc="$cf_arg"; break
 else
@@ -2614,7 +2700,7 @@ CFLAGS="$cf_save_CFLAGS"
 CPPFLAGS="$cf_save_CPPFLAGS"
 
 fi
-echo "$as_me:2617: result: $cf_cv_ansi_cc" >&5
+echo "$as_me:2703: result: $cf_cv_ansi_cc" >&5
 echo "${ECHO_T}$cf_cv_ansi_cc" >&6
 
 if test "$cf_cv_ansi_cc" != "no"; then
@@ -2707,7 +2793,7 @@ fi
 fi
 
 if test "$cf_cv_ansi_cc" = "no"; then
-       { { echo "$as_me:2710: error: Your compiler does not appear to recognize prototypes.
+       { { echo "$as_me:2796: 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
@@ -2738,10 +2824,10 @@ cat > conftest.i <<EOF
 EOF
 if test "$GCC" = yes
 then
-       { echo "$as_me:2741: checking for $CC __attribute__ directives..." >&5
+       { echo "$as_me:2827: checking for $CC __attribute__ directives..." >&5
 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
 cat > conftest.$ac_ext <<EOF
-#line 2744 "${as_me:-configure}"
+#line 2830 "${as_me:-configure}"
 #include "confdefs.h"
 #include "conftest.h"
 #include "conftest.i"
@@ -2790,12 +2876,12 @@ EOF
                        ;;
                esac
 
-               if { (eval echo "$as_me:2793: \"$ac_compile\"") >&5
+               if { (eval echo "$as_me:2879: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:2796: \$? = $ac_status" >&5
+  echo "$as_me:2882: \$? = $ac_status" >&5
   (exit $ac_status); }; then
-                       test -n "$verbose" && echo "$as_me:2798: result: ... $cf_attribute" >&5
+                       test -n "$verbose" && echo "$as_me:2884: result: ... $cf_attribute" >&5
 echo "${ECHO_T}... $cf_attribute" >&6
                        cat conftest.h >>confdefs.h
                        case $cf_attribute in #(vi
@@ -2835,14 +2921,18 @@ cf_POSIX_C_SOURCE=199506L
 cf_xopen_source=
 
 case $host_os in #(vi
-aix[456]*) #(vi
+aix[4-7]*) #(vi
        cf_xopen_source="-D_ALL_SOURCE"
        ;;
+cygwin) #(vi
+       cf_XOPEN_SOURCE=600
+       ;;
 darwin[0-8].*) #(vi
        cf_xopen_source="-D_APPLE_C_SOURCE"
        ;;
 darwin*) #(vi
        cf_xopen_source="-D_DARWIN_C_SOURCE"
+       cf_XOPEN_SOURCE=
        ;;
 freebsd*|dragonfly*) #(vi
        # 5.x headers associate
@@ -2860,17 +2950,18 @@ hpux*) #(vi
        ;;
 irix[56].*) #(vi
        cf_xopen_source="-D_SGI_SOURCE"
+       cf_XOPEN_SOURCE=
        ;;
 linux*|gnu*|mint*|k*bsd*-gnu) #(vi
 
-echo "$as_me:2866: checking if we must define _GNU_SOURCE" >&5
+echo "$as_me:2957: checking if we must define _GNU_SOURCE" >&5
 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
 if test "${cf_cv_gnu_source+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
 cat >conftest.$ac_ext <<_ACEOF
-#line 2873 "configure"
+#line 2964 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 int
@@ -2885,16 +2976,16 @@ make an error
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:2888: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:2979: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:2891: \$? = $ac_status" >&5
+  echo "$as_me:2982: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:2894: \"$ac_try\"") >&5
+  { (eval echo "$as_me:2985: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:2897: \$? = $ac_status" >&5
+  echo "$as_me:2988: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_gnu_source=no
 else
@@ -2903,7 +2994,7 @@ cat conftest.$ac_ext >&5
 cf_save="$CPPFLAGS"
         CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
         cat >conftest.$ac_ext <<_ACEOF
-#line 2906 "configure"
+#line 2997 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 int
@@ -2918,16 +3009,16 @@ make an error
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:2921: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:3012: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:2924: \$? = $ac_status" >&5
+  echo "$as_me:3015: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:2927: \"$ac_try\"") >&5
+  { (eval echo "$as_me:3018: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:2930: \$? = $ac_status" >&5
+  echo "$as_me:3021: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_gnu_source=no
 else
@@ -2942,51 +3033,45 @@ fi
 rm -f conftest.$ac_objext conftest.$ac_ext
 
 fi
-echo "$as_me:2945: result: $cf_cv_gnu_source" >&5
+echo "$as_me:3036: result: $cf_cv_gnu_source" >&5
 echo "${ECHO_T}$cf_cv_gnu_source" >&6
 test "$cf_cv_gnu_source" = yes && CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
 
        ;;
 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
-       cf_xopen_source="-D_OSF_SOURCE"
-       ;;
-nto-qnx*) #(vi
-       cf_xopen_source="-D_QNX_SOURCE"
-       ;;
-sco*) #(vi
-       # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
-       ;;
-solaris2.1[0-9]) #(vi
-       cf_xopen_source="-D__EXTENSIONS__ -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
-       ;;
-solaris2.[1-9]) #(vi
-       cf_xopen_source="-D__EXTENSIONS__"
-       ;;
-*)
-       echo "$as_me:2975: checking if we should define _XOPEN_SOURCE" >&5
-echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
-if test "${cf_cv_xopen_source+set}" = set; then
+       # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
+       cf_XOPEN_SOURCE=
+
+cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
+
+cf_save_CFLAGS="$CFLAGS"
+cf_save_CPPFLAGS="$CPPFLAGS"
+
+cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
+       sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
+               -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
+
+cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
+       sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
+               -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
+
+echo "$as_me:3058: checking if we should define _POSIX_C_SOURCE" >&5
+echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
+if test "${cf_cv_posix_c_source+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
+echo "${as_me:-configure}:3064: testing if the symbol is already defined go no further ..." 1>&5
+
        cat >conftest.$ac_ext <<_ACEOF
-#line 2982 "configure"
+#line 3067 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 int
 main ()
 {
 
-#ifndef _XOPEN_SOURCE
+#ifndef _POSIX_C_SOURCE
 make an error
 #endif
   ;
@@ -2994,32 +3079,44 @@ make an error
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:2997: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:3082: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:3000: \$? = $ac_status" >&5
+  echo "$as_me:3085: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:3003: \"$ac_try\"") >&5
+  { (eval echo "$as_me:3088: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:3006: \$? = $ac_status" >&5
+  echo "$as_me:3091: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  cf_cv_xopen_source=no
+  cf_cv_posix_c_source=no
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
-cf_save="$CPPFLAGS"
-        CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
-        cat >conftest.$ac_ext <<_ACEOF
-#line 3015 "configure"
+cf_want_posix_source=no
+        case .$cf_POSIX_C_SOURCE in #(vi
+        .[12]??*) #(vi
+               cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
+               ;;
+        .2) #(vi
+               cf_cv_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 <<_ACEOF
+#line 3112 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 int
 main ()
 {
 
-#ifdef _XOPEN_SOURCE
+#ifdef _POSIX_SOURCE
 make an error
 #endif
   ;
@@ -3027,50 +3124,87 @@ make an error
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:3030: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:3127: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:3033: \$? = $ac_status" >&5
+  echo "$as_me:3130: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:3036: \"$ac_try\"") >&5
+  { (eval echo "$as_me:3133: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:3039: \$? = $ac_status" >&5
+  echo "$as_me:3136: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  cf_cv_xopen_source=no
+  :
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
-cf_cv_xopen_source=$cf_XOPEN_SOURCE
+cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
-       CPPFLAGS="$cf_save"
+        fi
+
+echo "${as_me:-configure}:3147: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
+
+        CFLAGS="$cf_trim_CFLAGS"
+        CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
+
+echo "${as_me:-configure}:3152: testing if the second compile does not leave our definition intact error ..." 1>&5
+
+        cat >conftest.$ac_ext <<_ACEOF
+#line 3155 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+int
+main ()
+{
 
+#ifndef _POSIX_C_SOURCE
+make an error
+#endif
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:3170: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:3173: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:3176: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:3179: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_posix_c_source=no
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
+        CFLAGS="$cf_save_CFLAGS"
+        CPPFLAGS="$cf_save_CPPFLAGS"
 
 fi
-echo "$as_me:3054: result: $cf_cv_xopen_source" >&5
-echo "${ECHO_T}$cf_cv_xopen_source" >&6
-       if test "$cf_cv_xopen_source" != no ; then
-
-CFLAGS=`echo "$CFLAGS" | \
-       sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
-               -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
+rm -f conftest.$ac_objext conftest.$ac_ext
 
-CPPFLAGS=`echo "$CPPFLAGS" | \
-       sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
-               -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
+fi
+echo "$as_me:3195: result: $cf_cv_posix_c_source" >&5
+echo "${ECHO_T}$cf_cv_posix_c_source" >&6
 
-               cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
+if test "$cf_cv_posix_c_source" != no ; then
+       CFLAGS="$cf_trim_CFLAGS"
+       CPPFLAGS="$cf_trim_CPPFLAGS"
 
 cf_fix_cppflags=no
 cf_new_cflags=
 cf_new_cppflags=
 cf_new_extra_cppflags=
 
-for cf_add_cflags in $cf_temp_xopen_source
+for cf_add_cflags in $cf_cv_posix_c_source
 do
 case $cf_fix_cppflags in
 no)
@@ -3143,31 +3277,239 @@ if test -n "$cf_new_extra_cppflags" ; then
        EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
 fi
 
-       fi
-
-cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
-
-cf_save_CFLAGS="$CFLAGS"
-cf_save_CPPFLAGS="$CPPFLAGS"
-
-cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
-       sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
-               -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
+fi
 
-cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
-       sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
-               -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
+       ;;
+netbsd*) #(vi
+       cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
+       ;;
+openbsd[4-9]*) #(vi
+       # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
+       cf_xopen_source="-D_BSD_SOURCE"
+       cf_XOPEN_SOURCE=600
+       ;;
+openbsd*) #(vi
+       # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
+       ;;
+osf[45]*) #(vi
+       cf_xopen_source="-D_OSF_SOURCE"
+       ;;
+nto-qnx*) #(vi
+       cf_xopen_source="-D_QNX_SOURCE"
+       ;;
+sco*) #(vi
+       # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
+       ;;
+solaris2.*) #(vi
+       cf_xopen_source="-D__EXTENSIONS__"
+       ;;
+*)
 
-echo "$as_me:3161: checking if we should define _POSIX_C_SOURCE" >&5
-echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
-if test "${cf_cv_posix_c_source+set}" = set; then
+echo "$as_me:3308: checking if we should define _XOPEN_SOURCE" >&5
+echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
+if test "${cf_cv_xopen_source+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-echo "${as_me:-configure}:3167: testing if the symbol is already defined go no further ..." 1>&5
-
        cat >conftest.$ac_ext <<_ACEOF
-#line 3170 "configure"
+#line 3315 "configure"
+#include "confdefs.h"
+
+#include <stdlib.h>
+#include <string.h>
+#include <sys/types.h>
+
+int
+main ()
+{
+
+#ifndef _XOPEN_SOURCE
+make an error
+#endif
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:3334: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:3337: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:3340: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:3343: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_cv_xopen_source=no
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_save="$CPPFLAGS"
+        CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
+        cat >conftest.$ac_ext <<_ACEOF
+#line 3352 "configure"
+#include "confdefs.h"
+
+#include <stdlib.h>
+#include <string.h>
+#include <sys/types.h>
+
+int
+main ()
+{
+
+#ifdef _XOPEN_SOURCE
+make an error
+#endif
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:3371: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:3374: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:3377: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:3380: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_cv_xopen_source=no
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_xopen_source=$cf_XOPEN_SOURCE
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+       CPPFLAGS="$cf_save"
+
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+
+fi
+echo "$as_me:3395: result: $cf_cv_xopen_source" >&5
+echo "${ECHO_T}$cf_cv_xopen_source" >&6
+
+if test "$cf_cv_xopen_source" != no ; then
+
+CFLAGS=`echo "$CFLAGS" | \
+       sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
+               -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
+
+CPPFLAGS=`echo "$CPPFLAGS" | \
+       sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
+               -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
+
+       cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
+
+cf_fix_cppflags=no
+cf_new_cflags=
+cf_new_cppflags=
+cf_new_extra_cppflags=
+
+for cf_add_cflags in $cf_temp_xopen_source
+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
+                       case $cf_add_cflags in #(vi
+                       -D*)
+                               cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
+
+CPPFLAGS=`echo "$CPPFLAGS" | \
+       sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
+               -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
+
+                               ;;
+                       esac
+                       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="$CPPFLAGS $cf_new_cppflags"
+fi
+
+if test -n "$cf_new_extra_cppflags" ; then
+
+       EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
+fi
+
+fi
+
+cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
+
+cf_save_CFLAGS="$CFLAGS"
+cf_save_CPPFLAGS="$CPPFLAGS"
+
+cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
+       sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
+               -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
+
+cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
+       sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
+               -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
+
+echo "$as_me:3503: checking if we should define _POSIX_C_SOURCE" >&5
+echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
+if test "${cf_cv_posix_c_source+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+echo "${as_me:-configure}:3509: testing if the symbol is already defined go no further ..." 1>&5
+
+       cat >conftest.$ac_ext <<_ACEOF
+#line 3512 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 int
@@ -3182,16 +3524,16 @@ make an error
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:3185: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:3527: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:3188: \$? = $ac_status" >&5
+  echo "$as_me:3530: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:3191: \"$ac_try\"") >&5
+  { (eval echo "$as_me:3533: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:3194: \$? = $ac_status" >&5
+  echo "$as_me:3536: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_posix_c_source=no
 else
@@ -3212,7 +3554,7 @@ cf_want_posix_source=no
         esac
         if test "$cf_want_posix_source" = yes ; then
                cat >conftest.$ac_ext <<_ACEOF
-#line 3215 "configure"
+#line 3557 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 int
@@ -3227,16 +3569,16 @@ make an error
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:3230: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:3572: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:3233: \$? = $ac_status" >&5
+  echo "$as_me:3575: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:3236: \"$ac_try\"") >&5
+  { (eval echo "$as_me:3578: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:3239: \$? = $ac_status" >&5
+  echo "$as_me:3581: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   :
 else
@@ -3247,15 +3589,15 @@ fi
 rm -f conftest.$ac_objext conftest.$ac_ext
         fi
 
-echo "${as_me:-configure}:3250: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
+echo "${as_me:-configure}:3592: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
 
         CFLAGS="$cf_trim_CFLAGS"
         CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
 
-echo "${as_me:-configure}:3255: testing if the second compile does not leave our definition intact error ..." 1>&5
+echo "${as_me:-configure}:3597: testing if the second compile does not leave our definition intact error ..." 1>&5
 
         cat >conftest.$ac_ext <<_ACEOF
-#line 3258 "configure"
+#line 3600 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 int
@@ -3270,16 +3612,16 @@ make an error
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:3273: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:3615: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:3276: \$? = $ac_status" >&5
+  echo "$as_me:3618: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:3279: \"$ac_try\"") >&5
+  { (eval echo "$as_me:3621: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:3282: \$? = $ac_status" >&5
+  echo "$as_me:3624: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   :
 else
@@ -3295,7 +3637,7 @@ fi
 rm -f conftest.$ac_objext conftest.$ac_ext
 
 fi
-echo "$as_me:3298: result: $cf_cv_posix_c_source" >&5
+echo "$as_me:3640: result: $cf_cv_posix_c_source" >&5
 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
 
 if test "$cf_cv_posix_c_source" != no ; then
 
 fi
 
-echo "$as_me:3470: checking for $CC option to accept ANSI C" >&5
-echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
-if test "${ac_cv_prog_cc_stdc+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_cv_prog_cc_stdc=no
-ac_save_CC=$CC
-cat >conftest.$ac_ext <<_ACEOF
-#line 3478 "configure"
+if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
+       echo "$as_me:3813: checking if _XOPEN_SOURCE really is set" >&5
+echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
+       cat >conftest.$ac_ext <<_ACEOF
+#line 3816 "configure"
 #include "confdefs.h"
-#include <stdarg.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
-struct buf { int x; };
-FILE * (*rcsopen) (struct buf *, struct stat *, int);
-static char *e (p, i)
-     char **p;
-     int i;
-{
-  return p[i];
-}
-static char *f (char * (*g) (char **, int), char **p, ...)
-{
-  char *s;
-  va_list v;
-  va_start (v,p);
-  s = g (p, va_arg (v,int));
-  va_end (v);
-  return s;
-}
-int test (int i, double x);
-struct s1 {int (*f) (int a);};
-struct s2 {int (*f) (double a);};
-int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
-int argc;
-char **argv;
+#include <stdlib.h>
 int
 main ()
 {
-return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
+
+#ifndef _XOPEN_SOURCE
+make an error
+#endif
   ;
   return 0;
 }
 _ACEOF
-# 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 10.20 and later        -Ae
-# HP-UX older versions -Aa -D_HPUX_SOURCE
-# SVR4                 -Xc -D__EXTENSIONS__
-for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
-do
-  CC="$ac_save_CC $ac_arg"
-  rm -f conftest.$ac_objext
-if { (eval echo "$as_me:3527: \"$ac_compile\"") >&5
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:3831: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:3530: \$? = $ac_status" >&5
+  echo "$as_me:3834: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:3533: \"$ac_try\"") >&5
+  { (eval echo "$as_me:3837: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:3536: \$? = $ac_status" >&5
+  echo "$as_me:3840: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_prog_cc_stdc=$ac_arg
-break
+  cf_XOPEN_SOURCE_set=yes
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
+cf_XOPEN_SOURCE_set=no
 fi
-rm -f conftest.$ac_objext
-done
-rm -f conftest.$ac_ext conftest.$ac_objext
-CC=$ac_save_CC
-
-fi
-
-case "x$ac_cv_prog_cc_stdc" in
-  x|xno)
-    echo "$as_me:3553: result: none needed" >&5
-echo "${ECHO_T}none needed" >&6 ;;
-  *)
-    echo "$as_me:3556: result: $ac_cv_prog_cc_stdc" >&5
-echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
-    CC="$CC $ac_cv_prog_cc_stdc" ;;
-esac
-
-echo "$as_me:3561: checking for an ANSI C-conforming const" >&5
-echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
-if test "${ac_cv_c_const+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-#line 3567 "configure"
+rm -f conftest.$ac_objext conftest.$ac_ext
+       echo "$as_me:3849: result: $cf_XOPEN_SOURCE_set" >&5
+echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
+       if test $cf_XOPEN_SOURCE_set = yes
+       then
+               cat >conftest.$ac_ext <<_ACEOF
+#line 3854 "configure"
 #include "confdefs.h"
-
+#include <stdlib.h>
 int
 main ()
 {
-/* FIXME: Include the comments suggested by Paul. */
-#ifndef __cplusplus
-  /* Ultrix mips cc rejects this.  */
-  typedef int charset[2];
-  const charset x;
-  /* SunOS 4.1.1 cc rejects this.  */
-  char const *const *ccp;
-  char **p;
-  /* NEC SVR4.0.2 mips cc rejects this.  */
-  struct point {int x, y;};
-  static struct point const zero = {0,0};
-  /* AIX XL C 1.02.0.0 rejects this.
-     It does not let you subtract one const X* pointer from another in
-     an arm of an if-expression whose if-part is not a constant
-     expression */
-  const char *g = "string";
-  ccp = &g + (g ? g-g : 0);
-  /* HPUX 7.0 cc rejects these. */
-  ++ccp;
-  p = (char**) ccp;
-  ccp = (char const *const *) p;
-  { /* SCO 3.2v4 cc rejects this.  */
-    char *t;
-    char const *s = 0 ? (char *) 0 : (char const *) 0;
 
-    *t++ = 0;
-  }
-  { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
-    int x[] = {25, 17};
-    const int *foo = &x[0];
-    ++foo;
-  }
-  { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
-    typedef const int *iptr;
-    iptr p = 0;
-    ++p;
-  }
-  { /* AIX XL C 1.02.0.0 rejects this saying
-       "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
-    struct s { int j; const int *ap[3]; };
-    struct s *b; b->j = 5;
-  }
-  { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
-    const int foo = 10;
-  }
+#if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
+make an error
 #endif
-
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:3625: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:3869: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:3628: \$? = $ac_status" >&5
+  echo "$as_me:3872: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:3631: \"$ac_try\"") >&5
+  { (eval echo "$as_me:3875: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:3634: \$? = $ac_status" >&5
+  echo "$as_me:3878: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_c_const=yes
+  cf_XOPEN_SOURCE_set_ok=yes
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
-ac_cv_c_const=no
+cf_XOPEN_SOURCE_set_ok=no
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:3644: result: $ac_cv_c_const" >&5
-echo "${ECHO_T}$ac_cv_c_const" >&6
-if test $ac_cv_c_const = no; then
-
-cat >>confdefs.h <<\EOF
-#define const
-EOF
-
-fi
+               if test $cf_XOPEN_SOURCE_set_ok = no
+               then
+                       { echo "$as_me:3889: WARNING: _XOPEN_SOURCE is lower than requested" >&5
+echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
+               fi
+       else
 
-echo "$as_me:3654: checking for signal global datatype" >&5
-echo $ECHO_N "checking for signal global datatype... $ECHO_C" >&6
-if test "${cf_cv_sig_atomic_t+set}" = set; then
+echo "$as_me:3894: checking if we should define _XOPEN_SOURCE" >&5
+echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
+if test "${cf_cv_xopen_source+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-       for cf_type in \
-               "volatile sig_atomic_t" \
-               "sig_atomic_t" \
-               "int"
-       do
        cat >conftest.$ac_ext <<_ACEOF
-#line 3666 "configure"
+#line 3901 "configure"
 #include "confdefs.h"
 
+#include <stdlib.h>
+#include <string.h>
 #include <sys/types.h>
-#include <signal.h>
-#include <stdio.h>
 
-extern $cf_type x;
-$cf_type x;
-static void handler(int sig)
+int
+main ()
 {
-       x = 5;
+
+#ifndef _XOPEN_SOURCE
+make an error
+#endif
+  ;
+  return 0;
 }
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:3920: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:3923: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:3926: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:3929: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_cv_xopen_source=no
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_save="$CPPFLAGS"
+        CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
+        cat >conftest.$ac_ext <<_ACEOF
+#line 3938 "configure"
+#include "confdefs.h"
+
+#include <stdlib.h>
+#include <string.h>
+#include <sys/types.h>
+
 int
 main ()
 {
-signal(SIGINT, handler);
-                x = 1
+
+#ifdef _XOPEN_SOURCE
+make an error
+#endif
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:3689: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:3957: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:3692: \$? = $ac_status" >&5
+  echo "$as_me:3960: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:3695: \"$ac_try\"") >&5
+  { (eval echo "$as_me:3963: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:3698: \$? = $ac_status" >&5
+  echo "$as_me:3966: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  cf_cv_sig_atomic_t=$cf_type
+  cf_cv_xopen_source=no
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
-cf_cv_sig_atomic_t=no
+cf_cv_xopen_source=$cf_XOPEN_SOURCE
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
-               test "$cf_cv_sig_atomic_t" != no && break
-       done
+       CPPFLAGS="$cf_save"
 
 fi
+rm -f conftest.$ac_objext conftest.$ac_ext
 
-echo "$as_me:3712: result: $cf_cv_sig_atomic_t" >&5
-echo "${ECHO_T}$cf_cv_sig_atomic_t" >&6
-test "$cf_cv_sig_atomic_t" != no && cat >>confdefs.h <<EOF
-#define SIG_ATOMIC_T $cf_cv_sig_atomic_t
-EOF
+fi
+echo "$as_me:3981: result: $cf_cv_xopen_source" >&5
+echo "${ECHO_T}$cf_cv_xopen_source" >&6
 
-echo "$as_me:3718: checking if you want to see long compiling messages" >&5
-echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
+if test "$cf_cv_xopen_source" != no ; then
 
-# Check whether --enable-echo or --disable-echo was given.
-if test "${enable_echo+set}" = set; then
-  enableval="$enable_echo"
-  test "$enableval" != no && enableval=yes
-  if test "$enableval" != "yes" ; then
+CFLAGS=`echo "$CFLAGS" | \
+       sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
+               -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
 
-    ECHO_LT='--silent'
-    ECHO_LD='@echo linking $@;'
-    RULE_CC='@echo compiling $<'
-    SHOW_CC='@echo compiling $@'
-    ECHO_CC='@'
+CPPFLAGS=`echo "$CPPFLAGS" | \
+       sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
+               -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
 
-  else
+       cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
 
-    ECHO_LT=''
-    ECHO_LD=''
-    RULE_CC=''
-    SHOW_CC=''
-    ECHO_CC=''
+cf_fix_cppflags=no
+cf_new_cflags=
+cf_new_cppflags=
+cf_new_extra_cppflags=
 
-  fi
-else
-  enableval=yes
+for cf_add_cflags in $cf_temp_xopen_source
+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[^=]*='\''\"[^"]*//'`
 
-    ECHO_LT=''
-    ECHO_LD=''
-    RULE_CC=''
-    SHOW_CC=''
-    ECHO_CC=''
+                       test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+                               && test -z "${cf_tst_cflags}" \
+                               && cf_fix_cppflags=yes
 
-fi;
-echo "$as_me:3752: result: $enableval" >&5
-echo "${ECHO_T}$enableval" >&6
+                       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
+                       case $cf_add_cflags in #(vi
+                       -D*)
+                               cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
 
-GCC_VERSION=none
-if test "$GCC" = yes ; then
-       echo "$as_me:3757: checking version of $CC" >&5
-echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
-       GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(GCC) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
-       test -z "$GCC_VERSION" && GCC_VERSION=unknown
-       echo "$as_me:3761: result: $GCC_VERSION" >&5
-echo "${ECHO_T}$GCC_VERSION" >&6
-fi
+CPPFLAGS=`echo "$CPPFLAGS" | \
+       sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
+               -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
 
-if ( test "$GCC" = yes || test "$GXX" = yes )
-then
-echo "$as_me:3767: checking if you want to turn on gcc warnings" >&5
-echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
+                               ;;
+                       esac
+                       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"
 
-# Check whether --enable-warnings or --disable-warnings was given.
-if test "${enable_warnings+set}" = set; then
-  enableval="$enable_warnings"
-  test "$enableval" != yes && enableval=no
-  if test "$enableval" != "no" ; then
-    with_warnings=yes
-  else
-    with_warnings=no
-  fi
-else
-  enableval=no
-  with_warnings=no
+       cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
 
-fi;
-echo "$as_me:3784: result: $with_warnings" >&5
-echo "${ECHO_T}$with_warnings" >&6
-if test "$with_warnings" = "yes"
-then
+       test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+               && test -z "${cf_tst_cflags}" \
+               && cf_fix_cppflags=no
+       ;;
+esac
+done
 
-if test "$GCC" = yes
-then
-cat > conftest.i <<EOF
-#ifndef GCC_PRINTF
-#define GCC_PRINTF 0
-#endif
-#ifndef GCC_SCANF
-#define GCC_SCANF 0
-#endif
-#ifndef GCC_NORETURN
-#define GCC_NORETURN /* nothing */
-#endif
-#ifndef GCC_UNUSED
-#define GCC_UNUSED /* nothing */
-#endif
-EOF
-if test "$GCC" = yes
-then
-       { echo "$as_me:3807: checking for $CC __attribute__ directives..." >&5
-echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
-cat > conftest.$ac_ext <<EOF
-#line 3810 "${as_me:-configure}"
-#include "confdefs.h"
-#include "conftest.h"
-#include "conftest.i"
-#if    GCC_PRINTF
-#define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
-#else
-#define GCC_PRINTFLIKE(fmt,var) /*nothing*/
-#endif
-#if    GCC_SCANF
-#define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
-#else
-#define GCC_SCANFLIKE(fmt,var)  /*nothing*/
-#endif
-extern void wow(char *,...) GCC_SCANFLIKE(1,2);
-extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
-extern void foo(void) GCC_NORETURN;
-int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
-EOF
-       cf_printf_attribute=no
-       cf_scanf_attribute=no
-       for cf_attribute in scanf printf unused noreturn
-       do
+if test -n "$cf_new_cflags" ; then
 
-cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
+       CFLAGS="$CFLAGS $cf_new_cflags"
+fi
 
-               cf_directive="__attribute__(($cf_attribute))"
-               echo "checking for $CC $cf_directive" 1>&5
+if test -n "$cf_new_cppflags" ; then
 
-               case $cf_attribute in #(vi
-               printf) #(vi
-                       cf_printf_attribute=yes
-                       cat >conftest.h <<EOF
-#define GCC_$cf_ATTRIBUTE 1
-EOF
-                       ;;
-               scanf) #(vi
-                       cf_scanf_attribute=yes
-                       cat >conftest.h <<EOF
-#define GCC_$cf_ATTRIBUTE 1
-EOF
-                       ;;
-               *) #(vi
-                       cat >conftest.h <<EOF
-#define GCC_$cf_ATTRIBUTE $cf_directive
-EOF
-                       ;;
-               esac
+       CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
+fi
+
+if test -n "$cf_new_extra_cppflags" ; then
+
+       EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
+fi
+
+fi
 
-               if { (eval echo "$as_me:3859: \"$ac_compile\"") >&5
+       fi
+fi
+
+echo "$as_me:4079: checking for $CC option to accept ANSI C" >&5
+echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
+if test "${ac_cv_prog_cc_stdc+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_prog_cc_stdc=no
+ac_save_CC=$CC
+cat >conftest.$ac_ext <<_ACEOF
+#line 4087 "configure"
+#include "confdefs.h"
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+     char **p;
+     int i;
+{
+  return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+  char *s;
+  va_list v;
+  va_start (v,p);
+  s = g (p, va_arg (v,int));
+  va_end (v);
+  return s;
+}
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
+  ;
+  return 0;
+}
+_ACEOF
+# 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 10.20 and later        -Ae
+# HP-UX older versions -Aa -D_HPUX_SOURCE
+# SVR4                 -Xc -D__EXTENSIONS__
+for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+  CC="$ac_save_CC $ac_arg"
+  rm -f conftest.$ac_objext
+if { (eval echo "$as_me:4136: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:3862: \$? = $ac_status" >&5
-  (exit $ac_status); }; then
-                       test -n "$verbose" && echo "$as_me:3864: result: ... $cf_attribute" >&5
-echo "${ECHO_T}... $cf_attribute" >&6
-                       cat conftest.h >>confdefs.h
-                       case $cf_attribute in #(vi
-                       printf) #(vi
-                               if test "$cf_printf_attribute" = no ; then
-                                       cat >>confdefs.h <<EOF
-#define GCC_PRINTFLIKE(fmt,var) /* nothing */
-EOF
-                               else
-                                       cat >>confdefs.h <<EOF
-#define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
-EOF
-                               fi
-                               ;;
-                       scanf) #(vi
-                               if test "$cf_scanf_attribute" = no ; then
-                                       cat >>confdefs.h <<EOF
-#define GCC_SCANFLIKE(fmt,var) /* nothing */
-EOF
-                               else
-                                       cat >>confdefs.h <<EOF
-#define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
-EOF
-                               fi
-                               ;;
-                       esac
-               fi
-       done
+  echo "$as_me:4139: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:4142: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:4145: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_prog_cc_stdc=$ac_arg
+break
 else
-       fgrep define conftest.i >>confdefs.h
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
 fi
-rm -rf conftest*
+rm -f conftest.$ac_objext
+done
+rm -f conftest.$ac_ext conftest.$ac_objext
+CC=$ac_save_CC
+
 fi
 
-INTEL_COMPILER=no
+case "x$ac_cv_prog_cc_stdc" in
+  x|xno)
+    echo "$as_me:4162: result: none needed" >&5
+echo "${ECHO_T}none needed" >&6 ;;
+  *)
+    echo "$as_me:4165: result: $ac_cv_prog_cc_stdc" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
+    CC="$CC $ac_cv_prog_cc_stdc" ;;
+esac
 
-if test "$GCC" = yes ; then
-       case $host_os in
-       linux*|gnu*)
-               echo "$as_me:3904: checking if this is really Intel C compiler" >&5
-echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
-               cf_save_CFLAGS="$CFLAGS"
-               CFLAGS="$CFLAGS -no-gcc"
-               cat >conftest.$ac_ext <<_ACEOF
-#line 3909 "configure"
+echo "$as_me:4170: checking for an ANSI C-conforming const" >&5
+echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
+if test "${ac_cv_c_const+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 4176 "configure"
 #include "confdefs.h"
 
 int
 main ()
 {
+/* FIXME: Include the comments suggested by Paul. */
+#ifndef __cplusplus
+  /* Ultrix mips cc rejects this.  */
+  typedef int charset[2];
+  const charset x;
+  /* SunOS 4.1.1 cc rejects this.  */
+  char const *const *ccp;
+  char **p;
+  /* NEC SVR4.0.2 mips cc rejects this.  */
+  struct point {int x, y;};
+  static struct point const zero = {0,0};
+  /* AIX XL C 1.02.0.0 rejects this.
+     It does not let you subtract one const X* pointer from another in
+     an arm of an if-expression whose if-part is not a constant
+     expression */
+  const char *g = "string";
+  ccp = &g + (g ? g-g : 0);
+  /* HPUX 7.0 cc rejects these. */
+  ++ccp;
+  p = (char**) ccp;
+  ccp = (char const *const *) p;
+  { /* SCO 3.2v4 cc rejects this.  */
+    char *t;
+    char const *s = 0 ? (char *) 0 : (char const *) 0;
 
-#ifdef __INTEL_COMPILER
-#else
-make an error
+    *t++ = 0;
+  }
+  { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
+    int x[] = {25, 17};
+    const int *foo = &x[0];
+    ++foo;
+  }
+  { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
+    typedef const int *iptr;
+    iptr p = 0;
+    ++p;
+  }
+  { /* AIX XL C 1.02.0.0 rejects this saying
+       "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
+    struct s { int j; const int *ap[3]; };
+    struct s *b; b->j = 5;
+  }
+  { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
+    const int foo = 10;
+  }
 #endif
 
   ;
@@ -3923,426 +4231,1499 @@ make an error
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:3926: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:4234: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:3929: \$? = $ac_status" >&5
+  echo "$as_me:4237: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:3932: \"$ac_try\"") >&5
+  { (eval echo "$as_me:4240: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:3935: \$? = $ac_status" >&5
+  echo "$as_me:4243: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  INTEL_COMPILER=yes
-cf_save_CFLAGS="$cf_save_CFLAGS -we147 -no-gcc"
-
+  ac_cv_c_const=yes
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
+ac_cv_c_const=no
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
-               CFLAGS="$cf_save_CFLAGS"
-               echo "$as_me:3946: result: $INTEL_COMPILER" >&5
-echo "${ECHO_T}$INTEL_COMPILER" >&6
-               ;;
-       esac
 fi
+echo "$as_me:4253: result: $ac_cv_c_const" >&5
+echo "${ECHO_T}$ac_cv_c_const" >&6
+if test $ac_cv_c_const = no; then
 
-cat > conftest.$ac_ext <<EOF
-#line 3953 "${as_me:-configure}"
-int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
+cat >>confdefs.h <<\EOF
+#define const
 EOF
 
-if test "$INTEL_COMPILER" = yes
-then
-# The "-wdXXX" options suppress warnings:
-# remark #1419: external declaration in primary source file
-# remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
-# remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
-# remark #193: zero used for undefined preprocessing identifier
-# remark #593: variable "curs_sb_left_arrow" was set but never used
-# remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
-# remark #869: parameter "tw" was never referenced
-# remark #981: operands are evaluated in unspecified order
-# warning #279: controlling expression is constant
-
-       { echo "$as_me:3970: checking for $CC warning options..." >&5
-echo "$as_me: checking for $CC warning options..." >&6;}
-       cf_save_CFLAGS="$CFLAGS"
-       EXTRA_CFLAGS="-Wall"
-       for cf_opt in \
-               wd1419 \
-               wd1683 \
-               wd1684 \
-               wd193 \
-               wd593 \
-               wd279 \
-               wd810 \
-               wd869 \
-               wd981
-       do
-               CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
-               if { (eval echo "$as_me:3986: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:3989: \$? = $ac_status" >&5
-  (exit $ac_status); }; then
-                       test -n "$verbose" && echo "$as_me:3991: result: ... -$cf_opt" >&5
-echo "${ECHO_T}... -$cf_opt" >&6
-                       EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
-               fi
-       done
-       CFLAGS="$cf_save_CFLAGS"
-
-elif test "$GCC" = yes
-then
-       { echo "$as_me:4000: checking for $CC warning options..." >&5
-echo "$as_me: checking for $CC warning options..." >&6;}
-       cf_save_CFLAGS="$CFLAGS"
-       EXTRA_CFLAGS=
-       cf_warn_CONST=""
-       test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
-       for cf_opt in W Wall \
-               Wbad-function-cast \
-               Wcast-align \
-               Wcast-qual \
-               Winline \
-               Wmissing-declarations \
-               Wmissing-prototypes \
-               Wnested-externs \
-               Wpointer-arith \
-               Wshadow \
-               Wstrict-prototypes \
-               Wundef $cf_warn_CONST
-       do
-               CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
-               if { (eval echo "$as_me:4020: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:4023: \$? = $ac_status" >&5
-  (exit $ac_status); }; then
-                       test -n "$verbose" && echo "$as_me:4025: result: ... -$cf_opt" >&5
-echo "${ECHO_T}... -$cf_opt" >&6
-                       case $cf_opt in #(vi
-                       Wcast-qual) #(vi
-                               CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES"
-                               ;;
-                       Winline) #(vi
-                               case $GCC_VERSION in
-                               [34].*)
-                                       test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
-
-echo "${as_me:-configure}:4036: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
-
-                                       continue;;
-                               esac
-                               ;;
-                       esac
-                       EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
-               fi
-       done
-       CFLAGS="$cf_save_CFLAGS"
-fi
-rm -rf conftest*
-
-fi
-fi
-
-# Check whether --with-curses-dir or --without-curses-dir was given.
-if test "${with_curses_dir+set}" = set; then
-  withval="$with_curses_dir"
-
-if test "x$prefix" != xNONE; then
-  cf_path_syntax="$prefix"
-else
-  cf_path_syntax="$ac_default_prefix"
 fi
 
-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%$cf_path_syntax%`
-    ;;
-  esac
-  ;; #(vi
-.no|.NONE/*)
-  withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
-  ;;
-*)
-  { { echo "$as_me:4081: error: expected a pathname, not \"$withval\"" >&5
-echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
-   { (exit 1); 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
-else
-
-# Check whether --with-ncurses or --without-ncurses was given.
-if test "${with_ncurses+set}" = set; then
-  withval="$with_ncurses"
-  cf_cv_screen=ncurses
-else
-
-# Check whether --with-pdcurses or --without-pdcurses was given.
-if test "${with_pdcurses+set}" = set; then
-  withval="$with_pdcurses"
-  cf_cv_screen=pdcurses
-fi;
-fi;
-fi;
-
-case $cf_cv_screen in
-curses)
-
-echo "$as_me:4122: checking for extra include directories" >&5
-echo $ECHO_N "checking for extra include directories... $ECHO_C" >&6
-if test "${cf_cv_curses_incdir+set}" = set; then
+echo "$as_me:4263: checking for signal global datatype" >&5
+echo $ECHO_N "checking for signal global datatype... $ECHO_C" >&6
+if test "${cf_cv_sig_atomic_t+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-cf_cv_curses_incdir=no
-case $host_os in #(vi
-hpux10.*) #(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 "$as_me:4142: result: $cf_cv_curses_incdir" >&5
-echo "${ECHO_T}$cf_cv_curses_incdir" >&6
-test "$cf_cv_curses_incdir" != no && CPPFLAGS="$CPPFLAGS $cf_cv_curses_incdir"
+       for cf_type in \
+               "volatile sig_atomic_t" \
+               "sig_atomic_t" \
+               "int"
+       do
+       cat >conftest.$ac_ext <<_ACEOF
+#line 4275 "configure"
+#include "confdefs.h"
 
-echo "$as_me:4146: checking if we have identified curses headers" >&5
-echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
-if test "${cf_cv_ncurses_header+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
+#include <sys/types.h>
+#include <signal.h>
+#include <stdio.h>
 
-cf_cv_ncurses_header=none
-for cf_header in  \
-       curses.h \
-       ncurses.h ncurses/curses.h ncurses/ncurses.h
-do
-cat >conftest.$ac_ext <<_ACEOF
-#line 4158 "configure"
-#include "confdefs.h"
-#include <${cf_header}>
+extern $cf_type x;
+$cf_type x;
+static void handler(int sig)
+{
+       x = 5;
+}
 int
 main ()
 {
-initscr(); tgoto("?", 0,0)
+signal(SIGINT, handler);
+                x = 1
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:4170: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:4298: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:4173: \$? = $ac_status" >&5
+  echo "$as_me:4301: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:4176: \"$ac_try\"") >&5
+  { (eval echo "$as_me:4304: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:4179: \$? = $ac_status" >&5
+  echo "$as_me:4307: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  cf_cv_ncurses_header=$cf_header; break
+  cf_cv_sig_atomic_t=$cf_type
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
+cf_cv_sig_atomic_t=no
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
-done
+               test "$cf_cv_sig_atomic_t" != no && break
+       done
 
 fi
-echo "$as_me:4190: result: $cf_cv_ncurses_header" >&5
-echo "${ECHO_T}$cf_cv_ncurses_header" >&6
 
-if test "$cf_cv_ncurses_header" = none ; then
-       { { echo "$as_me:4194: error: No curses header-files found" >&5
-echo "$as_me: error: No curses header-files found" >&2;}
-   { (exit 1); exit 1; }; }
-fi
+echo "$as_me:4321: result: $cf_cv_sig_atomic_t" >&5
+echo "${ECHO_T}$cf_cv_sig_atomic_t" >&6
+test "$cf_cv_sig_atomic_t" != no && cat >>confdefs.h <<EOF
+#define SIG_ATOMIC_T $cf_cv_sig_atomic_t
+EOF
 
-# cheat, to get the right #define's for HAVE_NCURSES_H, etc.
+echo "$as_me:4327: checking if you want to see long compiling messages" >&5
+echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
+
+# Check whether --enable-echo or --disable-echo was given.
+if test "${enable_echo+set}" = set; then
+  enableval="$enable_echo"
+  test "$enableval" != no && enableval=yes
+  if test "$enableval" != "yes" ; then
+
+    ECHO_LT='--silent'
+    ECHO_LD='@echo linking $@;'
+    RULE_CC='@echo compiling $<'
+    SHOW_CC='@echo compiling $@'
+    ECHO_CC='@'
 
-for ac_header in $cf_cv_ncurses_header
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-echo "$as_me:4204: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-#line 4210 "configure"
-#include "confdefs.h"
-#include <$ac_header>
-_ACEOF
-if { (eval echo "$as_me:4214: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
-  ac_status=$?
-  egrep -v '^ *\+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:4220: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
   else
-    ac_cpp_err=
+
+    ECHO_LT=''
+    ECHO_LD=''
+    RULE_CC=''
+    SHOW_CC=''
+    ECHO_CC=''
+
   fi
 else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
-  eval "$as_ac_Header=yes"
-else
-  echo "$as_me: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  eval "$as_ac_Header=no"
-fi
-rm -f conftest.err conftest.$ac_ext
+  enableval=yes
+
+    ECHO_LT=''
+    ECHO_LD=''
+    RULE_CC=''
+    SHOW_CC=''
+    ECHO_CC=''
+
+fi;
+echo "$as_me:4361: result: $enableval" >&5
+echo "${ECHO_T}$enableval" >&6
+
+GCC_VERSION=none
+if test "$GCC" = yes ; then
+       echo "$as_me:4366: checking version of $CC" >&5
+echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
+       GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(GCC) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
+       test -z "$GCC_VERSION" && GCC_VERSION=unknown
+       echo "$as_me:4370: result: $GCC_VERSION" >&5
+echo "${ECHO_T}$GCC_VERSION" >&6
 fi
-echo "$as_me:4239: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
-  cat >>confdefs.h <<EOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+
+if ( test "$GCC" = yes || test "$GXX" = yes )
+then
+echo "$as_me:4376: checking if you want to turn on gcc warnings" >&5
+echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
+
+# Check whether --enable-warnings or --disable-warnings was given.
+if test "${enable_warnings+set}" = set; then
+  enableval="$enable_warnings"
+  test "$enableval" != yes && enableval=no
+  if test "$enableval" != "no" ; then
+    with_warnings=yes
+  else
+    with_warnings=no
+  fi
+else
+  enableval=no
+  with_warnings=no
+
+fi;
+echo "$as_me:4393: result: $with_warnings" >&5
+echo "${ECHO_T}$with_warnings" >&6
+if test "$with_warnings" = "yes"
+then
+
+if test "$GCC" = yes
+then
+cat > conftest.i <<EOF
+#ifndef GCC_PRINTF
+#define GCC_PRINTF 0
+#endif
+#ifndef GCC_SCANF
+#define GCC_SCANF 0
+#endif
+#ifndef GCC_NORETURN
+#define GCC_NORETURN /* nothing */
+#endif
+#ifndef GCC_UNUSED
+#define GCC_UNUSED /* nothing */
+#endif
 EOF
+if test "$GCC" = yes
+then
+       { echo "$as_me:4416: checking for $CC __attribute__ directives..." >&5
+echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
+cat > conftest.$ac_ext <<EOF
+#line 4419 "${as_me:-configure}"
+#include "confdefs.h"
+#include "conftest.h"
+#include "conftest.i"
+#if    GCC_PRINTF
+#define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
+#else
+#define GCC_PRINTFLIKE(fmt,var) /*nothing*/
+#endif
+#if    GCC_SCANF
+#define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
+#else
+#define GCC_SCANFLIKE(fmt,var)  /*nothing*/
+#endif
+extern void wow(char *,...) GCC_SCANFLIKE(1,2);
+extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
+extern void foo(void) GCC_NORETURN;
+int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
+EOF
+       cf_printf_attribute=no
+       cf_scanf_attribute=no
+       for cf_attribute in scanf printf unused noreturn
+       do
 
-fi
-done
+cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
 
-echo "$as_me:4249: checking for terminfo header" >&5
-echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
-if test "${cf_cv_term_header+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+               cf_directive="__attribute__(($cf_attribute))"
+               echo "checking for $CC $cf_directive" 1>&5
+
+               case $cf_attribute in #(vi
+               printf) #(vi
+                       cf_printf_attribute=yes
+                       cat >conftest.h <<EOF
+#define GCC_$cf_ATTRIBUTE 1
+EOF
+                       ;;
+               scanf) #(vi
+                       cf_scanf_attribute=yes
+                       cat >conftest.h <<EOF
+#define GCC_$cf_ATTRIBUTE 1
+EOF
+                       ;;
+               *) #(vi
+                       cat >conftest.h <<EOF
+#define GCC_$cf_ATTRIBUTE $cf_directive
+EOF
+                       ;;
+               esac
+
+               if { (eval echo "$as_me:4468: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:4471: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+                       test -n "$verbose" && echo "$as_me:4473: result: ... $cf_attribute" >&5
+echo "${ECHO_T}... $cf_attribute" >&6
+                       cat conftest.h >>confdefs.h
+                       case $cf_attribute in #(vi
+                       printf) #(vi
+                               if test "$cf_printf_attribute" = no ; then
+                                       cat >>confdefs.h <<EOF
+#define GCC_PRINTFLIKE(fmt,var) /* nothing */
+EOF
+                               else
+                                       cat >>confdefs.h <<EOF
+#define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
+EOF
+                               fi
+                               ;;
+                       scanf) #(vi
+                               if test "$cf_scanf_attribute" = no ; then
+                                       cat >>confdefs.h <<EOF
+#define GCC_SCANFLIKE(fmt,var) /* nothing */
+EOF
+                               else
+                                       cat >>confdefs.h <<EOF
+#define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
+EOF
+                               fi
+                               ;;
+                       esac
+               fi
+       done
 else
+       fgrep define conftest.i >>confdefs.h
+fi
+rm -rf conftest*
+fi
 
-case ${cf_cv_ncurses_header} in #(vi
-*/ncurses.h|*/ncursesw.h) #(vi
-       cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
-       ;;
-*)
-       cf_term_header=term.h
-       ;;
-esac
+INTEL_COMPILER=no
 
-for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
-do
-cat >conftest.$ac_ext <<_ACEOF
-#line 4267 "configure"
+if test "$GCC" = yes ; then
+       case $host_os in
+       linux*|gnu*)
+               echo "$as_me:4513: checking if this is really Intel C compiler" >&5
+echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
+               cf_save_CFLAGS="$CFLAGS"
+               CFLAGS="$CFLAGS -no-gcc"
+               cat >conftest.$ac_ext <<_ACEOF
+#line 4518 "configure"
 #include "confdefs.h"
-#include <stdio.h>
-#include <${cf_cv_ncurses_header:-curses.h}>
-#include <$cf_test>
 
 int
 main ()
 {
-int x = auto_left_margin
+
+#ifdef __INTEL_COMPILER
+#else
+make an error
+#endif
+
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:4282: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:4535: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:4285: \$? = $ac_status" >&5
+  echo "$as_me:4538: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:4288: \"$ac_try\"") >&5
+  { (eval echo "$as_me:4541: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:4291: \$? = $ac_status" >&5
+  echo "$as_me:4544: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
+  INTEL_COMPILER=yes
+cf_save_CFLAGS="$cf_save_CFLAGS -we147 -no-gcc"
 
-       cf_cv_term_header="$cf_test"
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
-
-       cf_cv_term_header=unknown
-
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
-       test "$cf_cv_term_header" != unknown && break
-done
-
+               CFLAGS="$cf_save_CFLAGS"
+               echo "$as_me:4555: result: $INTEL_COMPILER" >&5
+echo "${ECHO_T}$INTEL_COMPILER" >&6
+               ;;
+       esac
 fi
-echo "$as_me:4307: result: $cf_cv_term_header" >&5
-echo "${ECHO_T}$cf_cv_term_header" >&6
-
-# Set definitions to allow ifdef'ing to accommodate subdirectories
 
-case $cf_cv_term_header in # (vi
-*term.h)
-       cat >>confdefs.h <<\EOF
-#define HAVE_TERM_H 1
-EOF
+CLANG_COMPILER=no
 
-       ;;
-esac
+if test "$GCC" = yes ; then
+       echo "$as_me:4564: checking if this is really Clang C compiler" >&5
+echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
+       cf_save_CFLAGS="$CFLAGS"
+       CFLAGS="$CFLAGS -Qunused-arguments"
+       cat >conftest.$ac_ext <<_ACEOF
+#line 4569 "configure"
+#include "confdefs.h"
 
-case $cf_cv_term_header in # (vi
-ncurses/term.h) #(vi
-       cat >>confdefs.h <<\EOF
-#define HAVE_NCURSES_TERM_H 1
-EOF
+int
+main ()
+{
 
-       ;;
-ncursesw/term.h)
-       cat >>confdefs.h <<\EOF
-#define HAVE_NCURSESW_TERM_H 1
-EOF
+#ifdef __clang__
+#else
+make an error
+#endif
 
-       ;;
-esac
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:4586: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:4589: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:4592: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:4595: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  CLANG_COMPILER=yes
+cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments"
 
-echo "$as_me:4336: checking for ncurses version" >&5
-echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
-if test "${cf_cv_ncurses_version+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+       CFLAGS="$cf_save_CFLAGS"
+       echo "$as_me:4606: result: $CLANG_COMPILER" >&5
+echo "${ECHO_T}$CLANG_COMPILER" >&6
+fi
 
-       cf_cv_ncurses_version=no
-       cf_tempfile=out$$
-       rm -f $cf_tempfile
-       if test "$cross_compiling" = yes; then
+cat > conftest.$ac_ext <<EOF
+#line 4611 "${as_me:-configure}"
+int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
+EOF
+
+if test "$INTEL_COMPILER" = yes
+then
+# The "-wdXXX" options suppress warnings:
+# remark #1419: external declaration in primary source file
+# remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
+# remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
+# remark #193: zero used for undefined preprocessing identifier
+# remark #593: variable "curs_sb_left_arrow" was set but never used
+# remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
+# remark #869: parameter "tw" was never referenced
+# remark #981: operands are evaluated in unspecified order
+# warning #279: controlling expression is constant
+
+       { echo "$as_me:4628: checking for $CC warning options..." >&5
+echo "$as_me: checking for $CC warning options..." >&6;}
+       cf_save_CFLAGS="$CFLAGS"
+       EXTRA_CFLAGS="-Wall"
+       for cf_opt in \
+               wd1419 \
+               wd1683 \
+               wd1684 \
+               wd193 \
+               wd593 \
+               wd279 \
+               wd810 \
+               wd869 \
+               wd981
+       do
+               CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
+               if { (eval echo "$as_me:4644: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:4647: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+                       test -n "$verbose" && echo "$as_me:4649: result: ... -$cf_opt" >&5
+echo "${ECHO_T}... -$cf_opt" >&6
+                       EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
+               fi
+       done
+       CFLAGS="$cf_save_CFLAGS"
+
+elif test "$GCC" = yes
+then
+       { echo "$as_me:4658: checking for $CC warning options..." >&5
+echo "$as_me: checking for $CC warning options..." >&6;}
+       cf_save_CFLAGS="$CFLAGS"
+       EXTRA_CFLAGS=
+       cf_warn_CONST=""
+       test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
+       for cf_opt in W Wall \
+               Wbad-function-cast \
+               Wcast-align \
+               Wcast-qual \
+               Winline \
+               Wmissing-declarations \
+               Wmissing-prototypes \
+               Wnested-externs \
+               Wpointer-arith \
+               Wshadow \
+               Wstrict-prototypes \
+               Wundef $cf_warn_CONST
+       do
+               CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
+               if { (eval echo "$as_me:4678: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:4681: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+                       test -n "$verbose" && echo "$as_me:4683: result: ... -$cf_opt" >&5
+echo "${ECHO_T}... -$cf_opt" >&6
+                       case $cf_opt in #(vi
+                       Wcast-qual) #(vi
+                               CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES"
+                               ;;
+                       Winline) #(vi
+                               case $GCC_VERSION in
+                               [34].*)
+                                       test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
+
+echo "${as_me:-configure}:4694: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
+
+                                       continue;;
+                               esac
+                               ;;
+                       Wpointer-arith) #(vi
+                               case $GCC_VERSION in
+                               [12].*)
+                                       test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
+
+echo "${as_me:-configure}:4704: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
+
+                                       continue;;
+                               esac
+                               ;;
+                       esac
+                       EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
+               fi
+       done
+       CFLAGS="$cf_save_CFLAGS"
+fi
+rm -rf conftest*
+
+fi
+fi
+
+echo "$as_me:4720: checking if you want to use dmalloc for testing" >&5
+echo $ECHO_N "checking if you want to use dmalloc for testing... $ECHO_C" >&6
+
+# Check whether --with-dmalloc or --without-dmalloc was given.
+if test "${with_dmalloc+set}" = set; then
+  withval="$with_dmalloc"
+  cat >>confdefs.h <<\EOF
+#define USE_DMALLOC 1
+EOF
+
+       : ${with_cflags:=-g}
+       : ${with_no_leaks:=yes}
+        with_dmalloc=yes
+else
+  with_dmalloc=
+fi;
+echo "$as_me:4736: result: ${with_dmalloc:-no}" >&5
+echo "${ECHO_T}${with_dmalloc:-no}" >&6
+
+case .$with_cflags in #(vi
+.*-g*)
+       case .$CFLAGS in #(vi
+       .*-g*) #(vi
+               ;;
+       *)
+
+cf_fix_cppflags=no
+cf_new_cflags=
+cf_new_cppflags=
+cf_new_extra_cppflags=
+
+for cf_add_cflags in -g
+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
+                       case $cf_add_cflags in #(vi
+                       -D*)
+                               cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
+
+CPPFLAGS=`echo "$CPPFLAGS" | \
+       sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
+               -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
+
+                               ;;
+                       esac
+                       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="$CPPFLAGS $cf_new_cppflags"
+fi
+
+if test -n "$cf_new_extra_cppflags" ; then
+
+       EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
+fi
+
+               ;;
+       esac
+       ;;
+esac
+
+if test "$with_dmalloc" = yes ; then
+       echo "$as_me:4830: checking for dmalloc.h" >&5
+echo $ECHO_N "checking for dmalloc.h... $ECHO_C" >&6
+if test "${ac_cv_header_dmalloc_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 4836 "configure"
+#include "confdefs.h"
+#include <dmalloc.h>
+_ACEOF
+if { (eval echo "$as_me:4840: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  egrep -v '^ *\+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:4846: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_cv_header_dmalloc_h=yes
+else
+  echo "$as_me: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  ac_cv_header_dmalloc_h=no
+fi
+rm -f conftest.err conftest.$ac_ext
+fi
+echo "$as_me:4865: result: $ac_cv_header_dmalloc_h" >&5
+echo "${ECHO_T}$ac_cv_header_dmalloc_h" >&6
+if test $ac_cv_header_dmalloc_h = yes; then
+
+echo "$as_me:4869: checking for dmalloc_debug in -ldmalloc" >&5
+echo $ECHO_N "checking for dmalloc_debug in -ldmalloc... $ECHO_C" >&6
+if test "${ac_cv_lib_dmalloc_dmalloc_debug+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldmalloc  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line 4877 "configure"
+#include "confdefs.h"
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char dmalloc_debug ();
+int
+main ()
+{
+dmalloc_debug ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:4896: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:4899: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:4902: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:4905: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_dmalloc_dmalloc_debug=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_dmalloc_dmalloc_debug=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:4916: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5
+echo "${ECHO_T}$ac_cv_lib_dmalloc_dmalloc_debug" >&6
+if test $ac_cv_lib_dmalloc_dmalloc_debug = yes; then
+  cat >>confdefs.h <<EOF
+#define HAVE_LIBDMALLOC 1
+EOF
+
+  LIBS="-ldmalloc $LIBS"
+
+fi
+
+fi
+
+fi
+
+echo "$as_me:4931: checking if you want to use dbmalloc for testing" >&5
+echo $ECHO_N "checking if you want to use dbmalloc for testing... $ECHO_C" >&6
+
+# Check whether --with-dbmalloc or --without-dbmalloc was given.
+if test "${with_dbmalloc+set}" = set; then
+  withval="$with_dbmalloc"
+  cat >>confdefs.h <<\EOF
+#define USE_DBMALLOC 1
+EOF
+
+       : ${with_cflags:=-g}
+       : ${with_no_leaks:=yes}
+        with_dbmalloc=yes
+else
+  with_dbmalloc=
+fi;
+echo "$as_me:4947: result: ${with_dbmalloc:-no}" >&5
+echo "${ECHO_T}${with_dbmalloc:-no}" >&6
+
+case .$with_cflags in #(vi
+.*-g*)
+       case .$CFLAGS in #(vi
+       .*-g*) #(vi
+               ;;
+       *)
+
+cf_fix_cppflags=no
+cf_new_cflags=
+cf_new_cppflags=
+cf_new_extra_cppflags=
+
+for cf_add_cflags in -g
+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
+                       case $cf_add_cflags in #(vi
+                       -D*)
+                               cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
+
+CPPFLAGS=`echo "$CPPFLAGS" | \
+       sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
+               -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
+
+                               ;;
+                       esac
+                       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="$CPPFLAGS $cf_new_cppflags"
+fi
+
+if test -n "$cf_new_extra_cppflags" ; then
+
+       EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
+fi
+
+               ;;
+       esac
+       ;;
+esac
+
+if test "$with_dbmalloc" = yes ; then
+       echo "$as_me:5041: checking for dbmalloc.h" >&5
+echo $ECHO_N "checking for dbmalloc.h... $ECHO_C" >&6
+if test "${ac_cv_header_dbmalloc_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 5047 "configure"
+#include "confdefs.h"
+#include <dbmalloc.h>
+_ACEOF
+if { (eval echo "$as_me:5051: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  egrep -v '^ *\+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:5057: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_cv_header_dbmalloc_h=yes
+else
+  echo "$as_me: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  ac_cv_header_dbmalloc_h=no
+fi
+rm -f conftest.err conftest.$ac_ext
+fi
+echo "$as_me:5076: result: $ac_cv_header_dbmalloc_h" >&5
+echo "${ECHO_T}$ac_cv_header_dbmalloc_h" >&6
+if test $ac_cv_header_dbmalloc_h = yes; then
+
+echo "$as_me:5080: checking for debug_malloc in -ldbmalloc" >&5
+echo $ECHO_N "checking for debug_malloc in -ldbmalloc... $ECHO_C" >&6
+if test "${ac_cv_lib_dbmalloc_debug_malloc+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldbmalloc  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line 5088 "configure"
+#include "confdefs.h"
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char debug_malloc ();
+int
+main ()
+{
+debug_malloc ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:5107: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:5110: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:5113: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:5116: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_dbmalloc_debug_malloc=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_dbmalloc_debug_malloc=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:5127: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5
+echo "${ECHO_T}$ac_cv_lib_dbmalloc_debug_malloc" >&6
+if test $ac_cv_lib_dbmalloc_debug_malloc = yes; then
+  cat >>confdefs.h <<EOF
+#define HAVE_LIBDBMALLOC 1
+EOF
+
+  LIBS="-ldbmalloc $LIBS"
+
+fi
+
+fi
+
+fi
+
+echo "$as_me:5142: checking if you want to use valgrind for testing" >&5
+echo $ECHO_N "checking if you want to use valgrind for testing... $ECHO_C" >&6
+
+# Check whether --with-valgrind or --without-valgrind was given.
+if test "${with_valgrind+set}" = set; then
+  withval="$with_valgrind"
+  cat >>confdefs.h <<\EOF
+#define USE_VALGRIND 1
+EOF
+
+       : ${with_cflags:=-g}
+       : ${with_no_leaks:=yes}
+        with_valgrind=yes
+else
+  with_valgrind=
+fi;
+echo "$as_me:5158: result: ${with_valgrind:-no}" >&5
+echo "${ECHO_T}${with_valgrind:-no}" >&6
+
+case .$with_cflags in #(vi
+.*-g*)
+       case .$CFLAGS in #(vi
+       .*-g*) #(vi
+               ;;
+       *)
+
+cf_fix_cppflags=no
+cf_new_cflags=
+cf_new_cppflags=
+cf_new_extra_cppflags=
+
+for cf_add_cflags in -g
+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
+                       case $cf_add_cflags in #(vi
+                       -D*)
+                               cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
+
+CPPFLAGS=`echo "$CPPFLAGS" | \
+       sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
+               -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
+
+                               ;;
+                       esac
+                       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="$CPPFLAGS $cf_new_cppflags"
+fi
+
+if test -n "$cf_new_extra_cppflags" ; then
+
+       EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
+fi
+
+               ;;
+       esac
+       ;;
+esac
+
+echo "$as_me:5251: checking if you want to perform memory-leak testing" >&5
+echo $ECHO_N "checking if you want to perform memory-leak testing... $ECHO_C" >&6
+
+# Check whether --enable-leaks or --disable-leaks was given.
+if test "${enable_leaks+set}" = set; then
+  enableval="$enable_leaks"
+  if test "x$enableval" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi
+else
+  : ${with_no_leaks:=no}
+fi;
+echo "$as_me:5261: result: $with_no_leaks" >&5
+echo "${ECHO_T}$with_no_leaks" >&6
+
+if test "$with_no_leaks" = yes ; then
+       cat >>confdefs.h <<\EOF
+#define NO_LEAKS 1
+EOF
+
+       cat >>confdefs.h <<\EOF
+#define YY_NO_LEAKS 1
+EOF
+
+fi
+
+echo "$as_me:5275: checking if you want to check for wide-character functions" >&5
+echo $ECHO_N "checking if you want to check for wide-character functions... $ECHO_C" >&6
+
+# Check whether --enable-widec or --disable-widec was given.
+if test "${enable_widec+set}" = set; then
+  enableval="$enable_widec"
+  test "$enableval" != no && enableval=yes
+  if test "$enableval" != "yes" ; then
+    cf_enable_widec=no
+  else
+    cf_enable_widec=yes
+  fi
+else
+  enableval=yes
+  cf_enable_widec=yes
+
+fi;
+echo "$as_me:5292: result: $cf_enable_widec" >&5
+echo "${ECHO_T}$cf_enable_widec" >&6
+
+echo "$as_me:5295: checking for specific curses-directory" >&5
+echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
+
+# Check whether --with-curses-dir or --without-curses-dir was given.
+if test "${with_curses_dir+set}" = set; then
+  withval="$with_curses_dir"
+  cf_cv_curses_dir=$withval
+else
+  cf_cv_curses_dir=no
+fi;
+echo "$as_me:5305: result: $cf_cv_curses_dir" >&5
+echo "${ECHO_T}$cf_cv_curses_dir" >&6
+
+if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
+then
+
+if test "x$prefix" != xNONE; then
+  cf_path_syntax="$prefix"
+else
+  cf_path_syntax="$ac_default_prefix"
+fi
+
+case ".$withval" in #(vi
+.\$\(*\)*|.\'*\'*) #(vi
+  ;;
+..|./*|.\\*) #(vi
+  ;;
+.[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
+  ;;
+.\${*prefix}*|.\${*dir}*) #(vi
+  eval withval="$withval"
+  case ".$withval" in #(vi
+  .NONE/*)
+    withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
+    ;;
+  esac
+  ;; #(vi
+.no|.NONE/*)
+  withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
+  ;;
+*)
+  { { echo "$as_me:5336: error: expected a pathname, not \"$withval\"" >&5
+echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
+   { (exit 1); exit 1; }; }
+  ;;
+esac
+
+       if test -d "$cf_cv_curses_dir"
+       then
+
+if test -n "$cf_cv_curses_dir/include" ; then
+  for cf_add_incdir in $cf_cv_curses_dir/include
+  do
+       while test $cf_add_incdir != /usr/include
+       do
+         if test -d $cf_add_incdir
+         then
+               cf_have_incdir=no
+               if test -n "$CFLAGS$CPPFLAGS" ; then
+                 # a loop is needed to ensure we can add subdirs of existing dirs
+                 for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
+                       if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
+                         cf_have_incdir=yes; break
+                       fi
+                 done
+               fi
+
+               if test "$cf_have_incdir" = no ; then
+                 if test "$cf_add_incdir" = /usr/local/include ; then
+                       if test "$GCC" = yes
+                       then
+                         cf_save_CPPFLAGS=$CPPFLAGS
+                         CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
+                         cat >conftest.$ac_ext <<_ACEOF
+#line 5369 "configure"
+#include "confdefs.h"
+#include <stdio.h>
+int
+main ()
+{
+printf("Hello")
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:5381: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:5384: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:5387: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:5390: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_have_incdir=yes
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+                         CPPFLAGS=$cf_save_CPPFLAGS
+                       fi
+                 fi
+               fi
+
+               if test "$cf_have_incdir" = no ; then
+                 test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
+
+echo "${as_me:-configure}:5407: testing adding $cf_add_incdir to include-path ..." 1>&5
+
+                 CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
+
+                 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"
+               else
+                 break
+               fi
+         fi
+       done
+  done
+fi
+
+if test -n "$cf_cv_curses_dir/lib" ; then
+  for cf_add_libdir in $cf_cv_curses_dir/lib
+  do
+    if test $cf_add_libdir = /usr/lib ; then
+      :
+    elif test -d $cf_add_libdir
+    then
+      cf_have_libdir=no
+      if test -n "$LDFLAGS$LIBS" ; then
+        # a loop is needed to ensure we can add subdirs of existing dirs
+        for cf_test_libdir in $LDFLAGS $LIBS ; do
+          if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
+            cf_have_libdir=yes; break
+          fi
+        done
+      fi
+      if test "$cf_have_libdir" = no ; then
+        test -n "$verbose" && echo "   adding $cf_add_libdir to library-path" 1>&6
+
+echo "${as_me:-configure}:5441: testing adding $cf_add_libdir to library-path ..." 1>&5
+
+        LDFLAGS="-L$cf_add_libdir $LDFLAGS"
+      fi
+    fi
+  done
+fi
+
+       fi
+fi
+
+cf_cv_screen=curses
+
+echo "$as_me:5454: checking for specified curses library type" >&5
+echo $ECHO_N "checking for specified curses library type... $ECHO_C" >&6
+
+# Check whether --with-ncursesw or --without-ncursesw was given.
+if test "${with_ncursesw+set}" = set; then
+  withval="$with_ncursesw"
+  cf_cv_screen=ncursesw
+else
+
+# Check whether --with-ncurses or --without-ncurses was given.
+if test "${with_ncurses+set}" = set; then
+  withval="$with_ncurses"
+  cf_cv_screen=ncurses
+else
+
+# Check whether --with-pdcurses or --without-pdcurses was given.
+if test "${with_pdcurses+set}" = set; then
+  withval="$with_pdcurses"
+  cf_cv_screen=pdcurses
+else
+
+# Check whether --with-curses-colr or --without-curses-colr was given.
+if test "${with_curses_colr+set}" = set; then
+  withval="$with_curses_colr"
+  cf_cv_screen=curses_colr
+else
+
+# Check whether --with-curses-5lib or --without-curses-5lib was given.
+if test "${with_curses_5lib+set}" = set; then
+  withval="$with_curses_5lib"
+  cf_cv_screen=curses_5lib
+fi;
+fi;
+fi;
+fi;
+fi;
+
+echo "$as_me:5491: result: $cf_cv_screen" >&5
+echo "${ECHO_T}$cf_cv_screen" >&6
+
+case $cf_cv_screen in #(vi
+curses|curses_*) #(vi
+
+echo "$as_me:5497: checking for extra include directories" >&5
+echo $ECHO_N "checking for extra include directories... $ECHO_C" >&6
+if test "${cf_cv_curses_incdir+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+cf_cv_curses_incdir=no
+case $host_os in #(vi
+hpux10.*) #(vi
+       if test "x$cf_cv_screen" = "xcurses_colr"
+       then
+               test -d /usr/include/curses_colr && \
+               cf_cv_curses_incdir="-I/usr/include/curses_colr"
+       fi
+       ;;
+sunos3*|sunos4*)
+       if test "x$cf_cv_screen" = "xcurses_5lib"
+       then
+               test -d /usr/5lib && \
+               test -d /usr/5include && \
+               cf_cv_curses_incdir="-I/usr/5include"
+       fi
+       ;;
+esac
+
+fi
+echo "$as_me:5523: result: $cf_cv_curses_incdir" >&5
+echo "${ECHO_T}$cf_cv_curses_incdir" >&6
+test "$cf_cv_curses_incdir" != no && CPPFLAGS="$CPPFLAGS $cf_cv_curses_incdir"
+
+echo "$as_me:5527: checking if we have identified curses headers" >&5
+echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
+if test "${cf_cv_ncurses_header+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+cf_cv_ncurses_header=none
+for cf_header in  \
+       ncurses.h \
+       curses.h ncurses/ncurses.h ncurses/curses.h
+do
+cat >conftest.$ac_ext <<_ACEOF
+#line 5539 "configure"
+#include "confdefs.h"
+#include <${cf_header}>
+int
+main ()
+{
+initscr(); tgoto("?", 0,0)
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:5551: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:5554: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:5557: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:5560: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_cv_ncurses_header=$cf_header; break
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+done
+
+fi
+echo "$as_me:5571: result: $cf_cv_ncurses_header" >&5
+echo "${ECHO_T}$cf_cv_ncurses_header" >&6
+
+if test "$cf_cv_ncurses_header" = none ; then
+       { { echo "$as_me:5575: error: No curses header-files found" >&5
+echo "$as_me: error: No curses header-files found" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+# cheat, to get the right #define's for HAVE_NCURSES_H, etc.
+
+for ac_header in $cf_cv_ncurses_header
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+echo "$as_me:5585: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 5591 "configure"
+#include "confdefs.h"
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:5595: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  egrep -v '^ *\+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:5601: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  eval "$as_ac_Header=yes"
+else
+  echo "$as_me: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  eval "$as_ac_Header=no"
+fi
+rm -f conftest.err conftest.$ac_ext
+fi
+echo "$as_me:5620: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<EOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+EOF
+
+fi
+done
+
+echo "$as_me:5630: checking for terminfo header" >&5
+echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
+if test "${cf_cv_term_header+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+case ${cf_cv_ncurses_header} in #(vi
+*/ncurses.h|*/ncursesw.h) #(vi
+       cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
+       ;;
+*)
+       cf_term_header=term.h
+       ;;
+esac
+
+for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
+do
+cat >conftest.$ac_ext <<_ACEOF
+#line 5648 "configure"
+#include "confdefs.h"
+#include <stdio.h>
+#include <${cf_cv_ncurses_header:-curses.h}>
+#include <$cf_test>
+
+int
+main ()
+{
+int x = auto_left_margin
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:5663: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:5666: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:5669: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:5672: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+
+       cf_cv_term_header="$cf_test"
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+
+       cf_cv_term_header=unknown
+
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+       test "$cf_cv_term_header" != unknown && break
+done
+
+fi
+echo "$as_me:5688: result: $cf_cv_term_header" >&5
+echo "${ECHO_T}$cf_cv_term_header" >&6
+
+# Set definitions to allow ifdef'ing to accommodate subdirectories
+
+case $cf_cv_term_header in # (vi
+*term.h)
+       cat >>confdefs.h <<\EOF
+#define HAVE_TERM_H 1
+EOF
+
+       ;;
+esac
+
+case $cf_cv_term_header in # (vi
+ncurses/term.h) #(vi
+       cat >>confdefs.h <<\EOF
+#define HAVE_NCURSES_TERM_H 1
+EOF
+
+       ;;
+ncursesw/term.h)
+       cat >>confdefs.h <<\EOF
+#define HAVE_NCURSESW_TERM_H 1
+EOF
+
+       ;;
+esac
+
+echo "$as_me:5717: checking for ncurses version" >&5
+echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
+if test "${cf_cv_ncurses_version+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&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.
@@ -4359,10 +5740,10 @@ Autoconf "old"
 #endif
 EOF
        cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
-       { (eval echo "$as_me:4362: \"$cf_try\"") >&5
+       { (eval echo "$as_me:5743: \"$cf_try\"") >&5
   (eval $cf_try) 2>&5
   ac_status=$?
-  echo "$as_me:4365: \$? = $ac_status" >&5
+  echo "$as_me:5746: \$? = $ac_status" >&5
   (exit $ac_status); }
        if test -f conftest.out ; then
                cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
@@ -4372,7 +5753,7 @@ EOF
 
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 4375 "configure"
+#line 5756 "configure"
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header:-curses.h}>
@@ -4397,15 +5778,15 @@ int main()
 }
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:4400: \"$ac_link\"") >&5
+if { (eval echo "$as_me:5781: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:4403: \$? = $ac_status" >&5
+  echo "$as_me:5784: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:4405: \"$ac_try\"") >&5
+  { (eval echo "$as_me:5786: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:4408: \$? = $ac_status" >&5
+  echo "$as_me:5789: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
        cf_cv_ncurses_version=`cat $cf_tempfile`
@@ -4419,16 +5800,16 @@ fi
        rm -f $cf_tempfile
 
 fi
-echo "$as_me:4422: result: $cf_cv_ncurses_version" >&5
+echo "$as_me:5803: result: $cf_cv_ncurses_version" >&5
 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
 test "$cf_cv_ncurses_version" = no || cat >>confdefs.h <<\EOF
 #define NCURSES 1
 EOF
 
-echo "$as_me:4428: checking if we have identified curses libraries" >&5
+echo "$as_me:5809: checking if we have identified curses libraries" >&5
 echo $ECHO_N "checking if we have identified curses libraries... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
-#line 4431 "configure"
+#line 5812 "configure"
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header:-curses.h}>
 int
@@ -4440,16 +5821,16 @@ initscr(); tgoto("?", 0,0)
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:4443: \"$ac_link\"") >&5
+if { (eval echo "$as_me:5824: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:4446: \$? = $ac_status" >&5
+  echo "$as_me:5827: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:4449: \"$ac_try\"") >&5
+  { (eval echo "$as_me:5830: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:4452: \$? = $ac_status" >&5
+  echo "$as_me:5833: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_result=yes
 else
@@ -4458,13 +5839,13 @@ cat conftest.$ac_ext >&5
 cf_result=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-echo "$as_me:4461: result: $cf_result" >&5
+echo "$as_me:5842: result: $cf_result" >&5
 echo "${ECHO_T}$cf_result" >&6
 
 if test "$cf_result" = no ; then
 case $host_os in #(vi
 freebsd*) #(vi
-    echo "$as_me:4467: checking for tgoto in -lmytinfo" >&5
+    echo "$as_me:5848: checking for tgoto in -lmytinfo" >&5
 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -4472,7 +5853,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lmytinfo  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 4475 "configure"
+#line 5856 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -4491,16 +5872,16 @@ tgoto ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:4494: \"$ac_link\"") >&5
+if { (eval echo "$as_me:5875: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:4497: \$? = $ac_status" >&5
+  echo "$as_me:5878: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:4500: \"$ac_try\"") >&5
+  { (eval echo "$as_me:5881: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:4503: \$? = $ac_status" >&5
+  echo "$as_me:5884: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_mytinfo_tgoto=yes
 else
@@ -4511,7 +5892,7 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:4514: result: $ac_cv_lib_mytinfo_tgoto" >&5
+echo "$as_me:5895: result: $ac_cv_lib_mytinfo_tgoto" >&5
 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
 if test $ac_cv_lib_mytinfo_tgoto = yes; then
   LIBS="-lmytinfo $LIBS"
@@ -4519,7 +5900,13 @@ fi
 
     ;;
 hpux10.*) #(vi
-    echo "$as_me:4522: checking for initscr in -lcur_colr" >&5
+       # Looking at HPUX 10.20, the Hcurses library is the oldest (1997), cur_colr
+       # next (1998), and xcurses "newer" (2000).  There is no header file for
+       # Hcurses; the subdirectory curses_colr has the headers (curses.h and
+       # term.h) for cur_colr
+       if test "x$cf_cv_screen" = "xcurses_colr"
+       then
+               echo "$as_me:5909: checking for initscr in -lcur_colr" >&5
 echo $ECHO_N "checking for initscr in -lcur_colr... $ECHO_C" >&6
 if test "${ac_cv_lib_cur_colr_initscr+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -4527,7 +5914,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lcur_colr  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 4530 "configure"
+#line 5917 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -4546,16 +5933,16 @@ initscr ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:4549: \"$ac_link\"") >&5
+if { (eval echo "$as_me:5936: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:4552: \$? = $ac_status" >&5
+  echo "$as_me:5939: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:4555: \"$ac_try\"") >&5
+  { (eval echo "$as_me:5942: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:4558: \$? = $ac_status" >&5
+  echo "$as_me:5945: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_cur_colr_initscr=yes
 else
@@ -4566,16 +5953,16 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:4569: result: $ac_cv_lib_cur_colr_initscr" >&5
+echo "$as_me:5956: result: $ac_cv_lib_cur_colr_initscr" >&5
 echo "${ECHO_T}$ac_cv_lib_cur_colr_initscr" >&6
 if test $ac_cv_lib_cur_colr_initscr = yes; then
 
-        LIBS="-lcur_colr $LIBS"
-        ac_cv_func_initscr=yes
+                       LIBS="-lcur_colr $LIBS"
+                       ac_cv_func_initscr=yes
 
 else
 
-    echo "$as_me:4578: checking for initscr in -lHcurses" >&5
+               echo "$as_me:5965: checking for initscr in -lHcurses" >&5
 echo $ECHO_N "checking for initscr in -lHcurses... $ECHO_C" >&6
 if test "${ac_cv_lib_Hcurses_initscr+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -4583,7 +5970,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lHcurses  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 4586 "configure"
+#line 5973 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -4602,16 +5989,16 @@ initscr ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:4605: \"$ac_link\"") >&5
+if { (eval echo "$as_me:5992: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:4608: \$? = $ac_status" >&5
+  echo "$as_me:5995: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:4611: \"$ac_try\"") >&5
+  { (eval echo "$as_me:5998: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:4614: \$? = $ac_status" >&5
+  echo "$as_me:6001: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_Hcurses_initscr=yes
 else
@@ -4622,21 +6009,86 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:4625: result: $ac_cv_lib_Hcurses_initscr" >&5
+echo "$as_me:6012: result: $ac_cv_lib_Hcurses_initscr" >&5
 echo "${ECHO_T}$ac_cv_lib_Hcurses_initscr" >&6
 if test $ac_cv_lib_Hcurses_initscr = yes; then
 
-        # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
-        LIBS="-lHcurses $LIBS"
-        CPPFLAGS="$CPPFLAGS -D__HP_CURSES -D_HP_CURSES"
-        ac_cv_func_initscr=yes
+                       # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
+                       LIBS="-lHcurses $LIBS"
+                       CPPFLAGS="$CPPFLAGS -D__HP_CURSES -D_HP_CURSES"
+                       ac_cv_func_initscr=yes
 
 fi
 
 fi
 
+       fi
     ;;
-linux*) # Suse Linux does not follow /usr/lib convention
+linux*)
+       case `arch 2>/dev/null` in
+       x86_64)
+               if test -d /lib64
+               then
+
+if test -n "/lib64" ; then
+  for cf_add_libdir in /lib64
+  do
+    if test $cf_add_libdir = /usr/lib ; then
+      :
+    elif test -d $cf_add_libdir
+    then
+      cf_have_libdir=no
+      if test -n "$LDFLAGS$LIBS" ; then
+        # a loop is needed to ensure we can add subdirs of existing dirs
+        for cf_test_libdir in $LDFLAGS $LIBS ; do
+          if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
+            cf_have_libdir=yes; break
+          fi
+        done
+      fi
+      if test "$cf_have_libdir" = no ; then
+        test -n "$verbose" && echo "   adding $cf_add_libdir to library-path" 1>&6
+
+echo "${as_me:-configure}:6052: testing adding $cf_add_libdir to library-path ..." 1>&5
+
+        LDFLAGS="-L$cf_add_libdir $LDFLAGS"
+      fi
+    fi
+  done
+fi
+
+               else
+
+if test -n "/lib" ; then
+  for cf_add_libdir in /lib
+  do
+    if test $cf_add_libdir = /usr/lib ; then
+      :
+    elif test -d $cf_add_libdir
+    then
+      cf_have_libdir=no
+      if test -n "$LDFLAGS$LIBS" ; then
+        # a loop is needed to ensure we can add subdirs of existing dirs
+        for cf_test_libdir in $LDFLAGS $LIBS ; do
+          if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
+            cf_have_libdir=yes; break
+          fi
+        done
+      fi
+      if test "$cf_have_libdir" = no ; then
+        test -n "$verbose" && echo "   adding $cf_add_libdir to library-path" 1>&6
+
+echo "${as_me:-configure}:6081: testing adding $cf_add_libdir to library-path ..." 1>&5
+
+        LDFLAGS="-L$cf_add_libdir $LDFLAGS"
+      fi
+    fi
+  done
+fi
+
+               fi
+               ;;
+       *)
 
 if test -n "/lib" ; then
   for cf_add_libdir in /lib
@@ -4657,7 +6109,7 @@ if test -n "/lib" ; then
       if test "$cf_have_libdir" = no ; then
         test -n "$verbose" && echo "   adding $cf_add_libdir to library-path" 1>&6
 
-echo "${as_me:-configure}:4660: testing adding $cf_add_libdir to library-path ..." 1>&5
+echo "${as_me:-configure}:6112: testing adding $cf_add_libdir to library-path ..." 1>&5
 
         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
       fi
@@ -4665,9 +6117,13 @@ echo "${as_me:-configure}:4660: testing adding $cf_add_libdir to library-path ..
   done
 fi
 
+               ;;
+       esac
     ;;
 sunos3*|sunos4*)
-    if test -d /usr/5lib ; then
+       if test "x$cf_cv_screen" = "xcurses_5lib"
+       then
+               if test -d /usr/5lib ; then
 
 if test -n "/usr/5lib" ; then
   for cf_add_libdir in /usr/5lib
@@ -4688,7 +6144,7 @@ if test -n "/usr/5lib" ; then
       if test "$cf_have_libdir" = no ; then
         test -n "$verbose" && echo "   adding $cf_add_libdir to library-path" 1>&6
 
-echo "${as_me:-configure}:4691: testing adding $cf_add_libdir to library-path ..." 1>&5
+echo "${as_me:-configure}:6147: testing adding $cf_add_libdir to library-path ..." 1>&5
 
         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
       fi
@@ -4696,7 +6152,8 @@ echo "${as_me:-configure}:4691: testing adding $cf_add_libdir to library-path ..
   done
 fi
 
-      LIBS="-lcurses -ltermcap $LIBS"
+                       LIBS="-lcurses -ltermcap $LIBS"
+               fi
     fi
     ac_cv_func_initscr=yes
     ;;
@@ -4716,13 +6173,13 @@ if test ".$ac_cv_func_initscr" != .yes ; then
 
     # Check for library containing tgoto.  Do this before curses library
     # because it may be needed to link the test-case for initscr.
-    echo "$as_me:4719: checking for tgoto" >&5
+    echo "$as_me:6176: checking for tgoto" >&5
 echo $ECHO_N "checking for tgoto... $ECHO_C" >&6
 if test "${ac_cv_func_tgoto+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 4725 "configure"
+#line 6182 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char tgoto (); below.  */
@@ -4745,7 +6202,7 @@ main ()
 #if defined (__stub_tgoto) || defined (__stub___tgoto)
 choke me
 #else
-f = tgoto;
+f = tgoto; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
 #endif
 
   ;
@@ -4753,16 +6210,16 @@ f = tgoto;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:4756: \"$ac_link\"") >&5
+if { (eval echo "$as_me:6213: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:4759: \$? = $ac_status" >&5
+  echo "$as_me:6216: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:4762: \"$ac_try\"") >&5
+  { (eval echo "$as_me:6219: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:4765: \$? = $ac_status" >&5
+  echo "$as_me:6222: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_func_tgoto=yes
 else
@@ -4772,16 +6229,16 @@ ac_cv_func_tgoto=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:4775: result: $ac_cv_func_tgoto" >&5
+echo "$as_me:6232: result: $ac_cv_func_tgoto" >&5
 echo "${ECHO_T}$ac_cv_func_tgoto" >&6
 if test $ac_cv_func_tgoto = yes; then
   cf_term_lib=predefined
 else
 
-        for cf_term_lib in $cf_check_list termcap termlib unknown
+        for cf_term_lib in $cf_check_list otermcap termcap tinfo termlib unknown
         do
             as_ac_Lib=`echo "ac_cv_lib_$cf_term_lib''_tgoto" | $as_tr_sh`
-echo "$as_me:4784: checking for tgoto in -l$cf_term_lib" >&5
+echo "$as_me:6241: checking for tgoto in -l$cf_term_lib" >&5
 echo $ECHO_N "checking for tgoto in -l$cf_term_lib... $ECHO_C" >&6
 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -4789,7 +6246,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-l$cf_term_lib  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 4792 "configure"
+#line 6249 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -4808,16 +6265,16 @@ tgoto ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:4811: \"$ac_link\"") >&5
+if { (eval echo "$as_me:6268: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:4814: \$? = $ac_status" >&5
+  echo "$as_me:6271: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:4817: \"$ac_try\"") >&5
+  { (eval echo "$as_me:6274: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:4820: \$? = $ac_status" >&5
+  echo "$as_me:6277: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   eval "$as_ac_Lib=yes"
 else
@@ -4828,7 +6285,7 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:4831: result: `eval echo '${'$as_ac_Lib'}'`" >&5
+echo "$as_me:6288: result: `eval echo '${'$as_ac_Lib'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
   break
@@ -4843,7 +6300,7 @@ fi
        for cf_curs_lib in $cf_check_list xcurses jcurses pdcurses unknown
     do
         as_ac_Lib=`echo "ac_cv_lib_$cf_curs_lib''_initscr" | $as_tr_sh`
-echo "$as_me:4846: checking for initscr in -l$cf_curs_lib" >&5
+echo "$as_me:6303: checking for initscr in -l$cf_curs_lib" >&5
 echo $ECHO_N "checking for initscr in -l$cf_curs_lib... $ECHO_C" >&6
 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -4851,7 +6308,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-l$cf_curs_lib  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 4854 "configure"
+#line 6311 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -4870,16 +6327,16 @@ initscr ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:4873: \"$ac_link\"") >&5
+if { (eval echo "$as_me:6330: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:4876: \$? = $ac_status" >&5
+  echo "$as_me:6333: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:4879: \"$ac_try\"") >&5
+  { (eval echo "$as_me:6336: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:4882: \$? = $ac_status" >&5
+  echo "$as_me:6339: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   eval "$as_ac_Lib=yes"
 else
@@ -4890,23 +6347,23 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:4893: result: `eval echo '${'$as_ac_Lib'}'`" >&5
+echo "$as_me:6350: result: `eval echo '${'$as_ac_Lib'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
   break
 fi
 
     done
-    test $cf_curs_lib = unknown && { { echo "$as_me:4900: error: no curses library found" >&5
+    test $cf_curs_lib = unknown && { { echo "$as_me:6357: error: no curses library found" >&5
 echo "$as_me: error: no curses library found" >&2;}
    { (exit 1); exit 1; }; }
 
     LIBS="-l$cf_curs_lib $cf_save_LIBS"
     if test "$cf_term_lib" = unknown ; then
-        echo "$as_me:4906: checking if we can link with $cf_curs_lib library" >&5
+        echo "$as_me:6363: checking if we can link with $cf_curs_lib library" >&5
 echo $ECHO_N "checking if we can link with $cf_curs_lib library... $ECHO_C" >&6
         cat >conftest.$ac_ext <<_ACEOF
-#line 4909 "configure"
+#line 6366 "configure"
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header:-curses.h}>
 int
@@ -4918,16 +6375,16 @@ initscr()
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:4921: \"$ac_link\"") >&5
+if { (eval echo "$as_me:6378: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:4924: \$? = $ac_status" >&5
+  echo "$as_me:6381: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:4927: \"$ac_try\"") >&5
+  { (eval echo "$as_me:6384: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:4930: \$? = $ac_status" >&5
+  echo "$as_me:6387: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_result=yes
 else
@@ -4936,18 +6393,18 @@ cat conftest.$ac_ext >&5
 cf_result=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-        echo "$as_me:4939: result: $cf_result" >&5
+        echo "$as_me:6396: result: $cf_result" >&5
 echo "${ECHO_T}$cf_result" >&6
-        test $cf_result = no && { { echo "$as_me:4941: error: Cannot link curses library" >&5
+        test $cf_result = no && { { echo "$as_me:6398: error: Cannot link curses library" >&5
 echo "$as_me: error: Cannot link curses library" >&2;}
    { (exit 1); exit 1; }; }
     elif test "$cf_curs_lib" = "$cf_term_lib" ; then
         :
     elif test "$cf_term_lib" != predefined ; then
-        echo "$as_me:4947: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
+        echo "$as_me:6404: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
 echo $ECHO_N "checking if we need both $cf_curs_lib and $cf_term_lib libraries... $ECHO_C" >&6
         cat >conftest.$ac_ext <<_ACEOF
-#line 4950 "configure"
+#line 6407 "configure"
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header:-curses.h}>
 int
@@ -4959,16 +6416,16 @@ initscr(); tgoto((char *)0, 0, 0);
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:4962: \"$ac_link\"") >&5
+if { (eval echo "$as_me:6419: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:4965: \$? = $ac_status" >&5
+  echo "$as_me:6422: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:4968: \"$ac_try\"") >&5
+  { (eval echo "$as_me:6425: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:4971: \$? = $ac_status" >&5
+  echo "$as_me:6428: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_result=no
 else
@@ -4977,7 +6434,7 @@ cat conftest.$ac_ext >&5
 
             LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
             cat >conftest.$ac_ext <<_ACEOF
-#line 4980 "configure"
+#line 6437 "configure"
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header:-curses.h}>
 int
@@ -4989,16 +6446,16 @@ initscr()
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:4992: \"$ac_link\"") >&5
+if { (eval echo "$as_me:6449: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:4995: \$? = $ac_status" >&5
+  echo "$as_me:6452: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:4998: \"$ac_try\"") >&5
+  { (eval echo "$as_me:6455: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:5001: \$? = $ac_status" >&5
+  echo "$as_me:6458: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_result=yes
 else
@@ -5010,60 +6467,99 @@ rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-        echo "$as_me:5013: result: $cf_result" >&5
+        echo "$as_me:6470: result: $cf_result" >&5
 echo "${ECHO_T}$cf_result" >&6
     fi
 fi
 fi
 
        ;;
-ncurses)
+ncurses) #(vi
 
 cf_ncuconfig_root=ncurses
 
 echo "Looking for ${cf_ncuconfig_root}-config"
-for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
+
+if test -n "$ac_tool_prefix"; then
+  for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+echo "$as_me:6488: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$NCURSES_CONFIG"; then
+  ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
+else
+  ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+  IFS=$ac_save_IFS
+  test -z "$ac_dir" && ac_dir=.
+  $as_executable_p "$ac_dir/$ac_word" || continue
+ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
+echo "$as_me:6503: found $ac_dir/$ac_word" >&5
+break
+done
+
+fi
+fi
+NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
+if test -n "$NCURSES_CONFIG"; then
+  echo "$as_me:6511: result: $NCURSES_CONFIG" >&5
+echo "${ECHO_T}$NCURSES_CONFIG" >&6
+else
+  echo "$as_me:6514: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+    test -n "$NCURSES_CONFIG" && break
+  done
+fi
+if test -z "$NCURSES_CONFIG"; then
+  ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
+  for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-echo "$as_me:5029: checking for $ac_word" >&5
+echo "$as_me:6527: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_path_NCURSES_CONFIG+set}" = set; then
+if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  case $NCURSES_CONFIG in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test with a path.
-  ;;
-  *)
+  if test -n "$ac_ct_NCURSES_CONFIG"; then
+  ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
+else
   ac_save_IFS=$IFS; IFS=$ac_path_separator
 ac_dummy="$PATH"
 for ac_dir in $ac_dummy; do
   IFS=$ac_save_IFS
   test -z "$ac_dir" && ac_dir=.
-  if $as_executable_p "$ac_dir/$ac_word"; then
-   ac_cv_path_NCURSES_CONFIG="$ac_dir/$ac_word"
-   echo "$as_me:5046: found $ac_dir/$ac_word" >&5
-   break
-fi
+  $as_executable_p "$ac_dir/$ac_word" || continue
+ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
+echo "$as_me:6542: found $ac_dir/$ac_word" >&5
+break
 done
 
-  ;;
-esac
 fi
-NCURSES_CONFIG=$ac_cv_path_NCURSES_CONFIG
-
-if test -n "$NCURSES_CONFIG"; then
-  echo "$as_me:5057: result: $NCURSES_CONFIG" >&5
-echo "${ECHO_T}$NCURSES_CONFIG" >&6
+fi
+ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
+if test -n "$ac_ct_NCURSES_CONFIG"; then
+  echo "$as_me:6550: result: $ac_ct_NCURSES_CONFIG" >&5
+echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
 else
-  echo "$as_me:5060: result: no" >&5
+  echo "$as_me:6553: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
-  test -n "$NCURSES_CONFIG" && break
+  test -n "$ac_ct_NCURSES_CONFIG" && break
 done
-test -n "$NCURSES_CONFIG" || NCURSES_CONFIG="none"
+test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
+
+  NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
+fi
 
 if test "$NCURSES_CONFIG" != none ; then
 
@@ -5072,7 +6568,7 @@ LIBS="`$NCURSES_CONFIG --libs` $LIBS"
 
 # even with config script, some packages use no-override for curses.h
 
-echo "$as_me:5075: checking if we have identified curses headers" >&5
+echo "$as_me:6571: checking if we have identified curses headers" >&5
 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
 if test "${cf_cv_ncurses_header+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -5080,13 +6576,13 @@ else
 
 cf_cv_ncurses_header=none
 for cf_header in  \
-    ncurses/curses.h \
-       ncurses/ncurses.h \
-       curses.h \
-       ncurses.h
+    ncurses/ncurses.h \
+       ncurses/curses.h \
+       ncurses.h \
+       curses.h
 do
 cat >conftest.$ac_ext <<_ACEOF
-#line 5089 "configure"
+#line 6585 "configure"
 #include "confdefs.h"
 #include <${cf_header}>
 int
@@ -5098,16 +6594,16 @@ initscr(); tgoto("?", 0,0)
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:5101: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:6597: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:5104: \$? = $ac_status" >&5
+  echo "$as_me:6600: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:5107: \"$ac_try\"") >&5
+  { (eval echo "$as_me:6603: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:5110: \$? = $ac_status" >&5
+  echo "$as_me:6606: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_ncurses_header=$cf_header; break
 else
@@ -5118,11 +6614,11 @@ rm -f conftest.$ac_objext conftest.$ac_ext
 done
 
 fi
-echo "$as_me:5121: result: $cf_cv_ncurses_header" >&5
+echo "$as_me:6617: result: $cf_cv_ncurses_header" >&5
 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
 
 if test "$cf_cv_ncurses_header" = none ; then
-       { { echo "$as_me:5125: error: No curses header-files found" >&5
+       { { echo "$as_me:6621: error: No curses header-files found" >&5
 echo "$as_me: error: No curses header-files found" >&2;}
    { (exit 1); exit 1; }; }
 fi
@@ -5132,23 +6628,23 @@ fi
 for ac_header in $cf_cv_ncurses_header
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-echo "$as_me:5135: checking for $ac_header" >&5
+echo "$as_me:6631: checking for $ac_header" >&5
 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
 if eval "test \"\${$as_ac_Header+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 5141 "configure"
+#line 6637 "configure"
 #include "confdefs.h"
 #include <$ac_header>
 _ACEOF
-if { (eval echo "$as_me:5145: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:6641: \"$ac_cpp conftest.$ac_ext\"") >&5
   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
   ac_status=$?
   egrep -v '^ *\+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:5151: \$? = $ac_status" >&5
+  echo "$as_me:6647: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
@@ -5167,7 +6663,7 @@ else
 fi
 rm -f conftest.err conftest.$ac_ext
 fi
-echo "$as_me:5170: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "$as_me:6666: result: `eval echo '${'$as_ac_Header'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
 if test `eval echo '${'$as_ac_Header'}'` = yes; then
   cat >>confdefs.h <<EOF
@@ -5196,8 +6692,8 @@ cf_ncuhdr_root=ncurses
 test -n "$cf_cv_curses_dir" && \
 test "$cf_cv_curses_dir" != "no" && { \
 
-if test -n "$cf_cv_curses_dir/include $cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
-  for cf_add_incdir in $cf_cv_curses_dir/include $cf_cv_curses_dir/include/$cf_ncuhdr_root
+if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
+  for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
   do
        while test $cf_add_incdir != /usr/include
        do
@@ -5220,7 +6716,7 @@ if test -n "$cf_cv_curses_dir/include $cf_cv_curses_dir/include/$cf_ncuhdr_root"
                          cf_save_CPPFLAGS=$CPPFLAGS
                          CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
                          cat >conftest.$ac_ext <<_ACEOF
-#line 5223 "configure"
+#line 6719 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 int
@@ -5232,16 +6728,16 @@ printf("Hello")
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:5235: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:6731: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:5238: \$? = $ac_status" >&5
+  echo "$as_me:6734: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:5241: \"$ac_try\"") >&5
+  { (eval echo "$as_me:6737: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:5244: \$? = $ac_status" >&5
+  echo "$as_me:6740: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   :
 else
@@ -5258,7 +6754,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext
                if test "$cf_have_incdir" = no ; then
                  test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
 
-echo "${as_me:-configure}:5261: testing adding $cf_add_incdir to include-path ..." 1>&5
+echo "${as_me:-configure}:6757: testing adding $cf_add_incdir to include-path ..." 1>&5
 
                  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
 
@@ -5275,7 +6771,7 @@ fi
 
 }
 
-echo "$as_me:5278: checking for $cf_ncuhdr_root header in include-path" >&5
+echo "$as_me:6774: checking for $cf_ncuhdr_root header in include-path" >&5
 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
 if test "${cf_cv_ncurses_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -5287,7 +6783,7 @@ else
        do
 
        cat >conftest.$ac_ext <<_ACEOF
-#line 5290 "configure"
+#line 6786 "configure"
 #include "confdefs.h"
 
 #include <$cf_header>
@@ -5311,16 +6807,16 @@ printf("old\n");
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:5314: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:6810: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:5317: \$? = $ac_status" >&5
+  echo "$as_me:6813: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:5320: \"$ac_try\"") >&5
+  { (eval echo "$as_me:6816: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:5323: \$? = $ac_status" >&5
+  echo "$as_me:6819: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_ncurses_h=$cf_header
 
@@ -5335,14 +6831,14 @@ rm -f conftest.$ac_objext conftest.$ac_ext
        done
 
 fi
-echo "$as_me:5338: result: $cf_cv_ncurses_h" >&5
+echo "$as_me:6834: result: $cf_cv_ncurses_h" >&5
 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
 
 if test "$cf_cv_ncurses_h" != no ; then
        cf_cv_ncurses_header=$cf_cv_ncurses_h
 else
 
-echo "$as_me:5345: checking for $cf_ncuhdr_root include-path" >&5
+echo "$as_me:6841: checking for $cf_ncuhdr_root include-path" >&5
 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
 if test "${cf_cv_ncurses_h2+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -5482,7 +6978,7 @@ if test -n "$cf_incdir" ; then
                          cf_save_CPPFLAGS=$CPPFLAGS
                          CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
                          cat >conftest.$ac_ext <<_ACEOF
-#line 5485 "configure"
+#line 6981 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 int
@@ -5494,16 +6990,16 @@ printf("Hello")
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:5497: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:6993: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:5500: \$? = $ac_status" >&5
+  echo "$as_me:6996: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:5503: \"$ac_try\"") >&5
+  { (eval echo "$as_me:6999: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:5506: \$? = $ac_status" >&5
+  echo "$as_me:7002: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   :
 else
@@ -5520,7 +7016,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext
                if test "$cf_have_incdir" = no ; then
                  test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
 
-echo "${as_me:-configure}:5523: testing adding $cf_add_incdir to include-path ..." 1>&5
+echo "${as_me:-configure}:7019: testing adding $cf_add_incdir to include-path ..." 1>&5
 
                  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
 
@@ -5541,7 +7037,7 @@ fi
                do
 
        cat >conftest.$ac_ext <<_ACEOF
-#line 5544 "configure"
+#line 7040 "configure"
 #include "confdefs.h"
 
 #include <$cf_header>
@@ -5565,16 +7061,16 @@ printf("old\n");
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:5568: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:7064: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:5571: \$? = $ac_status" >&5
+  echo "$as_me:7067: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:5574: \"$ac_try\"") >&5
+  { (eval echo "$as_me:7070: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:5577: \$? = $ac_status" >&5
+  echo "$as_me:7073: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_ncurses_h2=$cf_header
 
@@ -5595,12 +7091,12 @@ rm -f conftest.$ac_objext conftest.$ac_ext
                CPPFLAGS="$cf_save2_CPPFLAGS"
                test "$cf_cv_ncurses_h2" != no && break
        done
-       test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:5598: error: not found" >&5
+       test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:7094: error: not found" >&5
 echo "$as_me: error: not found" >&2;}
    { (exit 1); exit 1; }; }
 
 fi
-echo "$as_me:5603: result: $cf_cv_ncurses_h2" >&5
+echo "$as_me:7099: result: $cf_cv_ncurses_h2" >&5
 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
 
        cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
@@ -5633,7 +7129,7 @@ if test -n "$cf_1st_incdir" ; then
                          cf_save_CPPFLAGS=$CPPFLAGS
                          CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
                          cat >conftest.$ac_ext <<_ACEOF
-#line 5636 "configure"
+#line 7132 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 int
@@ -5645,16 +7141,16 @@ printf("Hello")
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:5648: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:7144: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:5651: \$? = $ac_status" >&5
+  echo "$as_me:7147: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:5654: \"$ac_try\"") >&5
+  { (eval echo "$as_me:7150: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:5657: \$? = $ac_status" >&5
+  echo "$as_me:7153: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   :
 else
@@ -5671,7 +7167,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext
                if test "$cf_have_incdir" = no ; then
                  test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
 
-echo "${as_me:-configure}:5674: testing adding $cf_add_incdir to include-path ..." 1>&5
+echo "${as_me:-configure}:7170: testing adding $cf_add_incdir to include-path ..." 1>&5
 
                  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
 
@@ -5714,7 +7210,7 @@ EOF
        ;;
 esac
 
-echo "$as_me:5717: checking for terminfo header" >&5
+echo "$as_me:7213: checking for terminfo header" >&5
 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
 if test "${cf_cv_term_header+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -5732,7 +7228,7 @@ esac
 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
 do
 cat >conftest.$ac_ext <<_ACEOF
-#line 5735 "configure"
+#line 7231 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 #include <${cf_cv_ncurses_header:-curses.h}>
@@ -5747,16 +7243,16 @@ int x = auto_left_margin
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:5750: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:7246: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:5753: \$? = $ac_status" >&5
+  echo "$as_me:7249: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:5756: \"$ac_try\"") >&5
+  { (eval echo "$as_me:7252: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:5759: \$? = $ac_status" >&5
+  echo "$as_me:7255: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
        cf_cv_term_header="$cf_test"
@@ -5772,7 +7268,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext
 done
 
 fi
-echo "$as_me:5775: result: $cf_cv_term_header" >&5
+echo "$as_me:7271: result: $cf_cv_term_header" >&5
 echo "${ECHO_T}$cf_cv_term_header" >&6
 
 # Set definitions to allow ifdef'ing to accommodate subdirectories
@@ -5806,7 +7302,7 @@ cat >>confdefs.h <<\EOF
 #define NCURSES 1
 EOF
 
-echo "$as_me:5809: checking for ncurses version" >&5
+echo "$as_me:7305: checking for ncurses version" >&5
 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
 if test "${cf_cv_ncurses_version+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -5832,10 +7328,10 @@ Autoconf "old"
 #endif
 EOF
        cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
-       { (eval echo "$as_me:5835: \"$cf_try\"") >&5
+       { (eval echo "$as_me:7331: \"$cf_try\"") >&5
   (eval $cf_try) 2>&5
   ac_status=$?
-  echo "$as_me:5838: \$? = $ac_status" >&5
+  echo "$as_me:7334: \$? = $ac_status" >&5
   (exit $ac_status); }
        if test -f conftest.out ; then
                cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
@@ -5845,7 +7341,7 @@ EOF
 
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 5848 "configure"
+#line 7344 "configure"
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header:-curses.h}>
@@ -5870,15 +7366,15 @@ int main()
 }
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:5873: \"$ac_link\"") >&5
+if { (eval echo "$as_me:7369: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:5876: \$? = $ac_status" >&5
+  echo "$as_me:7372: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:5878: \"$ac_try\"") >&5
+  { (eval echo "$as_me:7374: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:5881: \$? = $ac_status" >&5
+  echo "$as_me:7377: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
        cf_cv_ncurses_version=`cat $cf_tempfile`
@@ -5892,7 +7388,7 @@ fi
        rm -f $cf_tempfile
 
 fi
-echo "$as_me:5895: result: $cf_cv_ncurses_version" >&5
+echo "$as_me:7391: result: $cf_cv_ncurses_version" >&5
 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
 test "$cf_cv_ncurses_version" = no || cat >>confdefs.h <<\EOF
 #define NCURSES 1
@@ -5904,7 +7400,7 @@ cf_nculib_root=ncurses
        # to link gpm.
 cf_ncurses_LIBS=""
 cf_ncurses_SAVE="$LIBS"
-echo "$as_me:5907: checking for Gpm_Open in -lgpm" >&5
+echo "$as_me:7403: checking for Gpm_Open in -lgpm" >&5
 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -5912,7 +7408,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lgpm  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 5915 "configure"
+#line 7411 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -5931,16 +7427,16 @@ Gpm_Open ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:5934: \"$ac_link\"") >&5
+if { (eval echo "$as_me:7430: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:5937: \$? = $ac_status" >&5
+  echo "$as_me:7433: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:5940: \"$ac_try\"") >&5
+  { (eval echo "$as_me:7436: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:5943: \$? = $ac_status" >&5
+  echo "$as_me:7439: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_gpm_Gpm_Open=yes
 else
@@ -5951,10 +7447,10 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:5954: result: $ac_cv_lib_gpm_Gpm_Open" >&5
+echo "$as_me:7450: result: $ac_cv_lib_gpm_Gpm_Open" >&5
 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
-  echo "$as_me:5957: checking for initscr in -lgpm" >&5
+  echo "$as_me:7453: checking for initscr in -lgpm" >&5
 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -5962,7 +7458,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lgpm  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 5965 "configure"
+#line 7461 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -5981,16 +7477,16 @@ initscr ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:5984: \"$ac_link\"") >&5
+if { (eval echo "$as_me:7480: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:5987: \$? = $ac_status" >&5
+  echo "$as_me:7483: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:5990: \"$ac_try\"") >&5
+  { (eval echo "$as_me:7486: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:5993: \$? = $ac_status" >&5
+  echo "$as_me:7489: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_gpm_initscr=yes
 else
@@ -6001,7 +7497,7 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:6004: result: $ac_cv_lib_gpm_initscr" >&5
+echo "$as_me:7500: result: $ac_cv_lib_gpm_initscr" >&5
 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
 if test $ac_cv_lib_gpm_initscr = yes; then
   LIBS="$cf_ncurses_SAVE"
@@ -6016,7 +7512,7 @@ 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 "$as_me:6019: checking for tgoto in -lmytinfo" >&5
+               echo "$as_me:7515: checking for tgoto in -lmytinfo" >&5
 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -6024,7 +7520,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lmytinfo  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 6027 "configure"
+#line 7523 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -6043,16 +7539,16 @@ tgoto ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:6046: \"$ac_link\"") >&5
+if { (eval echo "$as_me:7542: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:6049: \$? = $ac_status" >&5
+  echo "$as_me:7545: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:6052: \"$ac_try\"") >&5
+  { (eval echo "$as_me:7548: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:6055: \$? = $ac_status" >&5
+  echo "$as_me:7551: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_mytinfo_tgoto=yes
 else
@@ -6063,7 +7559,7 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:6066: result: $ac_cv_lib_mytinfo_tgoto" >&5
+echo "$as_me:7562: result: $ac_cv_lib_mytinfo_tgoto" >&5
 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
 if test $ac_cv_lib_mytinfo_tgoto = yes; then
   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
@@ -6077,46 +7573,18 @@ LIBS="$cf_ncurses_LIBS $LIBS"
 
 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
 then
-
-if test -n "$cf_cv_curses_dir/lib" ; then
-  for cf_add_libdir in $cf_cv_curses_dir/lib
-  do
-    if test $cf_add_libdir = /usr/lib ; then
-      :
-    elif test -d $cf_add_libdir
-    then
-      cf_have_libdir=no
-      if test -n "$LDFLAGS$LIBS" ; then
-        # a loop is needed to ensure we can add subdirs of existing dirs
-        for cf_test_libdir in $LDFLAGS $LIBS ; do
-          if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
-            cf_have_libdir=yes; break
-          fi
-        done
-      fi
-      if test "$cf_have_libdir" = no ; then
-        test -n "$verbose" && echo "   adding $cf_add_libdir to library-path" 1>&6
-
-echo "${as_me:-configure}:6100: testing adding $cf_add_libdir to library-path ..." 1>&5
-
-        LDFLAGS="-L$cf_add_libdir $LDFLAGS"
-      fi
-    fi
-  done
-fi
-
        LIBS="-l$cf_nculib_root $LIBS"
 else
 
        eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
        cf_libdir=""
-       echo "$as_me:6113: checking for initscr" >&5
+       echo "$as_me:7581: checking for initscr" >&5
 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
 if test "${ac_cv_func_initscr+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 6119 "configure"
+#line 7587 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char initscr (); below.  */
@@ -6139,7 +7607,7 @@ main ()
 #if defined (__stub_initscr) || defined (__stub___initscr)
 choke me
 #else
-f = initscr;
+f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
 #endif
 
   ;
@@ -6147,16 +7615,16 @@ f = initscr;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:6150: \"$ac_link\"") >&5
+if { (eval echo "$as_me:7618: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:6153: \$? = $ac_status" >&5
+  echo "$as_me:7621: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:6156: \"$ac_try\"") >&5
+  { (eval echo "$as_me:7624: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:6159: \$? = $ac_status" >&5
+  echo "$as_me:7627: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_func_initscr=yes
 else
@@ -6166,18 +7634,18 @@ ac_cv_func_initscr=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:6169: result: $ac_cv_func_initscr" >&5
+echo "$as_me:7637: result: $ac_cv_func_initscr" >&5
 echo "${ECHO_T}$ac_cv_func_initscr" >&6
 if test $ac_cv_func_initscr = yes; then
   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
 else
 
                cf_save_LIBS="$LIBS"
-               echo "$as_me:6176: checking for initscr in -l$cf_nculib_root" >&5
+               echo "$as_me:7644: checking for initscr in -l$cf_nculib_root" >&5
 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
                LIBS="-l$cf_nculib_root $LIBS"
                cat >conftest.$ac_ext <<_ACEOF
-#line 6180 "configure"
+#line 7648 "configure"
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header:-curses.h}>
 int
@@ -6189,25 +7657,25 @@ initscr()
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:6192: \"$ac_link\"") >&5
+if { (eval echo "$as_me:7660: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:6195: \$? = $ac_status" >&5
+  echo "$as_me:7663: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:6198: \"$ac_try\"") >&5
+  { (eval echo "$as_me:7666: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:6201: \$? = $ac_status" >&5
+  echo "$as_me:7669: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  echo "$as_me:6203: result: yes" >&5
+  echo "$as_me:7671: result: yes" >&5
 echo "${ECHO_T}yes" >&6
                         eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
 
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
-echo "$as_me:6210: result: no" >&5
+echo "$as_me:7678: result: no" >&5
 echo "${ECHO_T}no" >&6
 
 cf_search=
@@ -6297,11 +7765,11 @@ cf_search="$cf_library_path_list $cf_search"
 
                        for cf_libdir in $cf_search
                        do
-                               echo "$as_me:6300: checking for -l$cf_nculib_root in $cf_libdir" >&5
+                               echo "$as_me:7768: checking for -l$cf_nculib_root in $cf_libdir" >&5
 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
                                LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
                                cat >conftest.$ac_ext <<_ACEOF
-#line 6304 "configure"
+#line 7772 "configure"
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header:-curses.h}>
 int
@@ -6313,25 +7781,25 @@ initscr()
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:6316: \"$ac_link\"") >&5
+if { (eval echo "$as_me:7784: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:6319: \$? = $ac_status" >&5
+  echo "$as_me:7787: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:6322: \"$ac_try\"") >&5
+  { (eval echo "$as_me:7790: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:6325: \$? = $ac_status" >&5
+  echo "$as_me:7793: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  echo "$as_me:6327: result: yes" >&5
+  echo "$as_me:7795: result: yes" >&5
 echo "${ECHO_T}yes" >&6
                                         eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
                                         break
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
-echo "$as_me:6334: result: no" >&5
+echo "$as_me:7802: result: no" >&5
 echo "${ECHO_T}no" >&6
                                         LIBS="$cf_save_LIBS"
 fi
@@ -6346,7 +7814,7 @@ fi
 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
 
 if test $cf_found_library = no ; then
-       { { echo "$as_me:6349: error: Cannot link $cf_nculib_root library" >&5
+       { { echo "$as_me:7817: error: Cannot link $cf_nculib_root library" >&5
 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
    { (exit 1); exit 1; }; }
 fi
@@ -6354,7 +7822,7 @@ fi
 fi
 
 if test -n "$cf_ncurses_LIBS" ; then
-       echo "$as_me:6357: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
+       echo "$as_me:7825: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
        cf_ncurses_SAVE="$LIBS"
        for p in $cf_ncurses_LIBS ; do
@@ -6364,7 +7832,7 @@ echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS..
                fi
        done
        cat >conftest.$ac_ext <<_ACEOF
-#line 6367 "configure"
+#line 7835 "configure"
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header:-curses.h}>
 int
@@ -6376,23 +7844,23 @@ initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:6379: \"$ac_link\"") >&5
+if { (eval echo "$as_me:7847: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:6382: \$? = $ac_status" >&5
+  echo "$as_me:7850: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:6385: \"$ac_try\"") >&5
+  { (eval echo "$as_me:7853: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:6388: \$? = $ac_status" >&5
+  echo "$as_me:7856: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  echo "$as_me:6390: result: yes" >&5
+  echo "$as_me:7858: result: yes" >&5
 echo "${ECHO_T}yes" >&6
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
-echo "$as_me:6395: result: no" >&5
+echo "$as_me:7863: result: no" >&5
 echo "${ECHO_T}no" >&6
                 LIBS="$cf_ncurses_SAVE"
 fi
@@ -6408,10 +7876,9 @@ EOF
 fi
 
        ;;
-ncursesw)
-       cf_cv_libtype=w
+ncursesw) #(vi
 
-echo "$as_me:6414: checking for multibyte character support" >&5
+echo "$as_me:7881: checking for multibyte character support" >&5
 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
 if test "${cf_cv_utf8_lib+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -6419,7 +7886,7 @@ else
 
        cf_save_LIBS="$LIBS"
        cat >conftest.$ac_ext <<_ACEOF
-#line 6422 "configure"
+#line 7889 "configure"
 #include "confdefs.h"
 
 #include <stdlib.h>
@@ -6432,16 +7899,16 @@ putwc(0,0);
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:6435: \"$ac_link\"") >&5
+if { (eval echo "$as_me:7902: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:6438: \$? = $ac_status" >&5
+  echo "$as_me:7905: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:6441: \"$ac_try\"") >&5
+  { (eval echo "$as_me:7908: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:6444: \$? = $ac_status" >&5
+  echo "$as_me:7911: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_utf8_lib=yes
 else
@@ -6453,12 +7920,12 @@ cat conftest.$ac_ext >&5
 cf_cv_header_path_utf8=
 cf_cv_library_path_utf8=
 
-echo "${as_me:-configure}:6456: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
+echo "${as_me:-configure}:7923: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
 
 cf_save_LIBS="$LIBS"
 
 cat >conftest.$ac_ext <<_ACEOF
-#line 6461 "configure"
+#line 7928 "configure"
 #include "confdefs.h"
 
 #include <libutf8.h>
@@ -6471,16 +7938,16 @@ putwc(0,0);
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:6474: \"$ac_link\"") >&5
+if { (eval echo "$as_me:7941: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:6477: \$? = $ac_status" >&5
+  echo "$as_me:7944: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:6480: \"$ac_try\"") >&5
+  { (eval echo "$as_me:7947: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:6483: \$? = $ac_status" >&5
+  echo "$as_me:7950: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
        cf_cv_find_linkage_utf8=yes
@@ -6494,7 +7961,7 @@ cat conftest.$ac_ext >&5
 LIBS="-lutf8  $cf_save_LIBS"
 
 cat >conftest.$ac_ext <<_ACEOF
-#line 6497 "configure"
+#line 7964 "configure"
 #include "confdefs.h"
 
 #include <libutf8.h>
@@ -6507,16 +7974,16 @@ putwc(0,0);
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:6510: \"$ac_link\"") >&5
+if { (eval echo "$as_me:7977: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:6513: \$? = $ac_status" >&5
+  echo "$as_me:7980: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:6516: \"$ac_try\"") >&5
+  { (eval echo "$as_me:7983: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:6519: \$? = $ac_status" >&5
+  echo "$as_me:7986: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
        cf_cv_find_linkage_utf8=yes
@@ -6533,9 +8000,9 @@ cat conftest.$ac_ext >&5
 
     test -n "$verbose" && echo "       find linkage for utf8 library" 1>&6
 
-echo "${as_me:-configure}:6536: testing find linkage for utf8 library ..." 1>&5
+echo "${as_me:-configure}:8003: testing find linkage for utf8 library ..." 1>&5
 
-echo "${as_me:-configure}:6538: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
+echo "${as_me:-configure}:8005: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
 
     cf_save_CPPFLAGS="$CPPFLAGS"
     cf_test_CPPFLAGS="$CPPFLAGS"
@@ -6648,11 +8115,11 @@ cf_search="$cf_search $cf_header_path_list"
       if test -d $cf_cv_header_path_utf8 ; then
         test -n "$verbose" && echo "   ... testing $cf_cv_header_path_utf8" 1>&6
 
-echo "${as_me:-configure}:6651: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
+echo "${as_me:-configure}:8118: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
 
         CPPFLAGS="$cf_save_CPPFLAGS -I$cf_cv_header_path_utf8"
         cat >conftest.$ac_ext <<_ACEOF
-#line 6655 "configure"
+#line 8122 "configure"
 #include "confdefs.h"
 
 #include <libutf8.h>
@@ -6665,21 +8132,21 @@ putwc(0,0);
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:6668: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:8135: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:6671: \$? = $ac_status" >&5
+  echo "$as_me:8138: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:6674: \"$ac_try\"") >&5
+  { (eval echo "$as_me:8141: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:6677: \$? = $ac_status" >&5
+  echo "$as_me:8144: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
             test -n "$verbose" && echo "       ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
 
-echo "${as_me:-configure}:6682: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
+echo "${as_me:-configure}:8149: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
 
             cf_cv_find_linkage_utf8=maybe
             cf_test_CPPFLAGS="$CPPFLAGS"
@@ -6697,7 +8164,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext
 
     if test "$cf_cv_find_linkage_utf8" = maybe ; then
 
-echo "${as_me:-configure}:6700: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
+echo "${as_me:-configure}:8167: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
 
       cf_save_LIBS="$LIBS"
       cf_save_LDFLAGS="$LDFLAGS"
@@ -6794,13 +8261,13 @@ cf_search="$cf_library_path_list $cf_search"
           if test -d $cf_cv_library_path_utf8 ; then
             test -n "$verbose" && echo "       ... testing $cf_cv_library_path_utf8" 1>&6
 
-echo "${as_me:-configure}:6797: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
+echo "${as_me:-configure}:8264: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
 
             CPPFLAGS="$cf_test_CPPFLAGS"
             LIBS="-lutf8  $cf_save_LIBS"
             LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
             cat >conftest.$ac_ext <<_ACEOF
-#line 6803 "configure"
+#line 8270 "configure"
 #include "confdefs.h"
 
 #include <libutf8.h>
@@ -6813,21 +8280,21 @@ putwc(0,0);
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:6816: \"$ac_link\"") >&5
+if { (eval echo "$as_me:8283: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:6819: \$? = $ac_status" >&5
+  echo "$as_me:8286: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:6822: \"$ac_try\"") >&5
+  { (eval echo "$as_me:8289: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:6825: \$? = $ac_status" >&5
+  echo "$as_me:8292: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
                 test -n "$verbose" && echo "   ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
 
-echo "${as_me:-configure}:6830: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
+echo "${as_me:-configure}:8297: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
 
                 cf_cv_find_linkage_utf8=yes
                 cf_cv_library_file_utf8="-lutf8"
@@ -6869,7 +8336,7 @@ fi
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:6872: result: $cf_cv_utf8_lib" >&5
+echo "$as_me:8339: result: $cf_cv_utf8_lib" >&5
 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
 
 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
@@ -6903,7 +8370,7 @@ if test -n "$cf_cv_header_path_utf8" ; then
                          cf_save_CPPFLAGS=$CPPFLAGS
                          CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
                          cat >conftest.$ac_ext <<_ACEOF
-#line 6906 "configure"
+#line 8373 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 int
@@ -6915,16 +8382,16 @@ printf("Hello")
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:6918: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:8385: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:6921: \$? = $ac_status" >&5
+  echo "$as_me:8388: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:6924: \"$ac_try\"") >&5
+  { (eval echo "$as_me:8391: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:6927: \$? = $ac_status" >&5
+  echo "$as_me:8394: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   :
 else
@@ -6941,7 +8408,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext
                if test "$cf_have_incdir" = no ; then
                  test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
 
-echo "${as_me:-configure}:6944: testing adding $cf_add_incdir to include-path ..." 1>&5
+echo "${as_me:-configure}:8411: testing adding $cf_add_incdir to include-path ..." 1>&5
 
                  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
 
@@ -6975,7 +8442,7 @@ if test -n "$cf_cv_library_path_utf8" ; then
       if test "$cf_have_libdir" = no ; then
         test -n "$verbose" && echo "   adding $cf_add_libdir to library-path" 1>&6
 
-echo "${as_me:-configure}:6978: testing adding $cf_add_libdir to library-path ..." 1>&5
+echo "${as_me:-configure}:8445: testing adding $cf_add_libdir to library-path ..." 1>&5
 
         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
       fi
@@ -6988,49 +8455,88 @@ fi
 
 cf_ncuconfig_root=ncursesw
 
-echo "Looking for ${cf_ncuconfig_root}-config"
-for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
+echo "Looking for ${cf_ncuconfig_root}-config"
+
+if test -n "$ac_tool_prefix"; then
+  for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+echo "$as_me:8465: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$NCURSES_CONFIG"; then
+  ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
+else
+  ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+  IFS=$ac_save_IFS
+  test -z "$ac_dir" && ac_dir=.
+  $as_executable_p "$ac_dir/$ac_word" || continue
+ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
+echo "$as_me:8480: found $ac_dir/$ac_word" >&5
+break
+done
+
+fi
+fi
+NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
+if test -n "$NCURSES_CONFIG"; then
+  echo "$as_me:8488: result: $NCURSES_CONFIG" >&5
+echo "${ECHO_T}$NCURSES_CONFIG" >&6
+else
+  echo "$as_me:8491: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+    test -n "$NCURSES_CONFIG" && break
+  done
+fi
+if test -z "$NCURSES_CONFIG"; then
+  ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
+  for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-echo "$as_me:6996: checking for $ac_word" >&5
+echo "$as_me:8504: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_path_NCURSES_CONFIG+set}" = set; then
+if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  case $NCURSES_CONFIG in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test with a path.
-  ;;
-  *)
+  if test -n "$ac_ct_NCURSES_CONFIG"; then
+  ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
+else
   ac_save_IFS=$IFS; IFS=$ac_path_separator
 ac_dummy="$PATH"
 for ac_dir in $ac_dummy; do
   IFS=$ac_save_IFS
   test -z "$ac_dir" && ac_dir=.
-  if $as_executable_p "$ac_dir/$ac_word"; then
-   ac_cv_path_NCURSES_CONFIG="$ac_dir/$ac_word"
-   echo "$as_me:7013: found $ac_dir/$ac_word" >&5
-   break
-fi
+  $as_executable_p "$ac_dir/$ac_word" || continue
+ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
+echo "$as_me:8519: found $ac_dir/$ac_word" >&5
+break
 done
 
-  ;;
-esac
 fi
-NCURSES_CONFIG=$ac_cv_path_NCURSES_CONFIG
-
-if test -n "$NCURSES_CONFIG"; then
-  echo "$as_me:7024: result: $NCURSES_CONFIG" >&5
-echo "${ECHO_T}$NCURSES_CONFIG" >&6
+fi
+ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
+if test -n "$ac_ct_NCURSES_CONFIG"; then
+  echo "$as_me:8527: result: $ac_ct_NCURSES_CONFIG" >&5
+echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
 else
-  echo "$as_me:7027: result: no" >&5
+  echo "$as_me:8530: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
-  test -n "$NCURSES_CONFIG" && break
+  test -n "$ac_ct_NCURSES_CONFIG" && break
 done
-test -n "$NCURSES_CONFIG" || NCURSES_CONFIG="none"
+test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
+
+  NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
+fi
 
 if test "$NCURSES_CONFIG" != none ; then
 
@@ -7039,7 +8545,7 @@ LIBS="`$NCURSES_CONFIG --libs` $LIBS"
 
 # even with config script, some packages use no-override for curses.h
 
-echo "$as_me:7042: checking if we have identified curses headers" >&5
+echo "$as_me:8548: checking if we have identified curses headers" >&5
 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
 if test "${cf_cv_ncurses_header+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -7047,13 +8553,13 @@ else
 
 cf_cv_ncurses_header=none
 for cf_header in  \
-    ncursesw/curses.h \
-       ncursesw/ncurses.h \
-       curses.h \
-       ncurses.h
+    ncursesw/ncurses.h \
+       ncursesw/curses.h \
+       ncurses.h \
+       curses.h
 do
 cat >conftest.$ac_ext <<_ACEOF
-#line 7056 "configure"
+#line 8562 "configure"
 #include "confdefs.h"
 #include <${cf_header}>
 int
@@ -7065,16 +8571,16 @@ initscr(); tgoto("?", 0,0)
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:7068: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:8574: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:7071: \$? = $ac_status" >&5
+  echo "$as_me:8577: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:7074: \"$ac_try\"") >&5
+  { (eval echo "$as_me:8580: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:7077: \$? = $ac_status" >&5
+  echo "$as_me:8583: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_ncurses_header=$cf_header; break
 else
@@ -7085,11 +8591,11 @@ rm -f conftest.$ac_objext conftest.$ac_ext
 done
 
 fi
-echo "$as_me:7088: result: $cf_cv_ncurses_header" >&5
+echo "$as_me:8594: result: $cf_cv_ncurses_header" >&5
 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
 
 if test "$cf_cv_ncurses_header" = none ; then
-       { { echo "$as_me:7092: error: No curses header-files found" >&5
+       { { echo "$as_me:8598: error: No curses header-files found" >&5
 echo "$as_me: error: No curses header-files found" >&2;}
    { (exit 1); exit 1; }; }
 fi
@@ -7099,23 +8605,23 @@ fi
 for ac_header in $cf_cv_ncurses_header
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-echo "$as_me:7102: checking for $ac_header" >&5
+echo "$as_me:8608: checking for $ac_header" >&5
 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
 if eval "test \"\${$as_ac_Header+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 7108 "configure"
+#line 8614 "configure"
 #include "confdefs.h"
 #include <$ac_header>
 _ACEOF
-if { (eval echo "$as_me:7112: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:8618: \"$ac_cpp conftest.$ac_ext\"") >&5
   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
   ac_status=$?
   egrep -v '^ *\+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:7118: \$? = $ac_status" >&5
+  echo "$as_me:8624: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
@@ -7134,7 +8640,7 @@ else
 fi
 rm -f conftest.err conftest.$ac_ext
 fi
-echo "$as_me:7137: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "$as_me:8643: result: `eval echo '${'$as_ac_Header'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
 if test `eval echo '${'$as_ac_Header'}'` = yes; then
   cat >>confdefs.h <<EOF
@@ -7163,8 +8669,8 @@ cf_ncuhdr_root=ncursesw
 test -n "$cf_cv_curses_dir" && \
 test "$cf_cv_curses_dir" != "no" && { \
 
-if test -n "$cf_cv_curses_dir/include $cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
-  for cf_add_incdir in $cf_cv_curses_dir/include $cf_cv_curses_dir/include/$cf_ncuhdr_root
+if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
+  for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
   do
        while test $cf_add_incdir != /usr/include
        do
@@ -7187,7 +8693,7 @@ if test -n "$cf_cv_curses_dir/include $cf_cv_curses_dir/include/$cf_ncuhdr_root"
                          cf_save_CPPFLAGS=$CPPFLAGS
                          CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
                          cat >conftest.$ac_ext <<_ACEOF
-#line 7190 "configure"
+#line 8696 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 int
@@ -7199,16 +8705,16 @@ printf("Hello")
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:7202: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:8708: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:7205: \$? = $ac_status" >&5
+  echo "$as_me:8711: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:7208: \"$ac_try\"") >&5
+  { (eval echo "$as_me:8714: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:7211: \$? = $ac_status" >&5
+  echo "$as_me:8717: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   :
 else
@@ -7225,7 +8731,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext
                if test "$cf_have_incdir" = no ; then
                  test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
 
-echo "${as_me:-configure}:7228: testing adding $cf_add_incdir to include-path ..." 1>&5
+echo "${as_me:-configure}:8734: testing adding $cf_add_incdir to include-path ..." 1>&5
 
                  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
 
@@ -7242,7 +8748,7 @@ fi
 
 }
 
-echo "$as_me:7245: checking for $cf_ncuhdr_root header in include-path" >&5
+echo "$as_me:8751: checking for $cf_ncuhdr_root header in include-path" >&5
 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
 if test "${cf_cv_ncurses_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -7254,7 +8760,7 @@ else
        do
 
        cat >conftest.$ac_ext <<_ACEOF
-#line 7257 "configure"
+#line 8763 "configure"
 #include "confdefs.h"
 
 #define _XOPEN_SOURCE_EXTENDED
@@ -7286,16 +8792,16 @@ printf("old\n");
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:7289: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:8795: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:7292: \$? = $ac_status" >&5
+  echo "$as_me:8798: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:7295: \"$ac_try\"") >&5
+  { (eval echo "$as_me:8801: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:7298: \$? = $ac_status" >&5
+  echo "$as_me:8804: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_ncurses_h=$cf_header
 
@@ -7310,14 +8816,14 @@ rm -f conftest.$ac_objext conftest.$ac_ext
        done
 
 fi
-echo "$as_me:7313: result: $cf_cv_ncurses_h" >&5
+echo "$as_me:8819: result: $cf_cv_ncurses_h" >&5
 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
 
 if test "$cf_cv_ncurses_h" != no ; then
        cf_cv_ncurses_header=$cf_cv_ncurses_h
 else
 
-echo "$as_me:7320: checking for $cf_ncuhdr_root include-path" >&5
+echo "$as_me:8826: checking for $cf_ncuhdr_root include-path" >&5
 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
 if test "${cf_cv_ncurses_h2+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -7457,7 +8963,7 @@ if test -n "$cf_incdir" ; then
                          cf_save_CPPFLAGS=$CPPFLAGS
                          CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
                          cat >conftest.$ac_ext <<_ACEOF
-#line 7460 "configure"
+#line 8966 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 int
@@ -7469,16 +8975,16 @@ printf("Hello")
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:7472: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:8978: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:7475: \$? = $ac_status" >&5
+  echo "$as_me:8981: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:7478: \"$ac_try\"") >&5
+  { (eval echo "$as_me:8984: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:7481: \$? = $ac_status" >&5
+  echo "$as_me:8987: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   :
 else
@@ -7495,7 +9001,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext
                if test "$cf_have_incdir" = no ; then
                  test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
 
-echo "${as_me:-configure}:7498: testing adding $cf_add_incdir to include-path ..." 1>&5
+echo "${as_me:-configure}:9004: testing adding $cf_add_incdir to include-path ..." 1>&5
 
                  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
 
@@ -7516,7 +9022,7 @@ fi
                do
 
        cat >conftest.$ac_ext <<_ACEOF
-#line 7519 "configure"
+#line 9025 "configure"
 #include "confdefs.h"
 
 #include <$cf_header>
@@ -7540,16 +9046,16 @@ printf("old\n");
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:7543: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:9049: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:7546: \$? = $ac_status" >&5
+  echo "$as_me:9052: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:7549: \"$ac_try\"") >&5
+  { (eval echo "$as_me:9055: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:7552: \$? = $ac_status" >&5
+  echo "$as_me:9058: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_ncurses_h2=$cf_header
 
@@ -7570,12 +9076,12 @@ rm -f conftest.$ac_objext conftest.$ac_ext
                CPPFLAGS="$cf_save2_CPPFLAGS"
                test "$cf_cv_ncurses_h2" != no && break
        done
-       test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:7573: error: not found" >&5
+       test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:9079: error: not found" >&5
 echo "$as_me: error: not found" >&2;}
    { (exit 1); exit 1; }; }
 
 fi
-echo "$as_me:7578: result: $cf_cv_ncurses_h2" >&5
+echo "$as_me:9084: result: $cf_cv_ncurses_h2" >&5
 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
 
        cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
@@ -7608,7 +9114,7 @@ if test -n "$cf_1st_incdir" ; then
                          cf_save_CPPFLAGS=$CPPFLAGS
                          CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
                          cat >conftest.$ac_ext <<_ACEOF
-#line 7611 "configure"
+#line 9117 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 int
@@ -7620,16 +9126,16 @@ printf("Hello")
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:7623: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:9129: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:7626: \$? = $ac_status" >&5
+  echo "$as_me:9132: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:7629: \"$ac_try\"") >&5
+  { (eval echo "$as_me:9135: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:7632: \$? = $ac_status" >&5
+  echo "$as_me:9138: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   :
 else
@@ -7646,7 +9152,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext
                if test "$cf_have_incdir" = no ; then
                  test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
 
-echo "${as_me:-configure}:7649: testing adding $cf_add_incdir to include-path ..." 1>&5
+echo "${as_me:-configure}:9155: testing adding $cf_add_incdir to include-path ..." 1>&5
 
                  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
 
@@ -7689,7 +9195,7 @@ EOF
        ;;
 esac
 
-echo "$as_me:7692: checking for terminfo header" >&5
+echo "$as_me:9198: checking for terminfo header" >&5
 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
 if test "${cf_cv_term_header+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -7707,7 +9213,7 @@ esac
 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
 do
 cat >conftest.$ac_ext <<_ACEOF
-#line 7710 "configure"
+#line 9216 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 #include <${cf_cv_ncurses_header:-curses.h}>
@@ -7722,16 +9228,16 @@ int x = auto_left_margin
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:7725: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:9231: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:7728: \$? = $ac_status" >&5
+  echo "$as_me:9234: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:7731: \"$ac_try\"") >&5
+  { (eval echo "$as_me:9237: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:7734: \$? = $ac_status" >&5
+  echo "$as_me:9240: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
        cf_cv_term_header="$cf_test"
@@ -7747,7 +9253,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext
 done
 
 fi
-echo "$as_me:7750: result: $cf_cv_term_header" >&5
+echo "$as_me:9256: result: $cf_cv_term_header" >&5
 echo "${ECHO_T}$cf_cv_term_header" >&6
 
 # Set definitions to allow ifdef'ing to accommodate subdirectories
@@ -7781,7 +9287,7 @@ cat >>confdefs.h <<\EOF
 #define NCURSES 1
 EOF
 
-echo "$as_me:7784: checking for ncurses version" >&5
+echo "$as_me:9290: checking for ncurses version" >&5
 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
 if test "${cf_cv_ncurses_version+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -7807,10 +9313,10 @@ Autoconf "old"
 #endif
 EOF
        cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
-       { (eval echo "$as_me:7810: \"$cf_try\"") >&5
+       { (eval echo "$as_me:9316: \"$cf_try\"") >&5
   (eval $cf_try) 2>&5
   ac_status=$?
-  echo "$as_me:7813: \$? = $ac_status" >&5
+  echo "$as_me:9319: \$? = $ac_status" >&5
   (exit $ac_status); }
        if test -f conftest.out ; then
                cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
@@ -7820,7 +9326,7 @@ EOF
 
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 7823 "configure"
+#line 9329 "configure"
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header:-curses.h}>
@@ -7845,15 +9351,15 @@ int main()
 }
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:7848: \"$ac_link\"") >&5
+if { (eval echo "$as_me:9354: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:7851: \$? = $ac_status" >&5
+  echo "$as_me:9357: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:7853: \"$ac_try\"") >&5
+  { (eval echo "$as_me:9359: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:7856: \$? = $ac_status" >&5
+  echo "$as_me:9362: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
        cf_cv_ncurses_version=`cat $cf_tempfile`
@@ -7867,7 +9373,7 @@ fi
        rm -f $cf_tempfile
 
 fi
-echo "$as_me:7870: result: $cf_cv_ncurses_version" >&5
+echo "$as_me:9376: result: $cf_cv_ncurses_version" >&5
 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
 test "$cf_cv_ncurses_version" = no || cat >>confdefs.h <<\EOF
 #define NCURSES 1
@@ -7879,7 +9385,7 @@ cf_nculib_root=ncursesw
        # to link gpm.
 cf_ncurses_LIBS=""
 cf_ncurses_SAVE="$LIBS"
-echo "$as_me:7882: checking for Gpm_Open in -lgpm" >&5
+echo "$as_me:9388: checking for Gpm_Open in -lgpm" >&5
 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -7887,7 +9393,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lgpm  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 7890 "configure"
+#line 9396 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -7906,16 +9412,16 @@ Gpm_Open ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:7909: \"$ac_link\"") >&5
+if { (eval echo "$as_me:9415: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:7912: \$? = $ac_status" >&5
+  echo "$as_me:9418: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:7915: \"$ac_try\"") >&5
+  { (eval echo "$as_me:9421: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:7918: \$? = $ac_status" >&5
+  echo "$as_me:9424: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_gpm_Gpm_Open=yes
 else
@@ -7926,10 +9432,10 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:7929: result: $ac_cv_lib_gpm_Gpm_Open" >&5
+echo "$as_me:9435: result: $ac_cv_lib_gpm_Gpm_Open" >&5
 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
-  echo "$as_me:7932: checking for initscr in -lgpm" >&5
+  echo "$as_me:9438: checking for initscr in -lgpm" >&5
 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -7937,7 +9443,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lgpm  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 7940 "configure"
+#line 9446 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -7956,16 +9462,16 @@ initscr ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:7959: \"$ac_link\"") >&5
+if { (eval echo "$as_me:9465: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:7962: \$? = $ac_status" >&5
+  echo "$as_me:9468: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:7965: \"$ac_try\"") >&5
+  { (eval echo "$as_me:9471: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:7968: \$? = $ac_status" >&5
+  echo "$as_me:9474: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_gpm_initscr=yes
 else
@@ -7976,7 +9482,7 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:7979: result: $ac_cv_lib_gpm_initscr" >&5
+echo "$as_me:9485: result: $ac_cv_lib_gpm_initscr" >&5
 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
 if test $ac_cv_lib_gpm_initscr = yes; then
   LIBS="$cf_ncurses_SAVE"
@@ -7991,7 +9497,7 @@ 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 "$as_me:7994: checking for tgoto in -lmytinfo" >&5
+               echo "$as_me:9500: checking for tgoto in -lmytinfo" >&5
 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -7999,7 +9505,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lmytinfo  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 8002 "configure"
+#line 9508 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -8018,16 +9524,16 @@ tgoto ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:8021: \"$ac_link\"") >&5
+if { (eval echo "$as_me:9527: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:8024: \$? = $ac_status" >&5
+  echo "$as_me:9530: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:8027: \"$ac_try\"") >&5
+  { (eval echo "$as_me:9533: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:8030: \$? = $ac_status" >&5
+  echo "$as_me:9536: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_mytinfo_tgoto=yes
 else
@@ -8038,7 +9544,7 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:8041: result: $ac_cv_lib_mytinfo_tgoto" >&5
+echo "$as_me:9547: result: $ac_cv_lib_mytinfo_tgoto" >&5
 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
 if test $ac_cv_lib_mytinfo_tgoto = yes; then
   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
@@ -8052,46 +9558,18 @@ LIBS="$cf_ncurses_LIBS $LIBS"
 
 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
 then
-
-if test -n "$cf_cv_curses_dir/lib" ; then
-  for cf_add_libdir in $cf_cv_curses_dir/lib
-  do
-    if test $cf_add_libdir = /usr/lib ; then
-      :
-    elif test -d $cf_add_libdir
-    then
-      cf_have_libdir=no
-      if test -n "$LDFLAGS$LIBS" ; then
-        # a loop is needed to ensure we can add subdirs of existing dirs
-        for cf_test_libdir in $LDFLAGS $LIBS ; do
-          if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
-            cf_have_libdir=yes; break
-          fi
-        done
-      fi
-      if test "$cf_have_libdir" = no ; then
-        test -n "$verbose" && echo "   adding $cf_add_libdir to library-path" 1>&6
-
-echo "${as_me:-configure}:8075: testing adding $cf_add_libdir to library-path ..." 1>&5
-
-        LDFLAGS="-L$cf_add_libdir $LDFLAGS"
-      fi
-    fi
-  done
-fi
-
        LIBS="-l$cf_nculib_root $LIBS"
 else
 
        eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
        cf_libdir=""
-       echo "$as_me:8088: checking for initscr" >&5
+       echo "$as_me:9566: checking for initscr" >&5
 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
 if test "${ac_cv_func_initscr+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 8094 "configure"
+#line 9572 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char initscr (); below.  */
@@ -8114,7 +9592,7 @@ main ()
 #if defined (__stub_initscr) || defined (__stub___initscr)
 choke me
 #else
-f = initscr;
+f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
 #endif
 
   ;
@@ -8122,16 +9600,16 @@ f = initscr;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:8125: \"$ac_link\"") >&5
+if { (eval echo "$as_me:9603: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:8128: \$? = $ac_status" >&5
+  echo "$as_me:9606: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:8131: \"$ac_try\"") >&5
+  { (eval echo "$as_me:9609: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:8134: \$? = $ac_status" >&5
+  echo "$as_me:9612: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_func_initscr=yes
 else
@@ -8141,18 +9619,18 @@ ac_cv_func_initscr=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:8144: result: $ac_cv_func_initscr" >&5
+echo "$as_me:9622: result: $ac_cv_func_initscr" >&5
 echo "${ECHO_T}$ac_cv_func_initscr" >&6
 if test $ac_cv_func_initscr = yes; then
   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
 else
 
                cf_save_LIBS="$LIBS"
-               echo "$as_me:8151: checking for initscr in -l$cf_nculib_root" >&5
+               echo "$as_me:9629: checking for initscr in -l$cf_nculib_root" >&5
 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
                LIBS="-l$cf_nculib_root $LIBS"
                cat >conftest.$ac_ext <<_ACEOF
-#line 8155 "configure"
+#line 9633 "configure"
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header:-curses.h}>
 int
@@ -8164,25 +9642,25 @@ initscr()
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:8167: \"$ac_link\"") >&5
+if { (eval echo "$as_me:9645: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:8170: \$? = $ac_status" >&5
+  echo "$as_me:9648: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:8173: \"$ac_try\"") >&5
+  { (eval echo "$as_me:9651: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:8176: \$? = $ac_status" >&5
+  echo "$as_me:9654: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  echo "$as_me:8178: result: yes" >&5
+  echo "$as_me:9656: result: yes" >&5
 echo "${ECHO_T}yes" >&6
                         eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
 
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
-echo "$as_me:8185: result: no" >&5
+echo "$as_me:9663: result: no" >&5
 echo "${ECHO_T}no" >&6
 
 cf_search=
@@ -8272,11 +9750,11 @@ cf_search="$cf_library_path_list $cf_search"
 
                        for cf_libdir in $cf_search
                        do
-                               echo "$as_me:8275: checking for -l$cf_nculib_root in $cf_libdir" >&5
+                               echo "$as_me:9753: checking for -l$cf_nculib_root in $cf_libdir" >&5
 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
                                LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
                                cat >conftest.$ac_ext <<_ACEOF
-#line 8279 "configure"
+#line 9757 "configure"
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header:-curses.h}>
 int
@@ -8288,25 +9766,25 @@ initscr()
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:8291: \"$ac_link\"") >&5
+if { (eval echo "$as_me:9769: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:8294: \$? = $ac_status" >&5
+  echo "$as_me:9772: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:8297: \"$ac_try\"") >&5
+  { (eval echo "$as_me:9775: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:8300: \$? = $ac_status" >&5
+  echo "$as_me:9778: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  echo "$as_me:8302: result: yes" >&5
+  echo "$as_me:9780: result: yes" >&5
 echo "${ECHO_T}yes" >&6
                                         eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
                                         break
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
-echo "$as_me:8309: result: no" >&5
+echo "$as_me:9787: result: no" >&5
 echo "${ECHO_T}no" >&6
                                         LIBS="$cf_save_LIBS"
 fi
@@ -8321,7 +9799,7 @@ fi
 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
 
 if test $cf_found_library = no ; then
-       { { echo "$as_me:8324: error: Cannot link $cf_nculib_root library" >&5
+       { { echo "$as_me:9802: error: Cannot link $cf_nculib_root library" >&5
 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
    { (exit 1); exit 1; }; }
 fi
@@ -8329,7 +9807,7 @@ fi
 fi
 
 if test -n "$cf_ncurses_LIBS" ; then
-       echo "$as_me:8332: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
+       echo "$as_me:9810: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
        cf_ncurses_SAVE="$LIBS"
        for p in $cf_ncurses_LIBS ; do
@@ -8339,7 +9817,7 @@ echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS..
                fi
        done
        cat >conftest.$ac_ext <<_ACEOF
-#line 8342 "configure"
+#line 9820 "configure"
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header:-curses.h}>
 int
@@ -8351,23 +9829,23 @@ initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:8354: \"$ac_link\"") >&5
+if { (eval echo "$as_me:9832: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:8357: \$? = $ac_status" >&5
+  echo "$as_me:9835: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:8360: \"$ac_try\"") >&5
+  { (eval echo "$as_me:9838: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:8363: \$? = $ac_status" >&5
+  echo "$as_me:9841: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  echo "$as_me:8365: result: yes" >&5
+  echo "$as_me:9843: result: yes" >&5
 echo "${ECHO_T}yes" >&6
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
-echo "$as_me:8370: result: no" >&5
+echo "$as_me:9848: result: no" >&5
 echo "${ECHO_T}no" >&6
                 LIBS="$cf_ncurses_SAVE"
 fi
@@ -8383,9 +9861,9 @@ EOF
 fi
 
        ;;
-pdcurses) #(vi
+pdcurses)
 
-echo "$as_me:8388: checking if you want to use pkg-config" >&5
+echo "$as_me:9866: checking if you want to use pkg-config" >&5
 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
 
 # Check whether --with-pkg-config or --without-pkg-config was given.
@@ -8395,7 +9873,7 @@ if test "${with_pkg_config+set}" = set; then
 else
   cf_pkg_config=yes
 fi;
-echo "$as_me:8398: result: $cf_pkg_config" >&5
+echo "$as_me:9876: result: $cf_pkg_config" >&5
 echo "${ECHO_T}$cf_pkg_config" >&6
 
 case $cf_pkg_config in #(vi
@@ -8403,9 +9881,11 @@ no) #(vi
        PKG_CONFIG=none
        ;;
 yes) #(vi
-       # Extract the first word of "pkg-config", so it can be a program name with args.
-set dummy pkg-config; ac_word=$2
-echo "$as_me:8408: checking for $ac_word" >&5
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
+echo "$as_me:9888: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -8422,25 +9902,70 @@ for ac_dir in $ac_dummy; do
   test -z "$ac_dir" && ac_dir=.
   if $as_executable_p "$ac_dir/$ac_word"; then
    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
-   echo "$as_me:8425: found $ac_dir/$ac_word" >&5
+   echo "$as_me:9905: found $ac_dir/$ac_word" >&5
    break
 fi
 done
 
-  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="none"
   ;;
 esac
 fi
 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
 
 if test -n "$PKG_CONFIG"; then
-  echo "$as_me:8437: result: $PKG_CONFIG" >&5
+  echo "$as_me:9916: result: $PKG_CONFIG" >&5
 echo "${ECHO_T}$PKG_CONFIG" >&6
 else
-  echo "$as_me:8440: result: no" >&5
+  echo "$as_me:9919: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_path_PKG_CONFIG"; then
+  ac_pt_PKG_CONFIG=$PKG_CONFIG
+  # Extract the first word of "pkg-config", so it can be a program name with args.
+set dummy pkg-config; ac_word=$2
+echo "$as_me:9928: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $ac_pt_PKG_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+  IFS=$ac_save_IFS
+  test -z "$ac_dir" && ac_dir=.
+  if $as_executable_p "$ac_dir/$ac_word"; then
+   ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
+   echo "$as_me:9945: found $ac_dir/$ac_word" >&5
+   break
+fi
+done
+
+  test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
+  ;;
+esac
+fi
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
+
+if test -n "$ac_pt_PKG_CONFIG"; then
+  echo "$as_me:9957: result: $ac_pt_PKG_CONFIG" >&5
+echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
+else
+  echo "$as_me:9960: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
+  PKG_CONFIG=$ac_pt_PKG_CONFIG
+else
+  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
+fi
+
        ;;
 *)
        PKG_CONFIG=$withval
@@ -8463,7 +9988,7 @@ case ".$PKG_CONFIG" in #(vi
   ;;
 .[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
   ;;
-.\${*prefix}*) #(vi
+.\${*prefix}*|.\${*dir}*) #(vi
   eval PKG_CONFIG="$PKG_CONFIG"
   case ".$PKG_CONFIG" in #(vi
   .NONE/*)
@@ -8475,7 +10000,7 @@ case ".$PKG_CONFIG" in #(vi
   PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
   ;;
 *)
-  { { echo "$as_me:8478: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
+  { { echo "$as_me:10003: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
    { (exit 1); exit 1; }; }
   ;;
@@ -8483,7 +10008,7 @@ esac
 
 fi
 
-echo "$as_me:8486: checking for X" >&5
+echo "$as_me:10011: checking for X" >&5
 echo $ECHO_N "checking for X... $ECHO_C" >&6
 
 # Check whether --with-x or --without-x was given.
@@ -8580,17 +10105,17 @@ if test "$ac_x_includes" = no; then
   # Guess where to find include files, by looking for Intrinsic.h.
   # First, try using that file with no special directory specified.
   cat >conftest.$ac_ext <<_ACEOF
-#line 8583 "configure"
+#line 10108 "configure"
 #include "confdefs.h"
 #include <X11/Intrinsic.h>
 _ACEOF
-if { (eval echo "$as_me:8587: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:10112: \"$ac_cpp conftest.$ac_ext\"") >&5
   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
   ac_status=$?
   egrep -v '^ *\+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:8593: \$? = $ac_status" >&5
+  echo "$as_me:10118: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
@@ -8623,7 +10148,7 @@ if test "$ac_x_libraries" = no; then
   ac_save_LIBS=$LIBS
   LIBS="-lXt $LIBS"
   cat >conftest.$ac_ext <<_ACEOF
-#line 8626 "configure"
+#line 10151 "configure"
 #include "confdefs.h"
 #include <X11/Intrinsic.h>
 int
@@ -8635,16 +10160,16 @@ XtMalloc (0)
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:8638: \"$ac_link\"") >&5
+if { (eval echo "$as_me:10163: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:8641: \$? = $ac_status" >&5
+  echo "$as_me:10166: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:8644: \"$ac_try\"") >&5
+  { (eval echo "$as_me:10169: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:8647: \$? = $ac_status" >&5
+  echo "$as_me:10172: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   LIBS=$ac_save_LIBS
 # We can link X programs with no special library path.
@@ -8682,7 +10207,7 @@ fi
 fi # $with_x != no
 
 if test "$have_x" != yes; then
-  echo "$as_me:8685: result: $have_x" >&5
+  echo "$as_me:10210: result: $have_x" >&5
 echo "${ECHO_T}$have_x" >&6
   no_x=yes
 else
@@ -8692,7 +10217,7 @@ else
   # Update the cache value to reflect the command line values.
   ac_cv_have_x="have_x=yes \
                ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
-  echo "$as_me:8695: result: libraries $x_libraries, headers $x_includes" >&5
+  echo "$as_me:10220: result: libraries $x_libraries, headers $x_includes" >&5
 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
 fi
 
@@ -8716,11 +10241,11 @@ else
     # others require no space.  Words are not sufficient . . . .
     case `(uname -sr) 2>/dev/null` in
     "SunOS 5"*)
-      echo "$as_me:8719: checking whether -R must be followed by a space" >&5
+      echo "$as_me:10244: checking whether -R must be followed by a space" >&5
 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
       ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
       cat >conftest.$ac_ext <<_ACEOF
-#line 8723 "configure"
+#line 10248 "configure"
 #include "confdefs.h"
 
 int
@@ -8732,16 +10257,16 @@ main ()
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:8735: \"$ac_link\"") >&5
+if { (eval echo "$as_me:10260: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:8738: \$? = $ac_status" >&5
+  echo "$as_me:10263: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:8741: \"$ac_try\"") >&5
+  { (eval echo "$as_me:10266: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:8744: \$? = $ac_status" >&5
+  echo "$as_me:10269: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_R_nospace=yes
 else
@@ -8751,13 +10276,13 @@ ac_R_nospace=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
       if test $ac_R_nospace = yes; then
-       echo "$as_me:8754: result: no" >&5
+       echo "$as_me:10279: result: no" >&5
 echo "${ECHO_T}no" >&6
        X_LIBS="$X_LIBS -R$x_libraries"
       else
        LIBS="$ac_xsave_LIBS -R $x_libraries"
        cat >conftest.$ac_ext <<_ACEOF
-#line 8760 "configure"
+#line 10285 "configure"
 #include "confdefs.h"
 
 int
@@ -8769,16 +10294,16 @@ main ()
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:8772: \"$ac_link\"") >&5
+if { (eval echo "$as_me:10297: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:8775: \$? = $ac_status" >&5
+  echo "$as_me:10300: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:8778: \"$ac_try\"") >&5
+  { (eval echo "$as_me:10303: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:8781: \$? = $ac_status" >&5
+  echo "$as_me:10306: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_R_space=yes
 else
@@ -8788,11 +10313,11 @@ ac_R_space=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
        if test $ac_R_space = yes; then
-         echo "$as_me:8791: result: yes" >&5
+         echo "$as_me:10316: result: yes" >&5
 echo "${ECHO_T}yes" >&6
          X_LIBS="$X_LIBS -R $x_libraries"
        else
-         echo "$as_me:8795: result: neither works" >&5
+         echo "$as_me:10320: result: neither works" >&5
 echo "${ECHO_T}neither works" >&6
        fi
       fi
@@ -8812,7 +10337,7 @@ echo "${ECHO_T}neither works" >&6
     # the Alpha needs dnet_stub (dnet does not exist).
     ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
     cat >conftest.$ac_ext <<_ACEOF
-#line 8815 "configure"
+#line 10340 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -8831,22 +10356,22 @@ XOpenDisplay ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:8834: \"$ac_link\"") >&5
+if { (eval echo "$as_me:10359: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:8837: \$? = $ac_status" >&5
+  echo "$as_me:10362: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:8840: \"$ac_try\"") >&5
+  { (eval echo "$as_me:10365: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:8843: \$? = $ac_status" >&5
+  echo "$as_me:10368: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   :
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
-echo "$as_me:8849: checking for dnet_ntoa in -ldnet" >&5
+echo "$as_me:10374: checking for dnet_ntoa in -ldnet" >&5
 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
 if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -8854,7 +10379,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-ldnet  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 8857 "configure"
+#line 10382 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -8873,16 +10398,16 @@ dnet_ntoa ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:8876: \"$ac_link\"") >&5
+if { (eval echo "$as_me:10401: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:8879: \$? = $ac_status" >&5
+  echo "$as_me:10404: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:8882: \"$ac_try\"") >&5
+  { (eval echo "$as_me:10407: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:8885: \$? = $ac_status" >&5
+  echo "$as_me:10410: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_dnet_dnet_ntoa=yes
 else
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:8896: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
+echo "$as_me:10421: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
 if test $ac_cv_lib_dnet_dnet_ntoa = yes; then
   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
 fi
 
     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
-      echo "$as_me:8903: checking for dnet_ntoa in -ldnet_stub" >&5
+      echo "$as_me:10428: checking for dnet_ntoa in -ldnet_stub" >&5
 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
 if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -8908,7 +10433,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-ldnet_stub  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 8911 "configure"
+#line 10436 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -8927,16 +10452,16 @@ dnet_ntoa ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:8930: \"$ac_link\"") >&5
+if { (eval echo "$as_me:10455: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:8933: \$? = $ac_status" >&5
+  echo "$as_me:10458: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:8936: \"$ac_try\"") >&5
+  { (eval echo "$as_me:10461: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:8939: \$? = $ac_status" >&5
+  echo "$as_me:10464: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_dnet_stub_dnet_ntoa=yes
 else
@@ -8947,7 +10472,7 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:8950: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
+echo "$as_me:10475: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
 if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then
   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
@@ -8966,13 +10491,13 @@ rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
     # on Irix 5.2, according to T.E. Dickey.
     # The functions gethostbyname, getservbyname, and inet_addr are
     # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
-    echo "$as_me:8969: checking for gethostbyname" >&5
+    echo "$as_me:10494: checking for gethostbyname" >&5
 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
 if test "${ac_cv_func_gethostbyname+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 8975 "configure"
+#line 10500 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char gethostbyname (); below.  */
@@ -8995,7 +10520,7 @@ main ()
 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
 choke me
 #else
-f = gethostbyname;
+f = gethostbyname; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
 #endif
 
   ;
@@ -9003,16 +10528,16 @@ f = gethostbyname;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:9006: \"$ac_link\"") >&5
+if { (eval echo "$as_me:10531: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:9009: \$? = $ac_status" >&5
+  echo "$as_me:10534: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:9012: \"$ac_try\"") >&5
+  { (eval echo "$as_me:10537: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:9015: \$? = $ac_status" >&5
+  echo "$as_me:10540: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_func_gethostbyname=yes
 else
@@ -9022,11 +10547,11 @@ ac_cv_func_gethostbyname=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:9025: result: $ac_cv_func_gethostbyname" >&5
+echo "$as_me:10550: result: $ac_cv_func_gethostbyname" >&5
 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
 
     if test $ac_cv_func_gethostbyname = no; then
-      echo "$as_me:9029: checking for gethostbyname in -lnsl" >&5
+      echo "$as_me:10554: checking for gethostbyname in -lnsl" >&5
 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -9034,7 +10559,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lnsl  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 9037 "configure"
+#line 10562 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -9053,16 +10578,16 @@ gethostbyname ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:9056: \"$ac_link\"") >&5
+if { (eval echo "$as_me:10581: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:9059: \$? = $ac_status" >&5
+  echo "$as_me:10584: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:9062: \"$ac_try\"") >&5
+  { (eval echo "$as_me:10587: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:9065: \$? = $ac_status" >&5
+  echo "$as_me:10590: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_nsl_gethostbyname=yes
 else
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:9076: result: $ac_cv_lib_nsl_gethostbyname" >&5
+echo "$as_me:10601: result: $ac_cv_lib_nsl_gethostbyname" >&5
 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
 if test $ac_cv_lib_nsl_gethostbyname = yes; then
   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
 fi
 
       if test $ac_cv_lib_nsl_gethostbyname = no; then
-        echo "$as_me:9083: checking for gethostbyname in -lbsd" >&5
+        echo "$as_me:10608: checking for gethostbyname in -lbsd" >&5
 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
 if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -9088,7 +10613,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lbsd  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 9091 "configure"
+#line 10616 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -9107,16 +10632,16 @@ gethostbyname ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:9110: \"$ac_link\"") >&5
+if { (eval echo "$as_me:10635: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:9113: \$? = $ac_status" >&5
+  echo "$as_me:10638: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:9116: \"$ac_try\"") >&5
+  { (eval echo "$as_me:10641: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:9119: \$? = $ac_status" >&5
+  echo "$as_me:10644: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_bsd_gethostbyname=yes
 else
@@ -9127,7 +10652,7 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:9130: result: $ac_cv_lib_bsd_gethostbyname" >&5
+echo "$as_me:10655: result: $ac_cv_lib_bsd_gethostbyname" >&5
 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
 if test $ac_cv_lib_bsd_gethostbyname = yes; then
   X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
     # variants that don't use the nameserver (or something).  -lsocket
     # must be given before -lnsl if both are needed.  We assume that
     # if connect needs -lnsl, so does gethostbyname.
-    echo "$as_me:9146: checking for connect" >&5
+    echo "$as_me:10671: checking for connect" >&5
 echo $ECHO_N "checking for connect... $ECHO_C" >&6
 if test "${ac_cv_func_connect+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 9152 "configure"
+#line 10677 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char connect (); below.  */
@@ -9172,7 +10697,7 @@ main ()
 #if defined (__stub_connect) || defined (__stub___connect)
 choke me
 #else
-f = connect;
+f = connect; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
 #endif
 
   ;
@@ -9180,16 +10705,16 @@ f = connect;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:9183: \"$ac_link\"") >&5
+if { (eval echo "$as_me:10708: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:9186: \$? = $ac_status" >&5
+  echo "$as_me:10711: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:9189: \"$ac_try\"") >&5
+  { (eval echo "$as_me:10714: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:9192: \$? = $ac_status" >&5
+  echo "$as_me:10717: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_func_connect=yes
 else
@@ -9199,11 +10724,11 @@ ac_cv_func_connect=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:9202: result: $ac_cv_func_connect" >&5
+echo "$as_me:10727: result: $ac_cv_func_connect" >&5
 echo "${ECHO_T}$ac_cv_func_connect" >&6
 
     if test $ac_cv_func_connect = no; then
-      echo "$as_me:9206: checking for connect in -lsocket" >&5
+      echo "$as_me:10731: checking for connect in -lsocket" >&5
 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
 if test "${ac_cv_lib_socket_connect+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -9211,123 +10736,304 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 9214 "configure"
+#line 10739 "configure"
+#include "confdefs.h"
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char connect ();
+int
+main ()
+{
+connect ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:10758: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:10761: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:10764: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:10767: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_socket_connect=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_socket_connect=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:10778: result: $ac_cv_lib_socket_connect" >&5
+echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
+if test $ac_cv_lib_socket_connect = yes; then
+  X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
+fi
+
+    fi
+
+    # Guillermo Gomez says -lposix is necessary on A/UX.
+    echo "$as_me:10787: checking for remove" >&5
+echo $ECHO_N "checking for remove... $ECHO_C" >&6
+if test "${ac_cv_func_remove+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 10793 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char remove (); below.  */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char remove ();
+char (*f) ();
+
+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_remove) || defined (__stub___remove)
+choke me
+#else
+f = remove; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:10824: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:10827: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:10830: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:10833: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_remove=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_func_remove=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:10843: result: $ac_cv_func_remove" >&5
+echo "${ECHO_T}$ac_cv_func_remove" >&6
+
+    if test $ac_cv_func_remove = no; then
+      echo "$as_me:10847: checking for remove in -lposix" >&5
+echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
+if test "${ac_cv_lib_posix_remove+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lposix  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line 10855 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
 extern "C"
 #endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char connect ();
-int
-main ()
-{
-connect ();
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char remove ();
+int
+main ()
+{
+remove ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:10874: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:10877: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:10880: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:10883: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_posix_remove=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_posix_remove=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:10894: result: $ac_cv_lib_posix_remove" >&5
+echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
+if test $ac_cv_lib_posix_remove = yes; then
+  X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
+fi
+
+    fi
+
+    # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
+    echo "$as_me:10903: checking for shmat" >&5
+echo $ECHO_N "checking for shmat... $ECHO_C" >&6
+if test "${ac_cv_func_shmat+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 10909 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char shmat (); below.  */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char shmat ();
+char (*f) ();
+
+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_shmat) || defined (__stub___shmat)
+choke me
+#else
+f = shmat; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
+#endif
+
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:9233: \"$ac_link\"") >&5
+if { (eval echo "$as_me:10940: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:9236: \$? = $ac_status" >&5
+  echo "$as_me:10943: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:9239: \"$ac_try\"") >&5
+  { (eval echo "$as_me:10946: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:9242: \$? = $ac_status" >&5
+  echo "$as_me:10949: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_lib_socket_connect=yes
+  ac_cv_func_shmat=yes
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
-ac_cv_lib_socket_connect=no
+ac_cv_func_shmat=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:9253: result: $ac_cv_lib_socket_connect" >&5
-echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
-if test $ac_cv_lib_socket_connect = yes; then
-  X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
 fi
+echo "$as_me:10959: result: $ac_cv_func_shmat" >&5
+echo "${ECHO_T}$ac_cv_func_shmat" >&6
 
-    fi
-
-    # Guillermo Gomez says -lposix is necessary on A/UX.
-    echo "$as_me:9262: checking for remove" >&5
-echo $ECHO_N "checking for remove... $ECHO_C" >&6
-if test "${ac_cv_func_remove+set}" = set; then
+    if test $ac_cv_func_shmat = no; then
+      echo "$as_me:10963: checking for shmat in -lipc" >&5
+echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
+if test "${ac_cv_lib_ipc_shmat+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
-#line 9268 "configure"
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lipc  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line 10971 "configure"
 #include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char remove (); below.  */
-#include <assert.h>
+
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
 extern "C"
 #endif
 /* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
-char remove ();
-char (*f) ();
-
+char shmat ();
 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_remove) || defined (__stub___remove)
-choke me
-#else
-f = remove;
-#endif
-
+shmat ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:9299: \"$ac_link\"") >&5
+if { (eval echo "$as_me:10990: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:9302: \$? = $ac_status" >&5
+  echo "$as_me:10993: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:9305: \"$ac_try\"") >&5
+  { (eval echo "$as_me:10996: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:9308: \$? = $ac_status" >&5
+  echo "$as_me:10999: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_func_remove=yes
+  ac_cv_lib_ipc_shmat=yes
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
-ac_cv_func_remove=no
+ac_cv_lib_ipc_shmat=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:11010: result: $ac_cv_lib_ipc_shmat" >&5
+echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
+if test $ac_cv_lib_ipc_shmat = yes; then
+  X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
 fi
-echo "$as_me:9318: result: $ac_cv_func_remove" >&5
-echo "${ECHO_T}$ac_cv_func_remove" >&6
 
-    if test $ac_cv_func_remove = no; then
-      echo "$as_me:9322: checking for remove in -lposix" >&5
-echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
-if test "${ac_cv_lib_posix_remove+set}" = set; then
+    fi
+  fi
+
+  # Check for libraries that X11R6 Xt/Xaw programs need.
+  ac_save_LDFLAGS=$LDFLAGS
+  test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
+  # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
+  # check for ICE first), but we must link in the order -lSM -lICE or
+  # we get undefined symbols.  So assume we have SM if we have ICE.
+  # These have to be linked with before -lX11, unlike the other
+  # libraries we check for below, so use a different variable.
+  # John Interrante, Karl Berry
+  echo "$as_me:11028: checking for IceConnectionNumber in -lICE" >&5
+echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
+if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lposix  $LIBS"
+LIBS="-lICE $X_EXTRA_LIBS $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 9330 "configure"
+#line 11036 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -9336,179 +11042,502 @@ extern "C"
 #endif
 /* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
-char remove ();
+char IceConnectionNumber ();
 int
 main ()
 {
-remove ();
+IceConnectionNumber ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:9349: \"$ac_link\"") >&5
+if { (eval echo "$as_me:11055: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:9352: \$? = $ac_status" >&5
+  echo "$as_me:11058: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:9355: \"$ac_try\"") >&5
+  { (eval echo "$as_me:11061: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:9358: \$? = $ac_status" >&5
+  echo "$as_me:11064: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_lib_posix_remove=yes
+  ac_cv_lib_ICE_IceConnectionNumber=yes
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
-ac_cv_lib_posix_remove=no
+ac_cv_lib_ICE_IceConnectionNumber=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:9369: result: $ac_cv_lib_posix_remove" >&5
-echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
-if test $ac_cv_lib_posix_remove = yes; then
-  X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
+echo "$as_me:11075: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
+echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
+if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then
+  X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
 fi
 
-    fi
+  LDFLAGS=$ac_save_LDFLAGS
 
-    # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
-    echo "$as_me:9378: checking for shmat" >&5
-echo $ECHO_N "checking for shmat... $ECHO_C" >&6
-if test "${ac_cv_func_shmat+set}" = set; then
+fi
+
+cf_x_athena=${cf_x_athena:-Xaw}
+
+echo "$as_me:11087: checking if you want to link with Xaw 3d library" >&5
+echo $ECHO_N "checking if you want to link with Xaw 3d library... $ECHO_C" >&6
+withval=
+
+# Check whether --with-Xaw3d or --without-Xaw3d was given.
+if test "${with_Xaw3d+set}" = set; then
+  withval="$with_Xaw3d"
+
+fi;
+if test "$withval" = yes ; then
+       cf_x_athena=Xaw3d
+       echo "$as_me:11098: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+else
+       echo "$as_me:11101: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+echo "$as_me:11105: checking if you want to link with neXT Athena library" >&5
+echo $ECHO_N "checking if you want to link with neXT Athena library... $ECHO_C" >&6
+withval=
+
+# Check whether --with-neXtaw or --without-neXtaw was given.
+if test "${with_neXtaw+set}" = set; then
+  withval="$with_neXtaw"
+
+fi;
+if test "$withval" = yes ; then
+       cf_x_athena=neXtaw
+       echo "$as_me:11116: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+else
+       echo "$as_me:11119: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+echo "$as_me:11123: checking if you want to link with Athena-Plus library" >&5
+echo $ECHO_N "checking if you want to link with Athena-Plus library... $ECHO_C" >&6
+withval=
+
+# Check whether --with-XawPlus or --without-XawPlus was given.
+if test "${with_XawPlus+set}" = set; then
+  withval="$with_XawPlus"
+
+fi;
+if test "$withval" = yes ; then
+       cf_x_athena=XawPlus
+       echo "$as_me:11134: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+else
+       echo "$as_me:11137: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+cf_x_athena_lib=""
+
+if test "$PKG_CONFIG" != none ; then
+       cf_athena_list=
+       test "$cf_x_athena" = Xaw && cf_athena_list="xaw8 xaw7 xaw6"
+       for cf_athena_pkg in \
+               $cf_athena_list \
+               ${cf_x_athena} \
+               ${cf_x_athena}-devel \
+               lib${cf_x_athena} \
+               lib${cf_x_athena}-devel
+       do
+
+if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists $cf_athena_pkg; then
+       test -n "$verbose" && echo "    found package $cf_athena_pkg" 1>&6
+
+echo "${as_me:-configure}:11157: testing found package $cf_athena_pkg ..." 1>&5
+
+       cf_pkgconfig_incs="`$PKG_CONFIG --cflags $cf_athena_pkg 2>/dev/null`"
+       cf_pkgconfig_libs="`$PKG_CONFIG --libs   $cf_athena_pkg 2>/dev/null`"
+       test -n "$verbose" && echo "    package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs" 1>&6
+
+echo "${as_me:-configure}:11163: testing package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs ..." 1>&5
+
+       test -n "$verbose" && echo "    package $cf_athena_pkg LIBS: $cf_pkgconfig_libs" 1>&6
+
+echo "${as_me:-configure}:11167: testing package $cf_athena_pkg LIBS: $cf_pkgconfig_libs ..." 1>&5
+
+cf_fix_cppflags=no
+cf_new_cflags=
+cf_new_cppflags=
+cf_new_extra_cppflags=
+
+for cf_add_cflags in $cf_pkgconfig_incs
+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
+                       case $cf_add_cflags in #(vi
+                       -D*)
+                               cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
+
+CPPFLAGS=`echo "$CPPFLAGS" | \
+       sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
+               -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
+
+                               ;;
+                       esac
+                       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="$CPPFLAGS $cf_new_cppflags"
+fi
+
+if test -n "$cf_new_extra_cppflags" ; then
+
+       EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
+fi
+
+       LIBS="$cf_pkgconfig_libs $LIBS"
+
+                       cf_x_athena_lib="$cf_pkgconfig_libs"
+
+cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
+
+                       cat >>confdefs.h <<EOF
+#define $cf_x_athena_LIBS 1
+EOF
+
+echo "$as_me:11257: checking for usable $cf_x_athena/Xmu package" >&5
+echo $ECHO_N "checking for usable $cf_x_athena/Xmu package... $ECHO_C" >&6
+if test "${cf_cv_xaw_compat+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
-#line 9384 "configure"
+
+cat >conftest.$ac_ext <<_ACEOF
+#line 11264 "configure"
 #include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char shmat (); below.  */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char shmat ();
-char (*f) ();
+
+#include <X11/Xmu/CharSet.h>
 
 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_shmat) || defined (__stub___shmat)
-choke me
-#else
-f = shmat;
-#endif
+
+int check = XmuCompareISOLatin1("big", "small")
 
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:9415: \"$ac_link\"") >&5
+if { (eval echo "$as_me:11280: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:9418: \$? = $ac_status" >&5
+  echo "$as_me:11283: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:9421: \"$ac_try\"") >&5
+  { (eval echo "$as_me:11286: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:9424: \$? = $ac_status" >&5
+  echo "$as_me:11289: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_func_shmat=yes
+  cf_cv_xaw_compat=yes
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
-ac_cv_func_shmat=no
+cf_cv_xaw_compat=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:9434: result: $ac_cv_func_shmat" >&5
-echo "${ECHO_T}$ac_cv_func_shmat" >&6
+echo "$as_me:11299: result: $cf_cv_xaw_compat" >&5
+echo "${ECHO_T}$cf_cv_xaw_compat" >&6
 
-    if test $ac_cv_func_shmat = no; then
-      echo "$as_me:9438: checking for shmat in -lipc" >&5
-echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
-if test "${ac_cv_lib_ipc_shmat+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+                       if test "$cf_cv_xaw_compat" = no
+                       then
+                               # workaround for broken ".pc" files...
+                               case "$cf_x_athena_lib" in #(vi
+                               *-lXmu*) #(vi
+                                       ;;
+                               *)
+                                       test -n "$verbose" && echo "    work around broken package" 1>&6
+
+echo "${as_me:-configure}:11311: testing work around broken package ..." 1>&5
+
+if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xmu; then
+       test -n "$verbose" && echo "    found package xmu" 1>&6
+
+echo "${as_me:-configure}:11316: testing found package xmu ..." 1>&5
+
+       cf_pkgconfig_incs="`$PKG_CONFIG --cflags xmu 2>/dev/null`"
+       cf_pkgconfig_libs="`$PKG_CONFIG --libs   xmu 2>/dev/null`"
+       test -n "$verbose" && echo "    package xmu CFLAGS: $cf_pkgconfig_incs" 1>&6
+
+echo "${as_me:-configure}:11322: testing package xmu CFLAGS: $cf_pkgconfig_incs ..." 1>&5
+
+       test -n "$verbose" && echo "    package xmu LIBS: $cf_pkgconfig_libs" 1>&6
+
+echo "${as_me:-configure}:11326: testing package xmu LIBS: $cf_pkgconfig_libs ..." 1>&5
+
+cf_fix_cppflags=no
+cf_new_cflags=
+cf_new_cppflags=
+cf_new_extra_cppflags=
+
+for cf_add_cflags in $cf_pkgconfig_incs
+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
+                       case $cf_add_cflags in #(vi
+                       -D*)
+                               cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
+
+CPPFLAGS=`echo "$CPPFLAGS" | \
+       sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
+               -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
+
+                               ;;
+                       esac
+                       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="$CPPFLAGS $cf_new_cppflags"
+fi
+
+if test -n "$cf_new_extra_cppflags" ; then
+
+       EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
+fi
+
+       LIBS="$cf_pkgconfig_libs $LIBS"
+       :
 else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lipc  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-#line 9446 "configure"
-#include "confdefs.h"
 
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char shmat ();
-int
-main ()
-{
-shmat ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:9465: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:9468: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:9471: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:9474: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_ipc_shmat=yes
+test -n "$verbose" && echo "   ...before $LIBS" 1>&6
+
+echo "${as_me:-configure}:11412: testing ...before $LIBS ..." 1>&5
+
+LIBS=`echo "$LIBS" | sed -e "s/[       ][      ]*/ /g" -e "s,-lXt ,-lXt -lXmu ," -e 's/  / /g'`
+test -n "$verbose" && echo "   ...after  $LIBS" 1>&6
+
+echo "${as_me:-configure}:11417: testing ...after  $LIBS ..." 1>&5
+
+fi
+
+                                       ;;
+                               esac
+                       fi
+
+                       break
 else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-ac_cv_lib_ipc_shmat=no
+       :
+fi
+
+       done
+fi
+
+if test -z "$cf_x_athena_lib" ; then
+
+if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists Xext; then
+       test -n "$verbose" && echo "    found package Xext" 1>&6
+
+echo "${as_me:-configure}:11438: testing found package Xext ..." 1>&5
+
+       cf_pkgconfig_incs="`$PKG_CONFIG --cflags Xext 2>/dev/null`"
+       cf_pkgconfig_libs="`$PKG_CONFIG --libs   Xext 2>/dev/null`"
+       test -n "$verbose" && echo "    package Xext CFLAGS: $cf_pkgconfig_incs" 1>&6
+
+echo "${as_me:-configure}:11444: testing package Xext CFLAGS: $cf_pkgconfig_incs ..." 1>&5
+
+       test -n "$verbose" && echo "    package Xext LIBS: $cf_pkgconfig_libs" 1>&6
+
+echo "${as_me:-configure}:11448: testing package Xext LIBS: $cf_pkgconfig_libs ..." 1>&5
+
+cf_fix_cppflags=no
+cf_new_cflags=
+cf_new_cppflags=
+cf_new_extra_cppflags=
+
+for cf_add_cflags in $cf_pkgconfig_incs
+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
+                       case $cf_add_cflags in #(vi
+                       -D*)
+                               cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
+
+CPPFLAGS=`echo "$CPPFLAGS" | \
+       sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
+               -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
+
+                               ;;
+                       esac
+                       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
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+
+if test -n "$cf_new_cppflags" ; then
+
+       CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
 fi
-echo "$as_me:9485: result: $ac_cv_lib_ipc_shmat" >&5
-echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
-if test $ac_cv_lib_ipc_shmat = yes; then
-  X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
+
+if test -n "$cf_new_extra_cppflags" ; then
+
+       EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
 fi
 
-    fi
-  fi
+       LIBS="$cf_pkgconfig_libs $LIBS"
+       :
+else
 
-  # Check for libraries that X11R6 Xt/Xaw programs need.
-  ac_save_LDFLAGS=$LDFLAGS
-  test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
-  # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
-  # check for ICE first), but we must link in the order -lSM -lICE or
-  # we get undefined symbols.  So assume we have SM if we have ICE.
-  # These have to be linked with before -lX11, unlike the other
-  # libraries we check for below, so use a different variable.
-  # John Interrante, Karl Berry
-  echo "$as_me:9503: checking for IceConnectionNumber in -lICE" >&5
-echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
-if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
+       echo "$as_me:11532: checking for XextCreateExtension in -lXext" >&5
+echo $ECHO_N "checking for XextCreateExtension in -lXext... $ECHO_C" >&6
+if test "${ac_cv_lib_Xext_XextCreateExtension+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lICE $X_EXTRA_LIBS $LIBS"
+LIBS="-lXext  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 9511 "configure"
+#line 11540 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -9517,129 +11546,215 @@ extern "C"
 #endif
 /* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
-char IceConnectionNumber ();
+char XextCreateExtension ();
 int
 main ()
 {
-IceConnectionNumber ();
+XextCreateExtension ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:9530: \"$ac_link\"") >&5
+if { (eval echo "$as_me:11559: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:9533: \$? = $ac_status" >&5
+  echo "$as_me:11562: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:9536: \"$ac_try\"") >&5
+  { (eval echo "$as_me:11565: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:9539: \$? = $ac_status" >&5
+  echo "$as_me:11568: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_lib_ICE_IceConnectionNumber=yes
+  ac_cv_lib_Xext_XextCreateExtension=yes
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
-ac_cv_lib_ICE_IceConnectionNumber=no
+ac_cv_lib_Xext_XextCreateExtension=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:9550: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
-echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
-if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then
-  X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
+echo "$as_me:11579: result: $ac_cv_lib_Xext_XextCreateExtension" >&5
+echo "${ECHO_T}$ac_cv_lib_Xext_XextCreateExtension" >&6
+if test $ac_cv_lib_Xext_XextCreateExtension = yes; then
+  LIBS="-lXext $LIBS"
 fi
 
-  LDFLAGS=$ac_save_LDFLAGS
-
 fi
 
-cf_x_athena=${cf_x_athena:-Xaw}
+cf_have_X_LIBS=no
 
-echo "$as_me:9562: checking if you want to link with Xaw 3d library" >&5
-echo $ECHO_N "checking if you want to link with Xaw 3d library... $ECHO_C" >&6
-withval=
+if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
+       test -n "$verbose" && echo "    found package xt" 1>&6
 
-# Check whether --with-Xaw3d or --without-Xaw3d was given.
-if test "${with_Xaw3d+set}" = set; then
-  withval="$with_Xaw3d"
+echo "${as_me:-configure}:11592: testing found package xt ..." 1>&5
 
-fi;
-if test "$withval" = yes ; then
-       cf_x_athena=Xaw3d
-       echo "$as_me:9573: result: yes" >&5
-echo "${ECHO_T}yes" >&6
-else
-       echo "$as_me:9576: result: no" >&5
-echo "${ECHO_T}no" >&6
+       cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
+       cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
+       test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
+
+echo "${as_me:-configure}:11598: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
+
+       test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
+
+echo "${as_me:-configure}:11602: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
+
+cf_fix_cppflags=no
+cf_new_cflags=
+cf_new_cppflags=
+cf_new_extra_cppflags=
+
+for cf_add_cflags in $cf_pkgconfig_incs
+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
+                       case $cf_add_cflags in #(vi
+                       -D*)
+                               cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
+
+CPPFLAGS=`echo "$CPPFLAGS" | \
+       sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
+               -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
+
+                               ;;
+                       esac
+                       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
 
-echo "$as_me:9580: checking if you want to link with neXT Athena library" >&5
-echo $ECHO_N "checking if you want to link with neXT Athena library... $ECHO_C" >&6
-withval=
+if test -n "$cf_new_cppflags" ; then
 
-# Check whether --with-neXtaw or --without-neXtaw was given.
-if test "${with_neXtaw+set}" = set; then
-  withval="$with_neXtaw"
+       CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
+fi
 
-fi;
-if test "$withval" = yes ; then
-       cf_x_athena=neXtaw
-       echo "$as_me:9591: result: yes" >&5
-echo "${ECHO_T}yes" >&6
-else
-       echo "$as_me:9594: result: no" >&5
-echo "${ECHO_T}no" >&6
+if test -n "$cf_new_extra_cppflags" ; then
+
+       EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
 fi
 
-echo "$as_me:9598: checking if you want to link with Athena-Plus library" >&5
-echo $ECHO_N "checking if you want to link with Athena-Plus library... $ECHO_C" >&6
-withval=
+       LIBS="$cf_pkgconfig_libs $LIBS"
 
-# Check whether --with-XawPlus or --without-XawPlus was given.
-if test "${with_XawPlus+set}" = set; then
-  withval="$with_XawPlus"
+       case "x$LIBS" in #(vi
+       *-lX11*) #(vi
+               ;;
+       *)
+# we have an "xt" package, but it may omit Xt's dependency on X11
+echo "$as_me:11689: checking for usable X dependency" >&5
+echo $ECHO_N "checking for usable X dependency... $ECHO_C" >&6
+if test "${cf_cv_xt_x11_compat+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
 
-fi;
-if test "$withval" = yes ; then
-       cf_x_athena=XawPlus
-       echo "$as_me:9609: result: yes" >&5
-echo "${ECHO_T}yes" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line 11696 "configure"
+#include "confdefs.h"
+
+#include <X11/Xlib.h>
+
+int
+main ()
+{
+
+       int rc1 = XDrawLine((Display*) 0, (Drawable) 0, (GC) 0, 0, 0, 0, 0);
+       int rc2 = XClearWindow((Display*) 0, (Window) 0);
+       int rc3 = XMoveWindow((Display*) 0, (Window) 0, 0, 0);
+       int rc4 = XMoveResizeWindow((Display*)0, (Window)0, 0, 0, 0, 0);
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:11715: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:11718: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:11721: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:11724: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_cv_xt_x11_compat=yes
 else
-       echo "$as_me:9612: result: no" >&5
-echo "${ECHO_T}no" >&6
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_xt_x11_compat=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
+echo "$as_me:11734: result: $cf_cv_xt_x11_compat" >&5
+echo "${ECHO_T}$cf_cv_xt_x11_compat" >&6
+               if test "$cf_cv_xt_x11_compat" = no
+               then
+                       test -n "$verbose" && echo "    work around broken X11 dependency" 1>&6
 
-cf_x_athena_lib=""
+echo "${as_me:-configure}:11740: testing work around broken X11 dependency ..." 1>&5
 
-if test "$PKG_CONFIG" != none ; then
-       cf_athena_list=
-       test "$cf_x_athena" = Xaw && cf_athena_list="xaw8 xaw7 xaw6"
-       for cf_athena_pkg in \
-               $cf_athena_list \
-               ${cf_x_athena} \
-               ${cf_x_athena}-devel \
-               lib${cf_x_athena} \
-               lib${cf_x_athena}-devel
-       do
+                       # 2010/11/19 - good enough until a working Xt on Xcb is delivered.
 
-if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists $cf_athena_pkg; then
-       test -n "$verbose" && echo "    found package $cf_athena_pkg" 1>&6
+if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
+       test -n "$verbose" && echo "    found package x11" 1>&6
 
-echo "${as_me:-configure}:9632: testing found package $cf_athena_pkg ..." 1>&5
+echo "${as_me:-configure}:11747: testing found package x11 ..." 1>&5
 
-       cf_pkgconfig_incs="`$PKG_CONFIG --cflags $cf_athena_pkg 2>/dev/null`"
-       cf_pkgconfig_libs="`$PKG_CONFIG --libs   $cf_athena_pkg 2>/dev/null`"
-       test -n "$verbose" && echo "    package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs" 1>&6
+       cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
+       cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
+       test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
 
-echo "${as_me:-configure}:9638: testing package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs ..." 1>&5
+echo "${as_me:-configure}:11753: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
 
-       test -n "$verbose" && echo "    package $cf_athena_pkg LIBS: $cf_pkgconfig_libs" 1>&6
+       test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
 
-echo "${as_me:-configure}:9642: testing package $cf_athena_pkg LIBS: $cf_pkgconfig_libs ..." 1>&5
+echo "${as_me:-configure}:11757: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
 
 cf_fix_cppflags=no
 cf_new_cflags=
@@ -9720,39 +11835,95 @@ if test -n "$cf_new_extra_cppflags" ; then
 fi
 
        LIBS="$cf_pkgconfig_libs $LIBS"
+       :
+else
 
-                       cf_x_athena_lib="$cf_pkgconfig_libs"
+test -n "$verbose" && echo "   ...before $LIBS" 1>&6
 
-cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
+echo "${as_me:-configure}:11843: testing ...before $LIBS ..." 1>&5
 
-                       cat >>confdefs.h <<EOF
-#define $cf_x_athena_LIBS 1
-EOF
+LIBS=`echo "$LIBS" | sed -e "s/[       ][      ]*/ /g" -e "s,-lXt ,-lXt -lX11 ," -e 's/  / /g'`
+test -n "$verbose" && echo "   ...after  $LIBS" 1>&6
 
-                       break
+echo "${as_me:-configure}:11848: testing ...after  $LIBS ..." 1>&5
+
+fi
+
+               fi
+               ;;
+       esac
+
+echo "$as_me:11856: checking for usable X Toolkit package" >&5
+echo $ECHO_N "checking for usable X Toolkit package... $ECHO_C" >&6
+if test "${cf_cv_xt_ice_compat+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-       :
+
+cat >conftest.$ac_ext <<_ACEOF
+#line 11863 "configure"
+#include "confdefs.h"
+
+#include <X11/Shell.h>
+
+int
+main ()
+{
+int num = IceConnectionNumber(0)
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:11878: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:11881: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:11884: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:11887: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_cv_xt_ice_compat=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_xt_ice_compat=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
+echo "$as_me:11897: result: $cf_cv_xt_ice_compat" >&5
+echo "${ECHO_T}$cf_cv_xt_ice_compat" >&6
 
-       done
-fi
+       if test "$cf_cv_xt_ice_compat" = no
+       then
+               # workaround for broken ".pc" files used for X Toolkit.
+               case "x$X_PRE_LIBS" in #(vi
+               *-lICE*)
+                       case "x$LIBS" in #(vi
+                       *-lICE*) #(vi
+                               ;;
+                       *)
+                               test -n "$verbose" && echo "    work around broken ICE dependency" 1>&6
 
-if test -z "$cf_x_athena_lib" ; then
+echo "${as_me:-configure}:11911: testing work around broken ICE dependency ..." 1>&5
 
-if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists Xext; then
-       test -n "$verbose" && echo "    found package Xext" 1>&6
+if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
+       test -n "$verbose" && echo "    found package ice" 1>&6
 
-echo "${as_me:-configure}:9745: testing found package Xext ..." 1>&5
+echo "${as_me:-configure}:11916: testing found package ice ..." 1>&5
 
-       cf_pkgconfig_incs="`$PKG_CONFIG --cflags Xext 2>/dev/null`"
-       cf_pkgconfig_libs="`$PKG_CONFIG --libs   Xext 2>/dev/null`"
-       test -n "$verbose" && echo "    package Xext CFLAGS: $cf_pkgconfig_incs" 1>&6
+       cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
+       cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
+       test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
 
-echo "${as_me:-configure}:9751: testing package Xext CFLAGS: $cf_pkgconfig_incs ..." 1>&5
+echo "${as_me:-configure}:11922: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
 
-       test -n "$verbose" && echo "    package Xext LIBS: $cf_pkgconfig_libs" 1>&6
+       test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
 
-echo "${as_me:-configure}:9755: testing package Xext LIBS: $cf_pkgconfig_libs ..." 1>&5
+echo "${as_me:-configure}:11926: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
 
 cf_fix_cppflags=no
 cf_new_cflags=
@@ -9833,80 +12004,21 @@ if test -n "$cf_new_extra_cppflags" ; then
 fi
 
        LIBS="$cf_pkgconfig_libs $LIBS"
-       :
-else
-
-       echo "$as_me:9839: checking for XextCreateExtension in -lXext" >&5
-echo $ECHO_N "checking for XextCreateExtension in -lXext... $ECHO_C" >&6
-if test "${ac_cv_lib_Xext_XextCreateExtension+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lXext  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-#line 9847 "configure"
-#include "confdefs.h"
-
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char XextCreateExtension ();
-int
-main ()
-{
-XextCreateExtension ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:9866: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:9869: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:9872: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:9875: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_Xext_XextCreateExtension=yes
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-ac_cv_lib_Xext_XextCreateExtension=no
-fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:9886: result: $ac_cv_lib_Xext_XextCreateExtension" >&5
-echo "${ECHO_T}$ac_cv_lib_Xext_XextCreateExtension" >&6
-if test $ac_cv_lib_Xext_XextCreateExtension = yes; then
-  LIBS="-lXext $LIBS"
-fi
-
-fi
-
-cf_have_X_LIBS=no
 
-if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
-       test -n "$verbose" && echo "    found package xt" 1>&6
+if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
+       test -n "$verbose" && echo "    found package sm" 1>&6
 
-echo "${as_me:-configure}:9899: testing found package xt ..." 1>&5
+echo "${as_me:-configure}:12011: testing found package sm ..." 1>&5
 
-       cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
-       cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
-       test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
+       cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
+       cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
+       test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
 
-echo "${as_me:-configure}:9905: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
+echo "${as_me:-configure}:12017: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
 
-       test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
+       test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
 
-echo "${as_me:-configure}:9909: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
+echo "${as_me:-configure}:12021: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
 
 cf_fix_cppflags=no
 cf_new_cflags=
@@ -9987,31 +12099,29 @@ if test -n "$cf_new_extra_cppflags" ; then
 fi
 
        LIBS="$cf_pkgconfig_libs $LIBS"
+       :
+else
+       :
+fi
 
-       # workaround for broken ".pc" files used for X Toolkit.
-       case "x$X_PRE_LIBS" in #(vi
-       *-lICE*)
-               case "x$LIBS" in #(vi
-               *-lICE*) #(vi
-                       ;;
-               *)
-                       test -n "$verbose" && echo "    work around broken package" 1>&6
+else
 
-echo "${as_me:-configure}:10000: testing work around broken package ..." 1>&5
+test -n "$verbose" && echo "   ...before $LIBS" 1>&6
 
-                       test -n "$verbose" && echo "    ...before $LIBS" 1>&6
+echo "${as_me:-configure}:12111: testing ...before $LIBS ..." 1>&5
 
-echo "${as_me:-configure}:10004: testing ...before $LIBS ..." 1>&5
+LIBS=`echo "$LIBS" | sed -e "s/[       ][      ]*/ /g" -e "s,-lXt ,-lXt $X_PRE_LIBS ," -e 's/  / /g'`
+test -n "$verbose" && echo "   ...after  $LIBS" 1>&6
 
-                       LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s,-lXt ,-lXt $X_PRE_LIBS ," -e 's/  / /g'`
-                       test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
+echo "${as_me:-configure}:12116: testing ...after  $LIBS ..." 1>&5
 
-echo "${as_me:-configure}:10009: testing ...after  $LIBS ..." 1>&5
+fi
 
+                               ;;
+                       esac
                        ;;
                esac
-               ;;
-       esac
+       fi
 
        cf_have_X_LIBS=yes
 
@@ -10021,7 +12131,7 @@ else
 
 test -n "$verbose" && echo "   checking additions to CFLAGS" 1>&6
 
-echo "${as_me:-configure}:10024: testing checking additions to CFLAGS ..." 1>&5
+echo "${as_me:-configure}:12134: testing checking additions to CFLAGS ..." 1>&5
 
 cf_check_cflags="$CFLAGS"
 cf_check_cppflags="$CPPFLAGS"
@@ -10092,7 +12202,7 @@ done
 if test -n "$cf_new_cflags" ; then
        test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
 
-echo "${as_me:-configure}:10095: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
+echo "${as_me:-configure}:12205: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
 
        CFLAGS="$CFLAGS $cf_new_cflags"
 fi
@@ -10100,7 +12210,7 @@ fi
 if test -n "$cf_new_cppflags" ; then
        test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
 
-echo "${as_me:-configure}:10103: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
+echo "${as_me:-configure}:12213: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
 
        CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
 fi
 if test -n "$cf_new_extra_cppflags" ; then
        test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
 
-echo "${as_me:-configure}:10111: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
+echo "${as_me:-configure}:12221: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
 
        EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
 fi
 
 if test "$cf_check_cflags" != "$CFLAGS" ; then
 cat >conftest.$ac_ext <<_ACEOF
-#line 10118 "configure"
+#line 12228 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 int
@@ -10127,16 +12237,16 @@ printf("Hello world");
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:10130: \"$ac_link\"") >&5
+if { (eval echo "$as_me:12240: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:10133: \$? = $ac_status" >&5
+  echo "$as_me:12243: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:10136: \"$ac_try\"") >&5
+  { (eval echo "$as_me:12246: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:10139: \$? = $ac_status" >&5
+  echo "$as_me:12249: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   :
 else
@@ -10144,12 +12254,12 @@ else
 cat conftest.$ac_ext >&5
 test -n "$verbose" && echo "   test-compile failed.  Undoing change to \$CFLAGS" 1>&6
 
-echo "${as_me:-configure}:10147: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
+echo "${as_me:-configure}:12257: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
 
         if test "$cf_check_cppflags" != "$CPPFLAGS" ; then
                 test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
 
-echo "${as_me:-configure}:10152: testing but keeping change to \$CPPFLAGS ..." 1>&5
+echo "${as_me:-configure}:12262: testing but keeping change to \$CPPFLAGS ..." 1>&5
 
         fi
         CFLAGS="$cf_check_flags"
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
 
-       echo "$as_me:10160: checking for XOpenDisplay" >&5
+       echo "$as_me:12270: checking for XOpenDisplay" >&5
 echo $ECHO_N "checking for XOpenDisplay... $ECHO_C" >&6
 if test "${ac_cv_func_XOpenDisplay+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 10166 "configure"
+#line 12276 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char XOpenDisplay (); below.  */
@@ -10186,7 +12296,7 @@ main ()
 #if defined (__stub_XOpenDisplay) || defined (__stub___XOpenDisplay)
 choke me
 #else
-f = XOpenDisplay;
+f = XOpenDisplay; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
 #endif
 
   ;
@@ -10194,16 +12304,16 @@ f = XOpenDisplay;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:10197: \"$ac_link\"") >&5
+if { (eval echo "$as_me:12307: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:10200: \$? = $ac_status" >&5
+  echo "$as_me:12310: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:10203: \"$ac_try\"") >&5
+  { (eval echo "$as_me:12313: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:10206: \$? = $ac_status" >&5
+  echo "$as_me:12316: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_func_XOpenDisplay=yes
 else
@@ -10213,13 +12323,13 @@ ac_cv_func_XOpenDisplay=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:10216: result: $ac_cv_func_XOpenDisplay" >&5
+echo "$as_me:12326: result: $ac_cv_func_XOpenDisplay" >&5
 echo "${ECHO_T}$ac_cv_func_XOpenDisplay" >&6
 if test $ac_cv_func_XOpenDisplay = yes; then
   :
 else
 
-       echo "$as_me:10222: checking for XOpenDisplay in -lX11" >&5
+       echo "$as_me:12332: checking for XOpenDisplay in -lX11" >&5
 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -10227,7 +12337,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 10230 "configure"
+#line 12340 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -10246,16 +12356,16 @@ XOpenDisplay ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:10249: \"$ac_link\"") >&5
+if { (eval echo "$as_me:12359: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:10252: \$? = $ac_status" >&5
+  echo "$as_me:12362: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:10255: \"$ac_try\"") >&5
+  { (eval echo "$as_me:12365: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:10258: \$? = $ac_status" >&5
+  echo "$as_me:12368: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_X11_XOpenDisplay=yes
 else
@@ -10266,7 +12376,7 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:10269: result: $ac_cv_lib_X11_XOpenDisplay" >&5
+echo "$as_me:12379: result: $ac_cv_lib_X11_XOpenDisplay" >&5
 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
   LIBS="-lX11 $LIBS"
 
 fi
 
-       echo "$as_me:10277: checking for XtAppInitialize" >&5
+       echo "$as_me:12387: checking for XtAppInitialize" >&5
 echo $ECHO_N "checking for XtAppInitialize... $ECHO_C" >&6
 if test "${ac_cv_func_XtAppInitialize+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 10283 "configure"
+#line 12393 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char XtAppInitialize (); below.  */
@@ -10303,7 +12413,7 @@ main ()
 #if defined (__stub_XtAppInitialize) || defined (__stub___XtAppInitialize)
 choke me
 #else
-f = XtAppInitialize;
+f = XtAppInitialize; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
 #endif
 
   ;
@@ -10311,16 +12421,16 @@ f = XtAppInitialize;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:10314: \"$ac_link\"") >&5
+if { (eval echo "$as_me:12424: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:10317: \$? = $ac_status" >&5
+  echo "$as_me:12427: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:10320: \"$ac_try\"") >&5
+  { (eval echo "$as_me:12430: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:10323: \$? = $ac_status" >&5
+  echo "$as_me:12433: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_func_XtAppInitialize=yes
 else
@@ -10330,13 +12440,13 @@ ac_cv_func_XtAppInitialize=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:10333: result: $ac_cv_func_XtAppInitialize" >&5
+echo "$as_me:12443: result: $ac_cv_func_XtAppInitialize" >&5
 echo "${ECHO_T}$ac_cv_func_XtAppInitialize" >&6
 if test $ac_cv_func_XtAppInitialize = yes; then
   :
 else
 
-       echo "$as_me:10339: checking for XtAppInitialize in -lXt" >&5
+       echo "$as_me:12449: checking for XtAppInitialize in -lXt" >&5
 echo $ECHO_N "checking for XtAppInitialize in -lXt... $ECHO_C" >&6
 if test "${ac_cv_lib_Xt_XtAppInitialize+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -10344,7 +12454,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 10347 "configure"
+#line 12457 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -10363,16 +12473,16 @@ XtAppInitialize ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:10366: \"$ac_link\"") >&5
+if { (eval echo "$as_me:12476: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:10369: \$? = $ac_status" >&5
+  echo "$as_me:12479: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:10372: \"$ac_try\"") >&5
+  { (eval echo "$as_me:12482: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:10375: \$? = $ac_status" >&5
+  echo "$as_me:12485: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_Xt_XtAppInitialize=yes
 else
@@ -10383,7 +12493,7 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:10386: result: $ac_cv_lib_Xt_XtAppInitialize" >&5
+echo "$as_me:12496: result: $ac_cv_lib_Xt_XtAppInitialize" >&5
 echo "${ECHO_T}$ac_cv_lib_Xt_XtAppInitialize" >&6
 if test $ac_cv_lib_Xt_XtAppInitialize = yes; then
   cat >>confdefs.h <<\EOF
@@ -10399,7 +12509,7 @@ fi
 fi
 
 if test $cf_have_X_LIBS = no ; then
-       { echo "$as_me:10402: WARNING: Unable to successfully link X Toolkit library (-lXt) with
+       { echo "$as_me:12512: WARNING: Unable to successfully link X Toolkit library (-lXt) with
 test program.  You will have to check and add the proper libraries by hand
 to makefile." >&5
 echo "$as_me: WARNING: Unable to successfully link X Toolkit library (-lXt) with
                cf_test=X11/$cf_x_athena_root/SimpleMenu.h
                if test $cf_path != default ; then
                        CPPFLAGS="$cf_save -I$cf_path/include"
-                       echo "$as_me:10424: checking for $cf_test in $cf_path" >&5
+                       echo "$as_me:12534: checking for $cf_test in $cf_path" >&5
 echo $ECHO_N "checking for $cf_test in $cf_path... $ECHO_C" >&6
                else
-                       echo "$as_me:10427: checking for $cf_test" >&5
+                       echo "$as_me:12537: checking for $cf_test" >&5
 echo $ECHO_N "checking for $cf_test... $ECHO_C" >&6
                fi
                cat >conftest.$ac_ext <<_ACEOF
-#line 10431 "configure"
+#line 12541 "configure"
 #include "confdefs.h"
 
 #include <X11/Intrinsic.h>
@@ -10442,16 +12552,16 @@ main ()
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:10445: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:12555: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:10448: \$? = $ac_status" >&5
+  echo "$as_me:12558: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:10451: \"$ac_try\"") >&5
+  { (eval echo "$as_me:12561: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:10454: \$? = $ac_status" >&5
+  echo "$as_me:12564: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_result=yes
 else
@@ -10460,7 +12570,7 @@ cat conftest.$ac_ext >&5
 cf_result=no
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
-               echo "$as_me:10463: result: $cf_result" >&5
+               echo "$as_me:12573: result: $cf_result" >&5
 echo "${ECHO_T}$cf_result" >&6
                if test "$cf_result" = yes ; then
                        cf_x_athena_inc=$cf_path
@@ -10472,7 +12582,7 @@ echo "${ECHO_T}$cf_result" >&6
 done
 
 if test -z "$cf_x_athena_inc" ; then
-       { echo "$as_me:10475: WARNING: Unable to successfully find Athena header files with test program" >&5
+       { echo "$as_me:12585: WARNING: Unable to successfully find Athena header files with test program" >&5
 echo "$as_me: WARNING: Unable to successfully find Athena header files with test program" >&2;}
 elif test "$cf_x_athena_inc" != default ; then
        CPPFLAGS="$CPPFLAGS -I$cf_x_athena_inc"
@@ -10488,45 +12598,54 @@ for cf_path in default \
        /usr/local
 do
        for cf_lib in \
-               "-l$cf_x_athena_root -lXmu" \
-               "-l$cf_x_athena_root -lXpm -lXmu" \
-               "-l${cf_x_athena_root}_s -lXmu_s"
+               ${cf_x_athena_root} \
+               ${cf_x_athena_root}7 \
+               ${cf_x_athena_root}6
+       do
+       for cf_libs in \
+               "-l$cf_lib -lXmu" \
+               "-l$cf_lib -lXpm -lXmu" \
+               "-l${cf_lib}_s -lXmu_s"
        do
                if test -z "$cf_x_athena_lib" ; then
                        cf_save="$LIBS"
                        cf_test=XawSimpleMenuAddGlobalActions
                        if test $cf_path != default ; then
-                               LIBS="-L$cf_path/lib $cf_lib $LIBS"
-                               echo "$as_me:10500: checking for $cf_lib in $cf_path" >&5
-echo $ECHO_N "checking for $cf_lib in $cf_path... $ECHO_C" >&6
+                               LIBS="-L$cf_path/lib $cf_libs $LIBS"
+                               echo "$as_me:12615: checking for $cf_libs in $cf_path" >&5
+echo $ECHO_N "checking for $cf_libs in $cf_path... $ECHO_C" >&6
                        else
-                               LIBS="$cf_lib $LIBS"
-                               echo "$as_me:10504: checking for $cf_test in $cf_lib" >&5
-echo $ECHO_N "checking for $cf_test in $cf_lib... $ECHO_C" >&6
+                               LIBS="$cf_libs $LIBS"
+                               echo "$as_me:12619: checking for $cf_test in $cf_libs" >&5
+echo $ECHO_N "checking for $cf_test in $cf_libs... $ECHO_C" >&6
                        fi
                        cat >conftest.$ac_ext <<_ACEOF
-#line 10508 "configure"
+#line 12623 "configure"
 #include "confdefs.h"
 
+#include <X11/Intrinsic.h>
+#include <X11/$cf_x_athena_root/SimpleMenu.h>
+
 int
 main ()
 {
-$cf_test()
+
+$cf_test((XtAppContext) 0)
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:10520: \"$ac_link\"") >&5
+if { (eval echo "$as_me:12639: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:10523: \$? = $ac_status" >&5
+  echo "$as_me:12642: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:10526: \"$ac_try\"") >&5
+  { (eval echo "$as_me:12645: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:10529: \$? = $ac_status" >&5
+  echo "$as_me:12648: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_result=yes
 else
@@ -10535,19 +12654,21 @@ cat conftest.$ac_ext >&5
 cf_result=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-                       echo "$as_me:10538: result: $cf_result" >&5
+                       echo "$as_me:12657: result: $cf_result" >&5
 echo "${ECHO_T}$cf_result" >&6
                        if test "$cf_result" = yes ; then
-                               cf_x_athena_lib="$cf_lib"
+                               cf_x_athena_lib="$cf_libs"
                                break
                        fi
                        LIBS="$cf_save"
                fi
-       done
+       done # cf_libs
+               test -n "$cf_x_athena_lib" && break
+       done # cf_lib
 done
 
 if test -z "$cf_x_athena_lib" ; then
-       { { echo "$as_me:10550: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&5
+       { { echo "$as_me:12671: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&5
 echo "$as_me: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&2;}
    { (exit 1); exit 1; }; }
 fi
@@ -10560,48 +12681,86 @@ EOF
 
 fi
 
-for ac_prog in xcurses-config
+if test -n "$ac_tool_prefix"; then
+  for ac_prog in xcurses-config
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+echo "$as_me:12689: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_XCURSES_CONFIG+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$XCURSES_CONFIG"; then
+  ac_cv_prog_XCURSES_CONFIG="$XCURSES_CONFIG" # Let the user override the test.
+else
+  ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+  IFS=$ac_save_IFS
+  test -z "$ac_dir" && ac_dir=.
+  $as_executable_p "$ac_dir/$ac_word" || continue
+ac_cv_prog_XCURSES_CONFIG="$ac_tool_prefix$ac_prog"
+echo "$as_me:12704: found $ac_dir/$ac_word" >&5
+break
+done
+
+fi
+fi
+XCURSES_CONFIG=$ac_cv_prog_XCURSES_CONFIG
+if test -n "$XCURSES_CONFIG"; then
+  echo "$as_me:12712: result: $XCURSES_CONFIG" >&5
+echo "${ECHO_T}$XCURSES_CONFIG" >&6
+else
+  echo "$as_me:12715: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+    test -n "$XCURSES_CONFIG" && break
+  done
+fi
+if test -z "$XCURSES_CONFIG"; then
+  ac_ct_XCURSES_CONFIG=$XCURSES_CONFIG
+  for ac_prog in xcurses-config
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-echo "$as_me:10567: checking for $ac_word" >&5
+echo "$as_me:12728: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_path_XCURSES_CONFIG+set}" = set; then
+if test "${ac_cv_prog_ac_ct_XCURSES_CONFIG+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  case $XCURSES_CONFIG in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_XCURSES_CONFIG="$XCURSES_CONFIG" # Let the user override the test with a path.
-  ;;
-  *)
+  if test -n "$ac_ct_XCURSES_CONFIG"; then
+  ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_ct_XCURSES_CONFIG" # Let the user override the test.
+else
   ac_save_IFS=$IFS; IFS=$ac_path_separator
 ac_dummy="$PATH"
 for ac_dir in $ac_dummy; do
   IFS=$ac_save_IFS
   test -z "$ac_dir" && ac_dir=.
-  if $as_executable_p "$ac_dir/$ac_word"; then
-   ac_cv_path_XCURSES_CONFIG="$ac_dir/$ac_word"
-   echo "$as_me:10584: found $ac_dir/$ac_word" >&5
-   break
-fi
+  $as_executable_p "$ac_dir/$ac_word" || continue
+ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_prog"
+echo "$as_me:12743: found $ac_dir/$ac_word" >&5
+break
 done
 
-  ;;
-esac
 fi
-XCURSES_CONFIG=$ac_cv_path_XCURSES_CONFIG
-
-if test -n "$XCURSES_CONFIG"; then
-  echo "$as_me:10595: result: $XCURSES_CONFIG" >&5
-echo "${ECHO_T}$XCURSES_CONFIG" >&6
+fi
+ac_ct_XCURSES_CONFIG=$ac_cv_prog_ac_ct_XCURSES_CONFIG
+if test -n "$ac_ct_XCURSES_CONFIG"; then
+  echo "$as_me:12751: result: $ac_ct_XCURSES_CONFIG" >&5
+echo "${ECHO_T}$ac_ct_XCURSES_CONFIG" >&6
 else
-  echo "$as_me:10598: result: no" >&5
+  echo "$as_me:12754: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
-  test -n "$XCURSES_CONFIG" && break
+  test -n "$ac_ct_XCURSES_CONFIG" && break
 done
-test -n "$XCURSES_CONFIG" || XCURSES_CONFIG="none"
+test -n "$ac_ct_XCURSES_CONFIG" || ac_ct_XCURSES_CONFIG="none"
+
+  XCURSES_CONFIG=$ac_ct_XCURSES_CONFIG
+fi
 
 if test "$XCURSES_CONFIG" != none ; then
 
@@ -10616,7 +12775,7 @@ LDFLAGS="$LDFLAGS $X_LIBS"
 
 test -n "$verbose" && echo "   checking additions to CFLAGS" 1>&6
 
-echo "${as_me:-configure}:10619: testing checking additions to CFLAGS ..." 1>&5
+echo "${as_me:-configure}:12778: testing checking additions to CFLAGS ..." 1>&5
 
 cf_check_cflags="$CFLAGS"
 cf_check_cppflags="$CPPFLAGS"
@@ -10687,7 +12846,7 @@ done
 if test -n "$cf_new_cflags" ; then
        test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
 
-echo "${as_me:-configure}:10690: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
+echo "${as_me:-configure}:12849: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
 
        CFLAGS="$CFLAGS $cf_new_cflags"
 fi
@@ -10695,7 +12854,7 @@ fi
 if test -n "$cf_new_cppflags" ; then
        test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
 
-echo "${as_me:-configure}:10698: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
+echo "${as_me:-configure}:12857: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
 
        CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
 fi
 if test -n "$cf_new_extra_cppflags" ; then
        test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
 
-echo "${as_me:-configure}:10706: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
+echo "${as_me:-configure}:12865: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
 
        EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
 fi
 
 if test "$cf_check_cflags" != "$CFLAGS" ; then
 cat >conftest.$ac_ext <<_ACEOF
-#line 10713 "configure"
+#line 12872 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 int
@@ -10722,16 +12881,16 @@ printf("Hello world");
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:10725: \"$ac_link\"") >&5
+if { (eval echo "$as_me:12884: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:10728: \$? = $ac_status" >&5
+  echo "$as_me:12887: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:10731: \"$ac_try\"") >&5
+  { (eval echo "$as_me:12890: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:10734: \$? = $ac_status" >&5
+  echo "$as_me:12893: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   :
 else
@@ -10739,12 +12898,12 @@ else
 cat conftest.$ac_ext >&5
 test -n "$verbose" && echo "   test-compile failed.  Undoing change to \$CFLAGS" 1>&6
 
-echo "${as_me:-configure}:10742: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
+echo "${as_me:-configure}:12901: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
 
         if test "$cf_check_cppflags" != "$CPPFLAGS" ; then
                 test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
 
-echo "${as_me:-configure}:10747: testing but keeping change to \$CPPFLAGS ..." 1>&5
+echo "${as_me:-configure}:12906: testing but keeping change to \$CPPFLAGS ..." 1>&5
 
         fi
         CFLAGS="$cf_check_flags"
@@ -10752,7 +12911,7 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
 
-echo "$as_me:10755: checking for XOpenDisplay in -lX11" >&5
+echo "$as_me:12914: checking for XOpenDisplay in -lX11" >&5
 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -10760,7 +12919,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 10763 "configure"
+#line 12922 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -10779,16 +12938,16 @@ XOpenDisplay ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:10782: \"$ac_link\"") >&5
+if { (eval echo "$as_me:12941: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:10785: \$? = $ac_status" >&5
+  echo "$as_me:12944: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:10788: \"$ac_try\"") >&5
+  { (eval echo "$as_me:12947: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:10791: \$? = $ac_status" >&5
+  echo "$as_me:12950: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_X11_XOpenDisplay=yes
 else
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:10802: result: $ac_cv_lib_X11_XOpenDisplay" >&5
+echo "$as_me:12961: result: $ac_cv_lib_X11_XOpenDisplay" >&5
 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
   LIBS="-lX11 $LIBS"
 fi
 
-echo "$as_me:10808: checking for XCurses library" >&5
+echo "$as_me:12967: checking for XCurses library" >&5
 echo $ECHO_N "checking for XCurses library... $ECHO_C" >&6
 if test "${cf_cv_lib_XCurses+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -10813,7 +12972,7 @@ else
 
 LIBS="-lXCurses $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 10816 "configure"
+#line 12975 "configure"
 #include "confdefs.h"
 
 #include <xcurses.h>
@@ -10828,50 +12987,206 @@ XCursesExit();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:10831: \"$ac_link\"") >&5
+if { (eval echo "$as_me:12990: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:10834: \$? = $ac_status" >&5
+  echo "$as_me:12993: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:12996: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:12999: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_cv_lib_XCurses=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_lib_XCurses=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+
+fi
+echo "$as_me:13010: result: $cf_cv_lib_XCurses" >&5
+echo "${ECHO_T}$cf_cv_lib_XCurses" >&6
+
+fi
+
+if test $cf_cv_lib_XCurses = yes ; then
+       cat >>confdefs.h <<\EOF
+#define UNIX 1
+EOF
+
+       cat >>confdefs.h <<\EOF
+#define XCURSES 1
+EOF
+
+       echo "$as_me:13024: checking for xcurses.h" >&5
+echo $ECHO_N "checking for xcurses.h... $ECHO_C" >&6
+if test "${ac_cv_header_xcurses_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 13030 "configure"
+#include "confdefs.h"
+#include <xcurses.h>
+_ACEOF
+if { (eval echo "$as_me:13034: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  egrep -v '^ *\+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:13040: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_cv_header_xcurses_h=yes
+else
+  echo "$as_me: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  ac_cv_header_xcurses_h=no
+fi
+rm -f conftest.err conftest.$ac_ext
+fi
+echo "$as_me:13059: result: $ac_cv_header_xcurses_h" >&5
+echo "${ECHO_T}$ac_cv_header_xcurses_h" >&6
+if test $ac_cv_header_xcurses_h = yes; then
+  cat >>confdefs.h <<\EOF
+#define HAVE_XCURSES 1
+EOF
+
+fi
+
+else
+       { { echo "$as_me:13069: error: Cannot link with XCurses" >&5
+echo "$as_me: error: Cannot link with XCurses" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+       ;;
+esac
+
+case $cf_cv_screen in
+curses|curses_*)
+
+echo "$as_me:13080: checking for NetBSD form.h" >&5
+echo $ECHO_N "checking for NetBSD form.h... $ECHO_C" >&6
+if test "${cf_cv_netbsd_form_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+cat >conftest.$ac_ext <<_ACEOF
+#line 13087 "configure"
+#include "confdefs.h"
+
+#include <${cf_cv_ncurses_header:-curses.h}>
+#include <form.h>
+
+int
+main ()
+{
+
+       FORM *form;
+       int y = current_field(form)->cursor_ypos;
+       int x = current_field(form)->cursor_xpos;
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:13106: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:13109: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:13112: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:13115: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_cv_netbsd_form_h=yes
+
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_netbsd_form_h=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+
+fi
+echo "$as_me:13127: result: $cf_cv_netbsd_form_h" >&5
+echo "${ECHO_T}$cf_cv_netbsd_form_h" >&6
+
+test "$cf_cv_netbsd_form_h" = yes && cat >>confdefs.h <<\EOF
+#define HAVE_NETBSD_FORM_H 1
+EOF
+
+echo "$as_me:13134: checking for NetBSD menu.h" >&5
+echo $ECHO_N "checking for NetBSD menu.h... $ECHO_C" >&6
+if test "${cf_cv_netbsd_menu_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+cat >conftest.$ac_ext <<_ACEOF
+#line 13141 "configure"
+#include "confdefs.h"
+
+#include <${cf_cv_ncurses_header:-curses.h}>
+#include <menu.h>
+
+int
+main ()
+{
+
+       MENU *menu;
+       int y = menu->max_item_width;
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:13159: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:13162: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:10837: \"$ac_try\"") >&5
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:13165: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:10840: \$? = $ac_status" >&5
+  echo "$as_me:13168: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  cf_cv_lib_XCurses=yes
+  cf_cv_netbsd_menu_h=yes
+
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
-cf_cv_lib_XCurses=no
-fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-
+cf_cv_netbsd_menu_h=no
 fi
-echo "$as_me:10851: result: $cf_cv_lib_XCurses" >&5
-echo "${ECHO_T}$cf_cv_lib_XCurses" >&6
+rm -f conftest.$ac_objext conftest.$ac_ext
 
 fi
+echo "$as_me:13180: result: $cf_cv_netbsd_menu_h" >&5
+echo "${ECHO_T}$cf_cv_netbsd_menu_h" >&6
 
-if test $cf_cv_lib_XCurses = yes ; then
-       cat >>confdefs.h <<\EOF
-#define UNIX 1
-EOF
-
-       cat >>confdefs.h <<\EOF
-#define XCURSES 1
-EOF
-
-       cat >>confdefs.h <<\EOF
-#define HAVE_XCURSES 1
+test "$cf_cv_netbsd_menu_h" = yes && cat >>confdefs.h <<\EOF
+#define HAVE_NETBSD_MENU_H 1
 EOF
 
-else
-       { { echo "$as_me:10870: error: Cannot link with XCurses" >&5
-echo "$as_me: error: Cannot link with XCurses" >&2;}
-   { (exit 1); exit 1; }; }
-fi
-
+       ;;
+ncursesw)
+       cf_cv_libtype=w
        ;;
 esac
 
@@ -10882,7 +13197,7 @@ pdcurses) #(vi
        # look for curses-related libraries
 
 as_ac_Lib=`echo "ac_cv_lib_panel$cf_cv_libtype''_new_panel" | $as_tr_sh`
-echo "$as_me:10885: checking for new_panel in -lpanel$cf_cv_libtype" >&5
+echo "$as_me:13200: checking for new_panel in -lpanel$cf_cv_libtype" >&5
 echo $ECHO_N "checking for new_panel in -lpanel$cf_cv_libtype... $ECHO_C" >&6
 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -10890,7 +13205,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lpanel$cf_cv_libtype  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 10893 "configure"
+#line 13208 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -10909,16 +13224,16 @@ new_panel ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:10912: \"$ac_link\"") >&5
+if { (eval echo "$as_me:13227: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:10915: \$? = $ac_status" >&5
+  echo "$as_me:13230: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:10918: \"$ac_try\"") >&5
+  { (eval echo "$as_me:13233: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:10921: \$? = $ac_status" >&5
+  echo "$as_me:13236: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   eval "$as_ac_Lib=yes"
 else
@@ -10929,7 +13244,7 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:10932: result: `eval echo '${'$as_ac_Lib'}'`" >&5
+echo "$as_me:13247: result: `eval echo '${'$as_ac_Lib'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
   cat >>confdefs.h <<EOF
@@ -10941,7 +13256,7 @@ EOF
 fi
 
 as_ac_Lib=`echo "ac_cv_lib_menu$cf_cv_libtype''_menu_driver" | $as_tr_sh`
-echo "$as_me:10944: checking for menu_driver in -lmenu$cf_cv_libtype" >&5
+echo "$as_me:13259: checking for menu_driver in -lmenu$cf_cv_libtype" >&5
 echo $ECHO_N "checking for menu_driver in -lmenu$cf_cv_libtype... $ECHO_C" >&6
 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -10949,7 +13264,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lmenu$cf_cv_libtype  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 10952 "configure"
+#line 13267 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -10968,16 +13283,16 @@ menu_driver ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:10971: \"$ac_link\"") >&5
+if { (eval echo "$as_me:13286: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:10974: \$? = $ac_status" >&5
+  echo "$as_me:13289: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:10977: \"$ac_try\"") >&5
+  { (eval echo "$as_me:13292: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:10980: \$? = $ac_status" >&5
+  echo "$as_me:13295: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   eval "$as_ac_Lib=yes"
 else
@@ -10988,7 +13303,7 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:10991: result: `eval echo '${'$as_ac_Lib'}'`" >&5
+echo "$as_me:13306: result: `eval echo '${'$as_ac_Lib'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
   cat >>confdefs.h <<EOF
@@ -11000,7 +13315,7 @@ EOF
 fi
 
 as_ac_Lib=`echo "ac_cv_lib_form$cf_cv_libtype''_form_driver" | $as_tr_sh`
-echo "$as_me:11003: checking for form_driver in -lform$cf_cv_libtype" >&5
+echo "$as_me:13318: checking for form_driver in -lform$cf_cv_libtype" >&5
 echo $ECHO_N "checking for form_driver in -lform$cf_cv_libtype... $ECHO_C" >&6
 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -11008,7 +13323,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lform$cf_cv_libtype  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 11011 "configure"
+#line 13326 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -11027,16 +13342,16 @@ form_driver ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:11030: \"$ac_link\"") >&5
+if { (eval echo "$as_me:13345: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:11033: \$? = $ac_status" >&5
+  echo "$as_me:13348: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:11036: \"$ac_try\"") >&5
+  { (eval echo "$as_me:13351: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:11039: \$? = $ac_status" >&5
+  echo "$as_me:13354: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   eval "$as_ac_Lib=yes"
 else
@@ -11047,7 +13362,7 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:11050: result: `eval echo '${'$as_ac_Lib'}'`" >&5
+echo "$as_me:13365: result: `eval echo '${'$as_ac_Lib'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
   cat >>confdefs.h <<EOF
@@ -11066,26 +13381,27 @@ for ac_header in \
                form.h \
                menu.h \
                panel.h \
+               term_entry.h \
 
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-echo "$as_me:11072: checking for $ac_header" >&5
+echo "$as_me:13388: checking for $ac_header" >&5
 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
 if eval "test \"\${$as_ac_Header+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 11078 "configure"
+#line 13394 "configure"
 #include "confdefs.h"
 #include <$ac_header>
 _ACEOF
-if { (eval echo "$as_me:11082: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:13398: \"$ac_cpp conftest.$ac_ext\"") >&5
   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
   ac_status=$?
   egrep -v '^ *\+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:11088: \$? = $ac_status" >&5
+  echo "$as_me:13404: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
@@ -11104,7 +13420,7 @@ else
 fi
 rm -f conftest.err conftest.$ac_ext
 fi
-echo "$as_me:11107: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "$as_me:13423: result: `eval echo '${'$as_ac_Header'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
 if test `eval echo '${'$as_ac_Header'}'` = yes; then
   cat >>confdefs.h <<EOF
@@ -11117,13 +13433,13 @@ done
        ;;
 esac
 
-echo "$as_me:11120: checking return type of signal handlers" >&5
+echo "$as_me:13436: checking return type of signal handlers" >&5
 echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6
 if test "${ac_cv_type_signal+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 11126 "configure"
+#line 13442 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <signal.h>
@@ -11145,16 +13461,16 @@ int i;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:11148: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:13464: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:11151: \$? = $ac_status" >&5
+  echo "$as_me:13467: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:11154: \"$ac_try\"") >&5
+  { (eval echo "$as_me:13470: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:11157: \$? = $ac_status" >&5
+  echo "$as_me:13473: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_type_signal=void
 else
@@ -11164,20 +13480,20 @@ ac_cv_type_signal=int
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:11167: result: $ac_cv_type_signal" >&5
+echo "$as_me:13483: result: $ac_cv_type_signal" >&5
 echo "${ECHO_T}$ac_cv_type_signal" >&6
 
 cat >>confdefs.h <<EOF
 #define RETSIGTYPE $ac_cv_type_signal
 EOF
 
-echo "$as_me:11174: checking for ANSI C header files" >&5
+echo "$as_me:13490: checking for ANSI C header files" >&5
 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
 if test "${ac_cv_header_stdc+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 11180 "configure"
+#line 13496 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -11185,13 +13501,13 @@ else
 #include <float.h>
 
 _ACEOF
-if { (eval echo "$as_me:11188: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:13504: \"$ac_cpp conftest.$ac_ext\"") >&5
   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
   ac_status=$?
   egrep -v '^ *\+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:11194: \$? = $ac_status" >&5
+  echo "$as_me:13510: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
@@ -11213,7 +13529,7 @@ rm -f conftest.err conftest.$ac_ext
 if test $ac_cv_header_stdc = yes; then
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
   cat >conftest.$ac_ext <<_ACEOF
-#line 11216 "configure"
+#line 13532 "configure"
 #include "confdefs.h"
 #include <string.h>
 
@@ -11231,7 +13547,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 <<_ACEOF
-#line 11234 "configure"
+#line 13550 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 
@@ -11252,7 +13568,7 @@ if test $ac_cv_header_stdc = yes; then
   :
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 11255 "configure"
+#line 13571 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 #if ((' ' & 0x0FF) == 0x020)
@@ -11278,15 +13594,15 @@ main ()
 }
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:11281: \"$ac_link\"") >&5
+if { (eval echo "$as_me:13597: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:11284: \$? = $ac_status" >&5
+  echo "$as_me:13600: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:11286: \"$ac_try\"") >&5
+  { (eval echo "$as_me:13602: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:11289: \$? = $ac_status" >&5
+  echo "$as_me:13605: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   :
 else
@@ -11299,7 +13615,7 @@ rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 fi
 fi
-echo "$as_me:11302: result: $ac_cv_header_stdc" >&5
+echo "$as_me:13618: result: $ac_cv_header_stdc" >&5
 echo "${ECHO_T}$ac_cv_header_stdc" >&6
 if test $ac_cv_header_stdc = yes; then
 
@@ -11309,13 +13625,13 @@ EOF
 
 fi
 
-echo "$as_me:11312: checking whether time.h and sys/time.h may both be included" >&5
+echo "$as_me:13628: checking whether time.h and sys/time.h may both be included" >&5
 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
 if test "${ac_cv_header_time+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 11318 "configure"
+#line 13634 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/time.h>
@@ -11331,16 +13647,16 @@ return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:11334: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:13650: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:11337: \$? = $ac_status" >&5
+  echo "$as_me:13653: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:11340: \"$ac_try\"") >&5
+  { (eval echo "$as_me:13656: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:11343: \$? = $ac_status" >&5
+  echo "$as_me:13659: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_header_time=yes
 else
@@ -11350,7 +13666,7 @@ ac_cv_header_time=no
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:11353: result: $ac_cv_header_time" >&5
+echo "$as_me:13669: result: $ac_cv_header_time" >&5
 echo "${ECHO_T}$ac_cv_header_time" >&6
 if test $ac_cv_header_time = yes; then
 
@@ -11363,6 +13679,7 @@ fi
 for ac_header in \
 getopt.h \
 locale.h \
+math.h \
 stdarg.h \
 sys/ioctl.h \
 sys/select.h \
@@ -11372,23 +13689,71 @@ unistd.h \
 
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-echo "$as_me:11375: checking for $ac_header" >&5
+echo "$as_me:13692: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 13698 "configure"
+#include "confdefs.h"
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:13702: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  egrep -v '^ *\+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:13708: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  eval "$as_ac_Header=yes"
+else
+  echo "$as_me: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  eval "$as_ac_Header=no"
+fi
+rm -f conftest.err conftest.$ac_ext
+fi
+echo "$as_me:13727: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<EOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+EOF
+
+fi
+done
+
+for ac_header in unistd.h getopt.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+echo "$as_me:13740: checking for $ac_header" >&5
 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
 if eval "test \"\${$as_ac_Header+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 11381 "configure"
+#line 13746 "configure"
 #include "confdefs.h"
 #include <$ac_header>
 _ACEOF
-if { (eval echo "$as_me:11385: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:13750: \"$ac_cpp conftest.$ac_ext\"") >&5
   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
   ac_status=$?
   egrep -v '^ *\+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:11391: \$? = $ac_status" >&5
+  echo "$as_me:13756: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
@@ -11407,7 +13772,7 @@ else
 fi
 rm -f conftest.err conftest.$ac_ext
 fi
-echo "$as_me:11410: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "$as_me:13775: result: `eval echo '${'$as_ac_Header'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
 if test `eval echo '${'$as_ac_Header'}'` = yes; then
   cat >>confdefs.h <<EOF
 fi
 done
 
+echo "$as_me:13785: checking for header declaring getopt variables" >&5
+echo $ECHO_N "checking for header declaring getopt variables... $ECHO_C" >&6
+if test "${cf_cv_getopt_header+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+cf_cv_getopt_header=none
+for cf_header in stdio.h stdlib.h unistd.h getopt.h
+do
+cat >conftest.$ac_ext <<_ACEOF
+#line 13795 "configure"
+#include "confdefs.h"
+
+#include <$cf_header>
+int
+main ()
+{
+int x = optind; char *y = optarg
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:13808: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:13811: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:13814: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:13817: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_cv_getopt_header=$cf_header
+ break
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+done
+
+fi
+echo "$as_me:13829: result: $cf_cv_getopt_header" >&5
+echo "${ECHO_T}$cf_cv_getopt_header" >&6
+if test $cf_cv_getopt_header != none ; then
+       cat >>confdefs.h <<\EOF
+#define HAVE_GETOPT_HEADER 1
+EOF
+
+fi
+
 for ac_func in \
 gettimeofday \
+strdup \
+
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:13844: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 13850 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); below.  */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char $ac_func ();
+char (*f) ();
+
+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_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:13881: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:13884: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:13887: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:13890: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$as_ac_var=yes"
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+eval "$as_ac_var=no"
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:13900: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<EOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+EOF
+
+fi
+done
+
+if test "$cf_enable_widec" = yes; then
+
+for ac_func in \
 mblen \
 mbrlen \
 mbrtowc \
 mbsrtowcs \
 mbstowcs \
 mbtowc \
-strdup \
 wcsrtombs \
 wcstombs \
 
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:11434: checking for $ac_func" >&5
+echo "$as_me:13924: checking for $ac_func" >&5
 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
 if eval "test \"\${$as_ac_var+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 11440 "configure"
+#line 13930 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func (); below.  */
@@ -11460,7 +13950,7 @@ main ()
 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
 choke me
 #else
-f = $ac_func;
+f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
 #endif
 
   ;
@@ -11468,16 +13958,16 @@ f = $ac_func;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:11471: \"$ac_link\"") >&5
+if { (eval echo "$as_me:13961: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:11474: \$? = $ac_status" >&5
+  echo "$as_me:13964: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:11477: \"$ac_try\"") >&5
+  { (eval echo "$as_me:13967: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:11480: \$? = $ac_status" >&5
+  echo "$as_me:13970: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   eval "$as_ac_var=yes"
 else
@@ -11487,7 +13977,7 @@ eval "$as_ac_var=no"
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:11490: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "$as_me:13980: result: `eval echo '${'$as_ac_var'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<EOF
@@ -11497,14 +13987,16 @@ EOF
 fi
 done
 
-echo "$as_me:11500: checking if we must define _XOPEN_SOURCE_EXTENDED" >&5
+fi
+
+echo "$as_me:13992: checking if we must define _XOPEN_SOURCE_EXTENDED" >&5
 echo $ECHO_N "checking if we must define _XOPEN_SOURCE_EXTENDED... $ECHO_C" >&6
 if test "${cf_cv_need_xopen_extension+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
 cat >conftest.$ac_ext <<_ACEOF
-#line 11507 "configure"
+#line 13999 "configure"
 #include "confdefs.h"
 
 #include <stdlib.h>
@@ -11514,7 +14006,7 @@ main ()
 {
 
 #if defined(NCURSES_VERSION_PATCH)
-if (NCURSES_VERSION_PATCH < 20100501) && (NCURSES_VERSION_PATCH >= 20100403)
+#if (NCURSES_VERSION_PATCH < 20100501) && (NCURSES_VERSION_PATCH >= 20100403)
        make an error
 #endif
 #endif
@@ -11526,23 +14018,23 @@ if (NCURSES_VERSION_PATCH < 20100501) && (NCURSES_VERSION_PATCH >= 20100403)
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:11529: \"$ac_link\"") >&5
+if { (eval echo "$as_me:14021: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:11532: \$? = $ac_status" >&5
+  echo "$as_me:14024: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:11535: \"$ac_try\"") >&5
+  { (eval echo "$as_me:14027: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:11538: \$? = $ac_status" >&5
+  echo "$as_me:14030: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_need_xopen_extension=no
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
 cat >conftest.$ac_ext <<_ACEOF
-#line 11545 "configure"
+#line 14037 "configure"
 #include "confdefs.h"
 
 #define _XOPEN_SOURCE_EXTENDED
@@ -11564,16 +14056,16 @@ main ()
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:11567: \"$ac_link\"") >&5
+if { (eval echo "$as_me:14059: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:11570: \$? = $ac_status" >&5
+  echo "$as_me:14062: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:11573: \"$ac_try\"") >&5
+  { (eval echo "$as_me:14065: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:11576: \$? = $ac_status" >&5
+  echo "$as_me:14068: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_need_xopen_extension=yes
 else
@@ -11585,11 +14077,11 @@ rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:11588: result: $cf_cv_need_xopen_extension" >&5
+echo "$as_me:14080: result: $cf_cv_need_xopen_extension" >&5
 echo "${ECHO_T}$cf_cv_need_xopen_extension" >&6
 test $cf_cv_need_xopen_extension = yes && CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED"
 
-echo "$as_me:11592: checking for term.h" >&5
+echo "$as_me:14084: checking for term.h" >&5
 echo $ECHO_N "checking for term.h... $ECHO_C" >&6
 if test "${cf_cv_term_header+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -11597,12 +14089,20 @@ else
 
 # If we found <ncurses/curses.h>, look for <ncurses/term.h>, but always look
 # for <term.h> if we do not find the variant.
-for cf_header in \
-       `echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%/.*%/%'`term.h \
-       term.h
+
+cf_header_list="term.h ncurses/term.h ncursesw/term.h"
+
+case ${cf_cv_ncurses_header:-curses.h} in #(vi
+*/*)
+       cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`term.h
+       cf_header_list="$cf_header_item $cf_header_list"
+       ;;
+esac
+
+for cf_header in $cf_header_list
 do
        cat >conftest.$ac_ext <<_ACEOF
-#line 11605 "configure"
+#line 14105 "configure"
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header:-curses.h}>
@@ -11616,16 +14116,16 @@ WINDOW *x
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:11619: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:14119: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:11622: \$? = $ac_status" >&5
+  echo "$as_me:14122: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:11625: \"$ac_try\"") >&5
+  { (eval echo "$as_me:14125: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:11628: \$? = $ac_status" >&5
+  echo "$as_me:14128: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_term_header=$cf_header
         break
 rm -f conftest.$ac_objext conftest.$ac_ext
 done
 
-case $cf_cv_term_header in #(vi
-no)
-       # If curses is ncurses, some packagers still mess it up by trying to make
-       # us use GNU termcap.  This handles the most common case.
-       for cf_header in ncurses/term.h ncursesw/term.h
-       do
-               cat >conftest.$ac_ext <<_ACEOF
-#line 11647 "configure"
+case $cf_cv_term_header in #(vi
+no)
+       # If curses is ncurses, some packagers still mess it up by trying to make
+       # us use GNU termcap.  This handles the most common case.
+       for cf_header in ncurses/term.h ncursesw/term.h
+       do
+               cat >conftest.$ac_ext <<_ACEOF
+#line 14147 "configure"
+#include "confdefs.h"
+
+#include <${cf_cv_ncurses_header:-curses.h}>
+#ifdef NCURSES_VERSION
+#include <${cf_header}>
+#else
+make an error
+#endif
+int
+main ()
+{
+WINDOW *x
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:14165: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:14168: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:14171: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:14174: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_cv_term_header=$cf_header
+                        break
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_term_header=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+       done
+       ;;
+esac
+
+fi
+echo "$as_me:14189: result: $cf_cv_term_header" >&5
+echo "${ECHO_T}$cf_cv_term_header" >&6
+
+case $cf_cv_term_header in #(vi
+term.h) #(vi
+       cat >>confdefs.h <<\EOF
+#define HAVE_TERM_H 1
+EOF
+
+       ;;
+ncurses/term.h) #(vi
+       cat >>confdefs.h <<\EOF
+#define HAVE_NCURSES_TERM_H 1
+EOF
+
+       ;;
+ncursesw/term.h)
+       cat >>confdefs.h <<\EOF
+#define HAVE_NCURSESW_TERM_H 1
+EOF
+
+       ;;
+esac
+
+echo "$as_me:14213: checking for unctrl.h" >&5
+echo $ECHO_N "checking for unctrl.h... $ECHO_C" >&6
+if test "${cf_cv_unctrl_header+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+# If we found <ncurses/curses.h>, look for <ncurses/unctrl.h>, but always look
+# for <unctrl.h> if we do not find the variant.
+
+cf_header_list="unctrl.h ncurses/unctrl.h ncursesw/unctrl.h"
+
+case ${cf_cv_ncurses_header:-curses.h} in #(vi
+*/*)
+       cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`unctrl.h
+       cf_header_list="$cf_header_item $cf_header_list"
+       ;;
+esac
+
+for cf_header in $cf_header_list
+do
+       cat >conftest.$ac_ext <<_ACEOF
+#line 14234 "configure"
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header:-curses.h}>
-#ifdef NCURSES_VERSION
 #include <${cf_header}>
-#else
-make an error
-#endif
 int
 main ()
 {
@@ -11662,55 +14245,61 @@ WINDOW *x
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:11665: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:14248: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:11668: \$? = $ac_status" >&5
+  echo "$as_me:14251: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:11671: \"$ac_try\"") >&5
+  { (eval echo "$as_me:14254: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:11674: \$? = $ac_status" >&5
+  echo "$as_me:14257: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  cf_cv_term_header=$cf_header
-                        break
+  cf_cv_unctrl_header=$cf_header
+        break
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
-cf_cv_term_header=no
+cf_cv_unctrl_header=no
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
-       done
+done
+
+case $cf_cv_unctrl_header in #(vi
+no)
+       { echo "$as_me:14271: WARNING: unctrl.h header not found" >&5
+echo "$as_me: WARNING: unctrl.h header not found" >&2;}
        ;;
 esac
 
 fi
-echo "$as_me:11689: result: $cf_cv_term_header" >&5
-echo "${ECHO_T}$cf_cv_term_header" >&6
+echo "$as_me:14277: result: $cf_cv_unctrl_header" >&5
+echo "${ECHO_T}$cf_cv_unctrl_header" >&6
 
-case $cf_cv_term_header in #(vi
-term.h) #(vi
+case $cf_cv_unctrl_header in #(vi
+unctrl.h) #(vi
        cat >>confdefs.h <<\EOF
-#define HAVE_TERM_H 1
+#define HAVE_UNCTRL_H 1
 EOF
 
        ;;
-ncurses/term.h) #(vi
+ncurses/unctrl.h) #(vi
        cat >>confdefs.h <<\EOF
-#define HAVE_NCURSES_TERM_H 1
+#define HAVE_NCURSES_UNCTRL_H 1
 EOF
 
        ;;
-ncursesw/term.h)
+ncursesw/unctrl.h)
        cat >>confdefs.h <<\EOF
-#define HAVE_NCURSESW_TERM_H 1
+#define HAVE_NCURSESW_UNCTRL_H 1
 EOF
 
        ;;
 esac
 
 for cf_func in \
+assume_default_colors \
 chgat \
 color_set \
 filter \
@@ -11727,6 +14316,7 @@ putwin \
 resize_term \
 resizeterm \
 ripoffline \
+scr_dump \
 setupterm \
 slk_color \
 slk_init \
@@ -11736,20 +14326,23 @@ tigetnum \
 tigetstr \
 typeahead \
 use_default_colors \
-vw_printw \
+use_screen \
+use_window \
 vsscanf \
+vw_printw \
 wchgat \
 winsstr \
 wresize \
+wsyncdown \
 
 do
 
 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
 
-       echo "$as_me:11749: checking for ${cf_func}" >&5
+       echo "$as_me:14342: checking for ${cf_func}" >&5
 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
 
-echo "${as_me:-configure}:11752: testing ${cf_func} ..." 1>&5
+echo "${as_me:-configure}:14345: testing ${cf_func} ..." 1>&5
 
        if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -11758,7 +14351,7 @@ else
                eval cf_result='$ac_cv_func_'$cf_func
                if test ".$cf_result" != ".no"; then
                        cat >conftest.$ac_ext <<_ACEOF
-#line 11761 "configure"
+#line 14354 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_XCURSES
@@ -11781,7 +14374,8 @@ main ()
 
 #ifndef ${cf_func}
 long foo = (long)(&${cf_func});
-${cf_cv_main_return:-return}(foo == 0);
+if (foo + 1234 > 5678)
+       ${cf_cv_main_return:-return}(foo);
 #endif
 
   ;
@@ -11789,16 +14383,16 @@ ${cf_cv_main_return:-return}(foo == 0);
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:11792: \"$ac_link\"") >&5
+if { (eval echo "$as_me:14386: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:11795: \$? = $ac_status" >&5
+  echo "$as_me:14389: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:11798: \"$ac_try\"") >&5
+  { (eval echo "$as_me:14392: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:11801: \$? = $ac_status" >&5
+  echo "$as_me:14395: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_result=yes
 else
@@ -11814,7 +14408,7 @@ fi
 
        # use the computed/retrieved cache-value:
        eval 'cf_result=$cf_cv_func_'$cf_func
-       echo "$as_me:11817: result: $cf_result" >&5
+       echo "$as_me:14411: result: $cf_result" >&5
 echo "${ECHO_T}$cf_result" >&6
        if test $cf_result != no; then
                cat >>confdefs.h <<EOF
        fi
 done
 
-echo "$as_me:11827: checking for ncurses extended functions" >&5
-echo $ECHO_N "checking for ncurses extended functions... $ECHO_C" >&6
-if test "${cf_cv_ncurses_ext_funcs+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
+for cf_func in tputs
+do
 
-cat >conftest.$ac_ext <<_ACEOF
-#line 11834 "configure"
-#include "confdefs.h"
+cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
 
-#include <${cf_cv_ncurses_header:-curses.h}>
-int
-main ()
-{
+       echo "$as_me:14426: checking for ${cf_func}" >&5
+echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
 
-int x = NCURSES_EXT_FUNCS
+echo "${as_me:-configure}:14429: testing ${cf_func} ..." 1>&5
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:11849: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:11852: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:11855: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:11858: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  cf_cv_ncurses_ext_funcs=defined
+       if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
 
-cat >conftest.$ac_ext <<_ACEOF
-#line 11866 "configure"
+               eval cf_result='$ac_cv_func_'$cf_func
+               if test ".$cf_result" != ".no"; then
+                       cat >conftest.$ac_ext <<_ACEOF
+#line 14438 "configure"
 #include "confdefs.h"
 
+#ifdef HAVE_XCURSES
+#include <xcurses.h>
+char * XCursesProgramName = "test";
+#else
 #include <${cf_cv_ncurses_header:-curses.h}>
+#if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
+#include <ncursesw/term.h>
+#elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
+#include <ncurses/term.h>
+#elif defined(HAVE_TERM_H)
+#include <term.h>
+#endif
+#endif
+
 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);
+#ifndef ${cf_func}
+long foo = (long)(&${cf_func});
+if (foo + 1234 > 5678)
+       ${cf_cv_main_return:-return}(foo);
+#endif
+
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:11891: \"$ac_link\"") >&5
+if { (eval echo "$as_me:14470: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:11894: \$? = $ac_status" >&5
+  echo "$as_me:14473: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:11897: \"$ac_try\"") >&5
+  { (eval echo "$as_me:14476: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:11900: \$? = $ac_status" >&5
+  echo "$as_me:14479: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  cf_cv_ncurses_ext_funcs=yes
+  cf_result=yes
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
-cf_cv_ncurses_ext_funcs=no
+cf_result=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+               fi
+               eval 'cf_cv_func_'$cf_func'=$cf_result'
 
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
 
-fi
-echo "$as_me:11914: result: $cf_cv_ncurses_ext_funcs" >&5
-echo "${ECHO_T}$cf_cv_ncurses_ext_funcs" >&6
-test "$cf_cv_ncurses_ext_funcs" == yes && cat >>confdefs.h <<\EOF
-#define NCURSES_EXT_FUNCS 1
+       # use the computed/retrieved cache-value:
+       eval 'cf_result=$cf_cv_func_'$cf_func
+       echo "$as_me:14495: result: $cf_result" >&5
+echo "${ECHO_T}$cf_result" >&6
+       if test $cf_result != no; then
+               cat >>confdefs.h <<EOF
+#define HAVE_${cf_tr_func} 1
 EOF
 
-echo "$as_me:11920: checking for wide-character functions" >&5
-echo $ECHO_N "checking for wide-character functions... $ECHO_C" >&6
-if test "${cf_cv_widechar_funcs+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
+       fi
+done
 
-cat >conftest.$ac_ext <<_ACEOF
-#line 11927 "configure"
+if test x$cf_cv_func_tputs = xyes
+then
+       cf_done=no
+       for cf_arg in int char
+       do
+               for cf_ret in int void
+               do
+                       if test $cf_ret = void
+                       then
+                               cf_return="/* nothing */"
+                       else
+                               cf_return="return value"
+                       fi
+                       cat >conftest.$ac_ext <<_ACEOF
+#line 14519 "configure"
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header:-curses.h}>
+#include <$cf_cv_term_header>
+
+static $cf_ret outc($cf_arg value) { $cf_return; }
+
 int
 main ()
 {
 
-       static wchar_t src_wchar[2];
-       static cchar_t dst_cchar;
-       setcchar(&dst_cchar, src_wchar, A_NORMAL, 0, (void *) 0);
+       tputs("hello", 0, outc);
+       ${cf_cv_main_return:-return}(0);
 
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:11944: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:14539: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:11947: \$? = $ac_status" >&5
+  echo "$as_me:14542: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:11950: \"$ac_try\"") >&5
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:14545: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:11953: \$? = $ac_status" >&5
+  echo "$as_me:14548: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  cf_cv_widechar_funcs=yes
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-cf_cv_widechar_funcs=no
-fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-
-fi
-echo "$as_me:11964: result: $cf_cv_widechar_funcs" >&5
-echo "${ECHO_T}$cf_cv_widechar_funcs" >&6
-if test "$cf_cv_widechar_funcs" != no ; then
-       cat >>confdefs.h <<\EOF
-#define USE_WIDEC_SUPPORT 1
-EOF
 
-else
-       cat >>confdefs.h <<\EOF
-#define USE_WIDEC_SUPPORT 0
-EOF
+               test -n "$verbose" && echo "    prototype $cf_ret func($cf_arg value)" 1>&6
 
-fi
+echo "${as_me:-configure}:14553: testing prototype $cf_ret func($cf_arg value) ..." 1>&5
 
-# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+               cat >>confdefs.h <<EOF
+#define TPUTS_ARG               $cf_arg
+#define TPUTS_PROTO(func,value) $cf_ret func(TPUTS_ARG value)
+#define TPUTS_RETURN(value)     $cf_return
+EOF
+               cf_done=yes
+               break
 
-for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
-                  inttypes.h stdint.h unistd.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-echo "$as_me:11984: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-#line 11990 "configure"
-#include "confdefs.h"
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:11996: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:11999: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:12002: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:12005: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  eval "$as_ac_Header=yes"
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
-eval "$as_ac_Header=no"
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
+               done
+               test $cf_done = yes && break
+       done
 fi
-echo "$as_me:12015: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
-  cat >>confdefs.h <<EOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-EOF
-
-fi
-done
 
-echo "$as_me:12025: checking for pid_t" >&5
-echo $ECHO_N "checking for pid_t... $ECHO_C" >&6
-if test "${ac_cv_type_pid_t+set}" = set; then
+echo "$as_me:14573: checking for ncurses extended functions" >&5
+echo $ECHO_N "checking for ncurses extended functions... $ECHO_C" >&6
+if test "${cf_cv_ncurses_ext_funcs+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
-#line 12031 "configure"
+
+cat >conftest.$ac_ext <<_ACEOF
+#line 14580 "configure"
 #include "confdefs.h"
-$ac_includes_default
+
+#include <${cf_cv_ncurses_header:-curses.h}>
 int
 main ()
 {
-if ((pid_t *) 0)
-  return 0;
-if (sizeof (pid_t))
-  return 0;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:12046: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:12049: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:12052: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:12055: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_type_pid_t=yes
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-ac_cv_type_pid_t=no
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:12065: result: $ac_cv_type_pid_t" >&5
-echo "${ECHO_T}$ac_cv_type_pid_t" >&6
-if test $ac_cv_type_pid_t = yes; then
-  :
-else
-
-cat >>confdefs.h <<EOF
-#define pid_t int
-EOF
-
-fi
-
-for ac_header in unistd.h vfork.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-echo "$as_me:12080: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-#line 12086 "configure"
-#include "confdefs.h"
-#include <$ac_header>
-_ACEOF
-if { (eval echo "$as_me:12090: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
-  ac_status=$?
-  egrep -v '^ *\+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:12096: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
-  eval "$as_ac_Header=yes"
-else
-  echo "$as_me: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  eval "$as_ac_Header=no"
-fi
-rm -f conftest.err conftest.$ac_ext
-fi
-echo "$as_me:12115: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
-  cat >>confdefs.h <<EOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-EOF
 
-fi
-done
+int x = NCURSES_EXT_FUNCS
 
-for ac_func in fork vfork
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:12128: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:14595: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:14598: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:14601: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:14604: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_cv_ncurses_ext_funcs=defined
 else
-  cat >conftest.$ac_ext <<_ACEOF
-#line 12134 "configure"
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+
+cat >conftest.$ac_ext <<_ACEOF
+#line 14612 "configure"
 #include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); below.  */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char $ac_func ();
-char (*f) ();
 
+#include <${cf_cv_ncurses_header:-curses.h}>
 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_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-f = $ac_func;
-#endif
 
+       (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;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:12165: \"$ac_link\"") >&5
+if { (eval echo "$as_me:14637: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:12168: \$? = $ac_status" >&5
+  echo "$as_me:14640: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:12171: \"$ac_try\"") >&5
+  { (eval echo "$as_me:14643: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:12174: \$? = $ac_status" >&5
+  echo "$as_me:14646: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  eval "$as_ac_var=yes"
+  cf_cv_ncurses_ext_funcs=yes
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
-eval "$as_ac_var=no"
+cf_cv_ncurses_ext_funcs=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+
 fi
-echo "$as_me:12184: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-if test `eval echo '${'$as_ac_var'}'` = yes; then
-  cat >>confdefs.h <<EOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-EOF
+rm -f conftest.$ac_objext conftest.$ac_ext
 
 fi
-done
+echo "$as_me:14660: result: $cf_cv_ncurses_ext_funcs" >&5
+echo "${ECHO_T}$cf_cv_ncurses_ext_funcs" >&6
+test "$cf_cv_ncurses_ext_funcs" = yes && cat >>confdefs.h <<\EOF
+#define NCURSES_EXT_FUNCS 1
+EOF
 
-ac_cv_func_fork_works=$ac_cv_func_fork
-if test "x$ac_cv_func_fork" = xyes; then
-  echo "$as_me:12196: checking for working fork" >&5
-echo $ECHO_N "checking for working fork... $ECHO_C" >&6
-if test "${ac_cv_func_fork_works+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test "$cross_compiling" = yes; then
-  ac_cv_func_fork_works=cross
+if test "$cf_enable_widec" = yes
+then
+       # workaround for systems with ncurses before 20111029, due to change of
+       # feature test macro from _XPG5 to _XOPEN_SOURCE
+       if test -n "$cf_cv_ncurses_version" && test "x$cf_cv_ncurses_version" != xno
+       then
+               cf_define_xpg5=no
+               echo "$as_me:14673: checking if _XPG5 should be defined to enable wide-characters" >&5
+echo $ECHO_N "checking if _XPG5 should be defined to enable wide-characters... $ECHO_C" >&6
+
+               cat >conftest.$ac_ext <<_ACEOF
+#line 14677 "configure"
+#include "confdefs.h"
+
+#include <${cf_cv_ncurses_header:-curses.h}>
+int
+main ()
+{
+int x = _XPG5
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:14690: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:14693: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:14696: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:14699: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
 else
-  cat >conftest.$ac_ext <<_ACEOF
-/* By Rüdiger Kuhlmann. */
-      #include <sys/types.h>
-      #if HAVE_UNISTD_H
-      # include <unistd.h>
-      #endif
-      /* Some systems only have a dummy stub for fork() */
-      int main ()
-      {
-        if (fork() < 0)
-          $ac_main_return (1);
-        $ac_main_return (0);
-      }
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_save_cppflags="$CPPFLAGS"
+                        CPPFLAGS="$CPPFLAGS -D_XPG5"
+                        cat >conftest.$ac_ext <<_ACEOF
+#line 14708 "configure"
+#include "confdefs.h"
+
+#include <${cf_cv_ncurses_header:-curses.h}>
+int
+main ()
+{
+int x = _XPG5
+  ;
+  return 0;
+}
 _ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:12219: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:14721: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:12222: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:12224: \"$ac_try\"") >&5
+  echo "$as_me:14724: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:14727: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:12227: \$? = $ac_status" >&5
+  echo "$as_me:14730: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_func_fork_works=yes
+  cf_define_xpg5=yes
 else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
+  echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
-ac_cv_func_fork_works=no
-fi
-rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+                        CPPFLAGS="$cf_save_cppflags"
 fi
-echo "$as_me:12239: result: $ac_cv_func_fork_works" >&5
-echo "${ECHO_T}$ac_cv_func_fork_works" >&6
+rm -f conftest.$ac_objext conftest.$ac_ext
+               echo "$as_me:14741: result: $cf_define_xpg5" >&5
+echo "${ECHO_T}$cf_define_xpg5" >&6
 
-fi
-if test "x$ac_cv_func_fork_works" = xcross; then
-  case $host in
-    *-*-amigaos* | *-*-msdosdjgpp*)
-      # Override, as these systems have only a dummy fork() stub
-      ac_cv_func_fork_works=no
-      ;;
-    *)
-      ac_cv_func_fork_works=yes
-      ;;
-  esac
-  { echo "$as_me:12253: WARNING: CROSS: Result $ac_cv_func_fork_works guessed due to cross-compiling." >&5
-echo "$as_me: WARNING: CROSS: Result $ac_cv_func_fork_works guessed due to cross-compiling." >&2;}
-fi
-ac_cv_func_vfork_works=$ac_cv_func_vfork
-if test "x$ac_cv_func_vfork" = xyes; then
-  echo "$as_me:12258: checking for working vfork" >&5
-echo $ECHO_N "checking for working vfork... $ECHO_C" >&6
-if test "${ac_cv_func_vfork_works+set}" = set; then
+               if test "$cf_define_xpg5" = yes
+               then
+                       CPPFLAGS="$CPPFLAGS -D_XPG5"
+               fi
+       fi
+
+       echo "$as_me:14750: checking for wide-character functions" >&5
+echo $ECHO_N "checking for wide-character functions... $ECHO_C" >&6
+if test "${cf_cv_widechar_funcs+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if test "$cross_compiling" = yes; then
-  ac_cv_func_vfork_works=cross
-else
-  cat >conftest.$ac_ext <<_ACEOF
-#line 12267 "configure"
+
+       cat >conftest.$ac_ext <<_ACEOF
+#line 14757 "configure"
 #include "confdefs.h"
-/* Thanks to Paul Eggert for this test.  */
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#if HAVE_UNISTD_H
-# include <unistd.h>
-#endif
-#if HAVE_VFORK_H
-# include <vfork.h>
-#endif
-/* On some sparc systems, changes by the child to local and incoming
-   argument registers are propagated back to the parent.  The compiler
-   is told about this with #include <vfork.h>, but some compilers
-   (e.g. gcc -O) don't grok <vfork.h>.  Test for this by using a
-   static variable whose address is put into a register that is
-   clobbered by the vfork.  */
-static
-#ifdef __cplusplus
-sparc_address_test (int arg)
-# else
-sparc_address_test (arg) int arg;
-#endif
-{
-  static pid_t child;
-  if (!child) {
-    child = vfork ();
-    if (child < 0) {
-      perror ("vfork");
-      _exit(2);
-    }
-    if (!child) {
-      arg = getpid();
-      write(-1, "", 0);
-      _exit (arg);
-    }
-  }
-}
 
+#include <${cf_cv_ncurses_header:-curses.h}>
 int
 main ()
 {
-  pid_t parent = getpid ();
-  pid_t child;
-
-  sparc_address_test ();
-
-  child = vfork ();
-
-  if (child == 0) {
-    /* Here is another test for sparc vfork register problems.  This
-       test uses lots of local variables, at least as many local
-       variables as main has allocated so far including compiler
-       temporaries.  4 locals are enough for gcc 1.40.3 on a Solaris
-       4.1.3 sparc, but we use 8 to be safe.  A buggy compiler should
-       reuse the register of parent for one of the local variables,
-       since it will think that parent can't possibly be used any more
-       in this routine.  Assigning to the local variable will thus
-       munge parent in the parent process.  */
-    pid_t
-      p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(),
-      p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid();
-    /* Convince the compiler that p..p7 are live; otherwise, it might
-       use the same hardware register for all 8 local variables.  */
-    if (p != p1 || p != p2 || p != p3 || p != p4
-       || p != p5 || p != p6 || p != p7)
-      _exit(1);
-
-    /* On some systems (e.g. IRIX 3.3), vfork doesn't separate parent
-       from child file descriptors.  If the child closes a descriptor
-       before it execs or exits, this munges the parent's descriptor
-       as well.  Test for this by closing stdout in the child.  */
-    _exit(close(fileno(stdout)) != 0);
-  } else {
-    int status;
-    struct stat st;
-
-    while (wait(&status) != child)
-      ;
-    $ac_main_return(
-        /* Was there some problem with vforking?  */
-        child < 0
 
-        /* Did the child fail?  (This shouldn't happen.)  */
-        || status
+               static wchar_t src_wchar[2];
+               static cchar_t dst_cchar;
+               setcchar(&dst_cchar, src_wchar, A_NORMAL, 0, (void *) 0);
 
-        /* Did the vfork/compiler bug occur?  */
-        || parent != getpid()
-
-        /* Did the file descriptor bug occur?  */
-        || fstat(fileno(stdout), &st) != 0
-        );
-  }
+  ;
+  return 0;
 }
 _ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:12364: \"$ac_link\"") >&5
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:14774: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:12367: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:12369: \"$ac_try\"") >&5
+  echo "$as_me:14777: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:14780: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:12372: \$? = $ac_status" >&5
+  echo "$as_me:14783: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_func_vfork_works=yes
+  cf_cv_widechar_funcs=yes
 else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
+  echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
-ac_cv_func_vfork_works=no
-fi
-rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
+cf_cv_widechar_funcs=no
 fi
-echo "$as_me:12384: result: $ac_cv_func_vfork_works" >&5
-echo "${ECHO_T}$ac_cv_func_vfork_works" >&6
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 
-fi;
-if test "x$ac_cv_func_fork_works" = xcross; then
-  ac_cv_func_vfork_works=ac_cv_func_vfork
-  { echo "$as_me:12390: WARNING: CROSS: Result $ac_cv_func_vfork_works guessed due to cross-compiling." >&5
-echo "$as_me: WARNING: CROSS: Result $ac_cv_func_vfork_works guessed due to cross-compiling." >&2;}
 fi
-
-if test "x$ac_cv_func_vfork_works" = xyes; then
-
-cat >>confdefs.h <<\EOF
-#define HAVE_WORKING_VFORK 1
+echo "$as_me:14794: result: $cf_cv_widechar_funcs" >&5
+echo "${ECHO_T}$cf_cv_widechar_funcs" >&6
+       if test "$cf_cv_widechar_funcs" != no ; then
+               cat >>confdefs.h <<\EOF
+#define USE_WIDEC_SUPPORT 1
 EOF
 
-else
-
-cat >>confdefs.h <<\EOF
-#define vfork fork
+       else
+               cat >>confdefs.h <<\EOF
+#define USE_WIDEC_SUPPORT 0
 EOF
 
-fi
-if test "x$ac_cv_func_fork_works" = xyes; then
-
-cat >>confdefs.h <<\EOF
-#define HAVE_WORKING_FORK 1
+       fi
+else
+       cat >>confdefs.h <<\EOF
+#define USE_WIDEC_SUPPORT 0
 EOF
 
 fi
 
-echo "$as_me:12415: checking if sys/time.h works with sys/select.h" >&5
+echo "$as_me:14814: checking if sys/time.h works with sys/select.h" >&5
 echo $ECHO_N "checking if sys/time.h works with sys/select.h... $ECHO_C" >&6
 if test "${cf_cv_sys_time_select+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
 cat >conftest.$ac_ext <<_ACEOF
-#line 12422 "configure"
+#line 14821 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -12439,16 +14838,16 @@ main ()
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:12442: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:14841: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:12445: \$? = $ac_status" >&5
+  echo "$as_me:14844: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:12448: \"$ac_try\"") >&5
+  { (eval echo "$as_me:14847: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:12451: \$? = $ac_status" >&5
+  echo "$as_me:14850: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_sys_time_select=yes
 else
@@ -12460,13 +14859,13 @@ rm -f conftest.$ac_objext conftest.$ac_ext
 
 fi
 
-echo "$as_me:12463: result: $cf_cv_sys_time_select" >&5
+echo "$as_me:14862: result: $cf_cv_sys_time_select" >&5
 echo "${ECHO_T}$cf_cv_sys_time_select" >&6
 test "$cf_cv_sys_time_select" = yes && cat >>confdefs.h <<\EOF
 #define HAVE_SYS_TIME_SELECT 1
 EOF
 
-echo "$as_me:12469: checking for function curses_version" >&5
+echo "$as_me:14868: checking for function curses_version" >&5
 echo $ECHO_N "checking for function curses_version... $ECHO_C" >&6
 if test "${cf_cv_func_curses_version+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -12476,7 +14875,7 @@ if test "$cross_compiling" = yes; then
   cf_cv_func_curses_version=unknown
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 12479 "configure"
+#line 14878 "configure"
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header:-curses.h}>
@@ -12489,15 +14888,15 @@ int main()
 
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:12492: \"$ac_link\"") >&5
+if { (eval echo "$as_me:14891: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:12495: \$? = $ac_status" >&5
+  echo "$as_me:14894: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:12497: \"$ac_try\"") >&5
+  { (eval echo "$as_me:14896: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:12500: \$? = $ac_status" >&5
+  echo "$as_me:14899: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_func_curses_version=yes
 
@@ -12512,13 +14911,13 @@ rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 rm -f core
 fi
-echo "$as_me:12515: result: $cf_cv_func_curses_version" >&5
+echo "$as_me:14914: result: $cf_cv_func_curses_version" >&5
 echo "${ECHO_T}$cf_cv_func_curses_version" >&6
 test "$cf_cv_func_curses_version" = yes && cat >>confdefs.h <<\EOF
 #define HAVE_CURSES_VERSION 1
 EOF
 
-echo "$as_me:12521: checking for ncurses wrap-prefix" >&5
+echo "$as_me:14920: checking for ncurses wrap-prefix" >&5
 echo $ECHO_N "checking for ncurses wrap-prefix... $ECHO_C" >&6
 
 # Check whether --with-ncurses-wrap-prefix or --without-ncurses-wrap-prefix was given.
@@ -12528,10 +14927,10 @@ if test "${with_ncurses_wrap_prefix+set}" = set; then
 else
   NCURSES_WRAP_PREFIX=_nc_
 fi;
-echo "$as_me:12531: result: $NCURSES_WRAP_PREFIX" >&5
+echo "$as_me:14930: result: $NCURSES_WRAP_PREFIX" >&5
 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
 
-echo "$as_me:12534: checking for alternate character set array" >&5
+echo "$as_me:14933: checking for alternate character set array" >&5
 echo $ECHO_N "checking for alternate character set array... $ECHO_C" >&6
 if test "${cf_cv_curses_acs_map+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -12541,7 +14940,7 @@ cf_cv_curses_acs_map=unknown
 for name in acs_map _acs_map __acs_map ${NCURSES_WRAP_PREFIX}acs_map
 do
 cat >conftest.$ac_ext <<_ACEOF
-#line 12544 "configure"
+#line 14943 "configure"
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header:-curses.h}>
@@ -12557,16 +14956,16 @@ $name['k'] = ACS_PLUS
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:12560: \"$ac_link\"") >&5
+if { (eval echo "$as_me:14959: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:12563: \$? = $ac_status" >&5
+  echo "$as_me:14962: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:12566: \"$ac_try\"") >&5
+  { (eval echo "$as_me:14965: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:12569: \$? = $ac_status" >&5
+  echo "$as_me:14968: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_curses_acs_map=$name; break
 else
@@ -12577,24 +14976,26 @@ rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 done
 
 fi
-echo "$as_me:12580: result: $cf_cv_curses_acs_map" >&5
+echo "$as_me:14979: result: $cf_cv_curses_acs_map" >&5
 echo "${ECHO_T}$cf_cv_curses_acs_map" >&6
 
 test "$cf_cv_curses_acs_map" != unknown && cat >>confdefs.h <<EOF
 #define CURSES_ACS_ARRAY $cf_cv_curses_acs_map
 EOF
 
-echo "$as_me:12587: checking for wide alternate character set array" >&5
+if test "$cf_enable_widec" = yes; then
+
+echo "$as_me:14988: checking for wide alternate character set array" >&5
 echo $ECHO_N "checking for wide alternate character set array... $ECHO_C" >&6
 if test "${cf_cv_curses_wacs_map+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
        cf_cv_curses_wacs_map=unknown
-       for name in wacs_map _wacs_map __wacs_map _nc_wacs
+       for name in wacs_map _wacs_map __wacs_map _nc_wacs _wacs_char
        do
        cat >conftest.$ac_ext <<_ACEOF
-#line 12597 "configure"
+#line 14998 "configure"
 #include "confdefs.h"
 
 #ifndef _XOPEN_SOURCE_EXTENDED
@@ -12604,22 +15005,22 @@ else
 int
 main ()
 {
-$name['k'] = *WACS_PLUS
+void *foo = &($name['k'])
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:12613: \"$ac_link\"") >&5
+if { (eval echo "$as_me:15014: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:12616: \$? = $ac_status" >&5
+  echo "$as_me:15017: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:12619: \"$ac_try\"") >&5
+  { (eval echo "$as_me:15020: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:12622: \$? = $ac_status" >&5
+  echo "$as_me:15023: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_curses_wacs_map=$name
         break
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
        done
 fi
-echo "$as_me:12633: result: $cf_cv_curses_wacs_map" >&5
-echo "${ECHO_T}$cf_cv_curses_wacs_map" >&6
+echo "$as_me:15034: result: $cf_cv_curses_wacs_map" >&5
+echo "${ECHO_T}$cf_cv_curses_wacs_map" >&6
+
+test "$cf_cv_curses_wacs_map" != unknown && cat >>confdefs.h <<EOF
+#define CURSES_WACS_ARRAY $cf_cv_curses_wacs_map
+EOF
+
+echo "$as_me:15041: checking for wide alternate character constants" >&5
+echo $ECHO_N "checking for wide alternate character constants... $ECHO_C" >&6
+if test "${cf_cv_curses_wacs_symbols+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+cf_cv_curses_wacs_symbols=no
+if test "$cf_cv_curses_wacs_map" != unknown
+then
+       cat >conftest.$ac_ext <<_ACEOF
+#line 15051 "configure"
+#include "confdefs.h"
+
+#ifndef _XOPEN_SOURCE_EXTENDED
+#define _XOPEN_SOURCE_EXTENDED
+#endif
+#include <${cf_cv_ncurses_header:-curses.h}>
+int
+main ()
+{
+cchar_t *foo = WACS_PLUS;
+        $cf_cv_curses_wacs_map['k'] = *WACS_PLUS
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:15068: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:15071: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:15074: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:15077: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_cv_curses_wacs_symbols=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+else
+       cat >conftest.$ac_ext <<_ACEOF
+#line 15087 "configure"
+#include "confdefs.h"
+
+#ifndef _XOPEN_SOURCE_EXTENDED
+#define _XOPEN_SOURCE_EXTENDED
+#endif
+#include <${cf_cv_ncurses_header:-curses.h}>
+int
+main ()
+{
+cchar_t *foo = WACS_PLUS
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:15103: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:15106: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:15109: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:15112: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_cv_curses_wacs_symbols=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+
+fi
+echo "$as_me:15123: result: $cf_cv_curses_wacs_symbols" >&5
+echo "${ECHO_T}$cf_cv_curses_wacs_symbols" >&6
+
+test "$cf_cv_curses_wacs_symbols" != no && cat >>confdefs.h <<\EOF
+#define CURSES_WACS_SYMBOLS 1
+EOF
+
+fi
 
-echo "$as_me:12636: checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}" >&5
+echo "$as_me:15132: checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}" >&5
 echo $ECHO_N "checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
-#line 12639 "configure"
+#line 15135 "configure"
 #include "confdefs.h"
 
 #ifndef _XOPEN_SOURCE_EXTENDED
@@ -12654,16 +15150,16 @@ attr_t foo
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:12657: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:15153: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:12660: \$? = $ac_status" >&5
+  echo "$as_me:15156: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:12663: \"$ac_try\"") >&5
+  { (eval echo "$as_me:15159: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:12666: \$? = $ac_status" >&5
+  echo "$as_me:15162: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_result=yes
 else
@@ -12672,7 +15168,7 @@ cat conftest.$ac_ext >&5
 cf_result=no
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:12675: result: $cf_result" >&5
+echo "$as_me:15171: result: $cf_result" >&5
 echo "${ECHO_T}$cf_result" >&6
 if test $cf_result = yes ; then
 
@@ -12689,15 +15185,17 @@ EOF
 
 fi
 
+if test "$cf_enable_widec" = yes; then
+
 # This is needed on Tru64 5.0 to declare mbstate_t
-echo "$as_me:12693: checking if we must include wchar.h to declare mbstate_t" >&5
+echo "$as_me:15191: checking if we must include wchar.h to declare mbstate_t" >&5
 echo $ECHO_N "checking if we must include wchar.h to declare mbstate_t... $ECHO_C" >&6
 if test "${cf_cv_mbstate_t+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
 cat >conftest.$ac_ext <<_ACEOF
-#line 12700 "configure"
+#line 15198 "configure"
 #include "confdefs.h"
 
 #include <stdlib.h>
@@ -12715,23 +15213,23 @@ mbstate_t state
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:12718: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:15216: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:12721: \$? = $ac_status" >&5
+  echo "$as_me:15219: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:12724: \"$ac_try\"") >&5
+  { (eval echo "$as_me:15222: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:12727: \$? = $ac_status" >&5
+  echo "$as_me:15225: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_mbstate_t=no
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
 cat >conftest.$ac_ext <<_ACEOF
-#line 12734 "configure"
+#line 15232 "configure"
 #include "confdefs.h"
 
 #include <stdlib.h>
@@ -12750,16 +15248,16 @@ mbstate_t value
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:12753: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:15251: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:12756: \$? = $ac_status" >&5
+  echo "$as_me:15254: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:12759: \"$ac_try\"") >&5
+  { (eval echo "$as_me:15257: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:12762: \$? = $ac_status" >&5
+  echo "$as_me:15260: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_mbstate_t=yes
 else
@@ -12771,7 +15269,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:12774: result: $cf_cv_mbstate_t" >&5
+echo "$as_me:15272: result: $cf_cv_mbstate_t" >&5
 echo "${ECHO_T}$cf_cv_mbstate_t" >&6
 
 if test "$cf_cv_mbstate_t" = yes ; then
@@ -12793,14 +15291,14 @@ if test "$cf_cv_mbstate_t" != unknown ; then
 fi
 
 # This is needed on Tru64 5.0 to declare wchar_t
-echo "$as_me:12796: checking if we must include wchar.h to declare wchar_t" >&5
+echo "$as_me:15294: checking if we must include wchar.h to declare wchar_t" >&5
 echo $ECHO_N "checking if we must include wchar.h to declare wchar_t... $ECHO_C" >&6
 if test "${cf_cv_wchar_t+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
 cat >conftest.$ac_ext <<_ACEOF
-#line 12803 "configure"
+#line 15301 "configure"
 #include "confdefs.h"
 
 #include <stdlib.h>
@@ -12818,23 +15316,23 @@ wchar_t state
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:12821: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:15319: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:12824: \$? = $ac_status" >&5
+  echo "$as_me:15322: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:12827: \"$ac_try\"") >&5
+  { (eval echo "$as_me:15325: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:12830: \$? = $ac_status" >&5
+  echo "$as_me:15328: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_wchar_t=no
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
 cat >conftest.$ac_ext <<_ACEOF
-#line 12837 "configure"
+#line 15335 "configure"
 #include "confdefs.h"
 
 #include <stdlib.h>
@@ -12853,16 +15351,16 @@ wchar_t value
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:12856: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:15354: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:12859: \$? = $ac_status" >&5
+  echo "$as_me:15357: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:12862: \"$ac_try\"") >&5
+  { (eval echo "$as_me:15360: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:12865: \$? = $ac_status" >&5
+  echo "$as_me:15363: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_wchar_t=yes
 else
@@ -12874,7 +15372,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:12877: result: $cf_cv_wchar_t" >&5
+echo "$as_me:15375: result: $cf_cv_wchar_t" >&5
 echo "${ECHO_T}$cf_cv_wchar_t" >&6
 
 if test "$cf_cv_wchar_t" = yes ; then
@@ -12896,14 +15394,14 @@ if test "$cf_cv_wchar_t" != unknown ; then
 fi
 
 # This is needed on Tru64 5.0 to declare wint_t
-echo "$as_me:12899: checking if we must include wchar.h to declare wint_t" >&5
+echo "$as_me:15397: checking if we must include wchar.h to declare wint_t" >&5
 echo $ECHO_N "checking if we must include wchar.h to declare wint_t... $ECHO_C" >&6
 if test "${cf_cv_wint_t+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
 cat >conftest.$ac_ext <<_ACEOF
-#line 12906 "configure"
+#line 15404 "configure"
 #include "confdefs.h"
 
 #include <stdlib.h>
@@ -12921,23 +15419,23 @@ wint_t state
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:12924: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:15422: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:12927: \$? = $ac_status" >&5
+  echo "$as_me:15425: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:12930: \"$ac_try\"") >&5
+  { (eval echo "$as_me:15428: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:12933: \$? = $ac_status" >&5
+  echo "$as_me:15431: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_wint_t=no
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
 cat >conftest.$ac_ext <<_ACEOF
-#line 12940 "configure"
+#line 15438 "configure"
 #include "confdefs.h"
 
 #include <stdlib.h>
@@ -12956,16 +15454,16 @@ wint_t value
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:12959: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:15457: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:12962: \$? = $ac_status" >&5
+  echo "$as_me:15460: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:12965: \"$ac_try\"") >&5
+  { (eval echo "$as_me:15463: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:12968: \$? = $ac_status" >&5
+  echo "$as_me:15466: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_wint_t=yes
 else
@@ -12977,7 +15475,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:12980: result: $cf_cv_wint_t" >&5
+echo "$as_me:15478: result: $cf_cv_wint_t" >&5
 echo "${ECHO_T}$cf_cv_wint_t" >&6
 
 if test "$cf_cv_wint_t" = yes ; then
@@ -12998,12 +15496,12 @@ if test "$cf_cv_wint_t" != unknown ; then
        NCURSES_OK_WINT_T=1
 fi
 
-if test "$NCURSES_OK_MBSTATE_T" = 0 ; then
+       if test "$NCURSES_OK_MBSTATE_T" = 0 ; then
 
-echo "$as_me:13003: checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}" >&5
+echo "$as_me:15501: checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}" >&5
 echo $ECHO_N "checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
-#line 13006 "configure"
+#line 15504 "configure"
 #include "confdefs.h"
 
 #ifndef _XOPEN_SOURCE_EXTENDED
@@ -13021,16 +15519,16 @@ mbstate_t foo
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:13024: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:15522: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:13027: \$? = $ac_status" >&5
+  echo "$as_me:15525: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:13030: \"$ac_try\"") >&5
+  { (eval echo "$as_me:15528: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:13033: \$? = $ac_status" >&5
+  echo "$as_me:15531: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_result=yes
 else
@@ -13039,7 +15537,7 @@ cat conftest.$ac_ext >&5
 cf_result=no
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:13042: result: $cf_result" >&5
+echo "$as_me:15540: result: $cf_result" >&5
 echo "${ECHO_T}$cf_result" >&6
 if test $cf_result = yes ; then
 
@@ -13056,14 +15554,14 @@ EOF
 
 fi
 
-fi
+       fi
 
-if test "$NCURSES_OK_WCHAR_T" = 0 ; then
+       if test "$NCURSES_OK_WCHAR_T" = 0 ; then
 
-echo "$as_me:13063: checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}" >&5
+echo "$as_me:15561: checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}" >&5
 echo $ECHO_N "checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
-#line 13066 "configure"
+#line 15564 "configure"
 #include "confdefs.h"
 
 #ifndef _XOPEN_SOURCE_EXTENDED
@@ -13081,16 +15579,16 @@ wchar_t foo
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:13084: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:15582: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:13087: \$? = $ac_status" >&5
+  echo "$as_me:15585: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:13090: \"$ac_try\"") >&5
+  { (eval echo "$as_me:15588: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:13093: \$? = $ac_status" >&5
+  echo "$as_me:15591: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_result=yes
 else
@@ -13099,7 +15597,7 @@ cat conftest.$ac_ext >&5
 cf_result=no
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:13102: result: $cf_result" >&5
+echo "$as_me:15600: result: $cf_result" >&5
 echo "${ECHO_T}$cf_result" >&6
 if test $cf_result = yes ; then
 
@@ -13116,14 +15614,14 @@ EOF
 
 fi
 
-fi
+       fi
 
-if test "$NCURSES_OK_WINT_T" = 0 ; then
+       if test "$NCURSES_OK_WINT_T" = 0 ; then
 
-echo "$as_me:13123: checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}" >&5
+echo "$as_me:15621: checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}" >&5
 echo $ECHO_N "checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
-#line 13126 "configure"
+#line 15624 "configure"
 #include "confdefs.h"
 
 #ifndef _XOPEN_SOURCE_EXTENDED
@@ -13141,16 +15639,16 @@ wint_t foo
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:13144: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:15642: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:13147: \$? = $ac_status" >&5
+  echo "$as_me:15645: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:13150: \"$ac_try\"") >&5
+  { (eval echo "$as_me:15648: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:13153: \$? = $ac_status" >&5
+  echo "$as_me:15651: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_result=yes
 else
@@ -13159,7 +15657,7 @@ cat conftest.$ac_ext >&5
 cf_result=no
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:13162: result: $cf_result" >&5
+echo "$as_me:15660: result: $cf_result" >&5
 echo "${ECHO_T}$cf_result" >&6
 if test $cf_result = yes ; then
 
@@ -13176,12 +15674,14 @@ EOF
 
 fi
 
+       fi
 fi
 
-echo "$as_me:13181: checking for data boolnames declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
+echo "$as_me:15680: checking for data boolnames declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
 echo $ECHO_N "checking for data boolnames declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
+
 cat >conftest.$ac_ext <<_ACEOF
-#line 13184 "configure"
+#line 15684 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_XCURSES
@@ -13209,16 +15709,16 @@ void *foo = &(boolnames)
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:13212: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:15712: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:13215: \$? = $ac_status" >&5
+  echo "$as_me:15715: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:13218: \"$ac_try\"") >&5
+  { (eval echo "$as_me:15718: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:13221: \$? = $ac_status" >&5
+  echo "$as_me:15721: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_result=yes
 else
@@ -13227,8 +15727,9 @@ cat conftest.$ac_ext >&5
 cf_result=no
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:13230: result: $cf_result" >&5
+echo "$as_me:15730: result: $cf_result" >&5
 echo "${ECHO_T}$cf_result" >&6
+
 if test $cf_result = yes ; then
 
 cf_result=`echo "have_curses_data_boolnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
@@ -13238,10 +15739,14 @@ cf_result=`echo "have_curses_data_boolnames" | sed y%abcdefghijklmnopqrstuvwxyz.
 EOF
 
 else
-       echo "$as_me:13241: checking for data boolnames in library" >&5
+       echo "$as_me:15742: checking for data boolnames in library" >&5
 echo $ECHO_N "checking for data boolnames in library... $ECHO_C" >&6
+       # BSD linkers insist on making weak linkage, but resolve at runtime.
+       if test "$cross_compiling" = yes; then
+
+       # cross-compiling
        cat >conftest.$ac_ext <<_ACEOF
-#line 13244 "configure"
+#line 15749 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_XCURSES
@@ -13273,16 +15778,16 @@ main ()
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:13276: \"$ac_link\"") >&5
+if { (eval echo "$as_me:15781: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:13279: \$? = $ac_status" >&5
+  echo "$as_me:15784: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:13282: \"$ac_try\"") >&5
+  { (eval echo "$as_me:15787: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:13285: \$? = $ac_status" >&5
+  echo "$as_me:15790: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_result=yes
 else
@@ -13291,7 +15796,54 @@ cat conftest.$ac_ext >&5
 cf_result=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-       echo "$as_me:13294: result: $cf_result" >&5
+
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 15802 "configure"
+#include "confdefs.h"
+
+#ifdef HAVE_XCURSES
+#include <xcurses.h>
+char * XCursesProgramName = "test";
+#else
+#include <${cf_cv_ncurses_header:-curses.h}>
+#if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
+#include <ncursesw/term.h>
+#elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
+#include <ncurses/term.h>
+#elif defined(HAVE_TERM_H)
+#include <term.h>
+#endif
+#endif
+
+extern char boolnames;
+int main(void)
+{
+       void *foo = &(boolnames);
+       ${cf_cv_main_return:-return}(foo == 0);
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:15827: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:15830: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (eval echo "$as_me:15832: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:15835: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_result=yes
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_result=no
+fi
+rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+       echo "$as_me:15846: result: $cf_result" >&5
 echo "${ECHO_T}$cf_result" >&6
        if test $cf_result = yes ; then
 
@@ -13304,10 +15856,11 @@ EOF
        fi
 fi
 
-echo "$as_me:13307: checking for data boolfnames declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
+echo "$as_me:15859: checking for data boolfnames declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
 echo $ECHO_N "checking for data boolfnames declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
+
 cat >conftest.$ac_ext <<_ACEOF
-#line 13310 "configure"
+#line 15863 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_XCURSES
@@ -13335,16 +15888,16 @@ void *foo = &(boolfnames)
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:13338: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:15891: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:13341: \$? = $ac_status" >&5
+  echo "$as_me:15894: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:13344: \"$ac_try\"") >&5
+  { (eval echo "$as_me:15897: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:13347: \$? = $ac_status" >&5
+  echo "$as_me:15900: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_result=yes
 else
@@ -13353,8 +15906,9 @@ cat conftest.$ac_ext >&5
 cf_result=no
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:13356: result: $cf_result" >&5
+echo "$as_me:15909: result: $cf_result" >&5
 echo "${ECHO_T}$cf_result" >&6
+
 if test $cf_result = yes ; then
 
 cf_result=`echo "have_curses_data_boolfnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
@@ -13364,10 +15918,14 @@ cf_result=`echo "have_curses_data_boolfnames" | sed y%abcdefghijklmnopqrstuvwxyz
 EOF
 
 else
-       echo "$as_me:13367: checking for data boolfnames in library" >&5
+       echo "$as_me:15921: checking for data boolfnames in library" >&5
 echo $ECHO_N "checking for data boolfnames in library... $ECHO_C" >&6
+       # BSD linkers insist on making weak linkage, but resolve at runtime.
+       if test "$cross_compiling" = yes; then
+
+       # cross-compiling
        cat >conftest.$ac_ext <<_ACEOF
-#line 13370 "configure"
+#line 15928 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_XCURSES
@@ -13399,16 +15957,16 @@ main ()
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:13402: \"$ac_link\"") >&5
+if { (eval echo "$as_me:15960: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:13405: \$? = $ac_status" >&5
+  echo "$as_me:15963: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:13408: \"$ac_try\"") >&5
+  { (eval echo "$as_me:15966: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:13411: \$? = $ac_status" >&5
+  echo "$as_me:15969: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_result=yes
 else
@@ -13417,7 +15975,54 @@ cat conftest.$ac_ext >&5
 cf_result=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-       echo "$as_me:13420: result: $cf_result" >&5
+
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 15981 "configure"
+#include "confdefs.h"
+
+#ifdef HAVE_XCURSES
+#include <xcurses.h>
+char * XCursesProgramName = "test";
+#else
+#include <${cf_cv_ncurses_header:-curses.h}>
+#if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
+#include <ncursesw/term.h>
+#elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
+#include <ncurses/term.h>
+#elif defined(HAVE_TERM_H)
+#include <term.h>
+#endif
+#endif
+
+extern char boolfnames;
+int main(void)
+{
+       void *foo = &(boolfnames);
+       ${cf_cv_main_return:-return}(foo == 0);
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:16006: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:16009: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (eval echo "$as_me:16011: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:16014: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_result=yes
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_result=no
+fi
+rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+       echo "$as_me:16025: result: $cf_result" >&5
 echo "${ECHO_T}$cf_result" >&6
        if test $cf_result = yes ; then
 
@@ -13430,6 +16035,335 @@ EOF
        fi
 fi
 
+LD_RPATH_OPT=
+echo "$as_me:16039: checking for an rpath option" >&5
+echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
+case $cf_cv_system_name in #(vi
+irix*) #(vi
+       if test "$GCC" = yes; then
+               LD_RPATH_OPT="-Wl,-rpath,"
+       else
+               LD_RPATH_OPT="-rpath "
+       fi
+       ;;
+linux*|gnu*|k*bsd*-gnu) #(vi
+       LD_RPATH_OPT="-Wl,-rpath,"
+       ;;
+openbsd[2-9].*|mirbsd*) #(vi
+       LD_RPATH_OPT="-Wl,-rpath,"
+       ;;
+dragonfly*|freebsd*) #(vi
+       LD_RPATH_OPT="-rpath "
+       ;;
+netbsd*) #(vi
+       LD_RPATH_OPT="-Wl,-rpath,"
+       ;;
+osf*|mls+*) #(vi
+       LD_RPATH_OPT="-rpath "
+       ;;
+solaris2*) #(vi
+       LD_RPATH_OPT="-R"
+       ;;
+*)
+       ;;
+esac
+echo "$as_me:16070: result: $LD_RPATH_OPT" >&5
+echo "${ECHO_T}$LD_RPATH_OPT" >&6
+
+case "x$LD_RPATH_OPT" in #(vi
+x-R*)
+       echo "$as_me:16075: checking if we need a space after rpath option" >&5
+echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
+       cf_save_LIBS="$LIBS"
+       LIBS="${LD_RPATH_OPT}$libdir $LIBS"
+       cat >conftest.$ac_ext <<_ACEOF
+#line 16080 "configure"
+#include "confdefs.h"
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:16092: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:16095: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:16098: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:16101: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_rpath_space=no
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_rpath_space=yes
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+       LIBS="$cf_save_LIBS"
+       echo "$as_me:16111: result: $cf_rpath_space" >&5
+echo "${ECHO_T}$cf_rpath_space" >&6
+       test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
+       ;;
+esac
+
+echo "$as_me:16117: checking if rpath-hack should be disabled" >&5
+echo $ECHO_N "checking if rpath-hack should be disabled... $ECHO_C" >&6
+
+# Check whether --enable-rpath-hack or --disable-rpath-hack was given.
+if test "${enable_rpath_hack+set}" = set; then
+  enableval="$enable_rpath_hack"
+  test "$enableval" != no && enableval=yes
+  if test "$enableval" != "yes" ; then
+    cf_disable_rpath_hack=yes
+  else
+    cf_disable_rpath_hack=no
+  fi
+else
+  enableval=yes
+  cf_disable_rpath_hack=no
+
+fi;
+echo "$as_me:16134: result: $cf_disable_rpath_hack" >&5
+echo "${ECHO_T}$cf_disable_rpath_hack" >&6
+if test "$cf_disable_rpath_hack" = no ; then
+
+echo "$as_me:16138: checking for updated LDFLAGS" >&5
+echo $ECHO_N "checking for updated LDFLAGS... $ECHO_C" >&6
+if test -n "$LD_RPATH_OPT" ; then
+       echo "$as_me:16141: result: maybe" >&5
+echo "${ECHO_T}maybe" >&6
+
+       for ac_prog in ldd
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:16148: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_cf_ldd_prog+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$cf_ldd_prog"; then
+  ac_cv_prog_cf_ldd_prog="$cf_ldd_prog" # Let the user override the test.
+else
+  ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+  IFS=$ac_save_IFS
+  test -z "$ac_dir" && ac_dir=.
+  $as_executable_p "$ac_dir/$ac_word" || continue
+ac_cv_prog_cf_ldd_prog="$ac_prog"
+echo "$as_me:16163: found $ac_dir/$ac_word" >&5
+break
+done
+
+fi
+fi
+cf_ldd_prog=$ac_cv_prog_cf_ldd_prog
+if test -n "$cf_ldd_prog"; then
+  echo "$as_me:16171: result: $cf_ldd_prog" >&5
+echo "${ECHO_T}$cf_ldd_prog" >&6
+else
+  echo "$as_me:16174: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  test -n "$cf_ldd_prog" && break
+done
+test -n "$cf_ldd_prog" || cf_ldd_prog="no"
+
+       cf_rpath_list="/usr/lib /lib"
+       if test "$cf_ldd_prog" != no
+       then
+               cf_rpath_oops=
+
+cat >conftest.$ac_ext <<_ACEOF
+#line 16188 "configure"
+#include "confdefs.h"
+#include <stdio.h>
+int
+main ()
+{
+printf("Hello");
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:16200: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:16203: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:16206: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:16209: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_rpath_oops=`$cf_ldd_prog conftest$ac_exeext | fgrep ' not found' | sed -e 's% =>.*$%%' |sort -u`
+                cf_rpath_list=`$cf_ldd_prog conftest$ac_exeext | fgrep / | sed -e 's%^.*[      ]/%/%' -e 's%/[^/][^/]*$%%' |sort -u`
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+
+               # If we passed the link-test, but get a "not found" on a given library,
+               # this could be due to inept reconfiguration of gcc to make it only
+               # partly honor /usr/local/lib (or whatever).  Sometimes this behavior
+               # is intentional, e.g., installing gcc in /usr/bin and suppressing the
+               # /usr/local libraries.
+               if test -n "$cf_rpath_oops"
+               then
+                       for cf_rpath_src in $cf_rpath_oops
+                       do
+                               for cf_rpath_dir in \
+                                       /usr/local \
+                                       /usr/pkg \
+                                       /opt/sfw
+                               do
+                                       if test -f $cf_rpath_dir/lib/$cf_rpath_src
+                                       then
+                                               test -n "$verbose" && echo "    ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src" 1>&6
+
+echo "${as_me:-configure}:16237: testing ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src ..." 1>&5
+
+                                               LDFLAGS="$LDFLAGS -L$cf_rpath_dir/lib"
+                                               break
+                                       fi
+                               done
+                       done
+               fi
+       fi
+
+       test -n "$verbose" && echo "    ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
+
+echo "${as_me:-configure}:16249: testing ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
+
+test -n "$verbose" && echo "   ...checking LDFLAGS $LDFLAGS" 1>&6
+
+echo "${as_me:-configure}:16253: testing ...checking LDFLAGS $LDFLAGS ..." 1>&5
+
+cf_rpath_dst=
+for cf_rpath_src in $LDFLAGS
+do
+       case $cf_rpath_src in #(vi
+       -L*) #(vi
+
+               # check if this refers to a directory which we will ignore
+               cf_rpath_skip=no
+               if test -n "$cf_rpath_list"
+               then
+                       for cf_rpath_item in $cf_rpath_list
+                       do
+                               if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
+                               then
+                                       cf_rpath_skip=yes
+                                       break
+                               fi
+                       done
+               fi
+
+               if test "$cf_rpath_skip" = no
+               then
+                       # transform the option
+                       if test "$LD_RPATH_OPT" = "-R " ; then
+                               cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
+                       else
+                               cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
+                       fi
+
+                       # if we have not already added this, add it now
+                       cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
+                       if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
+                       then
+                               test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
+
+echo "${as_me:-configure}:16290: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
+
+                               EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
+                       fi
+               fi
+               ;;
+       esac
+       cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
+done
+LDFLAGS=$cf_rpath_dst
+
+test -n "$verbose" && echo "   ...checked LDFLAGS $LDFLAGS" 1>&6
+
+echo "${as_me:-configure}:16303: testing ...checked LDFLAGS $LDFLAGS ..." 1>&5
+
+test -n "$verbose" && echo "   ...checking LIBS $LIBS" 1>&6
+
+echo "${as_me:-configure}:16307: testing ...checking LIBS $LIBS ..." 1>&5
+
+cf_rpath_dst=
+for cf_rpath_src in $LIBS
+do
+       case $cf_rpath_src in #(vi
+       -L*) #(vi
+
+               # check if this refers to a directory which we will ignore
+               cf_rpath_skip=no
+               if test -n "$cf_rpath_list"
+               then
+                       for cf_rpath_item in $cf_rpath_list
+                       do
+                               if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
+                               then
+                                       cf_rpath_skip=yes
+                                       break
+                               fi
+                       done
+               fi
+
+               if test "$cf_rpath_skip" = no
+               then
+                       # transform the option
+                       if test "$LD_RPATH_OPT" = "-R " ; then
+                               cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
+                       else
+                               cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
+                       fi
+
+                       # if we have not already added this, add it now
+                       cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
+                       if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
+                       then
+                               test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
+
+echo "${as_me:-configure}:16344: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
+
+                               EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
+                       fi
+               fi
+               ;;
+       esac
+       cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
+done
+LIBS=$cf_rpath_dst
+
+test -n "$verbose" && echo "   ...checked LIBS $LIBS" 1>&6
+
+echo "${as_me:-configure}:16357: testing ...checked LIBS $LIBS ..." 1>&5
+
+       test -n "$verbose" && echo "    ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
+
+echo "${as_me:-configure}:16361: testing ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
+
+fi
+
+fi
+
 TEST_ARGS="$LIBS"
 LIBS=
 
@@ -13514,7 +16448,7 @@ DEFS=-DHAVE_CONFIG_H
 : ${CONFIG_STATUS=./config.status}
 ac_clean_files_save=$ac_clean_files
 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
-{ echo "$as_me:13517: creating $CONFIG_STATUS" >&5
+{ echo "$as_me:16451: creating $CONFIG_STATUS" >&5
 echo "$as_me: creating $CONFIG_STATUS" >&6;}
 cat >$CONFIG_STATUS <<_ACEOF
 #! $SHELL
@@ -13646,7 +16580,7 @@ EOF
 cat >>$CONFIG_STATUS <<EOF
 ac_cs_version="\\
 config.status
-configured by $0, generated by GNU Autoconf 2.52.20101001,
+configured by $0, generated by GNU Autoconf 2.52.20120811,
   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
 
 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
@@ -13690,7 +16624,7 @@ cat >>$CONFIG_STATUS <<\EOF
     echo "$ac_cs_version"; exit 0 ;;
   --he | --h)
     # Conflict between --help and --header
-    { { echo "$as_me:13693: error: ambiguous option: $1
+    { { echo "$as_me:16627: error: ambiguous option: $1
 Try \`$0 --help' for more information." >&5
 echo "$as_me: error: ambiguous option: $1
 Try \`$0 --help' for more information." >&2;}
@@ -13709,7 +16643,7 @@ Try \`$0 --help' for more information." >&2;}
     ac_need_defaults=false;;
 
   # This is an error.
-  -*) { { echo "$as_me:13712: error: unrecognized option: $1
+  -*) { { echo "$as_me:16646: error: unrecognized option: $1
 Try \`$0 --help' for more information." >&5
 echo "$as_me: error: unrecognized option: $1
 Try \`$0 --help' for more information." >&2;}
@@ -13728,7 +16662,7 @@ cat >&5 << _ACEOF
 ## Running config.status.  ##
 ## ----------------------- ##
 
-This file was extended by $as_me 2.52.20101001, executed with
+This file was extended by $as_me 2.52.20120811, executed with
   CONFIG_FILES    = $CONFIG_FILES
   CONFIG_HEADERS  = $CONFIG_HEADERS
   CONFIG_LINKS    = $CONFIG_LINKS
@@ -13745,7 +16679,9 @@ cat >>$CONFIG_STATUS <<EOF
 #
 
 AWK="$AWK"
+ECHO_CC="$ECHO_CC"
 ECHO_LD="$ECHO_LD"
+SHOW_CC="$SHOW_LD"
 
 EOF
 
@@ -13757,7 +16693,7 @@ do
   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
   "ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS ncurses_cfg.h:ncurses_tst.hin" ;;
-  *) { { echo "$as_me:13760: error: invalid argument: $ac_config_target" >&5
+  *) { { echo "$as_me:16696: error: invalid argument: $ac_config_target" >&5
 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
    { (exit 1); exit 1; }; };;
   esac
@@ -13816,6 +16752,7 @@ s,@program_transform_name@,$program_transform_name,;t t
 s,@bindir@,$bindir,;t t
 s,@sbindir@,$sbindir,;t t
 s,@libexecdir@,$libexecdir,;t t
+s,@datarootdir@,$datarootdir,;t t
 s,@datadir@,$datadir,;t t
 s,@sysconfdir@,$sysconfdir,;t t
 s,@sharedstatedir@,$sharedstatedir,;t t
@@ -13867,6 +16804,7 @@ s,@ETAGS@,$ETAGS,;t t
 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
 s,@MATH_LIB@,$MATH_LIB,;t t
+s,@top_builddir@,$top_builddir,;t t
 s,@CC_G_OPT@,$CC_G_OPT,;t t
 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
@@ -13887,7 +16825,8 @@ s,@PTHREAD@,$PTHREAD,;t t
 s,@TEST_ARGS@,$TEST_ARGS,;t t
 s,@TEST_DEPS@,$TEST_DEPS,;t t
 s,@TEST_LIBS@,$TEST_LIBS,;t t
-s,@TINFO_ARGS@,$TINFO_ARGS,;t t
+s,@TINFO_LDFLAGS@,$TINFO_LDFLAGS,;t t
+s,@TINFO_LIBS@,$TINFO_LIBS,;t t
 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
@@ -13898,13 +16837,18 @@ s,@SHOW_CC@,$SHOW_CC,;t t
 s,@ECHO_CC@,$ECHO_CC,;t t
 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
+s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
+s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
 s,@X_CFLAGS@,$X_CFLAGS,;t t
 s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t
 s,@X_LIBS@,$X_LIBS,;t t
 s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t
 s,@XCURSES_CONFIG@,$XCURSES_CONFIG,;t t
+s,@ac_ct_XCURSES_CONFIG@,$ac_ct_XCURSES_CONFIG,;t t
 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
+s,@cf_ldd_prog@,$cf_ldd_prog,;t t
+s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
 CEOF
 
 EOF
@@ -14019,7 +16963,7 @@ done; }
   esac
 
   if test x"$ac_file" != x-; then
-    { echo "$as_me:14022: creating $ac_file" >&5
+    { echo "$as_me:16966: creating $ac_file" >&5
 echo "$as_me: creating $ac_file" >&6;}
     rm -f "$ac_file"
   fi
@@ -14037,7 +16981,7 @@ echo "$as_me: creating $ac_file" >&6;}
       -) echo $tmp/stdin ;;
       [\\/$]*)
          # Absolute (can't be DOS-style, as IFS=:)
-         test -f "$f" || { { echo "$as_me:14040: error: cannot find input file: $f" >&5
+         test -f "$f" || { { echo "$as_me:16984: error: cannot find input file: $f" >&5
 echo "$as_me: error: cannot find input file: $f" >&2;}
    { (exit 1); exit 1; }; }
          echo $f;;
@@ -14050,7 +16994,7 @@ echo "$as_me: error: cannot find input file: $f" >&2;}
            echo $srcdir/$f
          else
            # /dev/null tree
-           { { echo "$as_me:14053: error: cannot find input file: $f" >&5
+           { { echo "$as_me:16997: error: cannot find input file: $f" >&5
 echo "$as_me: error: cannot find input file: $f" >&2;}
    { (exit 1); exit 1; }; }
          fi;;
@@ -14116,7 +17060,7 @@ for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
   * )   ac_file_in=$ac_file.in ;;
   esac
 
-  test x"$ac_file" != x- && { echo "$as_me:14119: creating $ac_file" >&5
+  test x"$ac_file" != x- && { echo "$as_me:17063: creating $ac_file" >&5
 echo "$as_me: creating $ac_file" >&6;}
 
   # First look for the input files in the build tree, otherwise in the
@@ -14127,7 +17071,7 @@ echo "$as_me: creating $ac_file" >&6;}
       -) echo $tmp/stdin ;;
       [\\/$]*)
          # Absolute (can't be DOS-style, as IFS=:)
-         test -f "$f" || { { echo "$as_me:14130: error: cannot find input file: $f" >&5
+         test -f "$f" || { { echo "$as_me:17074: error: cannot find input file: $f" >&5
 echo "$as_me: error: cannot find input file: $f" >&2;}
    { (exit 1); exit 1; }; }
          echo $f;;
@@ -14140,7 +17084,7 @@ echo "$as_me: error: cannot find input file: $f" >&2;}
            echo $srcdir/$f
          else
            # /dev/null tree
-           { { echo "$as_me:14143: error: cannot find input file: $f" >&5
+           { { echo "$as_me:17087: error: cannot find input file: $f" >&5
 echo "$as_me: error: cannot find input file: $f" >&2;}
    { (exit 1); exit 1; }; }
          fi;;
@@ -14198,7 +17142,7 @@ cat >>$CONFIG_STATUS <<\EOF
   rm -f $tmp/in
   if test x"$ac_file" != x-; then
     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
-      { echo "$as_me:14201: $ac_file is unchanged" >&5
+      { echo "$as_me:17145: $ac_file is unchanged" >&5
 echo "$as_me: $ac_file is unchanged" >&6;}
     else
       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
@@ -14271,10 +17215,11 @@ for N in $LIST
 do
        cat >>Makefile <<TEST_EOF
 
-\$(MODEL)/$N.o : $N.c \\
-       test.priv.h \\
+\$(MODEL)/$N.o : \$(srcdir)/$N.c \\
+       \$(srcdir)/test.priv.h \\
        ncurses_cfg.h
-       @echo compiling $N; \$(CC) -c \$(CFLAGS_DEFAULT) $N.c
+       $SHOW_CC
+       $ECHO_CC\$(CC) -c \$(CFLAGS_DEFAULT) \$(srcdir)/$N.c
 TEST_EOF
 done