]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - test/configure
ncurses 5.7 - patch 20100731
[ncurses.git] / test / configure
index fa21f99d4f8a8d4209c57761b27ed3affc7beb8b..9819eba781d21815aecaf63b55196f2199df695d 100755 (executable)
@@ -190,11 +190,14 @@ cat <<\EOF
   --with-ncursesw         use wide ncurses-libraries (installed)
   --with-ncurses          use ncurses-libraries (installed)
   --with-pdcurses         compile/link with pdcurses X11 library
   --with-ncursesw         use wide ncurses-libraries (installed)
   --with-ncurses          use ncurses-libraries (installed)
   --with-pdcurses         compile/link with pdcurses X11 library
-  --with-x                use the X Window System
   --with-Xaw3d            link with Xaw 3d library
   --with-neXtaw           link with neXT Athena library
   --with-XawPlus          link with Athena-Plus library
   --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
   --with-ncurses-wrap-prefix naming-prefix for ncurses wrapped-variables
+EOF
+cat <<\EOF
 EOF
     exit 0 ;;
 
 EOF
     exit 0 ;;
 
@@ -532,241 +535,6 @@ else
   ac_n= ac_c='\c' ac_t=
 fi
 
   ac_n= ac_c='\c' ac_t=
 fi
 
-# If we find X, set shell vars x_includes and x_libraries to the
-# paths, otherwise set no_x=yes.
-# Uses ac_ vars as temps to allow command line to override cache and checks.
-# --without-x overrides everything else, but does not touch the cache.
-echo $ac_n "checking for X""... $ac_c" 1>&6
-echo "configure:541: checking for X" >&5
-
-
-# Check whether --with-x or --without-x was given.
-if test "${with_x+set}" = set; then
-  withval="$with_x"
-  :
-fi
-
-# $have_x is `yes', `no', `disabled', or empty when we do not yet know.
-if test "x$with_x" = xno; then
-  # The user explicitly disabled X.
-  have_x=disabled
-else
-  if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
-    # Both variables are already set.
-    have_x=yes
-  else
-if eval "test \"`echo '$''{'ac_cv_have_x'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  # One or both of the vars are not set, and there is no cached value.
-ac_x_includes=NO ac_x_libraries=NO
-rm -fr conftestdir
-if mkdir conftestdir; then
-  cd conftestdir
-  # Make sure to not put "make" in the Imakefile rules, since we grep it out.
-  cat > Imakefile <<'EOF'
-acfindx:
-       @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
-EOF
-  if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
-    # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
-    eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
-    # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
-    for ac_extension in a so sl; do
-      if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
-        test -f $ac_im_libdir/libX11.$ac_extension; then
-        ac_im_usrlibdir=$ac_im_libdir; break
-      fi
-    done
-    # Screen out bogus values from the imake configuration.  They are
-    # bogus both because they are the default anyway, and because
-    # using them would break gcc on systems where it needs fixed includes.
-    case "$ac_im_incroot" in
-       /usr/include) ;;
-       *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes="$ac_im_incroot" ;;
-    esac
-    case "$ac_im_usrlibdir" in
-       /usr/lib | /lib) ;;
-       *) test -d "$ac_im_usrlibdir" && ac_x_libraries="$ac_im_usrlibdir" ;;
-    esac
-  fi
-  cd ..
-  rm -fr conftestdir
-fi
-
-if test "$ac_x_includes" = NO; then
-  # Guess where to find include files, by looking for this one X11 .h file.
-  test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h
-
-  # First, try using that file with no special directory specified.
-cat > conftest.$ac_ext <<EOF
-#line 604 "configure"
-#include "confdefs.h"
-#include <$x_direct_test_include>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:609: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  rm -rf conftest*
-  # We can compile using X headers with no special include directory.
-ac_x_includes=
-else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  # Look for the header file in a standard set of common directories.
-# Check X11 before X11Rn because it is often a symlink to the current release.
-  for ac_dir in               \
-    /usr/X11/include          \
-    /usr/X11R6/include        \
-    /usr/X11R5/include        \
-    /usr/X11R4/include        \
-                              \
-    /usr/include/X11          \
-    /usr/include/X11R6        \
-    /usr/include/X11R5        \
-    /usr/include/X11R4        \
-                              \
-    /usr/local/X11/include    \
-    /usr/local/X11R6/include  \
-    /usr/local/X11R5/include  \
-    /usr/local/X11R4/include  \
-                              \
-    /usr/local/include/X11    \
-    /usr/local/include/X11R6  \
-    /usr/local/include/X11R5  \
-    /usr/local/include/X11R4  \
-                              \
-    /usr/X386/include         \
-    /usr/x386/include         \
-    /usr/XFree86/include/X11  \
-                              \
-    /usr/include              \
-    /usr/local/include        \
-    /usr/unsupported/include  \
-    /usr/athena/include       \
-    /usr/local/x11r5/include  \
-    /usr/lpp/Xamples/include  \
-                              \
-    /usr/openwin/include      \
-    /usr/openwin/share/include \
-    ; \
-  do
-    if test -r "$ac_dir/$x_direct_test_include"; then
-      ac_x_includes=$ac_dir
-      break
-    fi
-  done
-fi
-rm -f conftest*
-fi # $ac_x_includes = NO
-
-if test "$ac_x_libraries" = NO; then
-  # Check for the libraries.
-
-  test -z "$x_direct_test_library" && x_direct_test_library=Xt
-  test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc
-
-  # See if we find them without any special options.
-  # Don't add to $LIBS permanently.
-  ac_save_LIBS="$LIBS"
-  LIBS="-l$x_direct_test_library $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 678 "configure"
-#include "confdefs.h"
-
-int main() {
-${x_direct_test_function}()
-; return 0; }
-EOF
-if { (eval echo configure:685: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  LIBS="$ac_save_LIBS"
-# We can link X programs with no special library path.
-ac_x_libraries=
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  LIBS="$ac_save_LIBS"
-# First see if replacing the include by lib works.
-# Check X11 before X11Rn because it is often a symlink to the current release.
-for ac_dir in `echo "$ac_x_includes" | sed s/include/lib/` \
-    /usr/X11/lib          \
-    /usr/X11R6/lib        \
-    /usr/X11R5/lib        \
-    /usr/X11R4/lib        \
-                          \
-    /usr/lib/X11          \
-    /usr/lib/X11R6        \
-    /usr/lib/X11R5        \
-    /usr/lib/X11R4        \
-                          \
-    /usr/local/X11/lib    \
-    /usr/local/X11R6/lib  \
-    /usr/local/X11R5/lib  \
-    /usr/local/X11R4/lib  \
-                          \
-    /usr/local/lib/X11    \
-    /usr/local/lib/X11R6  \
-    /usr/local/lib/X11R5  \
-    /usr/local/lib/X11R4  \
-                          \
-    /usr/X386/lib         \
-    /usr/x386/lib         \
-    /usr/XFree86/lib/X11  \
-                          \
-    /usr/lib              \
-    /usr/local/lib        \
-    /usr/unsupported/lib  \
-    /usr/athena/lib       \
-    /usr/local/x11r5/lib  \
-    /usr/lpp/Xamples/lib  \
-    /lib/usr/lib/X11     \
-                          \
-    /usr/openwin/lib      \
-    /usr/openwin/share/lib \
-    ; \
-do
-  for ac_extension in a so sl; do
-    if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then
-      ac_x_libraries=$ac_dir
-      break 2
-    fi
-  done
-done
-fi
-rm -f conftest*
-fi # $ac_x_libraries = NO
-
-if test "$ac_x_includes" = NO || test "$ac_x_libraries" = NO; then
-  # Didn't find X anywhere.  Cache the known absence of X.
-  ac_cv_have_x="have_x=no"
-else
-  # Record where we found X for the cache.
-  ac_cv_have_x="have_x=yes \
-               ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
-fi
-fi
-  fi
-  eval "$ac_cv_have_x"
-fi # $with_x != no
-
-if test "$have_x" != yes; then
-  echo "$ac_t""$have_x" 1>&6
-  no_x=yes
-else
-  # If each of the values was on the command line, it overrides each guess.
-  test "x$x_includes" = xNONE && x_includes=$ac_x_includes
-  test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
-  # 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 "$ac_t""libraries $x_libraries, headers $x_includes" 1>&6
-fi
-
 
 
 
 
 
 
@@ -804,7 +572,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
 fi
 
 echo $ac_n "checking host system type""... $ac_c" 1>&6
 fi
 
 echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:808: checking host system type" >&5
+echo "configure:576: checking host system type" >&5
 
 host_alias=$host
 case "$host_alias" in
 
 host_alias=$host
 case "$host_alias" in
@@ -852,7 +620,7 @@ fi
 
 
 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
 
 
 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:856: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:624: checking whether ${MAKE-make} sets \${MAKE}" >&5
 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -881,7 +649,7 @@ fi
 # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
 # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:885: checking for $ac_word" >&5
+echo "configure:653: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -911,7 +679,7 @@ if test -z "$CC"; then
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:915: checking for $ac_word" >&5
+echo "configure:683: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -962,7 +730,7 @@ fi
       # Extract the first word of "cl", so it can be a program name with args.
 set dummy cl; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
       # Extract the first word of "cl", so it can be a program name with args.
 set dummy cl; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:966: checking for $ac_word" >&5
+echo "configure:734: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -994,7 +762,7 @@ fi
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:998: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:766: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
 
 ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -1005,12 +773,12 @@ cross_compiling=$ac_cv_prog_cc_cross
 
 cat > conftest.$ac_ext << EOF
 
 
 cat > conftest.$ac_ext << EOF
 
-#line 1009 "configure"
+#line 777 "configure"
 #include "confdefs.h"
 
 main(){return(0);}
 EOF
 #include "confdefs.h"
 
 main(){return(0);}
 EOF
-if { (eval echo configure:1014: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:782: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -1036,12 +804,12 @@ if test $ac_cv_prog_cc_works = no; then
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:1040: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:808: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:1045: checking whether we are using GNU C" >&5
+echo "configure:813: checking whether we are using GNU C" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1050,7 +818,7 @@ else
   yes;
 #endif
 EOF
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1054: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:822: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -1069,7 +837,7 @@ ac_test_CFLAGS="${CFLAGS+set}"
 ac_save_CFLAGS="$CFLAGS"
 CFLAGS=
 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
 ac_save_CFLAGS="$CFLAGS"
 CFLAGS=
 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:1073: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:841: checking whether ${CC-cc} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1101,7 +869,7 @@ else
 fi
 
 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
 fi
 
 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:1105: checking how to run the C preprocessor" >&5
+echo "configure:873: checking how to run the C preprocessor" >&5
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
@@ -1116,13 +884,13 @@ else
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp.
   cat > conftest.$ac_ext <<EOF
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp.
   cat > conftest.$ac_ext <<EOF
-#line 1120 "configure"
+#line 888 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1126: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:894: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -1133,13 +901,13 @@ else
   rm -rf conftest*
   CPP="${CC-cc} -E -traditional-cpp"
   cat > conftest.$ac_ext <<EOF
   rm -rf conftest*
   CPP="${CC-cc} -E -traditional-cpp"
   cat > conftest.$ac_ext <<EOF
-#line 1137 "configure"
+#line 905 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1143: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:911: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -1150,13 +918,13 @@ else
   rm -rf conftest*
   CPP="${CC-cc} -nologo -E"
   cat > conftest.$ac_ext <<EOF
   rm -rf conftest*
   CPP="${CC-cc} -nologo -E"
   cat > conftest.$ac_ext <<EOF
-#line 1154 "configure"
+#line 922 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1160: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:928: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -1185,7 +953,7 @@ 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 $ac_n "checking for $ac_word""... $ac_c" 1>&6
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1189: checking for $ac_word" >&5
+echo "configure:957: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
 if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1215,29 +983,220 @@ test -n "$AWK" && break
 done
 
 
 done
 
 
-CC_G_OPT="-g"                                  
-CC_SHARED_OPTS=unknown                 
-CPPFLAGS="$CPPFLAGS"                   
-DFT_DEP_SUFFIX=""                              
-DFT_OBJ_SUBDIR=`pwd|sed -e's:.*/::'`   
-DFT_UPR_MODEL="NORMAL"                 
-LD="ld"                                                        
-LDFLAGS_SHARED=""                              
-LDFLAGS_STATIC=""                              
-LD_MODEL=""                                            
-LD_SHARED_OPTS=""                              
-LIBTOOL=""                                             
-LIB_CLEAN=""                                   
-LIB_COMPILE=""                                 
-LIB_LINK='${CC}'                               
-LINK_TESTS=""                                  
-LINT=lint                                              
-LINT_OPTS=""                                   
-LOCAL_LDFLAGS=""                               
-MATH_LIB="-lm"                                 
-PTHREAD="-lm"                                  
-TEST_ARGS=""                                   
-TEST_DEPS=""                                   
+echo $ac_n "checking if filesystem supports mixed-case filenames""... $ac_c" 1>&6
+echo "configure:988: checking if filesystem supports mixed-case filenames" >&5
+if eval "test \"`echo '$''{'cf_cv_mixedcase'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+if test "$cross_compiling" = yes ; then
+       case $target_alias in #(vi
+       *-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-mingw32*|*-uwin*) #(vi
+               cf_cv_mixedcase=no
+               ;;
+       *)
+               cf_cv_mixedcase=yes
+               ;;
+       esac
+else
+       rm -f conftest CONFTEST
+       echo test >conftest
+       if test -f CONFTEST ; then
+               cf_cv_mixedcase=no
+       else
+               cf_cv_mixedcase=yes
+       fi
+       rm -f conftest CONFTEST
+fi
+
+fi
+
+echo "$ac_t""$cf_cv_mixedcase" 1>&6
+test "$cf_cv_mixedcase" = yes && cat >> confdefs.h <<\EOF
+#define MIXEDCASE_FILENAMES 1
+EOF
+
+
+
+
+
+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 $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1029: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CTAGS'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CTAGS"; then
+  ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
+else
+  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CTAGS="$ac_prog"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CTAGS="$ac_cv_prog_CTAGS"
+if test -n "$CTAGS"; then
+  echo "$ac_t""$CTAGS" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+test -n "$CTAGS" && break
+done
+
+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 $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1063: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_ETAGS'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$ETAGS"; then
+  ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
+else
+  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_ETAGS="$ac_prog"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+ETAGS="$ac_cv_prog_ETAGS"
+if test -n "$ETAGS"; then
+  echo "$ac_t""$ETAGS" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+test -n "$ETAGS" && break
+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 $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1096: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_MAKE_LOWER_TAGS'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$MAKE_LOWER_TAGS"; then
+  ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
+else
+  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_MAKE_LOWER_TAGS="yes"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+  test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
+fi
+fi
+MAKE_LOWER_TAGS="$ac_cv_prog_MAKE_LOWER_TAGS"
+if test -n "$MAKE_LOWER_TAGS"; then
+  echo "$ac_t""$MAKE_LOWER_TAGS" 1>&6
+else
+  echo "$ac_t""no" 1>&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 $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1128: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_MAKE_UPPER_TAGS'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$MAKE_UPPER_TAGS"; then
+  ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
+else
+  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_MAKE_UPPER_TAGS="yes"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+  test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
+fi
+fi
+MAKE_UPPER_TAGS="$ac_cv_prog_MAKE_UPPER_TAGS"
+if test -n "$MAKE_UPPER_TAGS"; then
+  echo "$ac_t""$MAKE_UPPER_TAGS" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+else
+       MAKE_UPPER_TAGS=no
+fi
+
+if test "$MAKE_UPPER_TAGS" = yes ; then
+       MAKE_UPPER_TAGS=
+else
+       MAKE_UPPER_TAGS="#"
+fi
+
+if test "$MAKE_LOWER_TAGS" = yes ; then
+       MAKE_LOWER_TAGS=
+else
+       MAKE_LOWER_TAGS="#"
+fi
+
+
+
+
+
+
+
+
+CC_G_OPT="-g"                                  
+CC_SHARED_OPTS=unknown                 
+CPPFLAGS="$CPPFLAGS"                   
+DFT_DEP_SUFFIX=""                              
+DFT_OBJ_SUBDIR=`pwd|sed -e's:.*/::'`   
+DFT_UPR_MODEL="NORMAL"                 
+LD="ld"                                                        
+LDFLAGS_SHARED=""                              
+LDFLAGS_STATIC=""                              
+LD_MODEL=""                                            
+LD_SHARED_OPTS=""                              
+LIBTOOL=""                                             
+LIB_CLEAN=""                                   
+LIB_COMPILE=""                                 
+LIB_LINK='${CC}'                               
+LINK_TESTS=""                                  
+LINT=lint                                              
+LINT_OPTS=""                                   
+LOCAL_LDFLAGS=""                               
+MATH_LIB="-lm"                                 
+PTHREAD="-lm"                                  
+TEST_ARGS=""                                   
+TEST_DEPS=""                                   
 TEST_LIBS=""                                   
 TINFO_ARGS='$(LIBS_CURSES)'            
 cf_cv_abi_version=""                   
 TEST_LIBS=""                                   
 TINFO_ARGS='$(LIBS_CURSES)'            
 cf_cv_abi_version=""                   
@@ -1247,12 +1206,12 @@ cf_cv_screen=curses
 cf_cv_libtype=
 
 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
 cf_cv_libtype=
 
 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
-echo "configure:1251: checking for Cygwin environment" >&5
+echo "configure:1210: checking for Cygwin environment" >&5
 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1256 "configure"
+#line 1215 "configure"
 #include "confdefs.h"
 
 int main() {
 #include "confdefs.h"
 
 int main() {
@@ -1263,7 +1222,7 @@ int main() {
 return __CYGWIN__;
 ; return 0; }
 EOF
 return __CYGWIN__;
 ; return 0; }
 EOF
-if { (eval echo configure:1267: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1226: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_cygwin=yes
 else
   rm -rf conftest*
   ac_cv_cygwin=yes
 else
@@ -1280,19 +1239,19 @@ echo "$ac_t""$ac_cv_cygwin" 1>&6
 CYGWIN=
 test "$ac_cv_cygwin" = yes && CYGWIN=yes
 echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
 CYGWIN=
 test "$ac_cv_cygwin" = yes && CYGWIN=yes
 echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
-echo "configure:1284: checking for mingw32 environment" >&5
+echo "configure:1243: checking for mingw32 environment" >&5
 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1289 "configure"
+#line 1248 "configure"
 #include "confdefs.h"
 
 int main() {
 return __MINGW32__;
 ; return 0; }
 EOF
 #include "confdefs.h"
 
 int main() {
 return __MINGW32__;
 ; return 0; }
 EOF
-if { (eval echo configure:1296: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1255: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_mingw32=yes
 else
   rm -rf conftest*
   ac_cv_mingw32=yes
 else
@@ -1311,7 +1270,7 @@ test "$ac_cv_mingw32" = yes && MINGW32=yes
 
 
 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
 
 
 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:1315: checking for executable suffix" >&5
+echo "configure:1274: checking for executable suffix" >&5
 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1321,7 +1280,7 @@ else
   rm -f conftest*
   echo 'int main () { return 0; }' > conftest.$ac_ext
   ac_cv_exeext=
   rm -f conftest*
   echo 'int main () { return 0; }' > conftest.$ac_ext
   ac_cv_exeext=
-  if { (eval echo configure:1325: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+  if { (eval echo configure:1284: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
     for file in conftest.*; do
       case $file in
       *.c | *.o | *.obj) ;;
     for file in conftest.*; do
       case $file in
       *.c | *.o | *.obj) ;;
@@ -1342,13 +1301,13 @@ echo "$ac_t""${ac_cv_exeext}" 1>&6
 ac_exeext=$EXEEXT
 
 echo $ac_n "checking for object suffix""... $ac_c" 1>&6
 ac_exeext=$EXEEXT
 
 echo $ac_n "checking for object suffix""... $ac_c" 1>&6
-echo "configure:1346: checking for object suffix" >&5
+echo "configure:1305: checking for object suffix" >&5
 if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   rm -f conftest*
 echo 'int i = 1;' > conftest.$ac_ext
 if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   rm -f conftest*
 echo 'int i = 1;' > conftest.$ac_ext
-if { (eval echo configure:1352: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1311: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   for ac_file in conftest.*; do
     case $ac_file in
     *.c) ;;
   for ac_file in conftest.*; do
     case $ac_file in
     *.c) ;;
@@ -1368,7 +1327,7 @@ ac_objext=$ac_cv_objext
 
 
 echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6
 
 
 echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6
-echo "configure:1372: checking for ${CC-cc} option to accept ANSI C" >&5
+echo "configure:1331: checking for ${CC-cc} option to accept ANSI C" >&5
 if eval "test \"`echo '$''{'cf_cv_ansi_cc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
 if eval "test \"`echo '$''{'cf_cv_ansi_cc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1408,8 +1367,8 @@ no)
                        cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
 
                        test "${cf_add_cflags}" != "${cf_tst_cflags}" \
                        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
+                               && 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"
 
                        if test $cf_fix_cppflags = yes ; then
                                cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
@@ -1424,6 +1383,16 @@ no)
                *$cf_add_cflags) #(vi
                        ;;
                *) #(vi
                *$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_cppflags="$cf_new_cppflags $cf_add_cflags"
                        ;;
                esac
@@ -1439,8 +1408,8 @@ yes)
        cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
 
        test "${cf_add_cflags}" != "${cf_tst_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
+               && test -z "${cf_tst_cflags}" \
+               && cf_fix_cppflags=no
        ;;
 esac
 done
        ;;
 esac
 done
@@ -1464,7 +1433,7 @@ fi
 
 
        cat > conftest.$ac_ext <<EOF
 
 
        cat > conftest.$ac_ext <<EOF
-#line 1468 "configure"
+#line 1437 "configure"
 #include "confdefs.h"
 
 #ifndef CC_HAS_PROTOS
 #include "confdefs.h"
 
 #ifndef CC_HAS_PROTOS
@@ -1480,7 +1449,7 @@ int main() {
        struct s2 {int (*f) (double a);};
 ; return 0; }
 EOF
        struct s2 {int (*f) (double a);};
 ; return 0; }
 EOF
-if { (eval echo configure:1484: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1453: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_ansi_cc="$cf_arg"; break
 else
   rm -rf conftest*
   cf_cv_ansi_cc="$cf_arg"; break
 else
@@ -1515,8 +1484,8 @@ no)
                        cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
 
                        test "${cf_add_cflags}" != "${cf_tst_cflags}" \
                        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
+                               && 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"
 
                        if test $cf_fix_cppflags = yes ; then
                                cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
@@ -1531,6 +1500,16 @@ no)
                *$cf_add_cflags) #(vi
                        ;;
                *) #(vi
                *$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_cppflags="$cf_new_cppflags $cf_add_cflags"
                        ;;
                esac
@@ -1546,8 +1525,8 @@ yes)
        cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
 
        test "${cf_add_cflags}" != "${cf_tst_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
+               && test -z "${cf_tst_cflags}" \
+               && cf_fix_cppflags=no
        ;;
 esac
 done
        ;;
 esac
 done
@@ -1607,9 +1586,9 @@ EOF
 if test "$GCC" = yes
 then
        echo "checking for $CC __attribute__ directives" 1>&6
 if test "$GCC" = yes
 then
        echo "checking for $CC __attribute__ directives" 1>&6
-echo "configure:1611: checking for $CC __attribute__ directives" >&5
+echo "configure:1590: checking for $CC __attribute__ directives" >&5
 cat > conftest.$ac_ext <<EOF
 cat > conftest.$ac_ext <<EOF
-#line 1613 "${as_me-configure}"
+#line 1592 "${as_me-configure}"
 #include "confdefs.h"
 #include "conftest.h"
 #include "conftest.i"
 #include "confdefs.h"
 #include "conftest.h"
 #include "conftest.i"
@@ -1628,6 +1607,8 @@ 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
 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
                
        for cf_attribute in scanf printf unused noreturn
        do
                
@@ -1635,21 +1616,54 @@ cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFG
 
                cf_directive="__attribute__(($cf_attribute))"
                echo "checking for $CC $cf_directive" 1>&5
 
                cf_directive="__attribute__(($cf_attribute))"
                echo "checking for $CC $cf_directive" 1>&5
-               case $cf_attribute in
-               scanf|printf)
-               cat >conftest.h <<EOF
+
+               case $cf_attribute in #(vi
+               printf) #(vi
+                       cf_printf_attribute=yes
+                       cat >conftest.h <<EOF
 #define GCC_$cf_ATTRIBUTE 1
 EOF
                        ;;
 #define GCC_$cf_ATTRIBUTE 1
 EOF
                        ;;
-               *)
-               cat >conftest.h <<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
 #define GCC_$cf_ATTRIBUTE $cf_directive
 EOF
                        ;;
                esac
-               if { (eval echo configure:1651: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+
+               if { (eval echo configure:1641: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
                        test -n "$verbose" && echo "$ac_t""... $cf_attribute" 1>&6
                        cat conftest.h >>confdefs.h
                        test -n "$verbose" && echo "$ac_t""... $cf_attribute" 1>&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
                fi
        done
 else
@@ -1659,57 +1673,20 @@ rm -rf conftest*
 fi
 
 
 fi
 
 
-echo $ac_n "checking if $CC -U and -D options work together""... $ac_c" 1>&6
-echo "configure:1664: checking if $CC -U and -D options work together" >&5
-if eval "test \"`echo '$''{'cf_cv_cc_u_d_options'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  
-       cf_save_CPPFLAGS="$CPPFLAGS"
-       CPPFLAGS="-UU_D_OPTIONS -DU_D_OPTIONS -DD_U_OPTIONS -UD_U_OPTIONS"
-       cat > conftest.$ac_ext <<EOF
-#line 1672 "configure"
-#include "confdefs.h"
-
-int main() {
-
-#ifndef U_D_OPTIONS
-make an undefined-error
-#endif
-#ifdef  D_U_OPTIONS
-make a defined-error
-#endif
-       
-; return 0; }
-EOF
-if { (eval echo configure:1686: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
-  
-       cf_cv_cc_u_d_options=yes
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  
-       cf_cv_cc_u_d_options=no
-fi
-rm -f conftest*
-       CPPFLAGS="$cf_save_CPPFLAGS"
-
-fi
-
-echo "$ac_t""$cf_cv_cc_u_d_options" 1>&6
-
-
-
-
 
 cf_XOPEN_SOURCE=500
 cf_POSIX_C_SOURCE=199506L
 
 cf_XOPEN_SOURCE=500
 cf_POSIX_C_SOURCE=199506L
+cf_xopen_source=
 
 case $host_os in #(vi
 aix[456]*) #(vi
 
 case $host_os in #(vi
 aix[456]*) #(vi
-       CPPFLAGS="$CPPFLAGS -D_ALL_SOURCE"
+       cf_xopen_source="-D_ALL_SOURCE"
+       ;;
+darwin[0-8].*) #(vi
+       cf_xopen_source="-D_APPLE_C_SOURCE"
+       ;;
+darwin*) #(vi
+       cf_xopen_source="-D_DARWIN_C_SOURCE"
        ;;
 freebsd*|dragonfly*) #(vi
        # 5.x headers associate
        ;;
 freebsd*|dragonfly*) #(vi
        # 5.x headers associate
@@ -1717,24 +1694,27 @@ freebsd*|dragonfly*) #(vi
        #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
        cf_POSIX_C_SOURCE=200112L
        cf_XOPEN_SOURCE=600
        #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
        cf_POSIX_C_SOURCE=200112L
        cf_XOPEN_SOURCE=600
-       CPPFLAGS="$CPPFLAGS -D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
+       cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
+       ;;
+hpux11*) #(vi
+       cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
        ;;
 hpux*) #(vi
        ;;
 hpux*) #(vi
-       CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE"
+       cf_xopen_source="-D_HPUX_SOURCE"
        ;;
 irix[56].*) #(vi
        ;;
 irix[56].*) #(vi
-       CPPFLAGS="$CPPFLAGS -D_SGI_SOURCE"
+       cf_xopen_source="-D_SGI_SOURCE"
        ;;
 linux*|gnu*|mint*|k*bsd*-gnu) #(vi
        
 echo $ac_n "checking if we must define _GNU_SOURCE""... $ac_c" 1>&6
        ;;
 linux*|gnu*|mint*|k*bsd*-gnu) #(vi
        
 echo $ac_n "checking if we must define _GNU_SOURCE""... $ac_c" 1>&6
-echo "configure:1732: checking if we must define _GNU_SOURCE" >&5
+echo "configure:1712: checking if we must define _GNU_SOURCE" >&5
 if eval "test \"`echo '$''{'cf_cv_gnu_source'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 cat > conftest.$ac_ext <<EOF
 if eval "test \"`echo '$''{'cf_cv_gnu_source'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 cat > conftest.$ac_ext <<EOF
-#line 1738 "configure"
+#line 1718 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 int main() {
 #include "confdefs.h"
 #include <sys/types.h>
 int main() {
@@ -1744,7 +1724,7 @@ make an error
 #endif
 ; return 0; }
 EOF
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:1748: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1728: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_gnu_source=no
 else
   rm -rf conftest*
   cf_cv_gnu_source=no
 else
@@ -1754,7 +1734,7 @@ else
   cf_save="$CPPFLAGS"
         CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
         cat > conftest.$ac_ext <<EOF
   cf_save="$CPPFLAGS"
         CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
         cat > conftest.$ac_ext <<EOF
-#line 1758 "configure"
+#line 1738 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 int main() {
 #include "confdefs.h"
 #include <sys/types.h>
 int main() {
@@ -1764,7 +1744,7 @@ make an error
 #endif
 ; return 0; }
 EOF
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:1768: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1748: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_gnu_source=no
 else
   rm -rf conftest*
   cf_cv_gnu_source=no
 else
@@ -1795,26 +1775,29 @@ openbsd*) #(vi
        # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
        ;;
 osf[45]*) #(vi
        # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
        ;;
 osf[45]*) #(vi
-       CPPFLAGS="$CPPFLAGS -D_OSF_SOURCE"
+       cf_xopen_source="-D_OSF_SOURCE"
        ;;
 nto-qnx*) #(vi
        ;;
 nto-qnx*) #(vi
-       CPPFLAGS="$CPPFLAGS -D_QNX_SOURCE"
+       cf_xopen_source="-D_QNX_SOURCE"
        ;;
 sco*) #(vi
        # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
        ;;
        ;;
 sco*) #(vi
        # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
        ;;
-solaris*) #(vi
-       CPPFLAGS="$CPPFLAGS -D__EXTENSIONS__"
+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 $ac_n "checking if we should define _XOPEN_SOURCE""... $ac_c" 1>&6
        ;;
 *)
        echo $ac_n "checking if we should define _XOPEN_SOURCE""... $ac_c" 1>&6
-echo "configure:1812: checking if we should define _XOPEN_SOURCE" >&5
+echo "configure:1795: checking if we should define _XOPEN_SOURCE" >&5
 if eval "test \"`echo '$''{'cf_cv_xopen_source'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
        cat > conftest.$ac_ext <<EOF
 if eval "test \"`echo '$''{'cf_cv_xopen_source'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
        cat > conftest.$ac_ext <<EOF
-#line 1818 "configure"
+#line 1801 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 int main() {
 #include "confdefs.h"
 #include <sys/types.h>
 int main() {
@@ -1824,7 +1807,7 @@ make an error
 #endif
 ; return 0; }
 EOF
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:1828: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1811: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_xopen_source=no
 else
   rm -rf conftest*
   cf_cv_xopen_source=no
 else
@@ -1834,7 +1817,7 @@ else
   cf_save="$CPPFLAGS"
         CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
         cat > conftest.$ac_ext <<EOF
   cf_save="$CPPFLAGS"
         CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
         cat > conftest.$ac_ext <<EOF
-#line 1838 "configure"
+#line 1821 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 int main() {
 #include "confdefs.h"
 #include <sys/types.h>
 int main() {
@@ -1844,7 +1827,7 @@ make an error
 #endif
 ; return 0; }
 EOF
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:1848: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1831: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_xopen_source=no
 else
   rm -rf conftest*
   cf_cv_xopen_source=no
 else
 echo "$ac_t""$cf_cv_xopen_source" 1>&6
        if test "$cf_cv_xopen_source" != no ; then
                
 echo "$ac_t""$cf_cv_xopen_source" 1>&6
        if test "$cf_cv_xopen_source" != no ; then
                
-# remove _XOPEN_SOURCE symbol from $CFLAGS
 CFLAGS=`echo "$CFLAGS" | \
 CFLAGS=`echo "$CFLAGS" | \
-       sed     -e 's/-[UD]_XOPEN_SOURCE\(=[^   ]*\)\?[         ]/ /g' \
-               -e 's/-[UD]_XOPEN_SOURCE\(=[^   ]*\)\?$//g'`
+       sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
+               -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
 
                
 
                
-# remove _XOPEN_SOURCE symbol from $CPPFLAGS
 CPPFLAGS=`echo "$CPPFLAGS" | \
 CPPFLAGS=`echo "$CPPFLAGS" | \
-       sed     -e 's/-[UD]_XOPEN_SOURCE\(=[^   ]*\)\?[         ]/ /g' \
-               -e 's/-[UD]_XOPEN_SOURCE\(=[^   ]*\)\?$//g'`
-
-               test "$cf_cv_cc_u_d_options" = yes && \
-                       CPPFLAGS="$CPPFLAGS -U_XOPEN_SOURCE"
-               CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_cv_xopen_source"
-       fi
-       
-cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
+       sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
+               -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
 
 
-cf_save_CFLAGS="$CFLAGS"
-cf_save_CPPFLAGS="$CPPFLAGS"
+               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[^=]*='\''\"[^"]*//'`
 
 
-# remove _POSIX_C_SOURCE symbol from $cf_save_CFLAGS
-cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
-       sed     -e 's/-[UD]_POSIX_C_SOURCE\(=[^         ]*\)\?[         ]/ /g' \
-               -e 's/-[UD]_POSIX_C_SOURCE\(=[^         ]*\)\?$//g'`
+                       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'`
 
 
-# remove _POSIX_C_SOURCE symbol from $cf_save_CPPFLAGS
-cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
-       sed     -e 's/-[UD]_POSIX_C_SOURCE\(=[^         ]*\)\?[         ]/ /g' \
-               -e 's/-[UD]_POSIX_C_SOURCE\(=[^         ]*\)\?$//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 $ac_n "checking if we should define _POSIX_C_SOURCE""... $ac_c" 1>&6
 
 
 echo $ac_n "checking if we should define _POSIX_C_SOURCE""... $ac_c" 1>&6
-echo "configure:1903: checking if we should define _POSIX_C_SOURCE" >&5
+echo "configure:1962: checking if we should define _POSIX_C_SOURCE" >&5
 if eval "test \"`echo '$''{'cf_cv_posix_c_source'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
        
 if eval "test \"`echo '$''{'cf_cv_posix_c_source'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
        
-echo "${as_me-configure}:1909: testing if the symbol is already defined go no further ..." 1>&5
+echo "${as_me-configure}:1968: testing if the symbol is already defined go no further ..." 1>&5
 
        cat > conftest.$ac_ext <<EOF
 
        cat > conftest.$ac_ext <<EOF
-#line 1912 "configure"
+#line 1971 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 int main() {
 #include "confdefs.h"
 #include <sys/types.h>
 int main() {
@@ -1918,7 +1977,7 @@ make an error
 #endif
 ; return 0; }
 EOF
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:1922: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1981: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_posix_c_source=no
 else
   rm -rf conftest*
   cf_cv_posix_c_source=no
 else
@@ -1940,7 +1999,7 @@ else
         esac
         if test "$cf_want_posix_source" = yes ; then
                cat > conftest.$ac_ext <<EOF
         esac
         if test "$cf_want_posix_source" = yes ; then
                cat > conftest.$ac_ext <<EOF
-#line 1944 "configure"
+#line 2003 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 int main() {
 #include "confdefs.h"
 #include <sys/types.h>
 int main() {
@@ -1950,7 +2009,7 @@ make an error
 #endif
 ; return 0; }
 EOF
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:1954: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2013: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   :
 else
   echo "configure: failed program was:" >&5
   :
 else
   echo "configure: failed program was:" >&5
@@ -1961,15 +2020,15 @@ fi
 rm -f conftest*
         fi
         
 rm -f conftest*
         fi
         
-echo "${as_me-configure}:1965: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
+echo "${as_me-configure}:2024: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
 
         CFLAGS="$cf_trim_CFLAGS"
         CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
         
 
         CFLAGS="$cf_trim_CFLAGS"
         CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
         
-echo "${as_me-configure}:1970: testing if the second compile does not leave our definition intact error ..." 1>&5
+echo "${as_me-configure}:2029: testing if the second compile does not leave our definition intact error ..." 1>&5
 
         cat > conftest.$ac_ext <<EOF
 
         cat > conftest.$ac_ext <<EOF
-#line 1973 "configure"
+#line 2032 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 int main() {
 #include "confdefs.h"
 #include <sys/types.h>
 int main() {
@@ -1979,7 +2038,7 @@ make an error
 #endif
 ; return 0; }
 EOF
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:1983: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2042: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   :
 else
   echo "configure: failed program was:" >&5
   :
 else
   echo "configure: failed program was:" >&5
@@ -2001,25 +2060,186 @@ echo "$ac_t""$cf_cv_posix_c_source" 1>&6
 if test "$cf_cv_posix_c_source" != no ; then
        CFLAGS="$cf_trim_CFLAGS"
        CPPFLAGS="$cf_trim_CPPFLAGS"
 if test "$cf_cv_posix_c_source" != no ; then
        CFLAGS="$cf_trim_CFLAGS"
        CPPFLAGS="$cf_trim_CPPFLAGS"
-       if test "$cf_cv_cc_u_d_options" = yes ; then
-               cf_temp_posix_c_source=`echo "$cf_cv_posix_c_source" | \
-                               sed -e 's/-D/-U/g' -e 's/=[^    ]*//g'`
-               CPPFLAGS="$CPPFLAGS $cf_temp_posix_c_source"
-       fi
-       CPPFLAGS="$CPPFLAGS $cf_cv_posix_c_source"
+       
+cf_fix_cppflags=no
+cf_new_cflags=
+cf_new_cppflags=
+cf_new_extra_cppflags=
+
+for cf_add_cflags in $cf_cv_posix_c_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
 
 
+
+
+fi
+
+
+       ;;
+esac
+
+if test -n "$cf_xopen_source" ; then
+       
+cf_fix_cppflags=no
+cf_new_cflags=
+cf_new_cppflags=
+cf_new_extra_cppflags=
+
+for cf_add_cflags in $cf_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
        ;;
 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
 
 echo $ac_n "checking for working const""... $ac_c" 1>&6
 
 echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:2018: checking for working const" >&5
+echo "configure:2238: checking for working const" >&5
 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2023 "configure"
+#line 2243 "configure"
 #include "confdefs.h"
 
 int main() {
 #include "confdefs.h"
 
 int main() {
@@ -2068,7 +2288,7 @@ ccp = (char const *const *) p;
 
 ; return 0; }
 EOF
 
 ; return 0; }
 EOF
-if { (eval echo configure:2072: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2292: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_const=yes
 else
   rm -rf conftest*
   ac_cv_c_const=yes
 else
@@ -2090,7 +2310,7 @@ fi
 
 
 echo $ac_n "checking for signal global datatype""... $ac_c" 1>&6
 
 
 echo $ac_n "checking for signal global datatype""... $ac_c" 1>&6
-echo "configure:2094: checking for signal global datatype" >&5
+echo "configure:2314: checking for signal global datatype" >&5
 if eval "test \"`echo '$''{'cf_cv_sig_atomic_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
 if eval "test \"`echo '$''{'cf_cv_sig_atomic_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2101,7 +2321,7 @@ else
                "int"
        do
        cat > conftest.$ac_ext <<EOF
                "int"
        do
        cat > conftest.$ac_ext <<EOF
-#line 2105 "configure"
+#line 2325 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -2119,7 +2339,7 @@ signal(SIGINT, handler);
                 x = 1
 ; return 0; }
 EOF
                 x = 1
 ; return 0; }
 EOF
-if { (eval echo configure:2123: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2343: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_sig_atomic_t=$cf_type
 else
   rm -rf conftest*
   cf_cv_sig_atomic_t=$cf_type
 else
@@ -2143,7 +2363,7 @@ EOF
 
 
 echo $ac_n "checking if you want to see long compiling messages""... $ac_c" 1>&6
 
 
 echo $ac_n "checking if you want to see long compiling messages""... $ac_c" 1>&6
-echo "configure:2147: checking if you want to see long compiling messages" >&5
+echo "configure:2367: checking if you want to see long compiling messages" >&5
 
 # Check whether --enable-echo or --disable-echo was given.
 if test "${enable_echo+set}" = set; then
 
 # Check whether --enable-echo or --disable-echo was given.
 if test "${enable_echo+set}" = set; then
@@ -2153,16 +2373,16 @@ if test "${enable_echo+set}" = set; then
     
     ECHO_LT='--silent'
     ECHO_LD='@echo linking $@;'
     
     ECHO_LT='--silent'
     ECHO_LD='@echo linking $@;'
-    RULE_CC='  @echo compiling $<'
-    SHOW_CC='  @echo compiling $@'
+    RULE_CC='@echo compiling $<'
+    SHOW_CC='@echo compiling $@'
     ECHO_CC='@'
  
   else
     
     ECHO_LT=''
     ECHO_LD=''
     ECHO_CC='@'
  
   else
     
     ECHO_LT=''
     ECHO_LD=''
-    RULE_CC='# compiling'
-    SHOW_CC='# compiling'
+    RULE_CC=''
+    SHOW_CC=''
     ECHO_CC=''
 
   fi
     ECHO_CC=''
 
   fi
@@ -2171,8 +2391,8 @@ else
   
     ECHO_LT=''
     ECHO_LD=''
   
     ECHO_LT=''
     ECHO_LD=''
-    RULE_CC='# compiling'
-    SHOW_CC='# compiling'
+    RULE_CC=''
+    SHOW_CC=''
     ECHO_CC=''
 
   
     ECHO_CC=''
 
   
@@ -2190,8 +2410,8 @@ echo "$ac_t""$enableval" 1>&6
 GCC_VERSION=none
 if test "$GCC" = yes ; then
        echo $ac_n "checking version of $CC""... $ac_c" 1>&6
 GCC_VERSION=none
 if test "$GCC" = yes ; then
        echo $ac_n "checking version of $CC""... $ac_c" 1>&6
-echo "configure:2194: checking version of $CC" >&5
-       GCC_VERSION="`${CC} --version| sed -e '2,$d' -e 's/^.*(GCC) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
+echo "configure:2414: checking version of $CC" >&5
+       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 "$ac_t""$GCC_VERSION" 1>&6
 fi
        test -z "$GCC_VERSION" && GCC_VERSION=unknown
        echo "$ac_t""$GCC_VERSION" 1>&6
 fi
@@ -2200,7 +2420,7 @@ fi
 if ( test "$GCC" = yes || test "$GXX" = yes )
 then
 echo $ac_n "checking if you want to turn on gcc warnings""... $ac_c" 1>&6
 if ( test "$GCC" = yes || test "$GXX" = yes )
 then
 echo $ac_n "checking if you want to turn on gcc warnings""... $ac_c" 1>&6
-echo "configure:2204: checking if you want to turn on gcc warnings" >&5
+echo "configure:2424: checking if you want to turn on gcc warnings" >&5
 
 # Check whether --enable-warnings or --disable-warnings was given.
 if test "${enable_warnings+set}" = set; then
 
 # Check whether --enable-warnings or --disable-warnings was given.
 if test "${enable_warnings+set}" = set; then
@@ -2221,50 +2441,156 @@ echo "$ac_t""$with_warnings" 1>&6
 if test "$with_warnings" = "yes"
 then
        
 if test "$with_warnings" = "yes"
 then
        
-
-
-INTEL_COMPILER=no
-
-if test "$GCC" = yes ; then
-       case $host_os in
-       linux*|gnu*)
-               echo $ac_n "checking if this is really Intel C compiler""... $ac_c" 1>&6
-echo "configure:2233: checking if this is really Intel C compiler" >&5
-               cf_save_CFLAGS="$CFLAGS"
-               CFLAGS="$CFLAGS -no-gcc"
-               cat > conftest.$ac_ext <<EOF
-#line 2237 "configure"
+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 "checking for $CC __attribute__ directives" 1>&6
+echo "configure:2464: checking for $CC __attribute__ directives" >&5
+cat > conftest.$ac_ext <<EOF
+#line 2466 "${as_me-configure}"
 #include "confdefs.h"
 #include "confdefs.h"
-
-int main() {
-
-#ifdef __INTEL_COMPILER
+#include "conftest.h"
+#include "conftest.i"
+#if    GCC_PRINTF
+#define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
 #else
 #else
-make an error
+#define GCC_PRINTFLIKE(fmt,var) /*nothing*/
 #endif
 #endif
-
-; return 0; }
+#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
 EOF
-if { (eval echo configure:2249: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
-  INTEL_COMPILER=yes
-cf_save_CFLAGS="$cf_save_CFLAGS -we147 -no-gcc"
-
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-fi
-rm -f conftest*
-               CFLAGS="$cf_save_CFLAGS"
-               echo "$ac_t""$INTEL_COMPILER" 1>&6
-               ;;
-       esac
-fi
+       cf_printf_attribute=no
+       cf_scanf_attribute=no
+       for cf_attribute in scanf printf unused noreturn
+       do
+               
+cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
 
 
+               cf_directive="__attribute__(($cf_attribute))"
+               echo "checking for $CC $cf_directive" 1>&5
 
 
-cat > conftest.$ac_ext <<EOF
-#line 2267 "${as_me-configure}"
-int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
+               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 configure:2515: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+                       test -n "$verbose" && echo "$ac_t""... $cf_attribute" 1>&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
+
+       
+
+
+INTEL_COMPILER=no
+
+if test "$GCC" = yes ; then
+       case $host_os in
+       linux*|gnu*)
+               echo $ac_n "checking if this is really Intel C compiler""... $ac_c" 1>&6
+echo "configure:2559: checking if this is really Intel C compiler" >&5
+               cf_save_CFLAGS="$CFLAGS"
+               CFLAGS="$CFLAGS -no-gcc"
+               cat > conftest.$ac_ext <<EOF
+#line 2563 "configure"
+#include "confdefs.h"
+
+int main() {
+
+#ifdef __INTEL_COMPILER
+#else
+make an error
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:2575: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  INTEL_COMPILER=yes
+cf_save_CFLAGS="$cf_save_CFLAGS -we147 -no-gcc"
+
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+fi
+rm -f conftest*
+               CFLAGS="$cf_save_CFLAGS"
+               echo "$ac_t""$INTEL_COMPILER" 1>&6
+               ;;
+       esac
+fi
+
+
+cat > conftest.$ac_ext <<EOF
+#line 2593 "${as_me-configure}"
+int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
 EOF
 
 if test "$INTEL_COMPILER" = yes
 EOF
 
 if test "$INTEL_COMPILER" = yes
@@ -2281,7 +2607,7 @@ then
 # warning #279: controlling expression is constant
 
        echo "checking for $CC warning options" 1>&6
 # warning #279: controlling expression is constant
 
        echo "checking for $CC warning options" 1>&6
-echo "configure:2285: checking for $CC warning options" >&5
+echo "configure:2611: checking for $CC warning options" >&5
        cf_save_CFLAGS="$CFLAGS"
        EXTRA_CFLAGS="-Wall"
        for cf_opt in \
        cf_save_CFLAGS="$CFLAGS"
        EXTRA_CFLAGS="-Wall"
        for cf_opt in \
@@ -2296,7 +2622,7 @@ echo "configure:2285: checking for $CC warning options" >&5
                wd981
        do
                CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
                wd981
        do
                CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
-               if { (eval echo configure:2300: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+               if { (eval echo configure:2626: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
                        test -n "$verbose" && echo "$ac_t""... -$cf_opt" 1>&6
                        EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
                fi
                        test -n "$verbose" && echo "$ac_t""... -$cf_opt" 1>&6
                        EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
                fi
@@ -2306,12 +2632,12 @@ echo "configure:2285: checking for $CC warning options" >&5
 elif test "$GCC" = yes
 then
        echo "checking for $CC warning options" 1>&6
 elif test "$GCC" = yes
 then
        echo "checking for $CC warning options" 1>&6
-echo "configure:2310: checking for $CC warning options" >&5
+echo "configure:2636: checking for $CC warning options" >&5
        cf_save_CFLAGS="$CFLAGS"
        cf_save_CFLAGS="$CFLAGS"
-       EXTRA_CFLAGS="-W -Wall"
+       EXTRA_CFLAGS=
        cf_warn_CONST=""
        test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
        cf_warn_CONST=""
        test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
-       for cf_opt in \
+       for cf_opt in W Wall \
                Wbad-function-cast \
                Wcast-align \
                Wcast-qual \
                Wbad-function-cast \
                Wcast-align \
                Wcast-qual \
@@ -2325,7 +2651,7 @@ echo "configure:2310: checking for $CC warning options" >&5
                Wundef $cf_warn_CONST 
        do
                CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
                Wundef $cf_warn_CONST 
        do
                CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
-               if { (eval echo configure:2329: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+               if { (eval echo configure:2655: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
                        test -n "$verbose" && echo "$ac_t""... -$cf_opt" 1>&6
                        case $cf_opt in #(vi
                        Wcast-qual) #(vi
                        test -n "$verbose" && echo "$ac_t""... -$cf_opt" 1>&6
                        case $cf_opt in #(vi
                        Wcast-qual) #(vi
@@ -2336,7 +2662,7 @@ echo "configure:2310: checking for $CC warning options" >&5
                                [34].*)
                                        test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
 
                                [34].*)
                                        test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
 
-echo "${as_me-configure}:2340: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
+echo "${as_me-configure}:2666: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
 
 
                                        continue;;
 
 
                                        continue;;
@@ -2439,8 +2765,9 @@ case $cf_cv_screen in
 curses)
        
 
 curses)
        
 
+
 echo $ac_n "checking for extra include directories""... $ac_c" 1>&6
 echo $ac_n "checking for extra include directories""... $ac_c" 1>&6
-echo "configure:2444: checking for extra include directories" >&5
+echo "configure:2771: checking for extra include directories" >&5
 if eval "test \"`echo '$''{'cf_cv_curses_incdir'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
 if eval "test \"`echo '$''{'cf_cv_curses_incdir'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2465,27 +2792,25 @@ test "$cf_cv_curses_incdir" != no && CPPFLAGS="$CPPFLAGS $cf_cv_curses_incdir"
 
 
 echo $ac_n "checking if we have identified curses headers""... $ac_c" 1>&6
 
 
 echo $ac_n "checking if we have identified curses headers""... $ac_c" 1>&6
-echo "configure:2469: checking if we have identified curses headers" >&5
+echo "configure:2796: checking if we have identified curses headers" >&5
 if eval "test \"`echo '$''{'cf_cv_ncurses_header'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 cf_cv_ncurses_header=none
 if eval "test \"`echo '$''{'cf_cv_ncurses_header'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 cf_cv_ncurses_header=none
-for cf_header in \
+for cf_header in  \
        curses.h \
        curses.h \
-       ncurses.h \
-       ncurses/curses.h \
-       ncurses/ncurses.h
+       ncurses.h ncurses/curses.h ncurses/ncurses.h
 do
 cat > conftest.$ac_ext <<EOF
 do
 cat > conftest.$ac_ext <<EOF
-#line 2482 "configure"
+#line 2807 "configure"
 #include "confdefs.h"
 #include <${cf_header}>
 int main() {
 initscr(); tgoto("?", 0,0)
 ; return 0; }
 EOF
 #include "confdefs.h"
 #include <${cf_header}>
 int main() {
 initscr(); tgoto("?", 0,0)
 ; return 0; }
 EOF
-if { (eval echo configure:2489: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2814: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_ncurses_header=$cf_header; break
 else
   rm -rf conftest*
   cf_cv_ncurses_header=$cf_header; break
 else
@@ -2508,17 +2833,17 @@ for ac_hdr in $cf_cv_ncurses_header
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2512: checking for $ac_hdr" >&5
+echo "configure:2837: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2517 "configure"
+#line 2842 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2522: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2847: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2547,7 +2872,7 @@ done
 
 
 echo $ac_n "checking for terminfo header""... $ac_c" 1>&6
 
 
 echo $ac_n "checking for terminfo header""... $ac_c" 1>&6
-echo "configure:2551: checking for terminfo header" >&5
+echo "configure:2876: checking for terminfo header" >&5
 if eval "test \"`echo '$''{'cf_cv_term_header'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
 if eval "test \"`echo '$''{'cf_cv_term_header'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2564,7 +2889,7 @@ esac
 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
 do
 cat > conftest.$ac_ext <<EOF
 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
 do
 cat > conftest.$ac_ext <<EOF
-#line 2568 "configure"
+#line 2893 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 #include <${cf_cv_ncurses_header-curses.h}>
 #include "confdefs.h"
 #include <stdio.h>
 #include <${cf_cv_ncurses_header-curses.h}>
@@ -2574,7 +2899,7 @@ int main() {
 int x = auto_left_margin
 ; return 0; }
 EOF
 int x = auto_left_margin
 ; return 0; }
 EOF
-if { (eval echo configure:2578: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2903: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   
        cf_cv_term_header="$cf_test"
   rm -rf conftest*
   
        cf_cv_term_header="$cf_test"
@@ -2621,9 +2946,9 @@ EOF
 esac
 
 
 esac
 
 
-       
+
 echo $ac_n "checking for ncurses version""... $ac_c" 1>&6
 echo $ac_n "checking for ncurses version""... $ac_c" 1>&6
-echo "configure:2627: checking for ncurses version" >&5
+echo "configure:2952: checking for ncurses version" >&5
 if eval "test \"`echo '$''{'cf_cv_ncurses_version'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
 if eval "test \"`echo '$''{'cf_cv_ncurses_version'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2649,7 +2974,7 @@ Autoconf "old"
 #endif
 EOF
        cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
 #endif
 EOF
        cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
-       { (eval echo configure:2653: \"$cf_try\") 1>&5; (eval $cf_try) 2>&5; }
+       { (eval echo configure:2978: \"$cf_try\") 1>&5; (eval $cf_try) 2>&5; }
        if test -f conftest.out ; then
                cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
                test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
        if test -f conftest.out ; then
                cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
                test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
@@ -2658,7 +2983,7 @@ EOF
 
 else
   cat > conftest.$ac_ext <<EOF
 
 else
   cat > conftest.$ac_ext <<EOF
-#line 2662 "configure"
+#line 2987 "configure"
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header-curses.h}>
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header-curses.h}>
@@ -2682,7 +3007,7 @@ int main()
        ${cf_cv_main_return-return}(0);
 }
 EOF
        ${cf_cv_main_return-return}(0);
 }
 EOF
-if { (eval echo configure:2686: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3011: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   
        cf_cv_ncurses_version=`cat $cf_tempfile`
 then
   
        cf_cv_ncurses_version=`cat $cf_tempfile`
@@ -2703,19 +3028,19 @@ test "$cf_cv_ncurses_version" = no || cat >> confdefs.h <<\EOF
 EOF
 
 
 EOF
 
 
-       
+
 
 echo $ac_n "checking if we have identified curses libraries""... $ac_c" 1>&6
 
 echo $ac_n "checking if we have identified curses libraries""... $ac_c" 1>&6
-echo "configure:2710: checking if we have identified curses libraries" >&5
+echo "configure:3035: checking if we have identified curses libraries" >&5
 cat > conftest.$ac_ext <<EOF
 cat > conftest.$ac_ext <<EOF
-#line 2712 "configure"
+#line 3037 "configure"
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header-curses.h}>
 int main() {
 initscr(); tgoto("?", 0,0)
 ; return 0; }
 EOF
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header-curses.h}>
 int main() {
 initscr(); tgoto("?", 0,0)
 ; return 0; }
 EOF
-if { (eval echo configure:2719: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3044: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   cf_result=yes
 else
   rm -rf conftest*
   cf_result=yes
 else
@@ -2731,7 +3056,7 @@ if test "$cf_result" = no ; then
 case $host_os in #(vi
 freebsd*) #(vi
     echo $ac_n "checking for tgoto in -lmytinfo""... $ac_c" 1>&6
 case $host_os in #(vi
 freebsd*) #(vi
     echo $ac_n "checking for tgoto in -lmytinfo""... $ac_c" 1>&6
-echo "configure:2735: checking for tgoto in -lmytinfo" >&5
+echo "configure:3060: checking for tgoto in -lmytinfo" >&5
 ac_lib_var=`echo mytinfo'_'tgoto | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 ac_lib_var=`echo mytinfo'_'tgoto | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2739,7 +3064,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lmytinfo  $LIBS"
 cat > conftest.$ac_ext <<EOF
   ac_save_LIBS="$LIBS"
 LIBS="-lmytinfo  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2743 "configure"
+#line 3068 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2750,7 +3075,7 @@ int main() {
 tgoto()
 ; return 0; }
 EOF
 tgoto()
 ; return 0; }
 EOF
-if { (eval echo configure:2754: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3079: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2773,7 +3098,7 @@ fi
     ;;
 hpux10.*) #(vi
     echo $ac_n "checking for initscr in -lcur_colr""... $ac_c" 1>&6
     ;;
 hpux10.*) #(vi
     echo $ac_n "checking for initscr in -lcur_colr""... $ac_c" 1>&6
-echo "configure:2777: checking for initscr in -lcur_colr" >&5
+echo "configure:3102: checking for initscr in -lcur_colr" >&5
 ac_lib_var=`echo cur_colr'_'initscr | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 ac_lib_var=`echo cur_colr'_'initscr | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2781,7 +3106,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lcur_colr  $LIBS"
 cat > conftest.$ac_ext <<EOF
   ac_save_LIBS="$LIBS"
 LIBS="-lcur_colr  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2785 "configure"
+#line 3110 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2792,7 +3117,7 @@ int main() {
 initscr()
 ; return 0; }
 EOF
 initscr()
 ; return 0; }
 EOF
-if { (eval echo configure:2796: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3121: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2815,7 +3140,7 @@ else
   echo "$ac_t""no" 1>&6
 
     echo $ac_n "checking for initscr in -lHcurses""... $ac_c" 1>&6
   echo "$ac_t""no" 1>&6
 
     echo $ac_n "checking for initscr in -lHcurses""... $ac_c" 1>&6
-echo "configure:2819: checking for initscr in -lHcurses" >&5
+echo "configure:3144: checking for initscr in -lHcurses" >&5
 ac_lib_var=`echo Hcurses'_'initscr | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 ac_lib_var=`echo Hcurses'_'initscr | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2823,7 +3148,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lHcurses  $LIBS"
 cat > conftest.$ac_ext <<EOF
   ac_save_LIBS="$LIBS"
 LIBS="-lHcurses  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2827 "configure"
+#line 3152 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2834,7 +3159,7 @@ int main() {
 initscr()
 ; return 0; }
 EOF
 initscr()
 ; return 0; }
 EOF
-if { (eval echo configure:2838: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3163: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2883,7 +3208,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
 
       if test "$cf_have_libdir" = no ; then
         test -n "$verbose" && echo "   adding $cf_add_libdir to library-path" 1>&6
 
-echo "${as_me-configure}:2887: testing adding $cf_add_libdir to library-path ..." 1>&5
+echo "${as_me-configure}:3212: testing adding $cf_add_libdir to library-path ..." 1>&5
 
 
         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
 
 
         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
@@ -2915,7 +3240,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
 
       if test "$cf_have_libdir" = no ; then
         test -n "$verbose" && echo "   adding $cf_add_libdir to library-path" 1>&6
 
-echo "${as_me-configure}:2919: testing adding $cf_add_libdir to library-path ..." 1>&5
+echo "${as_me-configure}:3244: testing adding $cf_add_libdir to library-path ..." 1>&5
 
 
         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
 
 
         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
@@ -2945,12 +3270,12 @@ 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 $ac_n "checking for tgoto""... $ac_c" 1>&6
     # Check for library containing tgoto.  Do this before curses library
     # because it may be needed to link the test-case for initscr.
     echo $ac_n "checking for tgoto""... $ac_c" 1>&6
-echo "configure:2949: checking for tgoto" >&5
+echo "configure:3274: checking for tgoto" >&5
 if eval "test \"`echo '$''{'ac_cv_func_tgoto'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
 if eval "test \"`echo '$''{'ac_cv_func_tgoto'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2954 "configure"
+#line 3279 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char tgoto(); below.  */
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char tgoto(); below.  */
@@ -2973,7 +3298,7 @@ tgoto();
 
 ; return 0; }
 EOF
 
 ; return 0; }
 EOF
-if { (eval echo configure:2977: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3302: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_tgoto=yes"
 else
   rm -rf conftest*
   eval "ac_cv_func_tgoto=yes"
 else
@@ -2994,7 +3319,7 @@ else
         for cf_term_lib in $cf_check_list termcap termlib unknown
         do
             echo $ac_n "checking for tgoto in -l$cf_term_lib""... $ac_c" 1>&6
         for cf_term_lib in $cf_check_list termcap termlib unknown
         do
             echo $ac_n "checking for tgoto in -l$cf_term_lib""... $ac_c" 1>&6
-echo "configure:2998: checking for tgoto in -l$cf_term_lib" >&5
+echo "configure:3323: checking for tgoto in -l$cf_term_lib" >&5
 ac_lib_var=`echo $cf_term_lib'_'tgoto | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 ac_lib_var=`echo $cf_term_lib'_'tgoto | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3002,7 +3327,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-l$cf_term_lib  $LIBS"
 cat > conftest.$ac_ext <<EOF
   ac_save_LIBS="$LIBS"
 LIBS="-l$cf_term_lib  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3006 "configure"
+#line 3331 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3013,7 +3338,7 @@ int main() {
 tgoto()
 ; return 0; }
 EOF
 tgoto()
 ; return 0; }
 EOF
-if { (eval echo configure:3017: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3342: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3043,7 +3368,7 @@ fi
        for cf_curs_lib in $cf_check_list xcurses jcurses pdcurses unknown
     do
         echo $ac_n "checking for initscr in -l$cf_curs_lib""... $ac_c" 1>&6
        for cf_curs_lib in $cf_check_list xcurses jcurses pdcurses unknown
     do
         echo $ac_n "checking for initscr in -l$cf_curs_lib""... $ac_c" 1>&6
-echo "configure:3047: checking for initscr in -l$cf_curs_lib" >&5
+echo "configure:3372: checking for initscr in -l$cf_curs_lib" >&5
 ac_lib_var=`echo $cf_curs_lib'_'initscr | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 ac_lib_var=`echo $cf_curs_lib'_'initscr | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3051,7 +3376,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-l$cf_curs_lib  $LIBS"
 cat > conftest.$ac_ext <<EOF
   ac_save_LIBS="$LIBS"
 LIBS="-l$cf_curs_lib  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3055 "configure"
+#line 3380 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3062,7 +3387,7 @@ int main() {
 initscr()
 ; return 0; }
 EOF
 initscr()
 ; return 0; }
 EOF
-if { (eval echo configure:3066: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3391: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3088,16 +3413,16 @@ fi
     LIBS="-l$cf_curs_lib $cf_save_LIBS"
     if test "$cf_term_lib" = unknown ; then
         echo $ac_n "checking if we can link with $cf_curs_lib library""... $ac_c" 1>&6
     LIBS="-l$cf_curs_lib $cf_save_LIBS"
     if test "$cf_term_lib" = unknown ; then
         echo $ac_n "checking if we can link with $cf_curs_lib library""... $ac_c" 1>&6
-echo "configure:3092: checking if we can link with $cf_curs_lib library" >&5
+echo "configure:3417: checking if we can link with $cf_curs_lib library" >&5
         cat > conftest.$ac_ext <<EOF
         cat > conftest.$ac_ext <<EOF
-#line 3094 "configure"
+#line 3419 "configure"
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header-curses.h}>
 int main() {
 initscr()
 ; return 0; }
 EOF
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header-curses.h}>
 int main() {
 initscr()
 ; return 0; }
 EOF
-if { (eval echo configure:3101: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3426: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   cf_result=yes
 else
   rm -rf conftest*
   cf_result=yes
 else
@@ -3113,16 +3438,16 @@ rm -f conftest*
         :
     elif test "$cf_term_lib" != predefined ; then
         echo $ac_n "checking if we need both $cf_curs_lib and $cf_term_lib libraries""... $ac_c" 1>&6
         :
     elif test "$cf_term_lib" != predefined ; then
         echo $ac_n "checking if we need both $cf_curs_lib and $cf_term_lib libraries""... $ac_c" 1>&6
-echo "configure:3117: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
+echo "configure:3442: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
         cat > conftest.$ac_ext <<EOF
         cat > conftest.$ac_ext <<EOF
-#line 3119 "configure"
+#line 3444 "configure"
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header-curses.h}>
 int main() {
 initscr(); tgoto((char *)0, 0, 0);
 ; return 0; }
 EOF
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header-curses.h}>
 int main() {
 initscr(); tgoto((char *)0, 0, 0);
 ; return 0; }
 EOF
-if { (eval echo configure:3126: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3451: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   cf_result=no
 else
   rm -rf conftest*
   cf_result=no
 else
@@ -3132,14 +3457,14 @@ else
   
             LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
             cat > conftest.$ac_ext <<EOF
   
             LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
             cat > conftest.$ac_ext <<EOF
-#line 3136 "configure"
+#line 3461 "configure"
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header-curses.h}>
 int main() {
 initscr()
 ; return 0; }
 EOF
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header-curses.h}>
 int main() {
 initscr()
 ; return 0; }
 EOF
-if { (eval echo configure:3143: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3468: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   cf_result=yes
 else
   rm -rf conftest*
   cf_result=yes
 else
@@ -3158,6 +3483,7 @@ fi
 fi
 
 
 fi
 
 
+
        ;;
 ncurses)
        
        ;;
 ncurses)
        
@@ -3169,7 +3495,7 @@ 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 $ac_n "checking for $ac_word""... $ac_c" 1>&6
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3173: checking for $ac_word" >&5
+echo "configure:3499: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_NCURSES_CONFIG'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
 if eval "test \"`echo '$''{'ac_cv_path_NCURSES_CONFIG'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3208,11 +3534,93 @@ test -n "$NCURSES_CONFIG" || NCURSES_CONFIG="none"
 
 if test "$NCURSES_CONFIG" != none ; then
 
 
 if test "$NCURSES_CONFIG" != none ; then
 
-cf_cv_ncurses_header=curses.h
-
 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
 LIBS="`$NCURSES_CONFIG --libs` $LIBS"
 
 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
 LIBS="`$NCURSES_CONFIG --libs` $LIBS"
 
+# even with config script, some packages use no-override for curses.h
+
+echo $ac_n "checking if we have identified curses headers""... $ac_c" 1>&6
+echo "configure:3544: checking if we have identified curses headers" >&5
+if eval "test \"`echo '$''{'cf_cv_ncurses_header'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+cf_cv_ncurses_header=none
+for cf_header in  \
+    ncurses/curses.h \
+       ncurses/ncurses.h \
+       curses.h \
+       ncurses.h 
+do
+cat > conftest.$ac_ext <<EOF
+#line 3557 "configure"
+#include "confdefs.h"
+#include <${cf_header}>
+int main() {
+initscr(); tgoto("?", 0,0)
+; return 0; }
+EOF
+if { (eval echo configure:3564: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  cf_cv_ncurses_header=$cf_header; break
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+fi
+rm -f conftest*
+done
+
+fi
+
+echo "$ac_t""$cf_cv_ncurses_header" 1>&6
+
+if test "$cf_cv_ncurses_header" = none ; then
+       { echo "configure: error: No curses header-files found" 1>&2; exit 1; }
+fi
+
+# cheat, to get the right #define's for HAVE_NCURSES_H, etc.
+for ac_hdr in $cf_cv_ncurses_header
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:3587: checking for $ac_hdr" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 3592 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:3597: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=yes"
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+else
+  echo "$ac_t""no" 1>&6
+fi
+done
+
+
+
 cat >> confdefs.h <<\EOF
 #define NCURSES 1
 EOF
 cat >> confdefs.h <<\EOF
 #define NCURSES 1
 EOF
@@ -3261,14 +3669,14 @@ 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 <<EOF
                          cf_save_CPPFLAGS=$CPPFLAGS
                          CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
                          cat > conftest.$ac_ext <<EOF
-#line 3265 "configure"
+#line 3673 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 int main() {
 printf("Hello")
 ; return 0; }
 EOF
 #include "confdefs.h"
 #include <stdio.h>
 int main() {
 printf("Hello")
 ; return 0; }
 EOF
-if { (eval echo configure:3272: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3680: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   :
 else
   echo "configure: failed program was:" >&5
   :
 else
   echo "configure: failed program was:" >&5
@@ -3285,7 +3693,7 @@ rm -f conftest*
                if test "$cf_have_incdir" = no ; then
                  test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
 
                if test "$cf_have_incdir" = no ; then
                  test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
 
-echo "${as_me-configure}:3289: testing adding $cf_add_incdir to include-path ..." 1>&5
+echo "${as_me-configure}:3697: testing adding $cf_add_incdir to include-path ..." 1>&5
 
 
                  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
 
 
                  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
@@ -3304,7 +3712,7 @@ fi
 }
 
 echo $ac_n "checking for $cf_ncuhdr_root header in include-path""... $ac_c" 1>&6
 }
 
 echo $ac_n "checking for $cf_ncuhdr_root header in include-path""... $ac_c" 1>&6
-echo "configure:3308: checking for $cf_ncuhdr_root header in include-path" >&5
+echo "configure:3716: checking for $cf_ncuhdr_root header in include-path" >&5
 if eval "test \"`echo '$''{'cf_cv_ncurses_h'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
 if eval "test \"`echo '$''{'cf_cv_ncurses_h'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3315,7 +3723,7 @@ else
        do
                
        cat > conftest.$ac_ext <<EOF
        do
                
        cat > conftest.$ac_ext <<EOF
-#line 3319 "configure"
+#line 3727 "configure"
 #include "confdefs.h"
 
 
 #include "confdefs.h"
 
 
@@ -3336,7 +3744,7 @@ printf("old\n");
        
 ; return 0; }
 EOF
        
 ; return 0; }
 EOF
-if { (eval echo configure:3340: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3748: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_ncurses_h=$cf_header
        
   rm -rf conftest*
   cf_cv_ncurses_h=$cf_header
        
@@ -3362,13 +3770,16 @@ if test "$cf_cv_ncurses_h" != no ; then
 else
 
 echo $ac_n "checking for $cf_ncuhdr_root include-path""... $ac_c" 1>&6
 else
 
 echo $ac_n "checking for $cf_ncuhdr_root include-path""... $ac_c" 1>&6
-echo "configure:3366: checking for $cf_ncuhdr_root include-path" >&5
+echo "configure:3774: checking for $cf_ncuhdr_root include-path" >&5
 if eval "test \"`echo '$''{'cf_cv_ncurses_h2'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
        test -n "$verbose" && echo
        
 if eval "test \"`echo '$''{'cf_cv_ncurses_h2'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
        test -n "$verbose" && echo
        
+cf_search=
+
+# collect the current set of include-directories from compiler flags
 cf_header_path_list=""
 if test -n "${CFLAGS}${CPPFLAGS}" ; then
        for cf_header_path in $CPPFLAGS $CFLAGS
 cf_header_path_list=""
 if test -n "${CFLAGS}${CPPFLAGS}" ; then
        for cf_header_path in $CPPFLAGS $CFLAGS
@@ -3394,7 +3805,9 @@ test -d "$cf_header_path" && \
        done
 fi
 
        done
 fi
 
-cf_search=""
+# add the variations for the package we are looking for
+
+cf_search=
 
 
 test "/usr" != "$prefix" && \
 
 
 test "/usr" != "$prefix" && \
@@ -3472,7 +3885,7 @@ test -d "$oldincludedir" && {
        test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
 }
 
        test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
 }
 
-cf_search="$cf_header_path_list $cf_search"
+cf_search="$cf_search $cf_header_path_list"
 
        test -n "$verbose" && echo search path $cf_search
        cf_save2_CPPFLAGS="$CPPFLAGS"
 
        test -n "$verbose" && echo search path $cf_search
        cf_save2_CPPFLAGS="$CPPFLAGS"
@@ -3503,14 +3916,14 @@ if test -n "$cf_incdir" ; then
                          cf_save_CPPFLAGS=$CPPFLAGS
                          CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
                          cat > conftest.$ac_ext <<EOF
                          cf_save_CPPFLAGS=$CPPFLAGS
                          CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
                          cat > conftest.$ac_ext <<EOF
-#line 3507 "configure"
+#line 3920 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 int main() {
 printf("Hello")
 ; return 0; }
 EOF
 #include "confdefs.h"
 #include <stdio.h>
 int main() {
 printf("Hello")
 ; return 0; }
 EOF
-if { (eval echo configure:3514: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3927: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   :
 else
   echo "configure: failed program was:" >&5
   :
 else
   echo "configure: failed program was:" >&5
@@ -3527,7 +3940,7 @@ rm -f conftest*
                if test "$cf_have_incdir" = no ; then
                  test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
 
                if test "$cf_have_incdir" = no ; then
                  test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
 
-echo "${as_me-configure}:3531: testing adding $cf_add_incdir to include-path ..." 1>&5
+echo "${as_me-configure}:3944: testing adding $cf_add_incdir to include-path ..." 1>&5
 
 
                  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
 
 
                  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
@@ -3549,7 +3962,7 @@ fi
                do
                        
        cat > conftest.$ac_ext <<EOF
                do
                        
        cat > conftest.$ac_ext <<EOF
-#line 3553 "configure"
+#line 3966 "configure"
 #include "confdefs.h"
 
 
 #include "confdefs.h"
 
 
@@ -3570,7 +3983,7 @@ printf("old\n");
        
 ; return 0; }
 EOF
        
 ; return 0; }
 EOF
-if { (eval echo configure:3574: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3987: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_ncurses_h2=$cf_header
        
   rm -rf conftest*
   cf_cv_ncurses_h2=$cf_header
        
@@ -3628,14 +4041,14 @@ if test -n "$cf_1st_incdir" ; then
                          cf_save_CPPFLAGS=$CPPFLAGS
                          CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
                          cat > conftest.$ac_ext <<EOF
                          cf_save_CPPFLAGS=$CPPFLAGS
                          CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
                          cat > conftest.$ac_ext <<EOF
-#line 3632 "configure"
+#line 4045 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 int main() {
 printf("Hello")
 ; return 0; }
 EOF
 #include "confdefs.h"
 #include <stdio.h>
 int main() {
 printf("Hello")
 ; return 0; }
 EOF
-if { (eval echo configure:3639: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4052: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   :
 else
   echo "configure: failed program was:" >&5
   :
 else
   echo "configure: failed program was:" >&5
@@ -3652,7 +4065,7 @@ rm -f conftest*
                if test "$cf_have_incdir" = no ; then
                  test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
 
                if test "$cf_have_incdir" = no ; then
                  test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
 
-echo "${as_me-configure}:3656: testing adding $cf_add_incdir to include-path ..." 1>&5
+echo "${as_me-configure}:4069: testing adding $cf_add_incdir to include-path ..." 1>&5
 
 
                  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
 
 
                  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
@@ -3700,7 +4113,7 @@ esac
 
 
 echo $ac_n "checking for terminfo header""... $ac_c" 1>&6
 
 
 echo $ac_n "checking for terminfo header""... $ac_c" 1>&6
-echo "configure:3704: checking for terminfo header" >&5
+echo "configure:4117: checking for terminfo header" >&5
 if eval "test \"`echo '$''{'cf_cv_term_header'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
 if eval "test \"`echo '$''{'cf_cv_term_header'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3717,7 +4130,7 @@ esac
 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
 do
 cat > conftest.$ac_ext <<EOF
 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
 do
 cat > conftest.$ac_ext <<EOF
-#line 3721 "configure"
+#line 4134 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 #include <${cf_cv_ncurses_header-curses.h}>
 #include "confdefs.h"
 #include <stdio.h>
 #include <${cf_cv_ncurses_header-curses.h}>
@@ -3727,7 +4140,7 @@ int main() {
 int x = auto_left_margin
 ; return 0; }
 EOF
 int x = auto_left_margin
 ; return 0; }
 EOF
-if { (eval echo configure:3731: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4144: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   
        cf_cv_term_header="$cf_test"
   rm -rf conftest*
   
        cf_cv_term_header="$cf_test"
@@ -3782,7 +4195,7 @@ EOF
 
 
 echo $ac_n "checking for ncurses version""... $ac_c" 1>&6
 
 
 echo $ac_n "checking for ncurses version""... $ac_c" 1>&6
-echo "configure:3786: checking for ncurses version" >&5
+echo "configure:4199: checking for ncurses version" >&5
 if eval "test \"`echo '$''{'cf_cv_ncurses_version'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
 if eval "test \"`echo '$''{'cf_cv_ncurses_version'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3808,7 +4221,7 @@ Autoconf "old"
 #endif
 EOF
        cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
 #endif
 EOF
        cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
-       { (eval echo configure:3812: \"$cf_try\") 1>&5; (eval $cf_try) 2>&5; }
+       { (eval echo configure:4225: \"$cf_try\") 1>&5; (eval $cf_try) 2>&5; }
        if test -f conftest.out ; then
                cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
                test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
        if test -f conftest.out ; then
                cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
                test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
@@ -3817,7 +4230,7 @@ EOF
 
 else
   cat > conftest.$ac_ext <<EOF
 
 else
   cat > conftest.$ac_ext <<EOF
-#line 3821 "configure"
+#line 4234 "configure"
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header-curses.h}>
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header-curses.h}>
@@ -3841,7 +4254,7 @@ int main()
        ${cf_cv_main_return-return}(0);
 }
 EOF
        ${cf_cv_main_return-return}(0);
 }
 EOF
-if { (eval echo configure:3845: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:4258: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   
        cf_cv_ncurses_version=`cat $cf_tempfile`
 then
   
        cf_cv_ncurses_version=`cat $cf_tempfile`
@@ -3872,7 +4285,7 @@ cf_nculib_root=ncurses
 cf_ncurses_LIBS=""
 cf_ncurses_SAVE="$LIBS"
 echo $ac_n "checking for Gpm_Open in -lgpm""... $ac_c" 1>&6
 cf_ncurses_LIBS=""
 cf_ncurses_SAVE="$LIBS"
 echo $ac_n "checking for Gpm_Open in -lgpm""... $ac_c" 1>&6
-echo "configure:3876: checking for Gpm_Open in -lgpm" >&5
+echo "configure:4289: checking for Gpm_Open in -lgpm" >&5
 ac_lib_var=`echo gpm'_'Gpm_Open | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 ac_lib_var=`echo gpm'_'Gpm_Open | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3880,7 +4293,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lgpm  $LIBS"
 cat > conftest.$ac_ext <<EOF
   ac_save_LIBS="$LIBS"
 LIBS="-lgpm  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3884 "configure"
+#line 4297 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3891,7 +4304,7 @@ int main() {
 Gpm_Open()
 ; return 0; }
 EOF
 Gpm_Open()
 ; return 0; }
 EOF
-if { (eval echo configure:3895: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4308: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3907,7 +4320,7 @@ fi
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   echo $ac_n "checking for initscr in -lgpm""... $ac_c" 1>&6
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   echo $ac_n "checking for initscr in -lgpm""... $ac_c" 1>&6
-echo "configure:3911: checking for initscr in -lgpm" >&5
+echo "configure:4324: checking for initscr in -lgpm" >&5
 ac_lib_var=`echo gpm'_'initscr | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 ac_lib_var=`echo gpm'_'initscr | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3915,7 +4328,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lgpm  $LIBS"
 cat > conftest.$ac_ext <<EOF
   ac_save_LIBS="$LIBS"
 LIBS="-lgpm  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3919 "configure"
+#line 4332 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3926,7 +4339,7 @@ int main() {
 initscr()
 ; return 0; }
 EOF
 initscr()
 ; return 0; }
 EOF
-if { (eval echo configure:3930: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4343: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3958,7 +4371,7 @@ freebsd*)
        # version of ncurses (but it should do no harm, since it's static).
        if test "$cf_nculib_root" = ncurses ; then
                echo $ac_n "checking for tgoto in -lmytinfo""... $ac_c" 1>&6
        # version of ncurses (but it should do no harm, since it's static).
        if test "$cf_nculib_root" = ncurses ; then
                echo $ac_n "checking for tgoto in -lmytinfo""... $ac_c" 1>&6
-echo "configure:3962: checking for tgoto in -lmytinfo" >&5
+echo "configure:4375: checking for tgoto in -lmytinfo" >&5
 ac_lib_var=`echo mytinfo'_'tgoto | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 ac_lib_var=`echo mytinfo'_'tgoto | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3966,7 +4379,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lmytinfo  $LIBS"
 cat > conftest.$ac_ext <<EOF
   ac_save_LIBS="$LIBS"
 LIBS="-lmytinfo  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3970 "configure"
+#line 4383 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3977,7 +4390,7 @@ int main() {
 tgoto()
 ; return 0; }
 EOF
 tgoto()
 ; return 0; }
 EOF
-if { (eval echo configure:3981: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4394: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4025,7 +4438,7 @@ if test -n "$cf_cv_curses_dir/lib" ; then
       if test "$cf_have_libdir" = no ; then
         test -n "$verbose" && echo "   adding $cf_add_libdir to library-path" 1>&6
 
       if test "$cf_have_libdir" = no ; then
         test -n "$verbose" && echo "   adding $cf_add_libdir to library-path" 1>&6
 
-echo "${as_me-configure}:4029: testing adding $cf_add_libdir to library-path ..." 1>&5
+echo "${as_me-configure}:4442: testing adding $cf_add_libdir to library-path ..." 1>&5
 
 
         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
 
 
         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
@@ -4040,12 +4453,12 @@ else
        eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
        cf_libdir=""
        echo $ac_n "checking for initscr""... $ac_c" 1>&6
        eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
        cf_libdir=""
        echo $ac_n "checking for initscr""... $ac_c" 1>&6
-echo "configure:4044: checking for initscr" >&5
+echo "configure:4457: checking for initscr" >&5
 if eval "test \"`echo '$''{'ac_cv_func_initscr'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
 if eval "test \"`echo '$''{'ac_cv_func_initscr'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4049 "configure"
+#line 4462 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char initscr(); below.  */
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char initscr(); below.  */
@@ -4068,7 +4481,7 @@ initscr();
 
 ; return 0; }
 EOF
 
 ; return 0; }
 EOF
-if { (eval echo configure:4072: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4485: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_initscr=yes"
 else
   rm -rf conftest*
   eval "ac_cv_func_initscr=yes"
 else
@@ -4088,17 +4501,17 @@ else
 
                cf_save_LIBS="$LIBS"
                echo $ac_n "checking for initscr in -l$cf_nculib_root""... $ac_c" 1>&6
 
                cf_save_LIBS="$LIBS"
                echo $ac_n "checking for initscr in -l$cf_nculib_root""... $ac_c" 1>&6
-echo "configure:4092: checking for initscr in -l$cf_nculib_root" >&5
+echo "configure:4505: checking for initscr in -l$cf_nculib_root" >&5
                LIBS="-l$cf_nculib_root $LIBS"
                cat > conftest.$ac_ext <<EOF
                LIBS="-l$cf_nculib_root $LIBS"
                cat > conftest.$ac_ext <<EOF
-#line 4095 "configure"
+#line 4508 "configure"
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header-curses.h}>
 int main() {
 initscr()
 ; return 0; }
 EOF
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header-curses.h}>
 int main() {
 initscr()
 ; return 0; }
 EOF
-if { (eval echo configure:4102: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4515: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
                         eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
                         eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
@@ -4109,6 +4522,7 @@ else
   rm -rf conftest*
   echo "$ac_t""no" 1>&6
                        
   rm -rf conftest*
   echo "$ac_t""no" 1>&6
                        
+cf_search=
 cf_library_path_list=""
 if test -n "${LDFLAGS}${LIBS}" ; then
        for cf_library_path in $LDFLAGS $LIBS
 cf_library_path_list=""
 if test -n "${LDFLAGS}${LIBS}" ; then
        for cf_library_path in $LDFLAGS $LIBS
@@ -4134,7 +4548,8 @@ test -d "$cf_library_path" && \
        done
 fi
 
        done
 fi
 
-cf_search=""
+
+cf_search=
 
 
 test "/usr" != "$prefix" && \
 
 
 test "/usr" != "$prefix" && \
@@ -4203,17 +4618,17 @@ cf_search="$cf_library_path_list $cf_search"
                        for cf_libdir in $cf_search
                        do
                                echo $ac_n "checking for -l$cf_nculib_root in $cf_libdir""... $ac_c" 1>&6
                        for cf_libdir in $cf_search
                        do
                                echo $ac_n "checking for -l$cf_nculib_root in $cf_libdir""... $ac_c" 1>&6
-echo "configure:4207: checking for -l$cf_nculib_root in $cf_libdir" >&5
+echo "configure:4622: checking for -l$cf_nculib_root in $cf_libdir" >&5
                                LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
                                cat > conftest.$ac_ext <<EOF
                                LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
                                cat > conftest.$ac_ext <<EOF
-#line 4210 "configure"
+#line 4625 "configure"
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header-curses.h}>
 int main() {
 initscr()
 ; return 0; }
 EOF
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header-curses.h}>
 int main() {
 initscr()
 ; return 0; }
 EOF
-if { (eval echo configure:4217: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4632: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
                                         eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
                                         eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
@@ -4244,7 +4659,7 @@ fi
 
 if test -n "$cf_ncurses_LIBS" ; then
        echo $ac_n "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS""... $ac_c" 1>&6
 
 if test -n "$cf_ncurses_LIBS" ; then
        echo $ac_n "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS""... $ac_c" 1>&6
-echo "configure:4248: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
+echo "configure:4663: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
        cf_ncurses_SAVE="$LIBS"
        for p in $cf_ncurses_LIBS ; do
                q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
        cf_ncurses_SAVE="$LIBS"
        for p in $cf_ncurses_LIBS ; do
                q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
@@ -4253,14 +4668,14 @@ echo "configure:4248: checking if we can link $cf_nculib_root without $cf_ncurse
                fi
        done
        cat > conftest.$ac_ext <<EOF
                fi
        done
        cat > conftest.$ac_ext <<EOF
-#line 4257 "configure"
+#line 4672 "configure"
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header-curses.h}>
 int main() {
 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
 ; return 0; }
 EOF
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header-curses.h}>
 int main() {
 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
 ; return 0; }
 EOF
-if { (eval echo configure:4264: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4679: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
 else
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
 else
@@ -4289,14 +4704,14 @@ ncursesw)
        cf_cv_libtype=w
        
 echo $ac_n "checking for multibyte character support""... $ac_c" 1>&6
        cf_cv_libtype=w
        
 echo $ac_n "checking for multibyte character support""... $ac_c" 1>&6
-echo "configure:4293: checking for multibyte character support" >&5
+echo "configure:4708: checking for multibyte character support" >&5
 if eval "test \"`echo '$''{'cf_cv_utf8_lib'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
        cf_save_LIBS="$LIBS"
        cat > conftest.$ac_ext <<EOF
 if eval "test \"`echo '$''{'cf_cv_utf8_lib'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
        cf_save_LIBS="$LIBS"
        cat > conftest.$ac_ext <<EOF
-#line 4300 "configure"
+#line 4715 "configure"
 #include "confdefs.h"
 
 #include <stdlib.h>
 #include "confdefs.h"
 
 #include <stdlib.h>
@@ -4304,7 +4719,7 @@ int main() {
 putwc(0,0);
 ; return 0; }
 EOF
 putwc(0,0);
 ; return 0; }
 EOF
-if { (eval echo configure:4308: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4723: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   cf_cv_utf8_lib=yes
 else
   rm -rf conftest*
   cf_cv_utf8_lib=yes
 else
@@ -4319,11 +4734,37 @@ cf_cv_header_path_utf8=
 cf_cv_library_path_utf8=
 
 
 cf_cv_library_path_utf8=
 
 
-echo "${as_me-configure}:4323: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
+echo "${as_me-configure}:4738: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
+
+
+cf_save_LIBS="$LIBS"
 
 
+cat > conftest.$ac_ext <<EOF
+#line 4744 "configure"
+#include "confdefs.h"
+
+#include <libutf8.h>
+int main() {
+putwc(0,0);
+; return 0; }
+EOF
+if { (eval echo configure:4752: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  
+       cf_cv_find_linkage_utf8=yes
+       cf_cv_header_path_utf8=/usr/include
+       cf_cv_library_path_utf8=/usr/lib
+
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  
+
+LIBS="-lutf8  $cf_save_LIBS"
 
 cat > conftest.$ac_ext <<EOF
 
 cat > conftest.$ac_ext <<EOF
-#line 4327 "configure"
+#line 4768 "configure"
 #include "confdefs.h"
 
 #include <libutf8.h>
 #include "confdefs.h"
 
 #include <libutf8.h>
@@ -4331,29 +4772,38 @@ int main() {
 putwc(0,0);
 ; return 0; }
 EOF
 putwc(0,0);
 ; return 0; }
 EOF
-if { (eval echo configure:4335: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4776: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   rm -rf conftest*
-  cf_cv_find_linkage_utf8=yes
+  
+       cf_cv_find_linkage_utf8=yes
+       cf_cv_header_path_utf8=/usr/include
+       cf_cv_library_path_utf8=/usr/lib
+       cf_cv_library_file_utf8="-lutf8"
+
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
   
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
   
-    cf_cv_find_linkage_utf8=no
+       cf_cv_find_linkage_utf8=no
+       LIBS="$cf_save_LIBS"
 
     test -n "$verbose" && echo "       find linkage for utf8 library" 1>&6
 
 
     test -n "$verbose" && echo "       find linkage for utf8 library" 1>&6
 
-echo "${as_me-configure}:4347: testing find linkage for utf8 library ..." 1>&5
+echo "${as_me-configure}:4794: testing find linkage for utf8 library ..." 1>&5
 
 
     
 
 
     
-echo "${as_me-configure}:4351: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
+echo "${as_me-configure}:4798: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
 
 
     cf_save_CPPFLAGS="$CPPFLAGS"
     cf_test_CPPFLAGS="$CPPFLAGS"
 
     
 
 
     cf_save_CPPFLAGS="$CPPFLAGS"
     cf_test_CPPFLAGS="$CPPFLAGS"
 
     
+cf_search=
+
+# collect the current set of include-directories from compiler flags
 cf_header_path_list=""
 if test -n "${CFLAGS}${CPPFLAGS}" ; then
        for cf_header_path in $CPPFLAGS $CFLAGS
 cf_header_path_list=""
 if test -n "${CFLAGS}${CPPFLAGS}" ; then
        for cf_header_path in $CPPFLAGS $CFLAGS
@@ -4379,7 +4829,9 @@ test -d "$cf_header_path" && \
        done
 fi
 
        done
 fi
 
-cf_search=""
+# add the variations for the package we are looking for
+
+cf_search=
 
 
 test "/usr" != "$prefix" && \
 
 
 test "/usr" != "$prefix" && \
@@ -4457,19 +4909,19 @@ test -d "$oldincludedir" && {
        test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8"
 }
 
        test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8"
 }
 
-cf_search="$cf_header_path_list $cf_search"
+cf_search="$cf_search $cf_header_path_list"
 
     for cf_cv_header_path_utf8 in $cf_search
     do
       if test -d $cf_cv_header_path_utf8 ; then
         test -n "$verbose" && echo "   ... testing $cf_cv_header_path_utf8" 1>&6
 
 
     for cf_cv_header_path_utf8 in $cf_search
     do
       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}:4468: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
+echo "${as_me-configure}:4920: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
 
 
         CPPFLAGS="$cf_save_CPPFLAGS -I$cf_cv_header_path_utf8"
         cat > conftest.$ac_ext <<EOF
 
 
         CPPFLAGS="$cf_save_CPPFLAGS -I$cf_cv_header_path_utf8"
         cat > conftest.$ac_ext <<EOF
-#line 4473 "configure"
+#line 4925 "configure"
 #include "confdefs.h"
 
 #include <libutf8.h>
 #include "confdefs.h"
 
 #include <libutf8.h>
@@ -4477,12 +4929,12 @@ int main() {
 putwc(0,0);
 ; return 0; }
 EOF
 putwc(0,0);
 ; return 0; }
 EOF
-if { (eval echo configure:4481: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4933: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   
             test -n "$verbose" && echo "       ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
 
   rm -rf conftest*
   
             test -n "$verbose" && echo "       ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
 
-echo "${as_me-configure}:4486: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
+echo "${as_me-configure}:4938: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
 
 
             cf_cv_find_linkage_utf8=maybe
 
 
             cf_cv_find_linkage_utf8=maybe
@@ -4503,7 +4955,7 @@ rm -f conftest*
     if test "$cf_cv_find_linkage_utf8" = maybe ; then
 
       
     if test "$cf_cv_find_linkage_utf8" = maybe ; then
 
       
-echo "${as_me-configure}:4507: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
+echo "${as_me-configure}:4959: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
 
 
       cf_save_LIBS="$LIBS"
 
 
       cf_save_LIBS="$LIBS"
@@ -4513,6 +4965,7 @@ echo "${as_me-configure}:4507: testing Searching for utf8 library in FIND_LINKAG
 
       if test "$cf_cv_find_linkage_utf8" != yes ; then
         
 
       if test "$cf_cv_find_linkage_utf8" != yes ; then
         
+cf_search=
 cf_library_path_list=""
 if test -n "${LDFLAGS}${LIBS}" ; then
        for cf_library_path in $LDFLAGS $LIBS
 cf_library_path_list=""
 if test -n "${LDFLAGS}${LIBS}" ; then
        for cf_library_path in $LDFLAGS $LIBS
@@ -4538,7 +4991,8 @@ test -d "$cf_library_path" && \
        done
 fi
 
        done
 fi
 
-cf_search=""
+
+cf_search=
 
 
 test "/usr" != "$prefix" && \
 
 
 test "/usr" != "$prefix" && \
@@ -4609,14 +5063,14 @@ 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
 
           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}:4613: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
+echo "${as_me-configure}:5067: 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 <<EOF
 
 
             CPPFLAGS="$cf_test_CPPFLAGS"
             LIBS="-lutf8  $cf_save_LIBS"
             LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
             cat > conftest.$ac_ext <<EOF
-#line 4620 "configure"
+#line 5074 "configure"
 #include "confdefs.h"
 
 #include <libutf8.h>
 #include "confdefs.h"
 
 #include <libutf8.h>
@@ -4624,12 +5078,12 @@ int main() {
 putwc(0,0);
 ; return 0; }
 EOF
 putwc(0,0);
 ; return 0; }
 EOF
-if { (eval echo configure:4628: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5082: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   
                 test -n "$verbose" && echo "   ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
 
   rm -rf conftest*
   
                 test -n "$verbose" && echo "   ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
 
-echo "${as_me-configure}:4633: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
+echo "${as_me-configure}:5087: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
 
 
                 cf_cv_find_linkage_utf8=yes
 
 
                 cf_cv_find_linkage_utf8=yes
@@ -4648,7 +5102,6 @@ fi
 rm -f conftest*
           fi
         done
 rm -f conftest*
           fi
         done
-        LIBS="$cf_save_LIBS"
         CPPFLAGS="$cf_save_CPPFLAGS"
         LDFLAGS="$cf_save_LDFLAGS"
       fi
         CPPFLAGS="$cf_save_CPPFLAGS"
         LDFLAGS="$cf_save_LDFLAGS"
       fi
@@ -4660,6 +5113,11 @@ rm -f conftest*
 fi
 rm -f conftest*
 
 fi
 rm -f conftest*
 
+fi
+rm -f conftest*
+
+LIBS="$cf_save_LIBS"
+
 if test "$cf_cv_find_linkage_utf8" = yes ; then
 cf_cv_utf8_lib=add-on
 else
 if test "$cf_cv_find_linkage_utf8" = yes ; then
 cf_cv_utf8_lib=add-on
 else
@@ -4705,14 +5163,14 @@ if test -n "$cf_cv_header_path_utf8" ; then
                          cf_save_CPPFLAGS=$CPPFLAGS
                          CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
                          cat > conftest.$ac_ext <<EOF
                          cf_save_CPPFLAGS=$CPPFLAGS
                          CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
                          cat > conftest.$ac_ext <<EOF
-#line 4709 "configure"
+#line 5167 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 int main() {
 printf("Hello")
 ; return 0; }
 EOF
 #include "confdefs.h"
 #include <stdio.h>
 int main() {
 printf("Hello")
 ; return 0; }
 EOF
-if { (eval echo configure:4716: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5174: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   :
 else
   echo "configure: failed program was:" >&5
   :
 else
   echo "configure: failed program was:" >&5
@@ -4729,7 +5187,7 @@ rm -f conftest*
                if test "$cf_have_incdir" = no ; then
                  test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
 
                if test "$cf_have_incdir" = no ; then
                  test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
 
-echo "${as_me-configure}:4733: testing adding $cf_add_incdir to include-path ..." 1>&5
+echo "${as_me-configure}:5191: testing adding $cf_add_incdir to include-path ..." 1>&5
 
 
                  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
 
 
                  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
@@ -4765,7 +5223,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
 
       if test "$cf_have_libdir" = no ; then
         test -n "$verbose" && echo "   adding $cf_add_libdir to library-path" 1>&6
 
-echo "${as_me-configure}:4769: testing adding $cf_add_libdir to library-path ..." 1>&5
+echo "${as_me-configure}:5227: testing adding $cf_add_libdir to library-path ..." 1>&5
 
 
         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
 
 
         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
@@ -4774,7 +5232,7 @@ echo "${as_me-configure}:4769: testing adding $cf_add_libdir to library-path ...
   done
 fi
 
   done
 fi
 
-       LIBS="-lutf8 $LIBS"
+       LIBS="$cf_cv_library_file_utf8 $LIBS"
 fi
 
        
 fi
 
        
@@ -4786,7 +5244,7 @@ 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 $ac_n "checking for $ac_word""... $ac_c" 1>&6
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4790: checking for $ac_word" >&5
+echo "configure:5248: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_NCURSES_CONFIG'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
 if eval "test \"`echo '$''{'ac_cv_path_NCURSES_CONFIG'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4825,84 +5283,166 @@ test -n "$NCURSES_CONFIG" || NCURSES_CONFIG="none"
 
 if test "$NCURSES_CONFIG" != none ; then
 
 
 if test "$NCURSES_CONFIG" != none ; then
 
-cf_cv_ncurses_header=curses.h
-
 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
 LIBS="`$NCURSES_CONFIG --libs` $LIBS"
 
 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
 LIBS="`$NCURSES_CONFIG --libs` $LIBS"
 
-cat >> confdefs.h <<\EOF
-#define NCURSES 1
-EOF
-
-
-
-cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
-
-cat >> confdefs.h <<EOF
-#define $cf_nculib_ROOT 1
-EOF
-
-
-cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
+# even with config script, some packages use no-override for curses.h
 
 
+echo $ac_n "checking if we have identified curses headers""... $ac_c" 1>&6
+echo "configure:5293: checking if we have identified curses headers" >&5
+if eval "test \"`echo '$''{'cf_cv_ncurses_header'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
 else
 else
-
-
-
-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
-  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 <<EOF
-#line 4882 "configure"
+cf_cv_ncurses_header=none
+for cf_header in  \
+    ncursesw/curses.h \
+       ncursesw/ncurses.h \
+       curses.h \
+       ncurses.h 
+do
+cat > conftest.$ac_ext <<EOF
+#line 5306 "configure"
 #include "confdefs.h"
 #include "confdefs.h"
-#include <stdio.h>
+#include <${cf_header}>
 int main() {
 int main() {
-printf("Hello")
+initscr(); tgoto("?", 0,0)
 ; return 0; }
 EOF
 ; return 0; }
 EOF
-if { (eval echo configure:4889: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  :
+if { (eval echo configure:5313: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  cf_cv_ncurses_header=$cf_header; break
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  cf_have_incdir=yes
 fi
 rm -f conftest*
 fi
 rm -f conftest*
-                         CPPFLAGS=$cf_save_CPPFLAGS
-                       fi
-                 fi
-               fi
+done
+
+fi
+
+echo "$ac_t""$cf_cv_ncurses_header" 1>&6
+
+if test "$cf_cv_ncurses_header" = none ; then
+       { echo "configure: error: No curses header-files found" 1>&2; exit 1; }
+fi
+
+# cheat, to get the right #define's for HAVE_NCURSES_H, etc.
+for ac_hdr in $cf_cv_ncurses_header
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:5336: checking for $ac_hdr" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 5341 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:5346: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=yes"
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+else
+  echo "$ac_t""no" 1>&6
+fi
+done
+
+
+
+cat >> confdefs.h <<\EOF
+#define NCURSES 1
+EOF
+
+
+
+cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
+
+cat >> confdefs.h <<EOF
+#define $cf_nculib_ROOT 1
+EOF
+
+
+cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
+
+else
 
 
-               if test "$cf_have_incdir" = no ; then
-                 test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
 
 
-echo "${as_me-configure}:4906: testing adding $cf_add_incdir to include-path ..." 1>&5
+
+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
+  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 <<EOF
+#line 5422 "configure"
+#include "confdefs.h"
+#include <stdio.h>
+int main() {
+printf("Hello")
+; return 0; }
+EOF
+if { (eval echo configure:5429: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  :
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  cf_have_incdir=yes
+fi
+rm -f conftest*
+                         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}:5446: testing adding $cf_add_incdir to include-path ..." 1>&5
 
 
                  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
 
 
                  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
@@ -4921,7 +5461,7 @@ fi
 }
 
 echo $ac_n "checking for $cf_ncuhdr_root header in include-path""... $ac_c" 1>&6
 }
 
 echo $ac_n "checking for $cf_ncuhdr_root header in include-path""... $ac_c" 1>&6
-echo "configure:4925: checking for $cf_ncuhdr_root header in include-path" >&5
+echo "configure:5465: checking for $cf_ncuhdr_root header in include-path" >&5
 if eval "test \"`echo '$''{'cf_cv_ncurses_h'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
 if eval "test \"`echo '$''{'cf_cv_ncurses_h'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4932,7 +5472,7 @@ else
        do
                
        cat > conftest.$ac_ext <<EOF
        do
                
        cat > conftest.$ac_ext <<EOF
-#line 4936 "configure"
+#line 5476 "configure"
 #include "confdefs.h"
 
 
 #include "confdefs.h"
 
 
@@ -4961,7 +5501,7 @@ printf("old\n");
        
 ; return 0; }
 EOF
        
 ; return 0; }
 EOF
-if { (eval echo configure:4965: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5505: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_ncurses_h=$cf_header
        
   rm -rf conftest*
   cf_cv_ncurses_h=$cf_header
        
@@ -4987,13 +5527,16 @@ if test "$cf_cv_ncurses_h" != no ; then
 else
 
 echo $ac_n "checking for $cf_ncuhdr_root include-path""... $ac_c" 1>&6
 else
 
 echo $ac_n "checking for $cf_ncuhdr_root include-path""... $ac_c" 1>&6
-echo "configure:4991: checking for $cf_ncuhdr_root include-path" >&5
+echo "configure:5531: checking for $cf_ncuhdr_root include-path" >&5
 if eval "test \"`echo '$''{'cf_cv_ncurses_h2'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
        test -n "$verbose" && echo
        
 if eval "test \"`echo '$''{'cf_cv_ncurses_h2'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
        test -n "$verbose" && echo
        
+cf_search=
+
+# collect the current set of include-directories from compiler flags
 cf_header_path_list=""
 if test -n "${CFLAGS}${CPPFLAGS}" ; then
        for cf_header_path in $CPPFLAGS $CFLAGS
 cf_header_path_list=""
 if test -n "${CFLAGS}${CPPFLAGS}" ; then
        for cf_header_path in $CPPFLAGS $CFLAGS
@@ -5019,7 +5562,9 @@ test -d "$cf_header_path" && \
        done
 fi
 
        done
 fi
 
-cf_search=""
+# add the variations for the package we are looking for
+
+cf_search=
 
 
 test "/usr" != "$prefix" && \
 
 
 test "/usr" != "$prefix" && \
@@ -5097,7 +5642,7 @@ test -d "$oldincludedir" && {
        test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
 }
 
        test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
 }
 
-cf_search="$cf_header_path_list $cf_search"
+cf_search="$cf_search $cf_header_path_list"
 
        test -n "$verbose" && echo search path $cf_search
        cf_save2_CPPFLAGS="$CPPFLAGS"
 
        test -n "$verbose" && echo search path $cf_search
        cf_save2_CPPFLAGS="$CPPFLAGS"
@@ -5128,14 +5673,14 @@ if test -n "$cf_incdir" ; then
                          cf_save_CPPFLAGS=$CPPFLAGS
                          CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
                          cat > conftest.$ac_ext <<EOF
                          cf_save_CPPFLAGS=$CPPFLAGS
                          CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
                          cat > conftest.$ac_ext <<EOF
-#line 5132 "configure"
+#line 5677 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 int main() {
 printf("Hello")
 ; return 0; }
 EOF
 #include "confdefs.h"
 #include <stdio.h>
 int main() {
 printf("Hello")
 ; return 0; }
 EOF
-if { (eval echo configure:5139: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5684: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   :
 else
   echo "configure: failed program was:" >&5
   :
 else
   echo "configure: failed program was:" >&5
@@ -5152,7 +5697,7 @@ rm -f conftest*
                if test "$cf_have_incdir" = no ; then
                  test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
 
                if test "$cf_have_incdir" = no ; then
                  test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
 
-echo "${as_me-configure}:5156: testing adding $cf_add_incdir to include-path ..." 1>&5
+echo "${as_me-configure}:5701: testing adding $cf_add_incdir to include-path ..." 1>&5
 
 
                  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
 
 
                  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
@@ -5174,7 +5719,7 @@ fi
                do
                        
        cat > conftest.$ac_ext <<EOF
                do
                        
        cat > conftest.$ac_ext <<EOF
-#line 5178 "configure"
+#line 5723 "configure"
 #include "confdefs.h"
 
 
 #include "confdefs.h"
 
 
@@ -5195,7 +5740,7 @@ printf("old\n");
        
 ; return 0; }
 EOF
        
 ; return 0; }
 EOF
-if { (eval echo configure:5199: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5744: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_ncurses_h2=$cf_header
        
   rm -rf conftest*
   cf_cv_ncurses_h2=$cf_header
        
@@ -5253,14 +5798,14 @@ if test -n "$cf_1st_incdir" ; then
                          cf_save_CPPFLAGS=$CPPFLAGS
                          CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
                          cat > conftest.$ac_ext <<EOF
                          cf_save_CPPFLAGS=$CPPFLAGS
                          CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
                          cat > conftest.$ac_ext <<EOF
-#line 5257 "configure"
+#line 5802 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 int main() {
 printf("Hello")
 ; return 0; }
 EOF
 #include "confdefs.h"
 #include <stdio.h>
 int main() {
 printf("Hello")
 ; return 0; }
 EOF
-if { (eval echo configure:5264: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5809: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   :
 else
   echo "configure: failed program was:" >&5
   :
 else
   echo "configure: failed program was:" >&5
@@ -5277,7 +5822,7 @@ rm -f conftest*
                if test "$cf_have_incdir" = no ; then
                  test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
 
                if test "$cf_have_incdir" = no ; then
                  test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
 
-echo "${as_me-configure}:5281: testing adding $cf_add_incdir to include-path ..." 1>&5
+echo "${as_me-configure}:5826: testing adding $cf_add_incdir to include-path ..." 1>&5
 
 
                  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
 
 
                  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
@@ -5325,7 +5870,7 @@ esac
 
 
 echo $ac_n "checking for terminfo header""... $ac_c" 1>&6
 
 
 echo $ac_n "checking for terminfo header""... $ac_c" 1>&6
-echo "configure:5329: checking for terminfo header" >&5
+echo "configure:5874: checking for terminfo header" >&5
 if eval "test \"`echo '$''{'cf_cv_term_header'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
 if eval "test \"`echo '$''{'cf_cv_term_header'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5342,7 +5887,7 @@ esac
 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
 do
 cat > conftest.$ac_ext <<EOF
 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
 do
 cat > conftest.$ac_ext <<EOF
-#line 5346 "configure"
+#line 5891 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 #include <${cf_cv_ncurses_header-curses.h}>
 #include "confdefs.h"
 #include <stdio.h>
 #include <${cf_cv_ncurses_header-curses.h}>
@@ -5352,7 +5897,7 @@ int main() {
 int x = auto_left_margin
 ; return 0; }
 EOF
 int x = auto_left_margin
 ; return 0; }
 EOF
-if { (eval echo configure:5356: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5901: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   
        cf_cv_term_header="$cf_test"
   rm -rf conftest*
   
        cf_cv_term_header="$cf_test"
@@ -5407,7 +5952,7 @@ EOF
 
 
 echo $ac_n "checking for ncurses version""... $ac_c" 1>&6
 
 
 echo $ac_n "checking for ncurses version""... $ac_c" 1>&6
-echo "configure:5411: checking for ncurses version" >&5
+echo "configure:5956: checking for ncurses version" >&5
 if eval "test \"`echo '$''{'cf_cv_ncurses_version'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
 if eval "test \"`echo '$''{'cf_cv_ncurses_version'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5433,7 +5978,7 @@ Autoconf "old"
 #endif
 EOF
        cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
 #endif
 EOF
        cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
-       { (eval echo configure:5437: \"$cf_try\") 1>&5; (eval $cf_try) 2>&5; }
+       { (eval echo configure:5982: \"$cf_try\") 1>&5; (eval $cf_try) 2>&5; }
        if test -f conftest.out ; then
                cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
                test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
        if test -f conftest.out ; then
                cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
                test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
@@ -5442,7 +5987,7 @@ EOF
 
 else
   cat > conftest.$ac_ext <<EOF
 
 else
   cat > conftest.$ac_ext <<EOF
-#line 5446 "configure"
+#line 5991 "configure"
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header-curses.h}>
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header-curses.h}>
@@ -5466,7 +6011,7 @@ int main()
        ${cf_cv_main_return-return}(0);
 }
 EOF
        ${cf_cv_main_return-return}(0);
 }
 EOF
-if { (eval echo configure:5470: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:6015: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   
        cf_cv_ncurses_version=`cat $cf_tempfile`
 then
   
        cf_cv_ncurses_version=`cat $cf_tempfile`
@@ -5497,7 +6042,7 @@ cf_nculib_root=ncursesw
 cf_ncurses_LIBS=""
 cf_ncurses_SAVE="$LIBS"
 echo $ac_n "checking for Gpm_Open in -lgpm""... $ac_c" 1>&6
 cf_ncurses_LIBS=""
 cf_ncurses_SAVE="$LIBS"
 echo $ac_n "checking for Gpm_Open in -lgpm""... $ac_c" 1>&6
-echo "configure:5501: checking for Gpm_Open in -lgpm" >&5
+echo "configure:6046: checking for Gpm_Open in -lgpm" >&5
 ac_lib_var=`echo gpm'_'Gpm_Open | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 ac_lib_var=`echo gpm'_'Gpm_Open | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -5505,7 +6050,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lgpm  $LIBS"
 cat > conftest.$ac_ext <<EOF
   ac_save_LIBS="$LIBS"
 LIBS="-lgpm  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5509 "configure"
+#line 6054 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -5516,7 +6061,7 @@ int main() {
 Gpm_Open()
 ; return 0; }
 EOF
 Gpm_Open()
 ; return 0; }
 EOF
-if { (eval echo configure:5520: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6065: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5532,7 +6077,7 @@ fi
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   echo $ac_n "checking for initscr in -lgpm""... $ac_c" 1>&6
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   echo $ac_n "checking for initscr in -lgpm""... $ac_c" 1>&6
-echo "configure:5536: checking for initscr in -lgpm" >&5
+echo "configure:6081: checking for initscr in -lgpm" >&5
 ac_lib_var=`echo gpm'_'initscr | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 ac_lib_var=`echo gpm'_'initscr | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -5540,7 +6085,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lgpm  $LIBS"
 cat > conftest.$ac_ext <<EOF
   ac_save_LIBS="$LIBS"
 LIBS="-lgpm  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5544 "configure"
+#line 6089 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -5551,7 +6096,7 @@ int main() {
 initscr()
 ; return 0; }
 EOF
 initscr()
 ; return 0; }
 EOF
-if { (eval echo configure:5555: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6100: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5583,7 +6128,7 @@ freebsd*)
        # version of ncurses (but it should do no harm, since it's static).
        if test "$cf_nculib_root" = ncurses ; then
                echo $ac_n "checking for tgoto in -lmytinfo""... $ac_c" 1>&6
        # version of ncurses (but it should do no harm, since it's static).
        if test "$cf_nculib_root" = ncurses ; then
                echo $ac_n "checking for tgoto in -lmytinfo""... $ac_c" 1>&6
-echo "configure:5587: checking for tgoto in -lmytinfo" >&5
+echo "configure:6132: checking for tgoto in -lmytinfo" >&5
 ac_lib_var=`echo mytinfo'_'tgoto | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 ac_lib_var=`echo mytinfo'_'tgoto | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -5591,7 +6136,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lmytinfo  $LIBS"
 cat > conftest.$ac_ext <<EOF
   ac_save_LIBS="$LIBS"
 LIBS="-lmytinfo  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5595 "configure"
+#line 6140 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -5602,7 +6147,7 @@ int main() {
 tgoto()
 ; return 0; }
 EOF
 tgoto()
 ; return 0; }
 EOF
-if { (eval echo configure:5606: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6151: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5650,7 +6195,7 @@ if test -n "$cf_cv_curses_dir/lib" ; then
       if test "$cf_have_libdir" = no ; then
         test -n "$verbose" && echo "   adding $cf_add_libdir to library-path" 1>&6
 
       if test "$cf_have_libdir" = no ; then
         test -n "$verbose" && echo "   adding $cf_add_libdir to library-path" 1>&6
 
-echo "${as_me-configure}:5654: testing adding $cf_add_libdir to library-path ..." 1>&5
+echo "${as_me-configure}:6199: testing adding $cf_add_libdir to library-path ..." 1>&5
 
 
         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
 
 
         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
@@ -5665,12 +6210,12 @@ else
        eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
        cf_libdir=""
        echo $ac_n "checking for initscr""... $ac_c" 1>&6
        eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
        cf_libdir=""
        echo $ac_n "checking for initscr""... $ac_c" 1>&6
-echo "configure:5669: checking for initscr" >&5
+echo "configure:6214: checking for initscr" >&5
 if eval "test \"`echo '$''{'ac_cv_func_initscr'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
 if eval "test \"`echo '$''{'ac_cv_func_initscr'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5674 "configure"
+#line 6219 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char initscr(); below.  */
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char initscr(); below.  */
@@ -5693,7 +6238,7 @@ initscr();
 
 ; return 0; }
 EOF
 
 ; return 0; }
 EOF
-if { (eval echo configure:5697: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6242: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_initscr=yes"
 else
   rm -rf conftest*
   eval "ac_cv_func_initscr=yes"
 else
@@ -5713,17 +6258,17 @@ else
 
                cf_save_LIBS="$LIBS"
                echo $ac_n "checking for initscr in -l$cf_nculib_root""... $ac_c" 1>&6
 
                cf_save_LIBS="$LIBS"
                echo $ac_n "checking for initscr in -l$cf_nculib_root""... $ac_c" 1>&6
-echo "configure:5717: checking for initscr in -l$cf_nculib_root" >&5
+echo "configure:6262: checking for initscr in -l$cf_nculib_root" >&5
                LIBS="-l$cf_nculib_root $LIBS"
                cat > conftest.$ac_ext <<EOF
                LIBS="-l$cf_nculib_root $LIBS"
                cat > conftest.$ac_ext <<EOF
-#line 5720 "configure"
+#line 6265 "configure"
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header-curses.h}>
 int main() {
 initscr()
 ; return 0; }
 EOF
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header-curses.h}>
 int main() {
 initscr()
 ; return 0; }
 EOF
-if { (eval echo configure:5727: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6272: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
                         eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
                         eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
@@ -5734,6 +6279,7 @@ else
   rm -rf conftest*
   echo "$ac_t""no" 1>&6
                        
   rm -rf conftest*
   echo "$ac_t""no" 1>&6
                        
+cf_search=
 cf_library_path_list=""
 if test -n "${LDFLAGS}${LIBS}" ; then
        for cf_library_path in $LDFLAGS $LIBS
 cf_library_path_list=""
 if test -n "${LDFLAGS}${LIBS}" ; then
        for cf_library_path in $LDFLAGS $LIBS
@@ -5759,7 +6305,8 @@ test -d "$cf_library_path" && \
        done
 fi
 
        done
 fi
 
-cf_search=""
+
+cf_search=
 
 
 test "/usr" != "$prefix" && \
 
 
 test "/usr" != "$prefix" && \
@@ -5828,17 +6375,17 @@ cf_search="$cf_library_path_list $cf_search"
                        for cf_libdir in $cf_search
                        do
                                echo $ac_n "checking for -l$cf_nculib_root in $cf_libdir""... $ac_c" 1>&6
                        for cf_libdir in $cf_search
                        do
                                echo $ac_n "checking for -l$cf_nculib_root in $cf_libdir""... $ac_c" 1>&6
-echo "configure:5832: checking for -l$cf_nculib_root in $cf_libdir" >&5
+echo "configure:6379: checking for -l$cf_nculib_root in $cf_libdir" >&5
                                LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
                                cat > conftest.$ac_ext <<EOF
                                LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
                                cat > conftest.$ac_ext <<EOF
-#line 5835 "configure"
+#line 6382 "configure"
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header-curses.h}>
 int main() {
 initscr()
 ; return 0; }
 EOF
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header-curses.h}>
 int main() {
 initscr()
 ; return 0; }
 EOF
-if { (eval echo configure:5842: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6389: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
                                         eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
                                         eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
@@ -5869,7 +6416,7 @@ fi
 
 if test -n "$cf_ncurses_LIBS" ; then
        echo $ac_n "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS""... $ac_c" 1>&6
 
 if test -n "$cf_ncurses_LIBS" ; then
        echo $ac_n "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS""... $ac_c" 1>&6
-echo "configure:5873: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
+echo "configure:6420: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
        cf_ncurses_SAVE="$LIBS"
        for p in $cf_ncurses_LIBS ; do
                q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
        cf_ncurses_SAVE="$LIBS"
        for p in $cf_ncurses_LIBS ; do
                q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
@@ -5878,14 +6425,14 @@ echo "configure:5873: checking if we can link $cf_nculib_root without $cf_ncurse
                fi
        done
        cat > conftest.$ac_ext <<EOF
                fi
        done
        cat > conftest.$ac_ext <<EOF
-#line 5882 "configure"
+#line 6429 "configure"
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header-curses.h}>
 int main() {
 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
 ; return 0; }
 EOF
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header-curses.h}>
 int main() {
 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
 ; return 0; }
 EOF
-if { (eval echo configure:5889: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6436: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
 else
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
 else
 
        ;;
 pdcurses) #(vi
 
        ;;
 pdcurses) #(vi
-       if test "$no_x" = yes; then
-  # Not all programs may use this symbol, but it does not hurt to define it.
-  cat >> confdefs.h <<\EOF
-#define X_DISPLAY_MISSING 1
-EOF
-
-  X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
-else
-  if test -n "$x_includes"; then
-    X_CFLAGS="$X_CFLAGS -I$x_includes"
-  fi
+       # If we find X, set shell vars x_includes and x_libraries to the
+# paths, otherwise set no_x=yes.
+# Uses ac_ vars as temps to allow command line to override cache and checks.
+# --without-x overrides everything else, but does not touch the cache.
+echo $ac_n "checking for X""... $ac_c" 1>&6
+echo "configure:6467: checking for X" >&5
 
 
-  # It would also be nice to do this for all -L options, not just this one.
-  if test -n "$x_libraries"; then
-    X_LIBS="$X_LIBS -L$x_libraries"
-    # For Solaris; some versions of Sun CC require a space after -R and
-    # others require no space.  Words are not sufficient . . . .
-    case "`(uname -sr) 2>/dev/null`" in
-    "SunOS 5"*)
-      echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6
-echo "configure:5935: checking whether -R must be followed by a space" >&5
-      ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries"
-      cat > conftest.$ac_ext <<EOF
-#line 5938 "configure"
-#include "confdefs.h"
 
 
-int main() {
+# Check whether --with-x or --without-x was given.
+if test "${with_x+set}" = set; then
+  withval="$with_x"
+  :
+fi
 
 
-; return 0; }
-EOF
-if { (eval echo configure:5945: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  ac_R_nospace=yes
+# $have_x is `yes', `no', `disabled', or empty when we do not yet know.
+if test "x$with_x" = xno; then
+  # The user explicitly disabled X.
+  have_x=disabled
 else
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ac_R_nospace=no
+  if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
+    # Both variables are already set.
+    have_x=yes
+  else
+if eval "test \"`echo '$''{'ac_cv_have_x'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  # One or both of the vars are not set, and there is no cached value.
+ac_x_includes=NO ac_x_libraries=NO
+rm -fr conftestdir
+if mkdir conftestdir; then
+  cd conftestdir
+  # Make sure to not put "make" in the Imakefile rules, since we grep it out.
+  cat > Imakefile <<'EOF'
+acfindx:
+       @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
+EOF
+  if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
+    # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+    eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
+    # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
+    for ac_extension in a so sl; do
+      if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
+        test -f $ac_im_libdir/libX11.$ac_extension; then
+        ac_im_usrlibdir=$ac_im_libdir; break
+      fi
+    done
+    # Screen out bogus values from the imake configuration.  They are
+    # bogus both because they are the default anyway, and because
+    # using them would break gcc on systems where it needs fixed includes.
+    case "$ac_im_incroot" in
+       /usr/include) ;;
+       *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes="$ac_im_incroot" ;;
+    esac
+    case "$ac_im_usrlibdir" in
+       /usr/lib | /lib) ;;
+       *) test -d "$ac_im_usrlibdir" && ac_x_libraries="$ac_im_usrlibdir" ;;
+    esac
+  fi
+  cd ..
+  rm -fr conftestdir
 fi
 fi
-rm -f conftest*
-      if test $ac_R_nospace = yes; then
-       echo "$ac_t""no" 1>&6
-       X_LIBS="$X_LIBS -R$x_libraries"
-      else
-       LIBS="$ac_xsave_LIBS -R $x_libraries"
-       cat > conftest.$ac_ext <<EOF
-#line 5961 "configure"
-#include "confdefs.h"
 
 
-int main() {
+if test "$ac_x_includes" = NO; then
+  # Guess where to find include files, by looking for this one X11 .h file.
+  test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h
 
 
-; return 0; }
+  # First, try using that file with no special directory specified.
+cat > conftest.$ac_ext <<EOF
+#line 6530 "configure"
+#include "confdefs.h"
+#include <$x_direct_test_include>
 EOF
 EOF
-if { (eval echo configure:5968: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:6535: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
   rm -rf conftest*
   rm -rf conftest*
-  ac_R_space=yes
+  # We can compile using X headers with no special include directory.
+ac_x_includes=
 else
 else
+  echo "$ac_err" >&5
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  ac_R_space=no
-fi
-rm -f conftest*
-       if test $ac_R_space = yes; then
-         echo "$ac_t""yes" 1>&6
-         X_LIBS="$X_LIBS -R $x_libraries"
-       else
-         echo "$ac_t""neither works" 1>&6
-       fi
-      fi
-      LIBS="$ac_xsave_LIBS"
-    esac
-  fi
-
-  # Check for system-dependent libraries X programs must link with.
-  # Do this before checking for the system-independent R6 libraries
-  # (-lICE), since we may need -lsocket or whatever for X linking.
-
-  if test "$ISC" = yes; then
-    X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
-  else
-    # Martyn.Johnson@cl.cam.ac.uk says this is needed for Ultrix, if the X
-    # libraries were built with DECnet support.  And karl@cs.umb.edu says
-    # the Alpha needs dnet_stub (dnet does not exist).
-    echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6
-echo "configure:6000: checking for dnet_ntoa in -ldnet" >&5
-ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
+  # Look for the header file in a standard set of common directories.
+# Check X11 before X11Rn because it is often a symlink to the current release.
+  for ac_dir in               \
+    /usr/X11/include          \
+    /usr/X11R6/include        \
+    /usr/X11R5/include        \
+    /usr/X11R4/include        \
+                              \
+    /usr/include/X11          \
+    /usr/include/X11R6        \
+    /usr/include/X11R5        \
+    /usr/include/X11R4        \
+                              \
+    /usr/local/X11/include    \
+    /usr/local/X11R6/include  \
+    /usr/local/X11R5/include  \
+    /usr/local/X11R4/include  \
+                              \
+    /usr/local/include/X11    \
+    /usr/local/include/X11R6  \
+    /usr/local/include/X11R5  \
+    /usr/local/include/X11R4  \
+                              \
+    /usr/X386/include         \
+    /usr/x386/include         \
+    /usr/XFree86/include/X11  \
+                              \
+    /usr/include              \
+    /usr/local/include        \
+    /usr/unsupported/include  \
+    /usr/athena/include       \
+    /usr/local/x11r5/include  \
+    /usr/lpp/Xamples/include  \
+                              \
+    /usr/openwin/include      \
+    /usr/openwin/share/include \
+    ; \
+  do
+    if test -r "$ac_dir/$x_direct_test_include"; then
+      ac_x_includes=$ac_dir
+      break
+    fi
+  done
+fi
+rm -f conftest*
+fi # $ac_x_includes = NO
+
+if test "$ac_x_libraries" = NO; then
+  # Check for the libraries.
+
+  test -z "$x_direct_test_library" && x_direct_test_library=Xt
+  test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc
+
+  # See if we find them without any special options.
+  # Don't add to $LIBS permanently.
+  ac_save_LIBS="$LIBS"
+  LIBS="-l$x_direct_test_library $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 6604 "configure"
+#include "confdefs.h"
+
+int main() {
+${x_direct_test_function}()
+; return 0; }
+EOF
+if { (eval echo configure:6611: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  LIBS="$ac_save_LIBS"
+# We can link X programs with no special library path.
+ac_x_libraries=
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  LIBS="$ac_save_LIBS"
+# First see if replacing the include by lib works.
+# Check X11 before X11Rn because it is often a symlink to the current release.
+for ac_dir in `echo "$ac_x_includes" | sed s/include/lib/` \
+    /usr/X11/lib          \
+    /usr/X11R6/lib        \
+    /usr/X11R5/lib        \
+    /usr/X11R4/lib        \
+                          \
+    /usr/lib/X11          \
+    /usr/lib/X11R6        \
+    /usr/lib/X11R5        \
+    /usr/lib/X11R4        \
+                          \
+    /usr/local/X11/lib    \
+    /usr/local/X11R6/lib  \
+    /usr/local/X11R5/lib  \
+    /usr/local/X11R4/lib  \
+                          \
+    /usr/local/lib/X11    \
+    /usr/local/lib/X11R6  \
+    /usr/local/lib/X11R5  \
+    /usr/local/lib/X11R4  \
+                          \
+    /usr/X386/lib         \
+    /usr/x386/lib         \
+    /usr/XFree86/lib/X11  \
+                          \
+    /usr/lib              \
+    /usr/local/lib        \
+    /usr/unsupported/lib  \
+    /usr/athena/lib       \
+    /usr/local/x11r5/lib  \
+    /usr/lpp/Xamples/lib  \
+    /lib/usr/lib/X11     \
+                          \
+    /usr/openwin/lib      \
+    /usr/openwin/share/lib \
+    ; \
+do
+  for ac_extension in a so sl; do
+    if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then
+      ac_x_libraries=$ac_dir
+      break 2
+    fi
+  done
+done
+fi
+rm -f conftest*
+fi # $ac_x_libraries = NO
+
+if test "$ac_x_includes" = NO || test "$ac_x_libraries" = NO; then
+  # Didn't find X anywhere.  Cache the known absence of X.
+  ac_cv_have_x="have_x=no"
+else
+  # Record where we found X for the cache.
+  ac_cv_have_x="have_x=yes \
+               ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
+fi
+fi
+  fi
+  eval "$ac_cv_have_x"
+fi # $with_x != no
+
+if test "$have_x" != yes; then
+  echo "$ac_t""$have_x" 1>&6
+  no_x=yes
+else
+  # If each of the values was on the command line, it overrides each guess.
+  test "x$x_includes" = xNONE && x_includes=$ac_x_includes
+  test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
+  # 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 "$ac_t""libraries $x_libraries, headers $x_includes" 1>&6
+fi
+
+
+echo $ac_n "checking if you want to use pkg-config""... $ac_c" 1>&6
+echo "configure:6699: checking if you want to use pkg-config" >&5
+
+# Check whether --with-pkg-config or --without-pkg-config was given.
+if test "${with_pkg_config+set}" = set; then
+  withval="$with_pkg_config"
+  cf_pkg_config=$withval
+else
+  cf_pkg_config=yes
+fi
+
+echo "$ac_t""$cf_pkg_config" 1>&6
+
+case $cf_pkg_config in #(vi
+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 $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:6719: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  case "$PKG_CONFIG" in
+  /*)
+  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
+  ;;
+  ?:/*)                         
+  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a dos path.
+  ;;
+  *)
+  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do 
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+  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 "$ac_t""$PKG_CONFIG" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+       ;;
+*)
+       PKG_CONFIG=$withval
+       ;;
+esac
+
+test -z "$PKG_CONFIG" && PKG_CONFIG=none
+if test "$PKG_CONFIG" != none ; then
+       
+if test "x$prefix" != xNONE; then
+  cf_path_syntax="$prefix"
+else
+  cf_path_syntax="$ac_default_prefix"
+fi
+
+case ".$PKG_CONFIG" in #(vi
+.\$\(*\)*|.\'*\'*) #(vi
+  ;;
+..|./*|.\\*) #(vi
+  ;;
+.[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
+  ;;
+.\${*prefix}*) #(vi
+  eval PKG_CONFIG="$PKG_CONFIG"
+  case ".$PKG_CONFIG" in #(vi
+  .NONE/*)
+    PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
+    ;;
+  esac
+  ;; #(vi
+.no|.NONE/*)
+  PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
+  ;;
+*)
+  { echo "configure: error: expected a pathname, not \"$PKG_CONFIG\"" 1>&2; exit 1; }
+  ;;
+esac
+
+fi
+
+
+
+if test "$no_x" = yes; then
+  # Not all programs may use this symbol, but it does not hurt to define it.
+  cat >> confdefs.h <<\EOF
+#define X_DISPLAY_MISSING 1
+EOF
+
+  X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
+else
+  if test -n "$x_includes"; then
+    X_CFLAGS="$X_CFLAGS -I$x_includes"
+  fi
+
+  # It would also be nice to do this for all -L options, not just this one.
+  if test -n "$x_libraries"; then
+    X_LIBS="$X_LIBS -L$x_libraries"
+    # For Solaris; some versions of Sun CC require a space after -R and
+    # others require no space.  Words are not sufficient . . . .
+    case "`(uname -sr) 2>/dev/null`" in
+    "SunOS 5"*)
+      echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6
+echo "configure:6814: checking whether -R must be followed by a space" >&5
+      ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries"
+      cat > conftest.$ac_ext <<EOF
+#line 6817 "configure"
+#include "confdefs.h"
+
+int main() {
+
+; return 0; }
+EOF
+if { (eval echo configure:6824: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  ac_R_nospace=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ac_R_nospace=no
+fi
+rm -f conftest*
+      if test $ac_R_nospace = yes; then
+       echo "$ac_t""no" 1>&6
+       X_LIBS="$X_LIBS -R$x_libraries"
+      else
+       LIBS="$ac_xsave_LIBS -R $x_libraries"
+       cat > conftest.$ac_ext <<EOF
+#line 6840 "configure"
+#include "confdefs.h"
+
+int main() {
+
+; return 0; }
+EOF
+if { (eval echo configure:6847: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  ac_R_space=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ac_R_space=no
+fi
+rm -f conftest*
+       if test $ac_R_space = yes; then
+         echo "$ac_t""yes" 1>&6
+         X_LIBS="$X_LIBS -R $x_libraries"
+       else
+         echo "$ac_t""neither works" 1>&6
+       fi
+      fi
+      LIBS="$ac_xsave_LIBS"
+    esac
+  fi
+
+  # Check for system-dependent libraries X programs must link with.
+  # Do this before checking for the system-independent R6 libraries
+  # (-lICE), since we may need -lsocket or whatever for X linking.
+
+  if test "$ISC" = yes; then
+    X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
+  else
+    # Martyn.Johnson@cl.cam.ac.uk says this is needed for Ultrix, if the X
+    # libraries were built with DECnet support.  And karl@cs.umb.edu says
+    # the Alpha needs dnet_stub (dnet does not exist).
+    echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6
+echo "configure:6879: checking for dnet_ntoa in -ldnet" >&5
+ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-ldnet  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 6887 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char dnet_ntoa();
+
+int main() {
+dnet_ntoa()
+; return 0; }
+EOF
+if { (eval echo configure:6898: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+    if test $ac_cv_lib_dnet_dnet_ntoa = no; then
+      echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6
+echo "configure:6920: checking for dnet_ntoa in -ldnet_stub" >&5
+ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-ldnet_stub  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 6928 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char dnet_ntoa();
+
+int main() {
+dnet_ntoa()
+; return 0; }
+EOF
+if { (eval echo configure:6939: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+    fi
+
+    # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
+    # to get the SysV transport functions.
+    # chad@anasazi.com says the Pyramis MIS-ES running DC/OSx (SVR4)
+    # needs -lnsl.
+    # The nsl library prevents programs from opening the X display
+    # on Irix 5.2, according to dickey@clark.net.
+    echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
+echo "configure:6968: checking for gethostbyname" >&5
+if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 6973 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char gethostbyname(); below.  */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char gethostbyname();
+
+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_gethostbyname) || defined (__stub___gethostbyname)
+choke me
+#else
+gethostbyname();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:6996: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_func_gethostbyname=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_func_gethostbyname=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'gethostbyname`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  :
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+    if test $ac_cv_func_gethostbyname = no; then
+      echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
+echo "configure:7017: checking for gethostbyname in -lnsl" >&5
+ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-lnsl  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 7025 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char gethostbyname();
+
+int main() {
+gethostbyname()
+; return 0; }
+EOF
+if { (eval echo configure:7036: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+    fi
+
+    # lieder@skyler.mavd.honeywell.com says without -lsocket,
+    # socket/setsockopt and other routines are undefined under SCO ODT
+    # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
+    # on later versions), says simon@lia.di.epfl.ch: it contains
+    # gethostby* 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 $ac_n "checking for connect""... $ac_c" 1>&6
+echo "configure:7066: checking for connect" >&5
+if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 7071 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char connect(); below.  */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char connect();
+
+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_connect) || defined (__stub___connect)
+choke me
+#else
+connect();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:7094: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_func_connect=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_func_connect=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'connect`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  :
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+    if test $ac_cv_func_connect = no; then
+      echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6
+echo "configure:7115: checking for connect in -lsocket" >&5
+ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
   ac_save_LIBS="$LIBS"
   ac_save_LIBS="$LIBS"
-LIBS="-ldnet  $LIBS"
+LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
 cat > conftest.$ac_ext <<EOF
 cat > conftest.$ac_ext <<EOF
-#line 6008 "configure"
+#line 7123 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
     builtin and then its argument prototype would still apply.  */
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
     builtin and then its argument prototype would still apply.  */
-char dnet_ntoa();
+char connect();
 
 int main() {
 
 int main() {
-dnet_ntoa()
+connect()
 ; return 0; }
 EOF
 ; return 0; }
 EOF
-if { (eval echo configure:6019: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7134: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6030,33 +7145,228 @@ LIBS="$ac_save_LIBS"
 fi
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
 fi
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-  X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
+  X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
 else
   echo "$ac_t""no" 1>&6
 fi
 
 else
   echo "$ac_t""no" 1>&6
 fi
 
-    if test $ac_cv_lib_dnet_dnet_ntoa = no; then
-      echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6
-echo "configure:6041: checking for dnet_ntoa in -ldnet_stub" >&5
-ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'`
+    fi
+
+    # gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX.
+    echo $ac_n "checking for remove""... $ac_c" 1>&6
+echo "configure:7158: checking for remove" >&5
+if eval "test \"`echo '$''{'ac_cv_func_remove'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 7163 "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.  */
+/* 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() {
+
+/* 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
+remove();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:7186: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_func_remove=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_func_remove=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'remove`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  :
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+    if test $ac_cv_func_remove = no; then
+      echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6
+echo "configure:7207: checking for remove in -lposix" >&5
+ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-lposix  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 7215 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char remove();
+
+int main() {
+remove()
+; return 0; }
+EOF
+if { (eval echo configure:7226: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+    fi
+
+    # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
+    echo $ac_n "checking for shmat""... $ac_c" 1>&6
+echo "configure:7250: checking for shmat" >&5
+if eval "test \"`echo '$''{'ac_cv_func_shmat'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 7255 "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.  */
+/* 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() {
+
+/* 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
+shmat();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:7278: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_func_shmat=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_func_shmat=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'shmat`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  :
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+    if test $ac_cv_func_shmat = no; then
+      echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6
+echo "configure:7299: checking for shmat in -lipc" >&5
+ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-lipc  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 7307 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char shmat();
+
+int main() {
+shmat()
+; return 0; }
+EOF
+if { (eval echo configure:7318: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+    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.
+  #  --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
+  echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>&6
+echo "configure:7351: checking for IceConnectionNumber in -lICE" >&5
+ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_save_LIBS="$LIBS"
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_save_LIBS="$LIBS"
-LIBS="-ldnet_stub  $LIBS"
+LIBS="-lICE $X_EXTRA_LIBS $LIBS"
 cat > conftest.$ac_ext <<EOF
 cat > conftest.$ac_ext <<EOF
-#line 6049 "configure"
+#line 7359 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
     builtin and then its argument prototype would still apply.  */
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
     builtin and then its argument prototype would still apply.  */
-char dnet_ntoa();
+char IceConnectionNumber();
 
 int main() {
 
 int main() {
-dnet_ntoa()
+IceConnectionNumber()
 ; return 0; }
 EOF
 ; return 0; }
 EOF
-if { (eval echo configure:6060: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7370: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6071,89 +7381,305 @@ LIBS="$ac_save_LIBS"
 fi
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
 fi
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-  X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
+  X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
 else
   echo "$ac_t""no" 1>&6
 fi
 
 else
   echo "$ac_t""no" 1>&6
 fi
 
-    fi
+  LDFLAGS="$ac_save_LDFLAGS"
 
 
-    # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
-    # to get the SysV transport functions.
-    # chad@anasazi.com says the Pyramis MIS-ES running DC/OSx (SVR4)
-    # needs -lnsl.
-    # The nsl library prevents programs from opening the X display
-    # on Irix 5.2, according to dickey@clark.net.
-    echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
-echo "configure:6089: checking for gethostbyname" >&5
-if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+fi
+
+
+cf_x_athena=${cf_x_athena-Xaw}
+
+echo $ac_n "checking if you want to link with Xaw 3d library""... $ac_c" 1>&6
+echo "configure:7398: checking if you want to link with Xaw 3d library" >&5
+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 "$ac_t""yes" 1>&6
 else
 else
-  cat > conftest.$ac_ext <<EOF
-#line 6094 "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char gethostbyname(); below.  */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char gethostbyname();
+       echo "$ac_t""no" 1>&6
+fi
 
 
-int main() {
+echo $ac_n "checking if you want to link with neXT Athena library""... $ac_c" 1>&6
+echo "configure:7415: checking if you want to link with neXT Athena library" >&5
+withval=
 
 
-/* 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_gethostbyname) || defined (__stub___gethostbyname)
-choke me
-#else
-gethostbyname();
-#endif
+# Check whether --with-neXtaw or --without-neXtaw was given.
+if test "${with_neXtaw+set}" = set; then
+  withval="$with_neXtaw"
+  :
+fi
 
 
-; return 0; }
-EOF
-if { (eval echo configure:6117: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_func_gethostbyname=yes"
+if test "$withval" = yes ; then
+       cf_x_athena=neXtaw
+       echo "$ac_t""yes" 1>&6
 else
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_func_gethostbyname=no"
+       echo "$ac_t""no" 1>&6
 fi
 fi
-rm -f conftest*
+
+echo $ac_n "checking if you want to link with Athena-Plus library""... $ac_c" 1>&6
+echo "configure:7432: checking if you want to link with Athena-Plus library" >&5
+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 "$ac_t""yes" 1>&6
+else
+       echo "$ac_t""no" 1>&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 "$PKG_CONFIG" --exists $cf_athena_pkg; then
+                       test -n "$verbose" && echo "    found package $cf_athena_pkg" 1>&6
+
+echo "${as_me-configure}:7463: testing found package $cf_athena_pkg ..." 1>&5
+
+
+                       cf_x_athena_inc="`$PKG_CONFIG --cflags $cf_athena_pkg 2>/dev/null`"
+                       cf_x_athena_lib="`$PKG_CONFIG --libs   $cf_athena_pkg 2>/dev/null`"
+                       
+cf_fix_cppflags=no
+cf_new_cflags=
+cf_new_cppflags=
+cf_new_extra_cppflags=
+
+for cf_add_cflags in $cf_x_athena_inc
+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_x_athena_lib $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
+
+                       break
+               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}:7572: 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`"
+       
+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
 
 fi
 
-if eval "test \"`echo '$ac_cv_func_'gethostbyname`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  :
-else
-  echo "$ac_t""no" 1>&6
-fi
 
 
-    if test $ac_cv_func_gethostbyname = no; then
-      echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
-echo "configure:6138: checking for gethostbyname in -lnsl" >&5
-ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`
+
+
+       LIBS="$cf_pkgconfig_libs $LIBS"
+       :
+else
+       
+       echo $ac_n "checking for XextCreateExtension in -lXext""... $ac_c" 1>&6
+echo "configure:7664: checking for XextCreateExtension in -lXext" >&5
+ac_lib_var=`echo Xext'_'XextCreateExtension | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_save_LIBS="$LIBS"
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_save_LIBS="$LIBS"
-LIBS="-lnsl  $LIBS"
+LIBS="-lXext  $LIBS"
 cat > conftest.$ac_ext <<EOF
 cat > conftest.$ac_ext <<EOF
-#line 6146 "configure"
+#line 7672 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
     builtin and then its argument prototype would still apply.  */
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
     builtin and then its argument prototype would still apply.  */
-char gethostbyname();
+char XextCreateExtension();
 
 int main() {
 
 int main() {
-gethostbyname()
+XextCreateExtension()
 ; return 0; }
 EOF
 ; return 0; }
 EOF
-if { (eval echo configure:6157: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7683: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6168,182 +7694,324 @@ LIBS="$ac_save_LIBS"
 fi
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
 fi
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-  X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
+  LIBS="-lXext $LIBS"
 else
   echo "$ac_t""no" 1>&6
 fi
 
 else
   echo "$ac_t""no" 1>&6
 fi
 
-    fi
+fi
 
 
-    # lieder@skyler.mavd.honeywell.com says without -lsocket,
-    # socket/setsockopt and other routines are undefined under SCO ODT
-    # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
-    # on later versions), says simon@lia.di.epfl.ch: it contains
-    # gethostby* 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 $ac_n "checking for connect""... $ac_c" 1>&6
-echo "configure:6187: checking for connect" >&5
-if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 6192 "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char connect(); below.  */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char connect();
 
 
-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_connect) || defined (__stub___connect)
-choke me
-#else
-connect();
-#endif
 
 
-; return 0; }
-EOF
-if { (eval echo configure:6215: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_func_connect=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_func_connect=no"
+
+cf_have_X_LIBS=no
+
+
+
+
+if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
+       test -n "$verbose" && echo "    found package xt" 1>&6
+
+echo "${as_me-configure}:7718: testing found package xt ..." 1>&5
+
+
+       cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
+       cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
+       
+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
 fi
-rm -f conftest*
+
+if test -n "$cf_new_cppflags" ; then
+       
+       CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
 fi
 
 fi
 
-if eval "test \"`echo '$ac_cv_func_'connect`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  :
-else
-  echo "$ac_t""no" 1>&6
+if test -n "$cf_new_extra_cppflags" ; then
+       
+       EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
 fi
 
 fi
 
-    if test $ac_cv_func_connect = no; then
-      echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6
-echo "configure:6236: checking for connect in -lsocket" >&5
-ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+
+
+
+       LIBS="$cf_pkgconfig_libs $LIBS"
+       
+       cf_have_X_LIBS=yes
+
 else
 else
-  ac_save_LIBS="$LIBS"
-LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
+       
+
+       LDFLAGS="$X_LIBS $LDFLAGS"
+       
+test -n "$verbose" && echo "   checking additions to CFLAGS" 1>&6
+
+echo "${as_me-configure}:7816: testing checking additions to CFLAGS ..." 1>&5
+
+
+cf_check_cflags="$CFLAGS"
+cf_check_cppflags="$CPPFLAGS"
+
+cf_fix_cppflags=no
+cf_new_cflags=
+cf_new_cppflags=
+cf_new_extra_cppflags=
+
+for cf_add_cflags in $X_CFLAGS
+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
+       test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
+
+echo "${as_me-configure}:7888: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
+
+
+       CFLAGS="$CFLAGS $cf_new_cflags"
+fi
+
+if test -n "$cf_new_cppflags" ; then
+       test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
+
+echo "${as_me-configure}:7897: 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}:7906: 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 <<EOF
 cat > conftest.$ac_ext <<EOF
-#line 6244 "configure"
+#line 7917 "configure"
 #include "confdefs.h"
 #include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char connect();
-
+#include <stdio.h>
 int main() {
 int main() {
-connect()
+printf("Hello world");
 ; return 0; }
 EOF
 ; return 0; }
 EOF
-if { (eval echo configure:6255: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+if { (eval echo configure:7924: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  :
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
+  test -n "$verbose" && echo " test-compile failed.  Undoing change to \$CFLAGS" 1>&6
+
+echo "${as_me-configure}:7932: 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}:7938: testing but keeping change to \$CPPFLAGS ..." 1>&5
+
 
 
+        fi
+        CFLAGS="$cf_check_flags"
 fi
 fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
-else
-  echo "$ac_t""no" 1>&6
+rm -f conftest*
 fi
 
 fi
 
-    fi
 
 
-    # gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX.
-    echo $ac_n "checking for remove""... $ac_c" 1>&6
-echo "configure:6279: checking for remove" >&5
-if eval "test \"`echo '$''{'ac_cv_func_remove'+set}'`\" = set"; then
+       echo $ac_n "checking for XOpenDisplay""... $ac_c" 1>&6
+echo "configure:7949: checking for XOpenDisplay" >&5
+if eval "test \"`echo '$''{'ac_cv_func_XOpenDisplay'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6284 "configure"
+#line 7954 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char remove(); below.  */
+    which can conflict with char XOpenDisplay(); below.  */
 #include <assert.h>
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
     builtin and then its argument prototype would still apply.  */
 #include <assert.h>
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
     builtin and then its argument prototype would still apply.  */
-char remove();
+char XOpenDisplay();
 
 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.  */
 
 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)
+#if defined (__stub_XOpenDisplay) || defined (__stub___XOpenDisplay)
 choke me
 #else
 choke me
 #else
-remove();
+XOpenDisplay();
 #endif
 
 ; return 0; }
 EOF
 #endif
 
 ; return 0; }
 EOF
-if { (eval echo configure:6307: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7977: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   rm -rf conftest*
-  eval "ac_cv_func_remove=yes"
+  eval "ac_cv_func_XOpenDisplay=yes"
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  eval "ac_cv_func_remove=no"
+  eval "ac_cv_func_XOpenDisplay=no"
 fi
 rm -f conftest*
 fi
 
 fi
 rm -f conftest*
 fi
 
-if eval "test \"`echo '$ac_cv_func_'remove`\" = yes"; then
+if eval "test \"`echo '$ac_cv_func_'XOpenDisplay`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   :
 else
   echo "$ac_t""no" 1>&6
   echo "$ac_t""yes" 1>&6
   :
 else
   echo "$ac_t""no" 1>&6
-fi
 
 
-    if test $ac_cv_func_remove = no; then
-      echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6
-echo "configure:6328: checking for remove in -lposix" >&5
-ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'`
+       echo $ac_n "checking for XOpenDisplay in -lX11""... $ac_c" 1>&6
+echo "configure:7996: checking for XOpenDisplay in -lX11" >&5
+ac_lib_var=`echo X11'_'XOpenDisplay | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_save_LIBS="$LIBS"
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_save_LIBS="$LIBS"
-LIBS="-lposix  $LIBS"
+LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
 cat > conftest.$ac_ext <<EOF
 cat > conftest.$ac_ext <<EOF
-#line 6336 "configure"
+#line 8004 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
     builtin and then its argument prototype would still apply.  */
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
     builtin and then its argument prototype would still apply.  */
-char remove();
+char XOpenDisplay();
 
 int main() {
 
 int main() {
-remove()
+XOpenDisplay()
 ; return 0; }
 EOF
 ; return 0; }
 EOF
-if { (eval echo configure:6347: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8015: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6358,84 +8026,82 @@ LIBS="$ac_save_LIBS"
 fi
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
 fi
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-  X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
+  LIBS="-lX11 $LIBS"
 else
   echo "$ac_t""no" 1>&6
 fi
 
 else
   echo "$ac_t""no" 1>&6
 fi
 
-    fi
+fi
 
 
-    # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
-    echo $ac_n "checking for shmat""... $ac_c" 1>&6
-echo "configure:6371: checking for shmat" >&5
-if eval "test \"`echo '$''{'ac_cv_func_shmat'+set}'`\" = set"; then
+
+       echo $ac_n "checking for XtAppInitialize""... $ac_c" 1>&6
+echo "configure:8039: checking for XtAppInitialize" >&5
+if eval "test \"`echo '$''{'ac_cv_func_XtAppInitialize'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6376 "configure"
+#line 8044 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char shmat(); below.  */
+    which can conflict with char XtAppInitialize(); below.  */
 #include <assert.h>
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
     builtin and then its argument prototype would still apply.  */
 #include <assert.h>
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
     builtin and then its argument prototype would still apply.  */
-char shmat();
+char XtAppInitialize();
 
 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.  */
 
 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)
+#if defined (__stub_XtAppInitialize) || defined (__stub___XtAppInitialize)
 choke me
 #else
 choke me
 #else
-shmat();
+XtAppInitialize();
 #endif
 
 ; return 0; }
 EOF
 #endif
 
 ; return 0; }
 EOF
-if { (eval echo configure:6399: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8067: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   rm -rf conftest*
-  eval "ac_cv_func_shmat=yes"
+  eval "ac_cv_func_XtAppInitialize=yes"
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  eval "ac_cv_func_shmat=no"
+  eval "ac_cv_func_XtAppInitialize=no"
 fi
 rm -f conftest*
 fi
 
 fi
 rm -f conftest*
 fi
 
-if eval "test \"`echo '$ac_cv_func_'shmat`\" = yes"; then
+if eval "test \"`echo '$ac_cv_func_'XtAppInitialize`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   :
 else
   echo "$ac_t""no" 1>&6
   echo "$ac_t""yes" 1>&6
   :
 else
   echo "$ac_t""no" 1>&6
-fi
 
 
-    if test $ac_cv_func_shmat = no; then
-      echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6
-echo "configure:6420: checking for shmat in -lipc" >&5
-ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'`
+       echo $ac_n "checking for XtAppInitialize in -lXt""... $ac_c" 1>&6
+echo "configure:8086: checking for XtAppInitialize in -lXt" >&5
+ac_lib_var=`echo Xt'_'XtAppInitialize | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_save_LIBS="$LIBS"
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_save_LIBS="$LIBS"
-LIBS="-lipc  $LIBS"
+LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
 cat > conftest.$ac_ext <<EOF
 cat > conftest.$ac_ext <<EOF
-#line 6428 "configure"
+#line 8094 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
     builtin and then its argument prototype would still apply.  */
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
     builtin and then its argument prototype would still apply.  */
-char shmat();
+char XtAppInitialize();
 
 int main() {
 
 int main() {
-shmat()
+XtAppInitialize()
 ; return 0; }
 EOF
 ; return 0; }
 EOF
-if { (eval echo configure:6439: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8105: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6450,80 +8116,213 @@ LIBS="$ac_save_LIBS"
 fi
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
 fi
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-  X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
+  cat >> confdefs.h <<\EOF
+#define HAVE_LIBXT 1
+EOF
+
+                cf_have_X_LIBS=Xt
+                LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS"
 else
   echo "$ac_t""no" 1>&6
 fi
 
 else
   echo "$ac_t""no" 1>&6
 fi
 
-    fi
-  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.
-  #  --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
-  echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>&6
-echo "configure:6472: checking for IceConnectionNumber in -lICE" >&5
-ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+
+fi
+
+
+if test $cf_have_X_LIBS = no ; then
+       echo "configure: 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." 1>&2
+fi
+
+       
+cf_x_athena_root=$cf_x_athena
+cf_x_athena_inc=""
+
+for cf_path in default \
+       /usr/contrib/X11R6 \
+       /usr/contrib/X11R5 \
+       /usr/lib/X11R5 \
+       /usr/local
+do
+       if test -z "$cf_x_athena_inc" ; then
+               cf_save="$CPPFLAGS"
+               cf_test=X11/$cf_x_athena_root/SimpleMenu.h
+               if test $cf_path != default ; then
+                       CPPFLAGS="$cf_save -I$cf_path/include"
+                       echo $ac_n "checking for $cf_test in $cf_path""... $ac_c" 1>&6
+echo "configure:8158: checking for $cf_test in $cf_path" >&5
+               else
+                       echo $ac_n "checking for $cf_test""... $ac_c" 1>&6
+echo "configure:8161: checking for $cf_test" >&5
+               fi
+               cat > conftest.$ac_ext <<EOF
+#line 8164 "configure"
+#include "confdefs.h"
+
+#include <X11/Intrinsic.h>
+#include <$cf_test>
+int main() {
+
+; return 0; }
+EOF
+if { (eval echo configure:8173: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  cf_result=yes
 else
 else
-  ac_save_LIBS="$LIBS"
-LIBS="-lICE $X_EXTRA_LIBS $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 6480 "configure"
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  cf_result=no
+fi
+rm -f conftest*
+               echo "$ac_t""$cf_result" 1>&6
+               if test "$cf_result" = yes ; then
+                       cf_x_athena_inc=$cf_path
+                       break
+               else
+                       CPPFLAGS="$cf_save"
+               fi
+       fi
+done
+
+if test -z "$cf_x_athena_inc" ; then
+       echo "configure: warning: Unable to successfully find Athena header files with test program" 1>&2
+elif test "$cf_x_athena_inc" != default ; then
+       CPPFLAGS="$CPPFLAGS -I$cf_x_athena_inc"
+fi
+
+       
+cf_x_athena_root=$cf_x_athena
+cf_x_athena_lib=""
+
+for cf_path in default \
+       /usr/contrib/X11R6 \
+       /usr/contrib/X11R5 \
+       /usr/lib/X11R5 \
+       /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"
+       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 $ac_n "checking for $cf_lib in $cf_path""... $ac_c" 1>&6
+echo "configure:8220: checking for $cf_lib in $cf_path" >&5
+                       else
+                               LIBS="$cf_lib $LIBS"
+                               echo $ac_n "checking for $cf_test in $cf_lib""... $ac_c" 1>&6
+echo "configure:8224: checking for $cf_test in $cf_lib" >&5
+                       fi
+                       cat > conftest.$ac_ext <<EOF
+#line 8227 "configure"
 #include "confdefs.h"
 #include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char IceConnectionNumber();
 
 int main() {
 
 int main() {
-IceConnectionNumber()
+$cf_test()
 ; return 0; }
 EOF
 ; return 0; }
 EOF
-if { (eval echo configure:6491: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8234: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+  cf_result=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+  cf_result=no
 fi
 rm -f conftest*
 fi
 rm -f conftest*
-LIBS="$ac_save_LIBS"
+                       echo "$ac_t""$cf_result" 1>&6
+                       if test "$cf_result" = yes ; then
+                               cf_x_athena_lib="$cf_lib"
+                               break
+                       fi
+                       LIBS="$cf_save"
+               fi
+       done
+done
+
+if test -z "$cf_x_athena_lib" ; then
+       { echo "configure: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" 1>&2; exit 1; }
+fi
+
+
+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
+
+
+fi
+
+
+
 
 
+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 $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:8276: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_path_XCURSES_CONFIG'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  case "$XCURSES_CONFIG" in
+  /*)
+  ac_cv_path_XCURSES_CONFIG="$XCURSES_CONFIG" # Let the user override the test with a path.
+  ;;
+  ?:/*)                         
+  ac_cv_path_XCURSES_CONFIG="$XCURSES_CONFIG" # Let the user override the test with a dos path.
+  ;;
+  *)
+  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do 
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_path_XCURSES_CONFIG="$ac_dir/$ac_word"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+  ;;
+esac
 fi
 fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
+XCURSES_CONFIG="$ac_cv_path_XCURSES_CONFIG"
+if test -n "$XCURSES_CONFIG"; then
+  echo "$ac_t""$XCURSES_CONFIG" 1>&6
 else
   echo "$ac_t""no" 1>&6
 fi
 
 else
   echo "$ac_t""no" 1>&6
 fi
 
-  LDFLAGS="$ac_save_LDFLAGS"
-
-fi
-
+test -n "$XCURSES_CONFIG" && break
+done
+test -n "$XCURSES_CONFIG" || XCURSES_CONFIG="none"
 
 
 
 
+if test "$XCURSES_CONFIG" != none ; then
 
 
+CPPFLAGS="$CPPFLAGS `$XCURSES_CONFIG --cflags`"
+LIBS="`$XCURSES_CONFIG --libs` $LIBS"
 
 
-# SYSTEM_NAME=`echo "$cf_cv_system_name"|tr ' ' -`
+cf_cv_lib_XCurses=yes
 
 
-cf_have_X_LIBS=no
+else
 
 
-LDFLAGS="$X_LIBS $LDFLAGS"
+LDFLAGS="$LDFLAGS $X_LIBS"
 
 test -n "$verbose" && echo "   checking additions to CFLAGS" 1>&6
 
 
 test -n "$verbose" && echo "   checking additions to CFLAGS" 1>&6
 
-echo "${as_me-configure}:6527: testing checking additions to CFLAGS ..." 1>&5
+echo "${as_me-configure}:8326: testing checking additions to CFLAGS ..." 1>&5
 
 
 cf_check_cflags="$CFLAGS"
 
 
 cf_check_cflags="$CFLAGS"
@@ -6545,8 +8344,8 @@ no)
                        cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
 
                        test "${cf_add_cflags}" != "${cf_tst_cflags}" \
                        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
+                               && 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"
 
                        if test $cf_fix_cppflags = yes ; then
                                cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
@@ -6561,6 +8360,16 @@ no)
                *$cf_add_cflags) #(vi
                        ;;
                *) #(vi
                *$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_cppflags="$cf_new_cppflags $cf_add_cflags"
                        ;;
                esac
@@ -6576,8 +8385,8 @@ yes)
        cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
 
        test "${cf_add_cflags}" != "${cf_tst_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
+               && test -z "${cf_tst_cflags}" \
+               && cf_fix_cppflags=no
        ;;
 esac
 done
        ;;
 esac
 done
@@ -6585,7 +8394,7 @@ done
 if test -n "$cf_new_cflags" ; then
        test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
 
 if test -n "$cf_new_cflags" ; then
        test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
 
-echo "${as_me-configure}:6589: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
+echo "${as_me-configure}:8398: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
 
 
        CFLAGS="$CFLAGS $cf_new_cflags"
 
 
        CFLAGS="$CFLAGS $cf_new_cflags"
@@ -6594,7 +8403,7 @@ fi
 if test -n "$cf_new_cppflags" ; then
        test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
 
 if test -n "$cf_new_cppflags" ; then
        test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
 
-echo "${as_me-configure}:6598: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
+echo "${as_me-configure}:8407: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
 
 
        CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
 
 
        CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
@@ -6603,7 +8412,7 @@ fi
 if test -n "$cf_new_extra_cppflags" ; then
        test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
 
 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}:6607: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
+echo "${as_me-configure}:8416: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
 
 
        EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
 
 
        EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
@@ -6614,14 +8423,14 @@ fi
 
 if test "$cf_check_cflags" != "$CFLAGS" ; then
 cat > conftest.$ac_ext <<EOF
 
 if test "$cf_check_cflags" != "$CFLAGS" ; then
 cat > conftest.$ac_ext <<EOF
-#line 6618 "configure"
+#line 8427 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 int main() {
 printf("Hello world");
 ; return 0; }
 EOF
 #include "confdefs.h"
 #include <stdio.h>
 int main() {
 printf("Hello world");
 ; return 0; }
 EOF
-if { (eval echo configure:6625: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8434: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   :
 else
   echo "configure: failed program was:" >&5
   :
 else
   echo "configure: failed program was:" >&5
@@ -6629,13 +8438,13 @@ else
   rm -rf conftest*
   test -n "$verbose" && echo " test-compile failed.  Undoing change to \$CFLAGS" 1>&6
 
   rm -rf conftest*
   test -n "$verbose" && echo " test-compile failed.  Undoing change to \$CFLAGS" 1>&6
 
-echo "${as_me-configure}:6633: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
+echo "${as_me-configure}:8442: 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
 
 
 
         if test "$cf_check_cppflags" != "$CPPFLAGS" ; then
                 test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
 
-echo "${as_me-configure}:6639: testing but keeping change to \$CPPFLAGS ..." 1>&5
+echo "${as_me-configure}:8448: testing but keeping change to \$CPPFLAGS ..." 1>&5
 
 
         fi
 
 
         fi
 rm -f conftest*
 fi
 
 rm -f conftest*
 fi
 
-
-echo $ac_n "checking for XOpenDisplay""... $ac_c" 1>&6
-echo "configure:6650: checking for XOpenDisplay" >&5
-if eval "test \"`echo '$''{'ac_cv_func_XOpenDisplay'+set}'`\" = set"; then
+echo $ac_n "checking for XOpenDisplay in -lX11""... $ac_c" 1>&6
+echo "configure:8458: checking for XOpenDisplay in -lX11" >&5
+ac_lib_var=`echo X11'_'XOpenDisplay | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 6655 "configure"
+  ac_save_LIBS="$LIBS"
+LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 8466 "configure"
 #include "confdefs.h"
 #include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char XOpenDisplay(); below.  */
-#include <assert.h>
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
     builtin and then its argument prototype would still apply.  */
 char XOpenDisplay();
 
 int main() {
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
     builtin and then its argument prototype would still apply.  */
 char XOpenDisplay();
 
 int main() {
+XOpenDisplay()
+; return 0; }
+EOF
+if { (eval echo configure:8477: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
 
 
-/* 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_XOpenDisplay) || defined (__stub___XOpenDisplay)
-choke me
-#else
-XOpenDisplay();
-#endif
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  LIBS="-lX11 $LIBS"
+else
+  echo "$ac_t""no" 1>&6
+fi
 
 
+echo $ac_n "checking for XCurses library""... $ac_c" 1>&6
+echo "configure:8498: checking for XCurses library" >&5
+if eval "test \"`echo '$''{'cf_cv_lib_XCurses'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+LIBS="-lXCurses $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 8505 "configure"
+#include "confdefs.h"
+
+#include <xcurses.h>
+char *XCursesProgramName = "test";
+
+int main() {
+XCursesExit();
 ; return 0; }
 EOF
 ; return 0; }
 EOF
-if { (eval echo configure:6678: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8515: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   rm -rf conftest*
-  eval "ac_cv_func_XOpenDisplay=yes"
+  cf_cv_lib_XCurses=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  eval "ac_cv_func_XOpenDisplay=no"
+  cf_cv_lib_XCurses=no
 fi
 rm -f conftest*
 fi
 rm -f conftest*
+
 fi
 
 fi
 
-if eval "test \"`echo '$ac_cv_func_'XOpenDisplay`\" = yes"; then
+echo "$ac_t""$cf_cv_lib_XCurses" 1>&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
+
+       cat >> confdefs.h <<\EOF
+#define HAVE_XCURSES 1
+EOF
+
+else
+       { echo "configure: error: Cannot link with XCurses" 1>&2; exit 1; }
+fi
+
+       ;;
+esac
+
+
+
+case $cf_cv_screen in #(vi
+pdcurses) #(vi
+       ;;
+*)
+       # look for curses-related libraries
+       echo $ac_n "checking for new_panel in -lpanel$cf_cv_libtype""... $ac_c" 1>&6
+echo "configure:8560: checking for new_panel in -lpanel$cf_cv_libtype" >&5
+ac_lib_var=`echo panel$cf_cv_libtype'_'new_panel | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-lpanel$cf_cv_libtype  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 8568 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char new_panel();
+
+int main() {
+new_panel()
+; return 0; }
+EOF
+if { (eval echo configure:8579: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   echo "$ac_t""yes" 1>&6
-  :
+    ac_tr_lib=HAVE_LIB`echo panel$cf_cv_libtype | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_lib 1
+EOF
+
+  LIBS="-lpanel$cf_cv_libtype $LIBS"
+
 else
   echo "$ac_t""no" 1>&6
 else
   echo "$ac_t""no" 1>&6
+fi
 
 
-echo $ac_n "checking for XOpenDisplay in -lX11""... $ac_c" 1>&6
-echo "configure:6697: checking for XOpenDisplay in -lX11" >&5
-ac_lib_var=`echo X11'_'XOpenDisplay | sed 'y%./+-%__p_%'`
+       echo $ac_n "checking for menu_driver in -lmenu$cf_cv_libtype""... $ac_c" 1>&6
+echo "configure:8607: checking for menu_driver in -lmenu$cf_cv_libtype" >&5
+ac_lib_var=`echo menu$cf_cv_libtype'_'menu_driver | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_save_LIBS="$LIBS"
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_save_LIBS="$LIBS"
-LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
+LIBS="-lmenu$cf_cv_libtype  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 8615 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char menu_driver();
+
+int main() {
+menu_driver()
+; return 0; }
+EOF
+if { (eval echo configure:8626: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_lib=HAVE_LIB`echo menu$cf_cv_libtype | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_lib 1
+EOF
+
+  LIBS="-lmenu$cf_cv_libtype $LIBS"
+
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+       echo $ac_n "checking for form_driver in -lform$cf_cv_libtype""... $ac_c" 1>&6
+echo "configure:8654: checking for form_driver in -lform$cf_cv_libtype" >&5
+ac_lib_var=`echo form$cf_cv_libtype'_'form_driver | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-lform$cf_cv_libtype  $LIBS"
 cat > conftest.$ac_ext <<EOF
 cat > conftest.$ac_ext <<EOF
-#line 6705 "configure"
+#line 8662 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char form_driver();
+
+int main() {
+form_driver()
+; return 0; }
+EOF
+if { (eval echo configure:8673: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_lib=HAVE_LIB`echo form$cf_cv_libtype | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_lib 1
+EOF
+
+  LIBS="-lform$cf_cv_libtype $LIBS"
+
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+
+       # look for curses-related headers
+       for ac_hdr in \
+               nc_alloc.h \
+               nomacros.h \
+               form.h \
+               menu.h \
+               panel.h \
+               
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:8712: checking for $ac_hdr" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 8717 "configure"
 #include "confdefs.h"
 #include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char XOpenDisplay();
-
-int main() {
-XOpenDisplay()
-; return 0; }
+#include <$ac_hdr>
 EOF
 EOF
-if { (eval echo configure:6716: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:8722: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
   rm -rf conftest*
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+  eval "ac_cv_header_$ac_safe=yes"
 else
 else
+  echo "$ac_err" >&5
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+  eval "ac_cv_header_$ac_safe=no"
 fi
 rm -f conftest*
 fi
 rm -f conftest*
-LIBS="$ac_save_LIBS"
-
 fi
 fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   echo "$ac_t""yes" 1>&6
-  LIBS="-lX11 $LIBS"
+    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
 else
   echo "$ac_t""no" 1>&6
 fi
 else
   echo "$ac_t""no" 1>&6
 fi
+done
 
 
-fi
-
+       ;;
+esac
 
 
-echo $ac_n "checking for XtAppInitialize""... $ac_c" 1>&6
-echo "configure:6740: checking for XtAppInitialize" >&5
-if eval "test \"`echo '$''{'ac_cv_func_XtAppInitialize'+set}'`\" = set"; then
+echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
+echo "configure:8752: checking return type of signal handlers" >&5
+if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6745 "configure"
+#line 8757 "configure"
 #include "confdefs.h"
 #include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char XtAppInitialize(); below.  */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char XtAppInitialize();
-
-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_XtAppInitialize) || defined (__stub___XtAppInitialize)
-choke me
+#include <sys/types.h>
+#include <signal.h>
+#ifdef signal
+#undef signal
+#endif
+#ifdef __cplusplus
+extern "C" void (*signal (int, void (*)(int)))(int);
 #else
 #else
-XtAppInitialize();
+void (*signal ()) ();
 #endif
 
 #endif
 
+int main() {
+int i;
 ; return 0; }
 EOF
 ; return 0; }
 EOF
-if { (eval echo configure:6768: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8774: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   rm -rf conftest*
-  eval "ac_cv_func_XtAppInitialize=yes"
+  ac_cv_type_signal=void
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  eval "ac_cv_func_XtAppInitialize=no"
+  ac_cv_type_signal=int
 fi
 rm -f conftest*
 fi
 
 fi
 rm -f conftest*
 fi
 
-if eval "test \"`echo '$ac_cv_func_'XtAppInitialize`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  :
-else
-  echo "$ac_t""no" 1>&6
+echo "$ac_t""$ac_cv_type_signal" 1>&6
+cat >> confdefs.h <<EOF
+#define RETSIGTYPE $ac_cv_type_signal
+EOF
 
 
-echo $ac_n "checking for XtAppInitialize in -lXt""... $ac_c" 1>&6
-echo "configure:6787: checking for XtAppInitialize in -lXt" >&5
-ac_lib_var=`echo Xt'_'XtAppInitialize | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+
+
+echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
+echo "configure:8794: checking for ANSI C header files" >&5
+if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  ac_save_LIBS="$LIBS"
-LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 6795 "configure"
+  cat > conftest.$ac_ext <<EOF
+#line 8799 "configure"
 #include "confdefs.h"
 #include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char XtAppInitialize();
-
-int main() {
-XtAppInitialize()
-; return 0; }
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
 EOF
 EOF
-if { (eval echo configure:6806: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:8807: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
   rm -rf conftest*
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+  ac_cv_header_stdc=yes
 else
 else
+  echo "$ac_err" >&5
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+  ac_cv_header_stdc=no
 fi
 rm -f conftest*
 fi
 rm -f conftest*
-LIBS="$ac_save_LIBS"
 
 
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  cat >> confdefs.h <<\EOF
-#define HAVE_LIBXT 1
+if test $ac_cv_header_stdc = yes; then
+  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+cat > conftest.$ac_ext <<EOF
+#line 8824 "configure"
+#include "confdefs.h"
+#include <string.h>
 EOF
 EOF
-
-        cf_have_X_LIBS=Xt
-        LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS"
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "memchr" >/dev/null 2>&1; then
+  :
 else
 else
-  echo "$ac_t""no" 1>&6
-fi
-
+  rm -rf conftest*
+  ac_cv_header_stdc=no
 fi
 fi
+rm -f conftest*
 
 
-
-if test $cf_have_X_LIBS = no ; then
-       echo "configure: 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." 1>&2
 fi
 
 fi
 
-
-cf_x_athena=${cf_x_athena-Xaw}
-
-echo $ac_n "checking if you want to link with Xaw 3d library""... $ac_c" 1>&6
-echo "configure:6844: checking if you want to link with Xaw 3d library" >&5
-withval=
-
-# Check whether --with-Xaw3d or --without-Xaw3d was given.
-if test "${with_Xaw3d+set}" = set; then
-  withval="$with_Xaw3d"
+if test $ac_cv_header_stdc = yes; then
+  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+cat > conftest.$ac_ext <<EOF
+#line 8842 "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "free" >/dev/null 2>&1; then
   :
   :
-fi
-
-if test "$withval" = yes ; then
-       cf_x_athena=Xaw3d
-       echo "$ac_t""yes" 1>&6
 else
 else
-       echo "$ac_t""no" 1>&6
-fi
-
-echo $ac_n "checking if you want to link with neXT Athena library""... $ac_c" 1>&6
-echo "configure:6861: checking if you want to link with neXT Athena library" >&5
-withval=
-
-# Check whether --with-neXtaw or --without-neXtaw was given.
-if test "${with_neXtaw+set}" = set; then
-  withval="$with_neXtaw"
-  :
+  rm -rf conftest*
+  ac_cv_header_stdc=no
 fi
 fi
+rm -f conftest*
 
 
-if test "$withval" = yes ; then
-       cf_x_athena=neXtaw
-       echo "$ac_t""yes" 1>&6
-else
-       echo "$ac_t""no" 1>&6
 fi
 
 fi
 
-echo $ac_n "checking if you want to link with Athena-Plus library""... $ac_c" 1>&6
-echo "configure:6878: checking if you want to link with Athena-Plus library" >&5
-withval=
-
-# Check whether --with-XawPlus or --without-XawPlus was given.
-if test "${with_XawPlus+set}" = set; then
-  withval="$with_XawPlus"
+if test $ac_cv_header_stdc = yes; then
+  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+if test "$cross_compiling" = yes; then
   :
   :
-fi
-
-if test "$withval" = yes ; then
-       cf_x_athena=XawPlus
-       echo "$ac_t""yes" 1>&6
-else
-       echo "$ac_t""no" 1>&6
-fi
-
-echo $ac_n "checking for XextCreateExtension in -lXext""... $ac_c" 1>&6
-echo "configure:6895: checking for XextCreateExtension in -lXext" >&5
-ac_lib_var=`echo Xext'_'XextCreateExtension | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
 else
 else
-  ac_save_LIBS="$LIBS"
-LIBS="-lXext  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 6903 "configure"
+  cat > conftest.$ac_ext <<EOF
+#line 8863 "configure"
 #include "confdefs.h"
 #include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char XextCreateExtension();
+#include <ctype.h>
+#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int main () { int i; for (i = 0; i < 256; i++)
+if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
+exit (0); }
 
 
-int main() {
-XextCreateExtension()
-; return 0; }
 EOF
 EOF
-if { (eval echo configure:6914: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+if { (eval echo configure:8874: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+  :
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+  rm -fr conftest*
+  ac_cv_header_stdc=no
+fi
+rm -fr conftest*
 fi
 fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
 
 fi
 
 fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  LIBS="-lXext $LIBS"
-else
-  echo "$ac_t""no" 1>&6
 fi
 
 fi
 
+echo "$ac_t""$ac_cv_header_stdc" 1>&6
+if test $ac_cv_header_stdc = yes; then
+  cat >> confdefs.h <<\EOF
+#define STDC_HEADERS 1
+EOF
 
 
-cf_x_athena_lib=""
-
-
-cf_x_athena_root=$cf_x_athena
-cf_x_athena_include=""
+fi
 
 
-for cf_path in default \
-       /usr/contrib/X11R6 \
-       /usr/contrib/X11R5 \
-       /usr/lib/X11R5 \
-       /usr/local
-do
-       if test -z "$cf_x_athena_include" ; then
-               cf_save="$CPPFLAGS"
-               cf_test=X11/$cf_x_athena_root/SimpleMenu.h
-               if test $cf_path != default ; then
-                       CPPFLAGS="$cf_save -I$cf_path/include"
-                       echo $ac_n "checking for $cf_test in $cf_path""... $ac_c" 1>&6
-echo "configure:6953: checking for $cf_test in $cf_path" >&5
-               else
-                       echo $ac_n "checking for $cf_test""... $ac_c" 1>&6
-echo "configure:6956: checking for $cf_test" >&5
-               fi
-               cat > conftest.$ac_ext <<EOF
-#line 6959 "configure"
+echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
+echo "configure:8898: checking whether time.h and sys/time.h may both be included" >&5
+if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 8903 "configure"
 #include "confdefs.h"
 #include "confdefs.h"
-
-#include <X11/Intrinsic.h>
-#include <$cf_test>
+#include <sys/types.h>
+#include <sys/time.h>
+#include <time.h>
 int main() {
 int main() {
-
+struct tm *tp;
 ; return 0; }
 EOF
 ; return 0; }
 EOF
-if { (eval echo configure:6968: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8912: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   rm -rf conftest*
-  cf_result=yes
+  ac_cv_header_time=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  cf_result=no
+  ac_cv_header_time=no
 fi
 rm -f conftest*
 fi
 rm -f conftest*
-               echo "$ac_t""$cf_result" 1>&6
-               if test "$cf_result" = yes ; then
-                       cf_x_athena_include=$cf_path
-                       break
-               else
-                       CPPFLAGS="$cf_save"
-               fi
-       fi
-done
-
-if test -z "$cf_x_athena_include" ; then
-       echo "configure: warning: Unable to successfully find Athena header files with test program" 1>&2
-elif test "$cf_x_athena_include" != default ; then
-       CPPFLAGS="$CPPFLAGS -I$cf_x_athena_include"
 fi
 
 fi
 
+echo "$ac_t""$ac_cv_header_time" 1>&6
+if test $ac_cv_header_time = yes; then
+  cat >> confdefs.h <<\EOF
+#define TIME_WITH_SYS_TIME 1
+EOF
 
 
-cf_x_athena_root=$cf_x_athena
-cf_x_athena_lib=""
+fi
+
+for ac_hdr in \
+getopt.h \
+locale.h \
+stdarg.h \
+sys/ioctl.h \
+sys/select.h \
+sys/time.h \
+termios.h \
+unistd.h \
 
 
-for cf_path in default \
-       /usr/contrib/X11R6 \
-       /usr/contrib/X11R5 \
-       /usr/lib/X11R5 \
-       /usr/local
 do
 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"
-       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 $ac_n "checking for $cf_lib in $cf_path""... $ac_c" 1>&6
-echo "configure:7015: checking for $cf_lib in $cf_path" >&5
-                       else
-                               LIBS="$cf_lib $LIBS"
-                               echo $ac_n "checking for $cf_test in $cf_lib""... $ac_c" 1>&6
-echo "configure:7019: checking for $cf_test in $cf_lib" >&5
-                       fi
-                       cat > conftest.$ac_ext <<EOF
-#line 7022 "configure"
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:8945: checking for $ac_hdr" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 8950 "configure"
 #include "confdefs.h"
 #include "confdefs.h"
-
-int main() {
-$cf_test()
-; return 0; }
+#include <$ac_hdr>
 EOF
 EOF
-if { (eval echo configure:7029: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:8955: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
   rm -rf conftest*
   rm -rf conftest*
-  cf_result=yes
+  eval "ac_cv_header_$ac_safe=yes"
 else
 else
+  echo "$ac_err" >&5
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  cf_result=no
+  eval "ac_cv_header_$ac_safe=no"
 fi
 rm -f conftest*
 fi
 rm -f conftest*
-                       echo "$ac_t""$cf_result" 1>&6
-                       if test "$cf_result" = yes ; then
-                               cf_x_athena_lib="$cf_lib"
-                               break
-                       fi
-                       LIBS="$cf_save"
-               fi
-       done
-done
-
-if test -z "$cf_x_athena_lib" ; then
-       { echo "configure: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" 1>&2; exit 1; }
 fi
 fi
-
-
-cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
-
-cat >> confdefs.h <<EOF
-#define $cf_x_athena_LIBS 1
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
 EOF
 EOF
-
-
-
-
-
-
-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 $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:7070: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_XCURSES_CONFIG'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  case "$XCURSES_CONFIG" in
-  /*)
-  ac_cv_path_XCURSES_CONFIG="$XCURSES_CONFIG" # Let the user override the test with a path.
-  ;;
-  ?:/*)                         
-  ac_cv_path_XCURSES_CONFIG="$XCURSES_CONFIG" # Let the user override the test with a dos path.
-  ;;
-  *)
-  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS=":"
-  ac_dummy="$PATH"
-  for ac_dir in $ac_dummy; do 
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$ac_word; then
-      ac_cv_path_XCURSES_CONFIG="$ac_dir/$ac_word"
-      break
-    fi
-  done
-  IFS="$ac_save_ifs"
-  ;;
-esac
-fi
-XCURSES_CONFIG="$ac_cv_path_XCURSES_CONFIG"
-if test -n "$XCURSES_CONFIG"; then
-  echo "$ac_t""$XCURSES_CONFIG" 1>&6
 else
   echo "$ac_t""no" 1>&6
 fi
 else
   echo "$ac_t""no" 1>&6
 fi
-
-test -n "$XCURSES_CONFIG" && break
 done
 done
-test -n "$XCURSES_CONFIG" || XCURSES_CONFIG="none"
-
-
-if test "$XCURSES_CONFIG" != none ; then
-
-CPPFLAGS="$CPPFLAGS `$XCURSES_CONFIG --cflags`"
-LIBS="`$XCURSES_CONFIG --libs` $LIBS"
-
-cf_cv_lib_XCurses=yes
-
-else
-
-LDFLAGS="$LDFLAGS $X_LIBS"
-
-test -n "$verbose" && echo "   checking additions to CFLAGS" 1>&6
-
-echo "${as_me-configure}:7120: testing checking additions to CFLAGS ..." 1>&5
 
 
 
 
-cf_check_cflags="$CFLAGS"
-cf_check_cppflags="$CPPFLAGS"
-
-cf_fix_cppflags=no
-cf_new_cflags=
-cf_new_cppflags=
-cf_new_extra_cppflags=
+for ac_func in \
+gettimeofday \
+mblen \
+mbrlen \
+mbrtowc \
+mbsrtowcs \
+mbstowcs \
+mbtowc \
+strdup \
+wcsrtombs \
+wcstombs \
 
 
-for cf_add_cflags in $X_CFLAGS
 do
 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 $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:8996: checking for $ac_func" >&5
+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 9001 "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.  */
+/* 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();
 
 
-                       test "${cf_add_cflags}" != "${cf_tst_cflags}" \
-                       && test -z "${cf_tst_cflags}" \
-                       && cf_fix_cppflags=yes
+int main() {
 
 
-                       if test $cf_fix_cppflags = yes ; then
-                               cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
-                               continue
-                       elif test "${cf_tst_cflags}" = "\"'" ; then
-                               cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
-                               continue
-                       fi
-                       ;;
-               esac
-               case "$CPPFLAGS" in
-               *$cf_add_cflags) #(vi
-                       ;;
-               *) #(vi
-                       cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
-                       ;;
-               esac
-               ;;
-       *)
-               cf_new_cflags="$cf_new_cflags $cf_add_cflags"
-               ;;
-       esac
-       ;;
-yes)
-       cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+/* 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
+$ac_func();
+#endif
 
 
-       cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
+; return 0; }
+EOF
+if { (eval echo configure:9024: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_func_$ac_func=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
 
 
-       test "${cf_add_cflags}" != "${cf_tst_cflags}" \
-       && test -z "${cf_tst_cflags}" \
-       && cf_fix_cppflags=no
-       ;;
-esac
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+else
+  echo "$ac_t""no" 1>&6
+fi
 done
 
 done
 
-if test -n "$cf_new_cflags" ; then
-       test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
-
-echo "${as_me-configure}:7182: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
 
 
 
 
-       CFLAGS="$CFLAGS $cf_new_cflags"
-fi
+echo $ac_n "checking if we must define _XOPEN_SOURCE_EXTENDED""... $ac_c" 1>&6
+echo "configure:9051: checking if we must define _XOPEN_SOURCE_EXTENDED" >&5
+if eval "test \"`echo '$''{'cf_cv_need_xopen_extension'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+cat > conftest.$ac_ext <<EOF
+#line 9057 "configure"
+#include "confdefs.h"
 
 
-if test -n "$cf_new_cppflags" ; then
-       test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
+#include <stdlib.h>
+#include <${cf_cv_ncurses_header-curses.h}>
+int main() {
 
 
-echo "${as_me-configure}:7191: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
+#if defined(NCURSES_VERSION_PATCH)
+if (NCURSES_VERSION_PATCH < 20100501) && (NCURSES_VERSION_PATCH >= 20100403)
+       make an error
+#endif
+#endif
+       long x = winnstr(stdscr, "", 0);
+       int x1, y1;
+       getbegyx(stdscr, y1, x1)
+; return 0; }
+EOF
+if { (eval echo configure:9074: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  cf_cv_need_xopen_extension=no
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  cat > conftest.$ac_ext <<EOF
+#line 9082 "configure"
+#include "confdefs.h"
 
 
+#define _XOPEN_SOURCE_EXTENDED
+#include <stdlib.h>
+#include <${cf_cv_ncurses_header-curses.h}>
+int main() {
 
 
-       CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
+#ifdef NCURSES_VERSION
+       cchar_t check;
+       int check2 = curs_set((int)sizeof(check));
+#endif
+       long x = winnstr(stdscr, "", 0);
+       int x1, y1;
+       getbegyx(stdscr, y1, x1)
+; return 0; }
+EOF
+if { (eval echo configure:9099: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  cf_cv_need_xopen_extension=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  cf_cv_need_xopen_extension=unknown
+fi
+rm -f conftest*
+fi
+rm -f conftest*
 fi
 
 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}:7200: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
+echo "$ac_t""$cf_cv_need_xopen_extension" 1>&6
+test $cf_cv_need_xopen_extension = yes && CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED"
 
 
 
 
-       EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
-fi
 
 
+echo $ac_n "checking for term.h""... $ac_c" 1>&6
+echo "configure:9119: checking for term.h" >&5
+if eval "test \"`echo '$''{'cf_cv_term_header'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+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
+do
+       cat > conftest.$ac_ext <<EOF
+#line 9132 "configure"
+#include "confdefs.h"
 
 
+#include <${cf_cv_ncurses_header-curses.h}>
+#include <${cf_header}>
+int main() {
+WINDOW *x
+; return 0; }
+EOF
+if { (eval echo configure:9141: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  cf_cv_term_header=$cf_header
+        break
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  cf_cv_term_header=no
+fi
+rm -f conftest*
+done
 
 
-if test "$cf_check_cflags" != "$CFLAGS" ; then
-cat > conftest.$ac_ext <<EOF
-#line 7211 "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 <<EOF
+#line 9161 "configure"
 #include "confdefs.h"
 #include "confdefs.h"
-#include <stdio.h>
+
+#include <${cf_cv_ncurses_header-curses.h}>
+#ifdef NCURSES_VERSION
+#include <${cf_header}>
+#else
+make an error
+#endif
 int main() {
 int main() {
-printf("Hello world");
+WINDOW *x
 ; return 0; }
 EOF
 ; return 0; }
 EOF
-if { (eval echo configure:7218: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  :
+if { (eval echo configure:9174: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  cf_cv_term_header=$cf_header
+                        break
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  test -n "$verbose" && echo " test-compile failed.  Undoing change to \$CFLAGS" 1>&6
+  cf_cv_term_header=no
+fi
+rm -f conftest*
+       done
+       ;;
+esac
 
 
-echo "${as_me-configure}:7226: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
+fi
 
 
+echo "$ac_t""$cf_cv_term_header" 1>&6
 
 
-        if test "$cf_check_cppflags" != "$CPPFLAGS" ; then
-                test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
+case $cf_cv_term_header in #(vi
+term.h) #(vi
+       cat >> confdefs.h <<\EOF
+#define HAVE_TERM_H 1
+EOF
 
 
-echo "${as_me-configure}:7232: testing but keeping change to \$CPPFLAGS ..." 1>&5
+       ;;
+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
 
 
-        fi
-        CFLAGS="$cf_check_flags"
-fi
-rm -f conftest*
-fi
+       ;;
+esac
 
 
-echo $ac_n "checking for XOpenDisplay in -lX11""... $ac_c" 1>&6
-echo "configure:7242: checking for XOpenDisplay in -lX11" >&5
-ac_lib_var=`echo X11'_'XOpenDisplay | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+
+
+
+for cf_func in \
+chgat \
+color_set \
+filter \
+getbegx \
+getcurx \
+getmaxx \
+getnstr \
+getparx \
+getwin \
+mvvline \
+mvwvline \
+napms \
+putwin \
+resize_term \
+resizeterm \
+ripoffline \
+setupterm \
+slk_color \
+slk_init \
+termattrs \
+tgetent \
+tigetnum \
+tigetstr \
+typeahead \
+use_default_colors \
+vw_printw \
+vsscanf \
+wchgat \
+winsstr \
+wresize \
+
+do
+       
+cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
+
+       echo $ac_n "checking for ${cf_func}""... $ac_c" 1>&6
+echo "configure:9254: checking for ${cf_func}" >&5
+       
+echo "${as_me-configure}:9256: testing ${cf_func} ..." 1>&5
+
+       if eval "test \"`echo '$''{'cf_cv_func_$cf_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  ac_save_LIBS="$LIBS"
-LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 7250 "configure"
+  
+               eval cf_result='$ac_cv_func_'$cf_func
+               if test ".$cf_result" != ".no"; then
+                       cat > conftest.$ac_ext <<EOF
+#line 9265 "configure"
 #include "confdefs.h"
 #include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char XOpenDisplay();
+
+#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() {
 
 int main() {
-XOpenDisplay()
+
+#ifndef ${cf_func}
+long foo = (long)(&${cf_func});
+${cf_cv_main_return-return}(foo == 0);
+#endif
+                       
 ; return 0; }
 EOF
 ; return 0; }
 EOF
-if { (eval echo configure:7261: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9291: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+  cf_result=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+  cf_result=no
 fi
 rm -f conftest*
 fi
 rm -f conftest*
-LIBS="$ac_save_LIBS"
-
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  LIBS="-lX11 $LIBS"
-else
-  echo "$ac_t""no" 1>&6
+               fi
+               eval 'cf_cv_func_'$cf_func'=$cf_result'
+       
 fi
 
 fi
 
-echo $ac_n "checking for XCurses library""... $ac_c" 1>&6
-echo "configure:7282: checking for XCurses library" >&5
-if eval "test \"`echo '$''{'cf_cv_lib_XCurses'+set}'`\" = set"; then
+       # use the computed/retrieved cache-value:
+       eval 'cf_result=$cf_cv_func_'$cf_func
+       echo "$ac_t""$cf_result" 1>&6
+       if test $cf_result != no; then
+               cat >> confdefs.h <<EOF
+#define HAVE_${cf_tr_func} 1
+EOF
+
+       fi
+done
+
+
+
+echo $ac_n "checking for ncurses extended functions""... $ac_c" 1>&6
+echo "configure:9320: checking for ncurses extended functions" >&5
+if eval "test \"`echo '$''{'cf_cv_ncurses_ext_funcs'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
-LIBS="-lXCurses $LIBS"
 cat > conftest.$ac_ext <<EOF
 cat > conftest.$ac_ext <<EOF
-#line 7289 "configure"
+#line 9326 "configure"
 #include "confdefs.h"
 
 #include "confdefs.h"
 
-#include <xcurses.h>
-char *XCursesProgramName = "test";
-
+#include <${cf_cv_ncurses_header-curses.h}>
 int main() {
 int main() {
-XCursesExit();
+
+int x = NCURSES_EXT_FUNCS
+
 ; return 0; }
 EOF
 ; return 0; }
 EOF
-if { (eval echo configure:7299: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9336: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   rm -rf conftest*
-  cf_cv_lib_XCurses=yes
+  cf_cv_ncurses_ext_funcs=defined
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  cf_cv_lib_XCurses=no
-fi
-rm -f conftest*
-
-fi
-
-echo "$ac_t""$cf_cv_lib_XCurses" 1>&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
-
-       cat >> confdefs.h <<\EOF
-#define HAVE_XCURSES 1
-EOF
-
-else
-       { echo "configure: error: Cannot link with XCurses" 1>&2; exit 1; }
-fi
-
-       ;;
-esac
-
-
-
-case $cf_cv_screen in #(vi
-pdcurses) #(vi
-       ;;
-*)
-       # look for curses-related libraries
-       echo $ac_n "checking for new_panel in -lpanel$cf_cv_libtype""... $ac_c" 1>&6
-echo "configure:7344: checking for new_panel in -lpanel$cf_cv_libtype" >&5
-ac_lib_var=`echo panel$cf_cv_libtype'_'new_panel | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  ac_save_LIBS="$LIBS"
-LIBS="-lpanel$cf_cv_libtype  $LIBS"
+  
 cat > conftest.$ac_ext <<EOF
 cat > conftest.$ac_ext <<EOF
-#line 7352 "configure"
+#line 9345 "configure"
 #include "confdefs.h"
 #include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char new_panel();
 
 
+#include <${cf_cv_ncurses_header-curses.h}>
 int main() {
 int main() {
-new_panel()
+
+       (void) assume_default_colors (0, 0);
+       (void) curses_version ();
+       (void) define_key (0, 0);
+       (void) is_term_resized (0, 0);
+       (void) key_defined (0);
+       (void) keybound (0, 0);
+       (void) keyok (0, 0);
+       (void) resize_term (0, 0);
+       (void) resizeterm (0, 0);
+       (void) use_default_colors ();
+       (void) use_extended_names (0);
+       (void) wresize (0, 0, 0);
 ; return 0; }
 EOF
 ; return 0; }
 EOF
-if { (eval echo configure:7363: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9365: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+  cf_cv_ncurses_ext_funcs=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+  cf_cv_ncurses_ext_funcs=no
 fi
 rm -f conftest*
 fi
 rm -f conftest*
-LIBS="$ac_save_LIBS"
 
 fi
 
 fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_lib=HAVE_LIB`echo panel$cf_cv_libtype | sed -e 's/[^a-zA-Z0-9_]/_/g' \
-    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_lib 1
+rm -f conftest*
+
+fi
+
+echo "$ac_t""$cf_cv_ncurses_ext_funcs" 1>&6
+test "$cf_cv_ncurses_ext_funcs" == yes && cat >> confdefs.h <<\EOF
+#define NCURSES_EXT_FUNCS 1
 EOF
 
 EOF
 
-  LIBS="-lpanel$cf_cv_libtype $LIBS"
 
 
-else
-  echo "$ac_t""no" 1>&6
-fi
 
 
-       echo $ac_n "checking for menu_driver in -lmenu$cf_cv_libtype""... $ac_c" 1>&6
-echo "configure:7391: checking for menu_driver in -lmenu$cf_cv_libtype" >&5
-ac_lib_var=`echo menu$cf_cv_libtype'_'menu_driver | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+echo $ac_n "checking for wide-character functions""... $ac_c" 1>&6
+echo "configure:9389: checking for wide-character functions" >&5
+if eval "test \"`echo '$''{'cf_cv_widechar_funcs'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  ac_save_LIBS="$LIBS"
-LIBS="-lmenu$cf_cv_libtype  $LIBS"
+  
 cat > conftest.$ac_ext <<EOF
 cat > conftest.$ac_ext <<EOF
-#line 7399 "configure"
+#line 9395 "configure"
 #include "confdefs.h"
 #include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char menu_driver();
 
 
+#include <${cf_cv_ncurses_header-curses.h}>
 int main() {
 int main() {
-menu_driver()
+
+       static wchar_t src_wchar[2];
+       static cchar_t dst_cchar;
+       setcchar(&dst_cchar, src_wchar, A_NORMAL, 0, (void *) 0);
+       
 ; return 0; }
 EOF
 ; return 0; }
 EOF
-if { (eval echo configure:7410: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9407: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+  cf_cv_widechar_funcs=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+  cf_cv_widechar_funcs=no
 fi
 rm -f conftest*
 fi
 rm -f conftest*
-LIBS="$ac_save_LIBS"
 
 fi
 
 fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_lib=HAVE_LIB`echo menu$cf_cv_libtype | sed -e 's/[^a-zA-Z0-9_]/_/g' \
-    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_lib 1
-EOF
 
 
-  LIBS="-lmenu$cf_cv_libtype $LIBS"
+echo "$ac_t""$cf_cv_widechar_funcs" 1>&6
+if test "$cf_cv_widechar_funcs" != no ; then
+       cat >> confdefs.h <<\EOF
+#define USE_WIDEC_SUPPORT 1
+EOF
 
 else
 
 else
-  echo "$ac_t""no" 1>&6
+       cat >> confdefs.h <<\EOF
+#define USE_WIDEC_SUPPORT 0
+EOF
+
 fi
 
 fi
 
-       echo $ac_n "checking for form_driver in -lform$cf_cv_libtype""... $ac_c" 1>&6
-echo "configure:7438: checking for form_driver in -lform$cf_cv_libtype" >&5
-ac_lib_var=`echo form$cf_cv_libtype'_'form_driver | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+echo $ac_n "checking for pid_t""... $ac_c" 1>&6
+echo "configure:9434: checking for pid_t" >&5
+if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  ac_save_LIBS="$LIBS"
-LIBS="-lform$cf_cv_libtype  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 7446 "configure"
+  cat > conftest.$ac_ext <<EOF
+#line 9439 "configure"
 #include "confdefs.h"
 #include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char form_driver();
-
-int main() {
-form_driver()
-; return 0; }
+#include <sys/types.h>
+#if STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif
 EOF
 EOF
-if { (eval echo configure:7457: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
   rm -rf conftest*
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+  ac_cv_type_pid_t=yes
 else
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
   rm -rf conftest*
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+  ac_cv_type_pid_t=no
 fi
 rm -f conftest*
 fi
 rm -f conftest*
-LIBS="$ac_save_LIBS"
 
 fi
 
 fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_lib=HAVE_LIB`echo form$cf_cv_libtype | sed -e 's/[^a-zA-Z0-9_]/_/g' \
-    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_lib 1
+echo "$ac_t""$ac_cv_type_pid_t" 1>&6
+if test $ac_cv_type_pid_t = no; then
+  cat >> confdefs.h <<\EOF
+#define pid_t int
 EOF
 
 EOF
 
-  LIBS="-lform$cf_cv_libtype $LIBS"
-
-else
-  echo "$ac_t""no" 1>&6
 fi
 
 fi
 
-
-       # look for curses-related headers
-       for ac_hdr in \
-               nc_alloc.h \
-               nomacros.h \
-               form.h \
-               menu.h \
-               panel.h \
-               
-do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:7496: checking for $ac_hdr" >&5
+ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for vfork.h""... $ac_c" 1>&6
+echo "configure:9468: checking for vfork.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7501 "configure"
+#line 9473 "configure"
 #include "confdefs.h"
 #include "confdefs.h"
-#include <$ac_hdr>
+#include <vfork.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7506: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9478: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -7518,833 +9490,923 @@ rm -f conftest*
 fi
 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
   echo "$ac_t""yes" 1>&6
 fi
 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
+  cat >> confdefs.h <<\EOF
+#define HAVE_VFORK_H 1
 EOF
 EOF
+
 else
   echo "$ac_t""no" 1>&6
 fi
 else
   echo "$ac_t""no" 1>&6
 fi
-done
 
 
-       ;;
-esac
-
-echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:7536: checking return type of signal handlers" >&5
-if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
+echo $ac_n "checking for working vfork""... $ac_c" 1>&6
+echo "configure:9503: checking for working vfork" >&5
+if eval "test \"`echo '$''{'ac_cv_func_vfork_works'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test "$cross_compiling" = yes; then
+  echo $ac_n "checking for vfork""... $ac_c" 1>&6
+echo "configure:9509: checking for vfork" >&5
+if eval "test \"`echo '$''{'ac_cv_func_vfork'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7541 "configure"
+#line 9514 "configure"
 #include "confdefs.h"
 #include "confdefs.h"
-#include <sys/types.h>
-#include <signal.h>
-#ifdef signal
-#undef signal
-#endif
-#ifdef __cplusplus
-extern "C" void (*signal (int, void (*)(int)))(int);
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char vfork(); below.  */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char vfork();
+
+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_vfork) || defined (__stub___vfork)
+choke me
 #else
 #else
-void (*signal ()) ();
+vfork();
 #endif
 
 #endif
 
-int main() {
-int i;
 ; return 0; }
 EOF
 ; return 0; }
 EOF
-if { (eval echo configure:7558: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:9537: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   rm -rf conftest*
-  ac_cv_type_signal=void
+  eval "ac_cv_func_vfork=yes"
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  ac_cv_type_signal=int
+  eval "ac_cv_func_vfork=no"
 fi
 rm -f conftest*
 fi
 
 fi
 rm -f conftest*
 fi
 
-echo "$ac_t""$ac_cv_type_signal" 1>&6
-cat >> confdefs.h <<EOF
-#define RETSIGTYPE $ac_cv_type_signal
-EOF
-
-
+if eval "test \"`echo '$ac_cv_func_'vfork`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  :
+else
+  echo "$ac_t""no" 1>&6
+fi
 
 
-echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:7578: checking for ANSI C header files" >&5
-if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+ac_cv_func_vfork_works=$ac_cv_func_vfork
 else
   cat > conftest.$ac_ext <<EOF
 else
   cat > conftest.$ac_ext <<EOF
-#line 7583 "configure"
+#line 9559 "configure"
 #include "confdefs.h"
 #include "confdefs.h"
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <float.h>
+/* Thanks to Paul Eggert for this test.  */
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#ifdef 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);
+    }
+  }
+}
+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)
+      ;
+    exit(
+        /* Was there some problem with vforking?  */
+        child < 0
+
+        /* Did the child fail?  (This shouldn't happen.)  */
+        || status
+
+        /* Did the vfork/compiler bug occur?  */
+        || parent != getpid()
+
+        /* Did the file descriptor bug occur?  */
+        || fstat(fileno(stdout), &st) != 0
+        );
+  }
+}
 EOF
 EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7591: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  rm -rf conftest*
-  ac_cv_header_stdc=yes
+if { (eval echo configure:9654: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+  ac_cv_func_vfork_works=yes
 else
 else
-  echo "$ac_err" >&5
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ac_cv_header_stdc=no
+  rm -fr conftest*
+  ac_cv_func_vfork_works=no
+fi
+rm -fr conftest*
 fi
 fi
-rm -f conftest*
 
 
-if test $ac_cv_header_stdc = yes; then
-  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
-cat > conftest.$ac_ext <<EOF
-#line 7608 "configure"
-#include "confdefs.h"
-#include <string.h>
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "memchr" >/dev/null 2>&1; then
-  :
-else
-  rm -rf conftest*
-  ac_cv_header_stdc=no
 fi
 fi
-rm -f conftest*
+
+echo "$ac_t""$ac_cv_func_vfork_works" 1>&6
+if test $ac_cv_func_vfork_works = no; then
+  cat >> confdefs.h <<\EOF
+#define vfork fork
+EOF
 
 fi
 
 
 fi
 
-if test $ac_cv_header_stdc = yes; then
-  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+
+echo $ac_n "checking if sys/time.h works with sys/select.h""... $ac_c" 1>&6
+echo "configure:9678: checking if sys/time.h works with sys/select.h" >&5
+if eval "test \"`echo '$''{'cf_cv_sys_time_select'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
 cat > conftest.$ac_ext <<EOF
 cat > conftest.$ac_ext <<EOF
-#line 7626 "configure"
+#line 9684 "configure"
 #include "confdefs.h"
 #include "confdefs.h"
-#include <stdlib.h>
+
+#include <sys/types.h>
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#ifdef HAVE_SYS_SELECT_H
+#include <sys/select.h>
+#endif
+
+int main() {
+
+; return 0; }
 EOF
 EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "free" >/dev/null 2>&1; then
-  :
+if { (eval echo configure:9699: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  cf_cv_sys_time_select=yes
 else
 else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
   rm -rf conftest*
   rm -rf conftest*
-  ac_cv_header_stdc=no
+  cf_cv_sys_time_select=no
 fi
 rm -f conftest*
 fi
 rm -f conftest*
-
+     
 fi
 
 fi
 
-if test $ac_cv_header_stdc = yes; then
-  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+echo "$ac_t""$cf_cv_sys_time_select" 1>&6
+test "$cf_cv_sys_time_select" = yes && cat >> confdefs.h <<\EOF
+#define HAVE_SYS_TIME_SELECT 1
+EOF
+
+
+
+echo $ac_n "checking for function curses_version""... $ac_c" 1>&6
+echo "configure:9720: checking for function curses_version" >&5
+if eval "test \"`echo '$''{'cf_cv_func_curses_version'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
 if test "$cross_compiling" = yes; then
 if test "$cross_compiling" = yes; then
-  :
+  cf_cv_func_curses_version=unknown
 else
   cat > conftest.$ac_ext <<EOF
 else
   cat > conftest.$ac_ext <<EOF
-#line 7647 "configure"
+#line 9729 "configure"
 #include "confdefs.h"
 #include "confdefs.h"
-#include <ctype.h>
-#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
-#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
-#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
-int main () { int i; for (i = 0; i < 256; i++)
-if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
-exit (0); }
+
+#include <${cf_cv_ncurses_header-curses.h}>
+int main()
+{
+       char temp[1024];
+       sprintf(temp, "%s\n", curses_version());
+       ${cf_cv_main_return-return}(0);
+}
 
 EOF
 
 EOF
-if { (eval echo configure:7658: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:9741: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
 then
-  :
+  cf_cv_func_curses_version=yes
+
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -fr conftest*
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -fr conftest*
-  ac_cv_header_stdc=no
+  cf_cv_func_curses_version=no
+
 fi
 rm -fr conftest*
 fi
 
 fi
 rm -fr conftest*
 fi
 
-fi
+rm -f core
 fi
 
 fi
 
-echo "$ac_t""$ac_cv_header_stdc" 1>&6
-if test $ac_cv_header_stdc = yes; then
-  cat >> confdefs.h <<\EOF
-#define STDC_HEADERS 1
+echo "$ac_t""$cf_cv_func_curses_version" 1>&6
+test "$cf_cv_func_curses_version" = yes && cat >> confdefs.h <<\EOF
+#define HAVE_CURSES_VERSION 1
 EOF
 
 EOF
 
+
+
+echo $ac_n "checking for ncurses wrap-prefix""... $ac_c" 1>&6
+echo "configure:9766: checking for ncurses wrap-prefix" >&5
+
+# Check whether --with-ncurses-wrap-prefix or --without-ncurses-wrap-prefix was given.
+if test "${with_ncurses_wrap_prefix+set}" = set; then
+  withval="$with_ncurses_wrap_prefix"
+  NCURSES_WRAP_PREFIX=$withval
+else
+  NCURSES_WRAP_PREFIX=_nc_
 fi
 
 fi
 
-echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:7682: checking whether time.h and sys/time.h may both be included" >&5
-if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
+echo "$ac_t""$NCURSES_WRAP_PREFIX" 1>&6
+
+
+
+
+echo $ac_n "checking for alternate character set array""... $ac_c" 1>&6
+echo "configure:9782: checking for alternate character set array" >&5
+if eval "test \"`echo '$''{'cf_cv_curses_acs_map'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 7687 "configure"
+  
+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 <<EOF
+#line 9791 "configure"
 #include "confdefs.h"
 #include "confdefs.h"
-#include <sys/types.h>
-#include <sys/time.h>
-#include <time.h>
+
+#include <${cf_cv_ncurses_header-curses.h}>
+
 int main() {
 int main() {
-struct tm *tp;
+
+$name['k'] = ACS_PLUS
+
 ; return 0; }
 EOF
 ; return 0; }
 EOF
-if { (eval echo configure:7696: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:9802: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   rm -rf conftest*
-  ac_cv_header_time=yes
+  cf_cv_curses_acs_map=$name; break
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ac_cv_header_time=no
 fi
 rm -f conftest*
 fi
 rm -f conftest*
+done
+
 fi
 
 fi
 
-echo "$ac_t""$ac_cv_header_time" 1>&6
-if test $ac_cv_header_time = yes; then
-  cat >> confdefs.h <<\EOF
-#define TIME_WITH_SYS_TIME 1
+echo "$ac_t""$cf_cv_curses_acs_map" 1>&6
+
+test "$cf_cv_curses_acs_map" != unknown && cat >> confdefs.h <<EOF
+#define CURSES_ACS_ARRAY $cf_cv_curses_acs_map
 EOF
 
 EOF
 
-fi
 
 
-for ac_hdr in \
-getopt.h \
-locale.h \
-stdarg.h \
-sys/ioctl.h \
-sys/select.h \
-sys/time.h \
-termios.h \
-unistd.h \
 
 
-do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:7729: checking for $ac_hdr" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+echo $ac_n "checking for wide alternate character set array""... $ac_c" 1>&6
+echo "configure:9823: checking for wide alternate character set array" >&5
+if eval "test \"`echo '$''{'cf_cv_curses_wacs_map'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 7734 "configure"
+  
+       cf_cv_curses_wacs_map=unknown
+       for name in wacs_map _wacs_map __wacs_map _nc_wacs
+       do
+       cat > conftest.$ac_ext <<EOF
+#line 9832 "configure"
 #include "confdefs.h"
 #include "confdefs.h"
-#include <$ac_hdr>
+
+#ifndef _XOPEN_SOURCE_EXTENDED
+#define _XOPEN_SOURCE_EXTENDED
+#endif
+#include <${cf_cv_ncurses_header-curses.h}>
+int main() {
+$name['k'] = *WACS_PLUS
+; return 0; }
 EOF
 EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7739: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
+if { (eval echo configure:9843: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=yes"
+  cf_cv_curses_wacs_map=$name
+        break
 else
 else
-  echo "$ac_err" >&5
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=no"
 fi
 rm -f conftest*
 fi
 rm -f conftest*
+       done
 fi
 fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
-EOF
-else
-  echo "$ac_t""no" 1>&6
-fi
-done
 
 
+echo "$ac_t""$cf_cv_curses_wacs_map" 1>&6
 
 
-for ac_func in \
-gettimeofday \
-mblen \
-mbrlen \
-mbrtowc \
-mbsrtowcs \
-mbstowcs \
-mbtowc \
-strdup \
-wcsrtombs \
-wcstombs \
 
 
-do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:7780: checking for $ac_func" >&5
-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 7785 "configure"
+
+echo $ac_n "checking for type attr_t in ${cf_cv_ncurses_header-curses.h}""... $ac_c" 1>&6
+echo "configure:9860: checking for type attr_t in ${cf_cv_ncurses_header-curses.h}" >&5
+cat > conftest.$ac_ext <<EOF
+#line 9862 "configure"
 #include "confdefs.h"
 #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.  */
-/* 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();
 
 
+#ifndef _XOPEN_SOURCE_EXTENDED
+#define _XOPEN_SOURCE_EXTENDED
+#endif
+#include <${cf_cv_ncurses_header-curses.h}>
 int main() {
 
 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
-$ac_func();
-#endif
+attr_t foo
 
 ; return 0; }
 EOF
 
 ; return 0; }
 EOF
-if { (eval echo configure:7808: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9875: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   rm -rf conftest*
-  eval "ac_cv_func_$ac_func=yes"
+  cf_result=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  eval "ac_cv_func_$ac_func=no"
+  cf_result=no
 fi
 rm -f conftest*
 fi
 rm -f conftest*
-fi
-
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
+echo "$ac_t""$cf_result" 1>&6
+if test $cf_result = yes ; then
+       
+cf_result=`echo "have_type_attr_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
+
+       cat >> confdefs.h <<EOF
+#define $cf_result 1
 EOF
 EOF
+
 else
 else
-  echo "$ac_t""no" 1>&6
+       cat >> confdefs.h <<EOF
+#define attr_t long
+EOF
+
 fi
 fi
-done
 
 
 
 
 
 
-echo $ac_n "checking if we must define _XOPEN_SOURCE_EXTENDED""... $ac_c" 1>&6
-echo "configure:7835: checking if we must define _XOPEN_SOURCE_EXTENDED" >&5
-if eval "test \"`echo '$''{'cf_cv_need_xopen_extension'+set}'`\" = set"; then
+# This is needed on Tru64 5.0 to declare mbstate_t
+echo $ac_n "checking if we must include wchar.h to declare mbstate_t""... $ac_c" 1>&6
+echo "configure:9905: checking if we must include wchar.h to declare mbstate_t" >&5
+if eval "test \"`echo '$''{'cf_cv_mbstate_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 cat > conftest.$ac_ext <<EOF
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 cat > conftest.$ac_ext <<EOF
-#line 7841 "configure"
+#line 9911 "configure"
 #include "confdefs.h"
 
 #include <stdlib.h>
 #include "confdefs.h"
 
 #include <stdlib.h>
-#include <${cf_cv_ncurses_header-curses.h}>
+#include <stdarg.h>
+#include <stdio.h>
+#ifdef HAVE_LIBUTF8_H
+#include <libutf8.h>
+#endif
 int main() {
 int main() {
-
-       long x = winnstr(stdscr, "", 0);
-       int x1, y1;
-       getbegyx(stdscr, y1, x1)
+mbstate_t state
 ; return 0; }
 EOF
 ; return 0; }
 EOF
-if { (eval echo configure:7853: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9924: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   rm -rf conftest*
-  cf_cv_need_xopen_extension=no
+  cf_cv_mbstate_t=no
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
   cat > conftest.$ac_ext <<EOF
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
   cat > conftest.$ac_ext <<EOF
-#line 7861 "configure"
+#line 9932 "configure"
 #include "confdefs.h"
 
 #include "confdefs.h"
 
-#define _XOPEN_SOURCE_EXTENDED
 #include <stdlib.h>
 #include <stdlib.h>
-#include <${cf_cv_ncurses_header-curses.h}>
+#include <stdarg.h>
+#include <stdio.h>
+#include <wchar.h>
+#ifdef HAVE_LIBUTF8_H
+#include <libutf8.h>
+#endif
 int main() {
 int main() {
-
-       long x = winnstr(stdscr, "", 0);
-       int x1, y1;
-       getbegyx(stdscr, y1, x1)
+mbstate_t value
 ; return 0; }
 EOF
 ; return 0; }
 EOF
-if { (eval echo configure:7874: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9946: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   rm -rf conftest*
-  cf_cv_need_xopen_extension=yes
+  cf_cv_mbstate_t=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  cf_cv_need_xopen_extension=unknown
+  cf_cv_mbstate_t=unknown
 fi
 rm -f conftest*
 fi
 rm -f conftest*
 fi
 
 fi
 rm -f conftest*
 fi
 rm -f conftest*
 fi
 
-echo "$ac_t""$cf_cv_need_xopen_extension" 1>&6
-test $cf_cv_need_xopen_extension = yes && CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED"
+echo "$ac_t""$cf_cv_mbstate_t" 1>&6
 
 
+if test "$cf_cv_mbstate_t" = yes ; then
+       cat >> confdefs.h <<\EOF
+#define NEED_WCHAR_H 1
+EOF
 
 
-echo $ac_n "checking for term.h""... $ac_c" 1>&6
-echo "configure:7893: checking for term.h" >&5
-if eval "test \"`echo '$''{'cf_cv_term_header'+set}'`\" = set"; then
+       NEED_WCHAR_H=1
+fi
+
+
+# if we do not find mbstate_t in either place, use substitution to provide a fallback.
+if test "$cf_cv_mbstate_t" = unknown ; then
+       NCURSES_MBSTATE_T=1
+fi
+
+
+# if we find mbstate_t in either place, use substitution to provide a fallback.
+if test "$cf_cv_mbstate_t" != unknown ; then
+       NCURSES_OK_MBSTATE_T=1
+fi
+
+
+
+# This is needed on Tru64 5.0 to declare wchar_t
+echo $ac_n "checking if we must include wchar.h to declare wchar_t""... $ac_c" 1>&6
+echo "configure:9986: checking if we must include wchar.h to declare wchar_t" >&5
+if eval "test \"`echo '$''{'cf_cv_wchar_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
+cat > conftest.$ac_ext <<EOF
+#line 9992 "configure"
+#include "confdefs.h"
 
 
-# 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
-do
-       cat > conftest.$ac_ext <<EOF
-#line 7906 "configure"
+#include <stdlib.h>
+#include <stdarg.h>
+#include <stdio.h>
+#ifdef HAVE_LIBUTF8_H
+#include <libutf8.h>
+#endif
+int main() {
+wchar_t state
+; return 0; }
+EOF
+if { (eval echo configure:10005: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  cf_cv_wchar_t=no
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  cat > conftest.$ac_ext <<EOF
+#line 10013 "configure"
 #include "confdefs.h"
 
 #include "confdefs.h"
 
-#include <${cf_cv_ncurses_header-curses.h}>
-#include <${cf_header}>
+#include <stdlib.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <wchar.h>
+#ifdef HAVE_LIBUTF8_H
+#include <libutf8.h>
+#endif
 int main() {
 int main() {
-WINDOW *x
+wchar_t value
 ; return 0; }
 EOF
 ; return 0; }
 EOF
-if { (eval echo configure:7915: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:10027: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   rm -rf conftest*
-  cf_cv_term_header=$cf_header
-        break
+  cf_cv_wchar_t=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  cf_cv_term_header=no
+  cf_cv_wchar_t=unknown
+fi
+rm -f conftest*
 fi
 rm -f conftest*
 fi
 rm -f conftest*
-done
-
 fi
 
 fi
 
-echo "$ac_t""$cf_cv_term_header" 1>&6
-
-case $cf_cv_term_header in #(vi
-term.h) #(vi
-       cat >> confdefs.h <<\EOF
-#define HAVE_TERM_H 1
-EOF
-
-       ;;
-ncurses/term.h)
-       cat >> confdefs.h <<\EOF
-#define HAVE_NCURSES_TERM_H 1
-EOF
+echo "$ac_t""$cf_cv_wchar_t" 1>&6
 
 
-       ;;
-ncursesw/term.h)
+if test "$cf_cv_wchar_t" = yes ; then
        cat >> confdefs.h <<\EOF
        cat >> confdefs.h <<\EOF
-#define HAVE_NCURSESW_TERM_H 1
+#define NEED_WCHAR_H 1
 EOF
 
 EOF
 
-       ;;
-esac
+       NEED_WCHAR_H=1
+fi
 
 
 
 
+# if we do not find wchar_t in either place, use substitution to provide a fallback.
+if test "$cf_cv_wchar_t" = unknown ; then
+       NCURSES_WCHAR_T=1
+fi
 
 
 
 
-for cf_func in \
-chgat \
-color_set \
-filter \
-getbegx \
-getcurx \
-getmaxx \
-getnstr \
-getparx \
-getwin \
-mvvline \
-mvwvline \
-napms \
-putwin \
-resize_term \
-resizeterm \
-ripoffline \
-setupterm \
-slk_color \
-slk_init \
-termattrs \
-tgetent \
-tigetnum \
-tigetstr \
-typeahead \
-use_default_colors \
-vsscanf \
-wchgat \
-winsstr \
-wresize \
+# if we find wchar_t in either place, use substitution to provide a fallback.
+if test "$cf_cv_wchar_t" != unknown ; then
+       NCURSES_OK_WCHAR_T=1
+fi
 
 
-do
-       
-cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
 
 
-       echo $ac_n "checking for ${cf_func}""... $ac_c" 1>&6
-echo "configure:7992: checking for ${cf_func}" >&5
-       
-echo "${as_me-configure}:7994: testing ${cf_func} ..." 1>&5
 
 
-       if eval "test \"`echo '$''{'cf_cv_func_$cf_func'+set}'`\" = set"; then
+# This is needed on Tru64 5.0 to declare wint_t
+echo $ac_n "checking if we must include wchar.h to declare wint_t""... $ac_c" 1>&6
+echo "configure:10067: checking if we must include wchar.h to declare wint_t" >&5
+if eval "test \"`echo '$''{'cf_cv_wint_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
-               eval cf_result='$ac_cv_func_'$cf_func
-               if test ".$cf_result" != ".no"; then
-                       cat > conftest.$ac_ext <<EOF
-#line 8003 "configure"
+cat > conftest.$ac_ext <<EOF
+#line 10073 "configure"
 #include "confdefs.h"
 
 #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>
-#else
-#if defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
-#include <ncurses/term.h>
-#else
-#ifdef HAVE_TERM_H
-#include <term.h>
-#endif
-#endif
-#endif
+#include <stdlib.h>
+#include <stdarg.h>
+#include <stdio.h>
+#ifdef HAVE_LIBUTF8_H
+#include <libutf8.h>
 #endif
 int main() {
 #endif
 int main() {
-
-#ifndef ${cf_func}
-long foo = (long)(&${cf_func});
-${cf_cv_main_return-return}(foo == 0);
-#endif
-                       
+wint_t state
 ; return 0; }
 EOF
 ; return 0; }
 EOF
-if { (eval echo configure:8032: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10086: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   rm -rf conftest*
-  cf_result=yes
+  cf_cv_wint_t=no
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  cf_result=no
-fi
-rm -f conftest*
-               fi
-               eval 'cf_cv_func_'$cf_func'=$cf_result'
-       
-fi
-
-       # use the computed/retrieved cache-value:
-       eval 'cf_result=$cf_cv_func_'$cf_func
-       echo "$ac_t""$cf_result" 1>&6
-       if test $cf_result != no; then
-               cat >> confdefs.h <<EOF
-#define HAVE_${cf_tr_func} 1
-EOF
-
-       fi
-done
-
-
-echo $ac_n "checking for ncurses extended functions""... $ac_c" 1>&6
-echo "configure:8060: checking for ncurses extended functions" >&5
-if eval "test \"`echo '$''{'cf_cv_ncurses_ext_funcs'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  
-cat > conftest.$ac_ext <<EOF
-#line 8066 "configure"
+  cat > conftest.$ac_ext <<EOF
+#line 10094 "configure"
 #include "confdefs.h"
 
 #include "confdefs.h"
 
-#include <${cf_cv_ncurses_header-curses.h}>
+#include <stdlib.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <wchar.h>
+#ifdef HAVE_LIBUTF8_H
+#include <libutf8.h>
+#endif
 int main() {
 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);
+wint_t value
 ; return 0; }
 EOF
 ; return 0; }
 EOF
-if { (eval echo configure:8086: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10108: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   rm -rf conftest*
-  cf_cv_ncurses_ext_funcs=yes
+  cf_cv_wint_t=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  cf_cv_ncurses_ext_funcs=no
+  cf_cv_wint_t=unknown
+fi
+rm -f conftest*
 fi
 rm -f conftest*
 fi
 rm -f conftest*
-
 fi
 
 fi
 
-echo "$ac_t""$cf_cv_ncurses_ext_funcs" 1>&6
-test "$cf_cv_ncurses_ext_funcs" != no && cat >> confdefs.h <<\EOF
-#define NCURSES_EXT_FUNCS 1
+echo "$ac_t""$cf_cv_wint_t" 1>&6
+
+if test "$cf_cv_wint_t" = yes ; then
+       cat >> confdefs.h <<\EOF
+#define NEED_WCHAR_H 1
 EOF
 
 EOF
 
+       NEED_WCHAR_H=1
+fi
 
 
-echo $ac_n "checking for wide-character functions""... $ac_c" 1>&6
-echo "configure:8106: checking for wide-character functions" >&5
-if eval "test \"`echo '$''{'cf_cv_widechar_funcs'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  
+
+# if we do not find wint_t in either place, use substitution to provide a fallback.
+if test "$cf_cv_wint_t" = unknown ; then
+       NCURSES_WINT_T=1
+fi
+
+
+# if we find wint_t in either place, use substitution to provide a fallback.
+if test "$cf_cv_wint_t" != unknown ; then
+       NCURSES_OK_WINT_T=1
+fi
+
+
+
+if test "$NCURSES_OK_MBSTATE_T" = 0 ; then
+       
+echo $ac_n "checking for type mbstate_t in ${cf_cv_ncurses_header-curses.h}""... $ac_c" 1>&6
+echo "configure:10149: checking for type mbstate_t in ${cf_cv_ncurses_header-curses.h}" >&5
 cat > conftest.$ac_ext <<EOF
 cat > conftest.$ac_ext <<EOF
-#line 8112 "configure"
+#line 10151 "configure"
 #include "confdefs.h"
 
 #include "confdefs.h"
 
+#ifndef _XOPEN_SOURCE_EXTENDED
+#define _XOPEN_SOURCE_EXTENDED
+#endif
 #include <${cf_cv_ncurses_header-curses.h}>
 int main() {
 
 #include <${cf_cv_ncurses_header-curses.h}>
 int main() {
 
-       static wchar_t src_wchar[2];
-       static cchar_t dst_cchar;
-       setcchar(&dst_cchar, src_wchar, A_NORMAL, 0, (void *) 0);
-       
+mbstate_t foo
+
 ; return 0; }
 EOF
 ; return 0; }
 EOF
-if { (eval echo configure:8124: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10164: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   rm -rf conftest*
-  cf_cv_widechar_funcs=yes
+  cf_result=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  cf_cv_widechar_funcs=no
+  cf_result=no
 fi
 rm -f conftest*
 fi
 rm -f conftest*
+echo "$ac_t""$cf_result" 1>&6
+if test $cf_result = yes ; then
+       
+cf_result=`echo "have_type_mbstate_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
 
 
-fi
-
-echo "$ac_t""$cf_cv_widechar_funcs" 1>&6
-if test "$cf_cv_widechar_funcs" != no ; then
-       cat >> confdefs.h <<\EOF
-#define USE_WIDEC_SUPPORT 1
+       cat >> confdefs.h <<EOF
+#define $cf_result 1
 EOF
 
 else
 EOF
 
 else
-       cat >> confdefs.h <<\EOF
-#define USE_WIDEC_SUPPORT 0
+       cat >> confdefs.h <<EOF
+#define mbstate_t long
 EOF
 
 fi
 
 EOF
 
 fi
 
+fi
 
 
-echo $ac_n "checking if sys/time.h works with sys/select.h""... $ac_c" 1>&6
-echo "configure:8152: checking if sys/time.h works with sys/select.h" >&5
-if eval "test \"`echo '$''{'cf_cv_sys_time_select'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  
+if test "$NCURSES_OK_WCHAR_T" = 0 ; then
+       
+echo $ac_n "checking for type wchar_t in ${cf_cv_ncurses_header-curses.h}""... $ac_c" 1>&6
+echo "configure:10195: checking for type wchar_t in ${cf_cv_ncurses_header-curses.h}" >&5
 cat > conftest.$ac_ext <<EOF
 cat > conftest.$ac_ext <<EOF
-#line 8158 "configure"
+#line 10197 "configure"
 #include "confdefs.h"
 
 #include "confdefs.h"
 
-#include <sys/types.h>
-#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
-#ifdef HAVE_SYS_SELECT_H
-#include <sys/select.h>
+#ifndef _XOPEN_SOURCE_EXTENDED
+#define _XOPEN_SOURCE_EXTENDED
 #endif
 #endif
-
+#include <${cf_cv_ncurses_header-curses.h}>
 int main() {
 
 int main() {
 
+wchar_t foo
+
 ; return 0; }
 EOF
 ; return 0; }
 EOF
-if { (eval echo configure:8173: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:10210: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   rm -rf conftest*
-  cf_cv_sys_time_select=yes
+  cf_result=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  cf_cv_sys_time_select=no
+  cf_result=no
 fi
 rm -f conftest*
 fi
 rm -f conftest*
-     
-fi
+echo "$ac_t""$cf_result" 1>&6
+if test $cf_result = yes ; then
+       
+cf_result=`echo "have_type_wchar_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
 
 
-echo "$ac_t""$cf_cv_sys_time_select" 1>&6
-test "$cf_cv_sys_time_select" = yes && cat >> confdefs.h <<\EOF
-#define HAVE_SYS_TIME_SELECT 1
+       cat >> confdefs.h <<EOF
+#define $cf_result 1
 EOF
 
 EOF
 
+else
+       cat >> confdefs.h <<EOF
+#define wchar_t long
+EOF
 
 
+fi
 
 
-echo $ac_n "checking for function curses_version""... $ac_c" 1>&6
-echo "configure:8194: checking for function curses_version" >&5
-if eval "test \"`echo '$''{'cf_cv_func_curses_version'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  
-if test "$cross_compiling" = yes; then
-  cf_cv_func_curses_version=unknown
-else
-  cat > conftest.$ac_ext <<EOF
-#line 8203 "configure"
+fi
+
+if test "$NCURSES_OK_WINT_T" = 0 ; then
+       
+echo $ac_n "checking for type wint_t in ${cf_cv_ncurses_header-curses.h}""... $ac_c" 1>&6
+echo "configure:10241: checking for type wint_t in ${cf_cv_ncurses_header-curses.h}" >&5
+cat > conftest.$ac_ext <<EOF
+#line 10243 "configure"
 #include "confdefs.h"
 
 #include "confdefs.h"
 
+#ifndef _XOPEN_SOURCE_EXTENDED
+#define _XOPEN_SOURCE_EXTENDED
+#endif
 #include <${cf_cv_ncurses_header-curses.h}>
 #include <${cf_cv_ncurses_header-curses.h}>
-int main()
-{
-       char temp[1024];
-       sprintf(temp, "%s\n", curses_version());
-       ${cf_cv_main_return-return}(0);
-}
+int main() {
 
 
-EOF
-if { (eval echo configure:8215: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
-  cf_cv_func_curses_version=yes
+wint_t foo
 
 
+; return 0; }
+EOF
+if { (eval echo configure:10256: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  cf_result=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
-  rm -fr conftest*
-  cf_cv_func_curses_version=no
-
-fi
-rm -fr conftest*
-fi
-
-rm -f core
+  rm -rf conftest*
+  cf_result=no
 fi
 fi
+rm -f conftest*
+echo "$ac_t""$cf_result" 1>&6
+if test $cf_result = yes ; then
+       
+cf_result=`echo "have_type_wint_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
 
 
-echo "$ac_t""$cf_cv_func_curses_version" 1>&6
-test "$cf_cv_func_curses_version" = yes && cat >> confdefs.h <<\EOF
-#define HAVE_CURSES_VERSION 1
+       cat >> confdefs.h <<EOF
+#define $cf_result 1
 EOF
 
 EOF
 
-
-
-echo $ac_n "checking for ncurses wrap-prefix""... $ac_c" 1>&6
-echo "configure:8240: checking for ncurses wrap-prefix" >&5
-
-# Check whether --with-ncurses-wrap-prefix or --without-ncurses-wrap-prefix was given.
-if test "${with_ncurses_wrap_prefix+set}" = set; then
-  withval="$with_ncurses_wrap_prefix"
-  NCURSES_WRAP_PREFIX=$withval
 else
 else
-  NCURSES_WRAP_PREFIX=_nc_
-fi
-
-echo "$ac_t""$NCURSES_WRAP_PREFIX" 1>&6
+       cat >> confdefs.h <<EOF
+#define wint_t long
+EOF
 
 
+fi
 
 
+fi
 
 
 
 
-echo $ac_n "checking for alternate character set array""... $ac_c" 1>&6
-echo "configure:8256: checking for alternate character set array" >&5
-if eval "test \"`echo '$''{'cf_cv_curses_acs_map'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  
-cf_cv_curses_acs_map=unknown
-for name in acs_map _acs_map __acs_map ${NCURSES_WRAP_PREFIX}acs_map
-do
+echo $ac_n "checking for data boolnames declaration in ${cf_cv_ncurses_header-curses.h}""... $ac_c" 1>&6
+echo "configure:10286: checking for data boolnames declaration in ${cf_cv_ncurses_header-curses.h}" >&5
 cat > conftest.$ac_ext <<EOF
 cat > conftest.$ac_ext <<EOF
-#line 8265 "configure"
+#line 10288 "configure"
 #include "confdefs.h"
 
 #include "confdefs.h"
 
+#ifdef HAVE_XCURSES
+#include <xcurses.h>
+char * XCursesProgramName = "test";
+#else
 #include <${cf_cv_ncurses_header-curses.h}>
 #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() {
 
 
 int main() {
 
-$name['k'] = ACS_PLUS
+void *foo = &(boolnames)
 
 ; return 0; }
 EOF
 
 ; return 0; }
 EOF
-if { (eval echo configure:8276: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10311: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   rm -rf conftest*
-  cf_cv_curses_acs_map=$name; break
+  cf_result=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  cf_result=no
 fi
 rm -f conftest*
 fi
 rm -f conftest*
-done
-
-fi
-
-echo "$ac_t""$cf_cv_curses_acs_map" 1>&6
+echo "$ac_t""$cf_result" 1>&6
+if test $cf_result = yes ; then
+       
+cf_result=`echo "have_curses_data_boolnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
 
 
-test "$cf_cv_curses_acs_map" != unknown && cat >> confdefs.h <<EOF
-#define CURSES_ACS_ARRAY $cf_cv_curses_acs_map
+       cat >> confdefs.h <<EOF
+#define $cf_result 1
 EOF
 
 EOF
 
-
-
-echo $ac_n "checking for wide alternate character set array""... $ac_c" 1>&6
-echo "configure:8297: checking for wide alternate character set array" >&5
-if eval "test \"`echo '$''{'cf_cv_curses_wacs_map'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
 else
 else
-  
-       cf_cv_curses_wacs_map=unknown
-       for name in wacs_map _wacs_map __wacs_map _nc_wacs
-       do
+       echo $ac_n "checking for data boolnames in library""... $ac_c" 1>&6
+echo "configure:10332: checking for data boolnames in library" >&5
        cat > conftest.$ac_ext <<EOF
        cat > conftest.$ac_ext <<EOF
-#line 8306 "configure"
+#line 10334 "configure"
 #include "confdefs.h"
 
 #include "confdefs.h"
 
-#ifndef _XOPEN_SOURCE_EXTENDED
-#define _XOPEN_SOURCE_EXTENDED
-#endif
+#ifdef HAVE_XCURSES
+#include <xcurses.h>
+char * XCursesProgramName = "test";
+#else
 #include <${cf_cv_ncurses_header-curses.h}>
 #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() {
 int main() {
-$name['k'] = *WACS_PLUS
+
+       do {
+               void *foo = &(boolnames);
+               ${cf_cv_main_return-return}(foo == 0);
+       } while (0)
+
 ; return 0; }
 EOF
 ; return 0; }
 EOF
-if { (eval echo configure:8317: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10361: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   rm -rf conftest*
-  cf_cv_curses_wacs_map=$name
-        break
+  cf_result=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  cf_result=no
 fi
 rm -f conftest*
 fi
 rm -f conftest*
-       done
-fi
+       echo "$ac_t""$cf_result" 1>&6
+       if test $cf_result = yes ; then
+               
+cf_result=`echo "decl_curses_data_boolnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
 
 
-echo "$ac_t""$cf_cv_curses_wacs_map" 1>&6
+               cat >> confdefs.h <<EOF
+#define $cf_result 1
+EOF
 
 
+       fi
+fi
 
 
-echo $ac_n "checking for type attr_t in ${cf_cv_ncurses_header-curses.h}""... $ac_c" 1>&6
-echo "configure:8333: checking for type attr_t in ${cf_cv_ncurses_header-curses.h}" >&5
+
+echo $ac_n "checking for data boolfnames declaration in ${cf_cv_ncurses_header-curses.h}""... $ac_c" 1>&6
+echo "configure:10385: checking for data boolfnames declaration in ${cf_cv_ncurses_header-curses.h}" >&5
 cat > conftest.$ac_ext <<EOF
 cat > conftest.$ac_ext <<EOF
-#line 8335 "configure"
+#line 10387 "configure"
 #include "confdefs.h"
 
 #include "confdefs.h"
 
-#ifndef _XOPEN_SOURCE_EXTENDED
-#define _XOPEN_SOURCE_EXTENDED
-#endif
+#ifdef HAVE_XCURSES
+#include <xcurses.h>
+char * XCursesProgramName = "test";
+#else
 #include <${cf_cv_ncurses_header-curses.h}>
 #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() {
 
 int main() {
 
-attr_t foo
+void *foo = &(boolfnames)
 
 ; return 0; }
 EOF
 
 ; return 0; }
 EOF
-if { (eval echo configure:8348: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:10410: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_result=yes
 else
   rm -rf conftest*
   cf_result=yes
 else
@@ -8357,37 +10419,44 @@ rm -f conftest*
 echo "$ac_t""$cf_result" 1>&6
 if test $cf_result = yes ; then
        
 echo "$ac_t""$cf_result" 1>&6
 if test $cf_result = yes ; then
        
-cf_result=`echo "have_type_attr_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
+cf_result=`echo "have_curses_data_boolfnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
 
        cat >> confdefs.h <<EOF
 #define $cf_result 1
 EOF
 
 else
 
        cat >> confdefs.h <<EOF
 #define $cf_result 1
 EOF
 
 else
-       cat >> confdefs.h <<EOF
-#define attr_t long
-EOF
-
-fi
-
-
-echo $ac_n "checking for type mbstate_t in ${cf_cv_ncurses_header-curses.h}""... $ac_c" 1>&6
-echo "configure:8376: checking for type mbstate_t in ${cf_cv_ncurses_header-curses.h}" >&5
-cat > conftest.$ac_ext <<EOF
-#line 8378 "configure"
+       echo $ac_n "checking for data boolfnames in library""... $ac_c" 1>&6
+echo "configure:10431: checking for data boolfnames in library" >&5
+       cat > conftest.$ac_ext <<EOF
+#line 10433 "configure"
 #include "confdefs.h"
 
 #include "confdefs.h"
 
-#ifndef _XOPEN_SOURCE_EXTENDED
-#define _XOPEN_SOURCE_EXTENDED
-#endif
+#ifdef HAVE_XCURSES
+#include <xcurses.h>
+char * XCursesProgramName = "test";
+#else
 #include <${cf_cv_ncurses_header-curses.h}>
 #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() {
 
 int main() {
 
-mbstate_t foo
+       do {
+               void *foo = &(boolfnames);
+               ${cf_cv_main_return-return}(foo == 0);
+       } while (0)
 
 ; return 0; }
 EOF
 
 ; return 0; }
 EOF
-if { (eval echo configure:8391: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:10460: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   cf_result=yes
 else
   rm -rf conftest*
   cf_result=yes
 else
@@ -8397,20 +10466,16 @@ else
   cf_result=no
 fi
 rm -f conftest*
   cf_result=no
 fi
 rm -f conftest*
-echo "$ac_t""$cf_result" 1>&6
-if test $cf_result = yes ; then
-       
-cf_result=`echo "have_type_mbstate_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
+       echo "$ac_t""$cf_result" 1>&6
+       if test $cf_result = yes ; then
+               
+cf_result=`echo "decl_curses_data_boolfnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
 
 
-       cat >> confdefs.h <<EOF
+               cat >> confdefs.h <<EOF
 #define $cf_result 1
 EOF
 
 #define $cf_result 1
 EOF
 
-else
-       cat >> confdefs.h <<EOF
-#define mbstate_t long
-EOF
-
+       fi
 fi
 
 
 fi
 
 
@@ -8559,6 +10624,10 @@ s%@SET_MAKE@%$SET_MAKE%g
 s%@CC@%$CC%g
 s%@CPP@%$CPP%g
 s%@AWK@%$AWK%g
 s%@CC@%$CC%g
 s%@CPP@%$CPP%g
 s%@AWK@%$AWK%g
+s%@CTAGS@%$CTAGS%g
+s%@ETAGS@%$ETAGS%g
+s%@MAKE_LOWER_TAGS@%$MAKE_LOWER_TAGS%g
+s%@MAKE_UPPER_TAGS@%$MAKE_UPPER_TAGS%g
 s%@CC_G_OPT@%$CC_G_OPT%g
 s%@CC_SHARED_OPTS@%$CC_SHARED_OPTS%g
 s%@DFT_DEP_SUFFIX@%$DFT_DEP_SUFFIX%g
 s%@CC_G_OPT@%$CC_G_OPT%g
 s%@CC_SHARED_OPTS@%$CC_SHARED_OPTS%g
 s%@DFT_DEP_SUFFIX@%$DFT_DEP_SUFFIX%g
@@ -8595,6 +10664,7 @@ s%@SHOW_CC@%$SHOW_CC%g
 s%@ECHO_CC@%$ECHO_CC%g
 s%@EXTRA_CFLAGS@%$EXTRA_CFLAGS%g
 s%@NCURSES_CONFIG@%$NCURSES_CONFIG%g
 s%@ECHO_CC@%$ECHO_CC%g
 s%@EXTRA_CFLAGS@%$EXTRA_CFLAGS%g
 s%@NCURSES_CONFIG@%$NCURSES_CONFIG%g
+s%@PKG_CONFIG@%$PKG_CONFIG%g
 s%@X_CFLAGS@%$X_CFLAGS%g
 s%@X_PRE_LIBS@%$X_PRE_LIBS%g
 s%@X_LIBS@%$X_LIBS%g
 s%@X_CFLAGS@%$X_CFLAGS%g
 s%@X_PRE_LIBS@%$X_PRE_LIBS%g
 s%@X_LIBS@%$X_LIBS%g