]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - test/configure
ncurses 5.7 - patch 20090328
[ncurses.git] / test / configure
index c66d6c2a5193489fe3a1d662809cb9d88b47fd81..fa21f99d4f8a8d4209c57761b27ed3affc7beb8b 100755 (executable)
@@ -183,6 +183,7 @@ Features and packages:
 EOF
 cat <<\EOF
 --enable and --with options recognized:
 EOF
 cat <<\EOF
 --enable and --with options recognized:
+  --disable-echo          display "compiling" commands
   --enable-warnings       test: turn on gcc compiler warnings
   --with-curses-dir=DIR   directory in which (n)curses is installed
   --with-5lib             use SunOS sysv-libraries
   --enable-warnings       test: turn on gcc compiler warnings
   --with-curses-dir=DIR   directory in which (n)curses is installed
   --with-5lib             use SunOS sysv-libraries
@@ -193,6 +194,7 @@ cat <<\EOF
   --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-ncurses-wrap-prefix naming-prefix for ncurses wrapped-variables
 EOF
     exit 0 ;;
 
 EOF
     exit 0 ;;
 
@@ -535,7 +537,7 @@ fi
 # 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
 # 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:539: checking for X" >&5
+echo "configure:541: checking for X" >&5
 
 
 # Check whether --with-x or --without-x was given.
 
 
 # Check whether --with-x or --without-x was given.
@@ -598,12 +600,12 @@ if test "$ac_x_includes" = NO; then
 
   # First, try using that file with no special directory specified.
 cat > conftest.$ac_ext <<EOF
 
   # First, try using that file with no special directory specified.
 cat > conftest.$ac_ext <<EOF
-#line 602 "configure"
+#line 604 "configure"
 #include "confdefs.h"
 #include <$x_direct_test_include>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
 #include "confdefs.h"
 #include <$x_direct_test_include>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:607: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (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*
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -672,14 +674,14 @@ if test "$ac_x_libraries" = NO; then
   ac_save_LIBS="$LIBS"
   LIBS="-l$x_direct_test_library $LIBS"
 cat > conftest.$ac_ext <<EOF
   ac_save_LIBS="$LIBS"
   LIBS="-l$x_direct_test_library $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 676 "configure"
+#line 678 "configure"
 #include "confdefs.h"
 
 int main() {
 ${x_direct_test_function}()
 ; return 0; }
 EOF
 #include "confdefs.h"
 
 int main() {
 ${x_direct_test_function}()
 ; return 0; }
 EOF
-if { (eval echo configure:683: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+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.
   rm -rf conftest*
   LIBS="$ac_save_LIBS"
 # We can link X programs with no special library path.
@@ -802,7 +804,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:806: checking host system type" >&5
+echo "configure:808: checking host system type" >&5
 
 host_alias=$host
 case "$host_alias" in
 
 host_alias=$host
 case "$host_alias" in
@@ -850,7 +852,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:854: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:856: 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
@@ -879,7 +881,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:883: checking for $ac_word" >&5
+echo "configure:885: 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
@@ -909,7 +911,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:913: checking for $ac_word" >&5
+echo "configure:915: 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
@@ -960,7 +962,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:964: checking for $ac_word" >&5
+echo "configure:966: 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
@@ -992,7 +994,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:996: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:998: 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.
@@ -1003,12 +1005,12 @@ cross_compiling=$ac_cv_prog_cc_cross
 
 cat > conftest.$ac_ext << EOF
 
 
 cat > conftest.$ac_ext << EOF
 
-#line 1007 "configure"
+#line 1009 "configure"
 #include "confdefs.h"
 
 main(){return(0);}
 EOF
 #include "confdefs.h"
 
 main(){return(0);}
 EOF
-if { (eval echo configure:1012: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1014: \"$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
@@ -1034,12 +1036,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:1038: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:1040: 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:1043: checking whether we are using GNU C" >&5
+echo "configure:1045: 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
@@ -1048,7 +1050,7 @@ else
   yes;
 #endif
 EOF
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1052: \"$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:1054: \"$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
@@ -1067,7 +1069,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:1071: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:1073: 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
@@ -1099,7 +1101,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:1103: checking how to run the C preprocessor" >&5
+echo "configure:1105: 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=
@@ -1114,13 +1116,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 1118 "configure"
+#line 1120 "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:1124: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1126: \"$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
   :
@@ -1131,13 +1133,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 1135 "configure"
+#line 1137 "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:1141: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1143: \"$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
   :
@@ -1148,13 +1150,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 1152 "configure"
+#line 1154 "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:1158: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1160: \"$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
   :
@@ -1183,7 +1185,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:1187: checking for $ac_word" >&5
+echo "configure:1189: 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
@@ -1213,29 +1215,30 @@ test -n "$AWK" && break
 done
 
 
 done
 
 
-CC_G_OPT="-g"                          
+CC_G_OPT="-g"                                  
 CC_SHARED_OPTS=unknown                 
 CPPFLAGS="$CPPFLAGS"                   
 CC_SHARED_OPTS=unknown                 
 CPPFLAGS="$CPPFLAGS"                   
-DFT_DEP_SUFFIX=""                      
+DFT_DEP_SUFFIX=""                              
 DFT_OBJ_SUBDIR=`pwd|sed -e's:.*/::'`   
 DFT_UPR_MODEL="NORMAL"                 
 DFT_OBJ_SUBDIR=`pwd|sed -e's:.*/::'`   
 DFT_UPR_MODEL="NORMAL"                 
-ECHO_LINK='@ echo linking $@ ... ;'    
-LD="ld"                                        
-LDFLAGS_SHARED=""                      
-LD_MODEL=""                            
-LD_SHARED_OPTS=""                      
-LIBTOOL=""                             
-LIB_CLEAN=""                           
-LIB_COMPILE=""                         
-LIB_LINK=""                            
-LINK_TESTS=""                          
-LINT=lint                              
-LINT_OPTS=""                           
-LOCAL_LDFLAGS=""                       
-MATH_LIB="-lm"                         
-TEST_ARGS=""                           
-TEST_DEPS=""                           
-TICS_LEAKS=""                          
+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=""                   
 cf_cv_rel_version=""                   
 TINFO_ARGS='$(LIBS_CURSES)'            
 cf_cv_abi_version=""                   
 cf_cv_rel_version=""                   
@@ -1244,12 +1247,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:1248: checking for Cygwin environment" >&5
+echo "configure:1251: 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 1253 "configure"
+#line 1256 "configure"
 #include "confdefs.h"
 
 int main() {
 #include "confdefs.h"
 
 int main() {
@@ -1260,7 +1263,7 @@ int main() {
 return __CYGWIN__;
 ; return 0; }
 EOF
 return __CYGWIN__;
 ; return 0; }
 EOF
-if { (eval echo configure:1264: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1267: \"$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
@@ -1277,19 +1280,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:1281: checking for mingw32 environment" >&5
+echo "configure:1284: 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 1286 "configure"
+#line 1289 "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:1293: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1296: \"$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
@@ -1308,7 +1311,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:1312: checking for executable suffix" >&5
+echo "configure:1315: 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
@@ -1318,7 +1321,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:1322: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+  if { (eval echo configure:1325: \"$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) ;;
@@ -1339,13 +1342,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:1343: checking for object suffix" >&5
+echo "configure:1346: 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:1349: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1352: \"$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) ;;
@@ -1365,7 +1368,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:1369: checking for ${CC-cc} option to accept ANSI C" >&5
+echo "configure:1372: 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
@@ -1449,7 +1452,7 @@ fi
 
 if test -n "$cf_new_cppflags" ; then
        
 
 if test -n "$cf_new_cppflags" ; then
        
-       CPPFLAGS="$cf_new_cppflags $CPPFLAGS"
+       CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
 fi
 
 if test -n "$cf_new_extra_cppflags" ; then
 fi
 
 if test -n "$cf_new_extra_cppflags" ; then
@@ -1461,7 +1464,7 @@ fi
 
 
        cat > conftest.$ac_ext <<EOF
 
 
        cat > conftest.$ac_ext <<EOF
-#line 1465 "configure"
+#line 1468 "configure"
 #include "confdefs.h"
 
 #ifndef CC_HAS_PROTOS
 #include "confdefs.h"
 
 #ifndef CC_HAS_PROTOS
@@ -1477,7 +1480,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:1481: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1484: \"$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
@@ -1556,7 +1559,7 @@ fi
 
 if test -n "$cf_new_cppflags" ; then
        
 
 if test -n "$cf_new_cppflags" ; then
        
-       CPPFLAGS="$cf_new_cppflags $CPPFLAGS"
+       CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
 fi
 
 if test -n "$cf_new_extra_cppflags" ; then
 fi
 
 if test -n "$cf_new_extra_cppflags" ; then
@@ -1585,175 +1588,6 @@ You have the following choices:
 fi
 
 
 fi
 
 
-
-GCC_VERSION=none
-if test "$GCC" = yes ; then
-       echo $ac_n "checking version of $CC""... $ac_c" 1>&6
-echo "configure:1593: checking version of $CC" >&5
-       GCC_VERSION="`${CC} --version| 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
-
-
-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:1603: 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
-  enableval="$enable_warnings"
-  test "$enableval" != yes && enableval=no
-  if test "$enableval" != "no" ; then
-    with_warnings=yes 
-  else
-    with_warnings=no
-  fi
-else
-  enableval=no 
-  with_warnings=no
-  
-fi
-
-echo "$ac_t""$with_warnings" 1>&6
-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:1632: checking if this is really Intel C compiler" >&5
-               cf_save_CFLAGS="$CFLAGS"
-               CFLAGS="$CFLAGS -no-gcc"
-               cat > conftest.$ac_ext <<EOF
-#line 1636 "configure"
-#include "confdefs.h"
-
-int main() {
-
-#ifdef __INTEL_COMPILER
-#else
-make an error
-#endif
-
-; return 0; }
-EOF
-if { (eval echo configure:1648: \"$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 1666 "configure"
-int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
-EOF
-
-if test "$INTEL_COMPILER" = yes
-then
-# The "-wdXXX" options suppress warnings:
-# remark #1419: external declaration in primary source file
-# remark #1682: implicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
-# remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
-# remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
-# remark #193: zero used for undefined preprocessing identifier
-# remark #593: variable "curs_sb_left_arrow" was set but never used
-# remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
-# remark #869: parameter "tw" was never referenced
-# remark #981: operands are evaluated in unspecified order
-# warning #269: invalid format string conversion
-
-       echo "checking for $CC warning options" 1>&6
-echo "configure:1685: checking for $CC warning options" >&5
-       cf_save_CFLAGS="$CFLAGS"
-       EXTRA_CFLAGS="-Wall"
-       for cf_opt in  \
-               wd1419 \
-               wd1682 \
-               wd1683 \
-               wd1684 \
-               wd193 \
-               wd279 \
-               wd593 \
-               wd810 \
-               wd869 \
-               wd981
-       do
-               CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
-               if { (eval echo configure:1701: \"$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
-       done
-       CFLAGS="$cf_save_CFLAGS"
-
-elif test "$GCC" = yes
-then
-       echo "checking for $CC warning options" 1>&6
-echo "configure:1711: checking for $CC warning options" >&5
-       cf_save_CFLAGS="$CFLAGS"
-       EXTRA_CFLAGS="-W -Wall"
-       cf_warn_CONST=""
-       test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
-       for cf_opt in \
-               Wbad-function-cast \
-               Wcast-align \
-               Wcast-qual \
-               Winline \
-               Wmissing-declarations \
-               Wmissing-prototypes \
-               Wnested-externs \
-               Wpointer-arith \
-               Wshadow \
-               Wstrict-prototypes \
-               Wundef $cf_warn_CONST 
-       do
-               CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
-               if { (eval echo configure:1730: \"$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
-                               CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES"
-                               ;;
-                       Winline) #(vi
-                               case $GCC_VERSION in
-                               3.3*)
-                                       test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
-
-                                       continue;;
-                               esac
-                               ;;
-                       esac
-                       EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
-               fi
-       done
-       CFLAGS="$cf_save_CFLAGS"
-fi
-rm -f conftest*
-
-
-
-fi
-fi
-
-
 if test "$GCC" = yes
 then
 cat > conftest.i <<EOF
 if test "$GCC" = yes
 then
 cat > conftest.i <<EOF
@@ -1773,9 +1607,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:1777: checking for $CC __attribute__ directives" >&5
+echo "configure:1611: checking for $CC __attribute__ directives" >&5
 cat > conftest.$ac_ext <<EOF
 cat > conftest.$ac_ext <<EOF
-#line 1779 "configure"
+#line 1613 "${as_me-configure}"
 #include "confdefs.h"
 #include "conftest.h"
 #include "conftest.i"
 #include "confdefs.h"
 #include "conftest.h"
 #include "conftest.i"
@@ -1813,7 +1647,7 @@ EOF
 EOF
                        ;;
                esac
 EOF
                        ;;
                esac
-               if { (eval echo configure:1817: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+               if { (eval echo configure:1651: \"$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
                fi
                        test -n "$verbose" && echo "$ac_t""... $cf_attribute" 1>&6
                        cat conftest.h >>confdefs.h
                fi
@@ -1826,7 +1660,7 @@ fi
 
 
 echo $ac_n "checking if $CC -U and -D options work together""... $ac_c" 1>&6
 
 
 echo $ac_n "checking if $CC -U and -D options work together""... $ac_c" 1>&6
-echo "configure:1830: checking if $CC -U and -D options work together" >&5
+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
 if eval "test \"`echo '$''{'cf_cv_cc_u_d_options'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1834,7 +1668,7 @@ else
        cf_save_CPPFLAGS="$CPPFLAGS"
        CPPFLAGS="-UU_D_OPTIONS -DU_D_OPTIONS -DD_U_OPTIONS -UD_U_OPTIONS"
        cat > conftest.$ac_ext <<EOF
        cf_save_CPPFLAGS="$CPPFLAGS"
        CPPFLAGS="-UU_D_OPTIONS -DU_D_OPTIONS -DD_U_OPTIONS -UD_U_OPTIONS"
        cat > conftest.$ac_ext <<EOF
-#line 1838 "configure"
+#line 1672 "configure"
 #include "confdefs.h"
 
 int main() {
 #include "confdefs.h"
 
 int main() {
@@ -1848,7 +1682,7 @@ make a defined-error
        
 ; return 0; }
 EOF
        
 ; return 0; }
 EOF
-if { (eval echo configure:1852: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+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
   rm -rf conftest*
   
        cf_cv_cc_u_d_options=yes
@@ -1874,10 +1708,10 @@ cf_XOPEN_SOURCE=500
 cf_POSIX_C_SOURCE=199506L
 
 case $host_os in #(vi
 cf_POSIX_C_SOURCE=199506L
 
 case $host_os in #(vi
-aix[45]*) #(vi
+aix[456]*) #(vi
        CPPFLAGS="$CPPFLAGS -D_ALL_SOURCE"
        ;;
        CPPFLAGS="$CPPFLAGS -D_ALL_SOURCE"
        ;;
-freebsd*) #(vi
+freebsd*|dragonfly*) #(vi
        # 5.x headers associate
        #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
        #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
        # 5.x headers associate
        #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
        #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
@@ -1891,16 +1725,16 @@ hpux*) #(vi
 irix[56].*) #(vi
        CPPFLAGS="$CPPFLAGS -D_SGI_SOURCE"
        ;;
 irix[56].*) #(vi
        CPPFLAGS="$CPPFLAGS -D_SGI_SOURCE"
        ;;
-linux*|gnu*) #(vi
+linux*|gnu*|mint*|k*bsd*-gnu) #(vi
        
 echo $ac_n "checking if we must define _GNU_SOURCE""... $ac_c" 1>&6
        
 echo $ac_n "checking if we must define _GNU_SOURCE""... $ac_c" 1>&6
-echo "configure:1898: checking if we must define _GNU_SOURCE" >&5
+echo "configure:1732: 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 1904 "configure"
+#line 1738 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 int main() {
 #include "confdefs.h"
 #include <sys/types.h>
 int main() {
@@ -1910,7 +1744,7 @@ make an error
 #endif
 ; return 0; }
 EOF
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:1914: \"$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
@@ -1920,7 +1754,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 1924 "configure"
+#line 1758 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 int main() {
 #include "confdefs.h"
 #include <sys/types.h>
 int main() {
@@ -1930,7 +1764,7 @@ make an error
 #endif
 ; return 0; }
 EOF
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:1934: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1768: \"$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
@@ -1974,13 +1808,13 @@ solaris*) #(vi
        ;;
 *)
        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:1978: checking if we should define _XOPEN_SOURCE" >&5
+echo "configure:1812: 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 1984 "configure"
+#line 1818 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 int main() {
 #include "confdefs.h"
 #include <sys/types.h>
 int main() {
@@ -1990,7 +1824,7 @@ make an error
 #endif
 ; return 0; }
 EOF
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:1994: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1828: \"$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
@@ -2000,7 +1834,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 2004 "configure"
+#line 1838 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 int main() {
 #include "confdefs.h"
 #include <sys/types.h>
 int main() {
@@ -2010,7 +1844,7 @@ make an error
 #endif
 ; return 0; }
 EOF
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:2014: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1848: \"$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
@@ -2065,16 +1899,16 @@ cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
 
 
 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:2069: checking if we should define _POSIX_C_SOURCE" >&5
+echo "configure:1903: 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 "(line 2075) testing if the symbol is already defined go no further ..." 1>&5
+echo "${as_me-configure}:1909: testing if the symbol is already defined go no further ..." 1>&5
 
        cat > conftest.$ac_ext <<EOF
 
        cat > conftest.$ac_ext <<EOF
-#line 2078 "configure"
+#line 1912 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 int main() {
 #include "confdefs.h"
 #include <sys/types.h>
 int main() {
@@ -2084,7 +1918,7 @@ make an error
 #endif
 ; return 0; }
 EOF
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:2088: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1922: \"$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
@@ -2106,7 +1940,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 2110 "configure"
+#line 1944 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 int main() {
 #include "confdefs.h"
 #include <sys/types.h>
 int main() {
@@ -2116,7 +1950,7 @@ make an error
 #endif
 ; return 0; }
 EOF
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:2120: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1954: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   :
 else
   echo "configure: failed program was:" >&5
   :
 else
   echo "configure: failed program was:" >&5
@@ -2127,15 +1961,15 @@ fi
 rm -f conftest*
         fi
         
 rm -f conftest*
         fi
         
-echo "(line 2131) testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
+echo "${as_me-configure}:1965: 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 "(line 2136) testing if the second compile does not leave our definition intact error ..." 1>&5
+echo "${as_me-configure}:1970: 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 2139 "configure"
+#line 1973 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 int main() {
 #include "confdefs.h"
 #include <sys/types.h>
 int main() {
@@ -2145,7 +1979,7 @@ make an error
 #endif
 ; return 0; }
 EOF
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:2149: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1983: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   :
 else
   echo "configure: failed program was:" >&5
   :
 else
   echo "configure: failed program was:" >&5
        ;;
 esac
 
        ;;
 esac
 
+echo $ac_n "checking for working const""... $ac_c" 1>&6
+echo "configure:2018: 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
+#line 2023 "configure"
+#include "confdefs.h"
 
 
+int main() {
 
 
+/* Ultrix mips cc rejects this.  */
+typedef int charset[2]; const charset x;
+/* SunOS 4.1.1 cc rejects this.  */
+char const *const *ccp;
+char **p;
+/* NEC SVR4.0.2 mips cc rejects this.  */
+struct point {int x, y;};
+static struct point const zero = {0,0};
+/* AIX XL C 1.02.0.0 rejects this.
+   It does not let you subtract one const X* pointer from another in an arm
+   of an if-expression whose if-part is not a constant expression */
+const char *g = "string";
+ccp = &g + (g ? g-g : 0);
+/* HPUX 7.0 cc rejects these. */
+++ccp;
+p = (char**) ccp;
+ccp = (char const *const *) p;
+{ /* SCO 3.2v4 cc rejects this.  */
+  char *t;
+  char const *s = 0 ? (char *) 0 : (char const *) 0;
+
+  *t++ = 0;
+}
+{ /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
+  int x[] = {25, 17};
+  const int *foo = &x[0];
+  ++foo;
+}
+{ /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
+  typedef const int *iptr;
+  iptr p = 0;
+  ++p;
+}
+{ /* AIX XL C 1.02.0.0 rejects this saying
+     "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
+  struct s { int j; const int *ap[3]; };
+  struct s *b; b->j = 5;
+}
+{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
+  const int foo = 10;
+}
 
 
-# Check whether --with-curses-dir or --without-curses-dir was given.
-if test "${with_curses_dir+set}" = set; then
-  withval="$with_curses_dir"
-  
-if test "x$prefix" != xNONE; then
-  cf_path_syntax="$prefix"
+; return 0; }
+EOF
+if { (eval echo configure:2072: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  ac_cv_c_const=yes
 else
 else
-  cf_path_syntax="$ac_default_prefix"
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ac_cv_c_const=no
 fi
 fi
-
-case ".$withval" in #(vi
-.\$\(*\)*|.\'*\'*) #(vi
-  ;;
-..|./*|.\\*) #(vi
-  ;;
-.[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
-  ;;
-.\${*prefix}*) #(vi
-  eval withval="$withval"
-  case ".$withval" in #(vi
-  .NONE/*)
-    withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
-    ;;
-  esac
-  ;; #(vi
-.no|.NONE/*)
-  withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
-  ;;
-*)
-  { echo "configure: error: expected a pathname, not \"$withval\"" 1>&2; exit 1; }
-  ;;
-esac
-
-        cf_cv_curses_dir=$withval
-else
-  cf_cv_curses_dir=no
+rm -f conftest*
 fi
 
 fi
 
+echo "$ac_t""$ac_cv_c_const" 1>&6
+if test $ac_cv_c_const = no; then
+  cat >> confdefs.h <<\EOF
+#define const 
+EOF
 
 
-
-
-# Check whether --with-5lib or --without-5lib was given.
-if test "${with_5lib+set}" = set; then
-  withval="$with_5lib"
-  LIBS="-L/usr/5lib $LIBS"
-        CPPFLAGS="$CPPFLAGS -I/usr/5include"
 fi
 
 
 fi
 
 
-
-# Check whether --with-ncursesw or --without-ncursesw was given.
-if test "${with_ncursesw+set}" = set; then
-  withval="$with_ncursesw"
-  cf_cv_screen=ncursesw
+echo $ac_n "checking for signal global datatype""... $ac_c" 1>&6
+echo "configure:2094: 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
   
 else
   
+       for cf_type in \
+               "volatile sig_atomic_t" \
+               "sig_atomic_t" \
+               "int"
+       do
+       cat > conftest.$ac_ext <<EOF
+#line 2105 "configure"
+#include "confdefs.h"
 
 
+#include <sys/types.h>
+#include <signal.h>
+#include <stdio.h>
 
 
-# Check whether --with-ncurses or --without-ncurses was given.
-if test "${with_ncurses+set}" = set; then
-  withval="$with_ncurses"
-  cf_cv_screen=ncurses
+extern $cf_type x;
+$cf_type x;
+static void handler(int sig)
+{
+       x = 5;
+}
+int main() {
+signal(SIGINT, handler);
+                x = 1
+; return 0; }
+EOF
+if { (eval echo configure:2123: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  cf_cv_sig_atomic_t=$cf_type
 else
 else
-  
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  cf_cv_sig_atomic_t=no
+fi
+rm -f conftest*
+               test "$cf_cv_sig_atomic_t" != no && break
+       done
+       
+fi
 
 
+echo "$ac_t""$cf_cv_sig_atomic_t" 1>&6
+test "$cf_cv_sig_atomic_t" != no && cat >> confdefs.h <<EOF
+#define SIG_ATOMIC_T $cf_cv_sig_atomic_t
+EOF
 
 
-# Check whether --with-pdcurses or --without-pdcurses was given.
-if test "${with_pdcurses+set}" = set; then
-  withval="$with_pdcurses"
-  cf_cv_screen=pdcurses
-fi
 
 
-fi
 
 
-fi
+
+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
+
+# Check whether --enable-echo or --disable-echo was given.
+if test "${enable_echo+set}" = set; then
+  enableval="$enable_echo"
+  test "$enableval" != no && enableval=yes
+  if test "$enableval" != "yes" ; then
+    
+    ECHO_LT='--silent'
+    ECHO_LD='@echo linking $@;'
+    RULE_CC='  @echo compiling $<'
+    SHOW_CC='  @echo compiling $@'
+    ECHO_CC='@'
+  else
+    
+    ECHO_LT=''
+    ECHO_LD=''
+    RULE_CC='# compiling'
+    SHOW_CC='# compiling'
+    ECHO_CC=''
+
+  fi
+else
+  enableval=yes 
+  
+    ECHO_LT=''
+    ECHO_LD=''
+    RULE_CC='# compiling'
+    SHOW_CC='# compiling'
+    ECHO_CC=''
+
+  
+fi
+
+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
+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.].*//'`"
+       test -z "$GCC_VERSION" && GCC_VERSION=unknown
+       echo "$ac_t""$GCC_VERSION" 1>&6
+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
+echo "configure:2204: 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
+  enableval="$enable_warnings"
+  test "$enableval" != yes && enableval=no
+  if test "$enableval" != "no" ; then
+    with_warnings=yes 
+  else
+    with_warnings=no
+  fi
+else
+  enableval=no 
+  with_warnings=no
+  
+fi
+
+echo "$ac_t""$with_warnings" 1>&6
+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"
+#include "confdefs.h"
+
+int main() {
+
+#ifdef __INTEL_COMPILER
+#else
+make an error
+#endif
+
+; return 0; }
+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
+
+
+cat > conftest.$ac_ext <<EOF
+#line 2267 "${as_me-configure}"
+int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
+EOF
+
+if test "$INTEL_COMPILER" = yes
+then
+# The "-wdXXX" options suppress warnings:
+# remark #1419: external declaration in primary source file
+# remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
+# remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
+# remark #193: zero used for undefined preprocessing identifier
+# remark #593: variable "curs_sb_left_arrow" was set but never used
+# remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
+# remark #869: parameter "tw" was never referenced
+# remark #981: operands are evaluated in unspecified order
+# warning #279: controlling expression is constant
+
+       echo "checking for $CC warning options" 1>&6
+echo "configure:2285: checking for $CC warning options" >&5
+       cf_save_CFLAGS="$CFLAGS"
+       EXTRA_CFLAGS="-Wall"
+       for cf_opt in \
+               wd1419 \
+               wd1683 \
+               wd1684 \
+               wd193 \
+               wd593 \
+               wd279 \
+               wd810 \
+               wd869 \
+               wd981
+       do
+               CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
+               if { (eval echo configure:2300: \"$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
+       done
+       CFLAGS="$cf_save_CFLAGS"
+
+elif test "$GCC" = yes
+then
+       echo "checking for $CC warning options" 1>&6
+echo "configure:2310: checking for $CC warning options" >&5
+       cf_save_CFLAGS="$CFLAGS"
+       EXTRA_CFLAGS="-W -Wall"
+       cf_warn_CONST=""
+       test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
+       for cf_opt in \
+               Wbad-function-cast \
+               Wcast-align \
+               Wcast-qual \
+               Winline \
+               Wmissing-declarations \
+               Wmissing-prototypes \
+               Wnested-externs \
+               Wpointer-arith \
+               Wshadow \
+               Wstrict-prototypes \
+               Wundef $cf_warn_CONST 
+       do
+               CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
+               if { (eval echo configure:2329: \"$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
+                               CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES"
+                               ;;
+                       Winline) #(vi
+                               case $GCC_VERSION in
+                               [34].*)
+                                       test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
+
+echo "${as_me-configure}:2340: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
+
+
+                                       continue;;
+                               esac
+                               ;;
+                       esac
+                       EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
+               fi
+       done
+       CFLAGS="$cf_save_CFLAGS"
+fi
+rm -f conftest*
+
+
+
+fi
+fi
+
+
+
+
+# Check whether --with-curses-dir or --without-curses-dir was given.
+if test "${with_curses_dir+set}" = set; then
+  withval="$with_curses_dir"
+  
+if test "x$prefix" != xNONE; then
+  cf_path_syntax="$prefix"
+else
+  cf_path_syntax="$ac_default_prefix"
+fi
+
+case ".$withval" in #(vi
+.\$\(*\)*|.\'*\'*) #(vi
+  ;;
+..|./*|.\\*) #(vi
+  ;;
+.[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
+  ;;
+.\${*prefix}*) #(vi
+  eval withval="$withval"
+  case ".$withval" in #(vi
+  .NONE/*)
+    withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
+    ;;
+  esac
+  ;; #(vi
+.no|.NONE/*)
+  withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
+  ;;
+*)
+  { echo "configure: error: expected a pathname, not \"$withval\"" 1>&2; exit 1; }
+  ;;
+esac
+
+        cf_cv_curses_dir=$withval
+else
+  cf_cv_curses_dir=no
+fi
+
+
+
+
+# Check whether --with-5lib or --without-5lib was given.
+if test "${with_5lib+set}" = set; then
+  withval="$with_5lib"
+  LIBS="-L/usr/5lib $LIBS"
+        CPPFLAGS="$CPPFLAGS -I/usr/5include"
+fi
+
+
+
+# Check whether --with-ncursesw or --without-ncursesw was given.
+if test "${with_ncursesw+set}" = set; then
+  withval="$with_ncursesw"
+  cf_cv_screen=ncursesw
+else
+  
+
+
+# Check whether --with-ncurses or --without-ncurses was given.
+if test "${with_ncurses+set}" = set; then
+  withval="$with_ncurses"
+  cf_cv_screen=ncurses
+else
+  
+
+
+# Check whether --with-pdcurses or --without-pdcurses was given.
+if test "${with_pdcurses+set}" = set; then
+  withval="$with_pdcurses"
+  cf_cv_screen=pdcurses
+fi
+
+fi
+
+fi
 
 
 case $cf_cv_screen in
 
 
 case $cf_cv_screen in
@@ -2264,7 +2440,7 @@ 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:2268: checking for extra include directories" >&5
+echo "configure:2444: 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
@@ -2285,11 +2461,11 @@ esac
 fi
 
 echo "$ac_t""$cf_cv_curses_incdir" 1>&6
 fi
 
 echo "$ac_t""$cf_cv_curses_incdir" 1>&6
-test "$cf_cv_curses_incdir" != no && CPPFLAGS="$cf_cv_curses_incdir $CPPFLAGS"
+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:2293: checking if we have identified curses headers" >&5
+echo "configure:2469: 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
 if eval "test \"`echo '$''{'cf_cv_ncurses_header'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2302,14 +2478,14 @@ for cf_header in \
        ncurses/ncurses.h
 do
 cat > conftest.$ac_ext <<EOF
        ncurses/ncurses.h
 do
 cat > conftest.$ac_ext <<EOF
-#line 2306 "configure"
+#line 2482 "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:2313: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2489: \"$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
@@ -2332,17 +2508,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:2336: checking for $ac_hdr" >&5
+echo "configure:2512: 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 2341 "configure"
+#line 2517 "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:2346: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2522: \"$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*
@@ -2371,7 +2547,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:2375: checking for terminfo header" >&5
+echo "configure:2551: 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
@@ -2388,7 +2564,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 2392 "configure"
+#line 2568 "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}>
@@ -2398,7 +2574,7 @@ int main() {
 int x = auto_left_margin
 ; return 0; }
 EOF
 int x = auto_left_margin
 ; return 0; }
 EOF
-if { (eval echo configure:2402: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2578: \"$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"
@@ -2447,7 +2623,7 @@ 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:2451: checking for ncurses version" >&5
+echo "configure:2627: 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
@@ -2473,7 +2649,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:2477: \"$cf_try\") 1>&5; (eval $cf_try) 2>&5; }
+       { (eval echo configure:2653: \"$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"
@@ -2482,7 +2658,7 @@ EOF
 
 else
   cat > conftest.$ac_ext <<EOF
 
 else
   cat > conftest.$ac_ext <<EOF
-#line 2486 "configure"
+#line 2662 "configure"
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header-curses.h}>
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header-curses.h}>
@@ -2503,10 +2679,10 @@ int main()
        make an error
 # endif
 #endif
        make an error
 # endif
 #endif
-       exit(0);
+       ${cf_cv_main_return-return}(0);
 }
 EOF
 }
 EOF
-if { (eval echo configure:2510: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2686: \"$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`
@@ -2530,16 +2706,16 @@ 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:2534: checking if we have identified curses libraries" >&5
+echo "configure:2710: checking if we have identified curses libraries" >&5
 cat > conftest.$ac_ext <<EOF
 cat > conftest.$ac_ext <<EOF
-#line 2536 "configure"
+#line 2712 "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:2543: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2719: \"$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
@@ -2554,8 +2730,8 @@ echo "$ac_t""$cf_result" 1>&6
 if test "$cf_result" = no ; then
 case $host_os in #(vi
 freebsd*) #(vi
 if test "$cf_result" = no ; then
 case $host_os in #(vi
 freebsd*) #(vi
-       echo $ac_n "checking for tgoto in -lmytinfo""... $ac_c" 1>&6
-echo "configure:2559: checking for tgoto in -lmytinfo" >&5
+    echo $ac_n "checking for tgoto in -lmytinfo""... $ac_c" 1>&6
+echo "configure:2735: 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
@@ -2563,7 +2739,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 2567 "configure"
+#line 2743 "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
@@ -2574,7 +2750,7 @@ int main() {
 tgoto()
 ; return 0; }
 EOF
 tgoto()
 ; return 0; }
 EOF
-if { (eval echo configure:2578: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2754: \"$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
@@ -2594,10 +2770,10 @@ else
   echo "$ac_t""no" 1>&6
 fi
 
   echo "$ac_t""no" 1>&6
 fi
 
-       ;;
+    ;;
 hpux10.*) #(vi
 hpux10.*) #(vi
-       echo $ac_n "checking for initscr in -lcur_colr""... $ac_c" 1>&6
-echo "configure:2601: checking for initscr in -lcur_colr" >&5
+    echo $ac_n "checking for initscr in -lcur_colr""... $ac_c" 1>&6
+echo "configure:2777: 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
@@ -2605,7 +2781,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 2609 "configure"
+#line 2785 "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
@@ -2616,7 +2792,7 @@ int main() {
 initscr()
 ; return 0; }
 EOF
 initscr()
 ; return 0; }
 EOF
-if { (eval echo configure:2620: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2796: \"$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
@@ -2632,14 +2808,14 @@ fi
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   
-               LIBS="-lcur_colr $LIBS"
-               ac_cv_func_initscr=yes
-               
+        LIBS="-lcur_colr $LIBS"
+        ac_cv_func_initscr=yes
+        
 else
   echo "$ac_t""no" 1>&6
 
 else
   echo "$ac_t""no" 1>&6
 
-       echo $ac_n "checking for initscr in -lHcurses""... $ac_c" 1>&6
-echo "configure:2643: checking for initscr in -lHcurses" >&5
+    echo $ac_n "checking for initscr in -lHcurses""... $ac_c" 1>&6
+echo "configure:2819: 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
@@ -2647,7 +2823,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 2651 "configure"
+#line 2827 "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
@@ -2658,7 +2834,7 @@ int main() {
 initscr()
 ; return 0; }
 EOF
 initscr()
 ; return 0; }
 EOF
-if { (eval echo configure:2662: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2838: \"$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
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   
-               # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
-               LIBS="-lHcurses $LIBS"
-               CPPFLAGS="-D__HP_CURSES -D_HP_CURSES $CPPFLAGS"
-               ac_cv_func_initscr=yes
-               
+        # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
+        LIBS="-lHcurses $LIBS"
+        CPPFLAGS="$CPPFLAGS -D__HP_CURSES -D_HP_CURSES"
+        ac_cv_func_initscr=yes
+        
 else
   echo "$ac_t""no" 1>&6
 fi
 
 fi
 
 else
   echo "$ac_t""no" 1>&6
 fi
 
 fi
 
-       ;;
+    ;;
 linux*) # Suse Linux does not follow /usr/lib convention
 linux*) # Suse Linux does not follow /usr/lib convention
-       LIBS="$LIBS -L/lib"
-       ;;
+    
+if test -n "/lib" ; then
+  for cf_add_libdir in /lib
+  do
+    if test $cf_add_libdir = /usr/lib ; then
+      :
+    elif test -d $cf_add_libdir
+    then
+      cf_have_libdir=no
+      if test -n "$LDFLAGS$LIBS" ; then
+        # a loop is needed to ensure we can add subdirs of existing dirs
+        for cf_test_libdir in $LDFLAGS $LIBS ; do
+          if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
+            cf_have_libdir=yes; break
+          fi
+        done
+      fi
+      if test "$cf_have_libdir" = no ; then
+        test -n "$verbose" && echo "   adding $cf_add_libdir to library-path" 1>&6
+
+echo "${as_me-configure}:2887: testing adding $cf_add_libdir to library-path ..." 1>&5
+
+
+        LDFLAGS="-L$cf_add_libdir $LDFLAGS"
+      fi
+    fi
+  done
+fi
+
+    ;;
 sunos3*|sunos4*)
 sunos3*|sunos4*)
-       test -d /usr/5lib && \
-       LIBS="$LIBS -L/usr/5lib -lcurses -ltermcap"
-       ac_cv_func_initscr=yes
-       ;;
+    if test -d /usr/5lib ; then
+      
+if test -n "/usr/5lib" ; then
+  for cf_add_libdir in /usr/5lib
+  do
+    if test $cf_add_libdir = /usr/lib ; then
+      :
+    elif test -d $cf_add_libdir
+    then
+      cf_have_libdir=no
+      if test -n "$LDFLAGS$LIBS" ; then
+        # a loop is needed to ensure we can add subdirs of existing dirs
+        for cf_test_libdir in $LDFLAGS $LIBS ; do
+          if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
+            cf_have_libdir=yes; break
+          fi
+        done
+      fi
+      if test "$cf_have_libdir" = no ; then
+        test -n "$verbose" && echo "   adding $cf_add_libdir to library-path" 1>&6
+
+echo "${as_me-configure}:2919: testing adding $cf_add_libdir to library-path ..." 1>&5
+
+
+        LDFLAGS="-L$cf_add_libdir $LDFLAGS"
+      fi
+    fi
+  done
+fi
+
+      LIBS="$LIBS -lcurses -ltermcap"
+    fi
+    ac_cv_func_initscr=yes
+    ;;
 esac
 
 if test ".$ac_cv_func_initscr" != .yes ; then
 esac
 
 if test ".$ac_cv_func_initscr" != .yes ; then
-       cf_save_LIBS="$LIBS"
-       cf_term_lib=""
-       cf_curs_lib=""
+    cf_save_LIBS="$LIBS"
+    cf_term_lib=""
+    cf_curs_lib=""
 
 
-       if test ".${cf_cv_ncurses_version-no}" != .no
-       then
-               cf_check_list="ncurses curses cursesX"
-       else
-               cf_check_list="cursesX curses ncurses"
-       fi
+    if test ".${cf_cv_ncurses_version-no}" != .no
+    then
+        cf_check_list="ncurses curses cursesX"
+    else
+        cf_check_list="cursesX curses ncurses"
+    fi
 
 
-       # Check for library containing tgoto.  Do this before curses library
-       # because it may be needed to link the test-case for initscr.
-       echo $ac_n "checking for tgoto""... $ac_c" 1>&6
-echo "configure:2715: checking for tgoto" >&5
+    # 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
 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 2720 "configure"
+#line 2954 "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.  */
@@ -2739,7 +2973,7 @@ tgoto();
 
 ; return 0; }
 EOF
 
 ; return 0; }
 EOF
-if { (eval echo configure:2743: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2977: \"$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
@@ -2757,10 +2991,10 @@ if eval "test \"`echo '$ac_cv_func_'tgoto`\" = yes"; then
 else
   echo "$ac_t""no" 1>&6
 
 else
   echo "$ac_t""no" 1>&6
 
-               for cf_term_lib in $cf_check_list termcap termlib unknown
-               do
-                       echo $ac_n "checking for tgoto in -l$cf_term_lib""... $ac_c" 1>&6
-echo "configure:2764: checking for tgoto in -l$cf_term_lib" >&5
+        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
 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
@@ -2768,7 +3002,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 2772 "configure"
+#line 3006 "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
@@ -2779,7 +3013,7 @@ int main() {
 tgoto()
 ; return 0; }
 EOF
 tgoto()
 ; return 0; }
 EOF
-if { (eval echo configure:2783: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3017: \"$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
@@ -2799,17 +3033,17 @@ else
   echo "$ac_t""no" 1>&6
 fi
 
   echo "$ac_t""no" 1>&6
 fi
 
-               done
-       
+        done
+    
 fi
 
 
 fi
 
 
-       # Check for library containing initscr
-       test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
-       for cf_curs_lib in $cf_check_list xcurses jcurses unknown
-       do
-               echo $ac_n "checking for initscr in -l$cf_curs_lib""... $ac_c" 1>&6
-echo "configure:2813: checking for initscr in -l$cf_curs_lib" >&5
+    # Check for library containing initscr
+    test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
+       for cf_curs_lib in $cf_check_list xcurses jcurses 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
 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
@@ -2817,7 +3051,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 2821 "configure"
+#line 3055 "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
@@ -2828,7 +3062,7 @@ int main() {
 initscr()
 ; return 0; }
 EOF
 initscr()
 ; return 0; }
 EOF
-if { (eval echo configure:2832: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3066: \"$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
@@ -2848,22 +3082,22 @@ else
   echo "$ac_t""no" 1>&6
 fi
 
   echo "$ac_t""no" 1>&6
 fi
 
-       done
-       test $cf_curs_lib = unknown && { echo "configure: error: no curses library found" 1>&2; exit 1; }
-
-       LIBS="-l$cf_curs_lib $cf_save_LIBS"
-       if test "$cf_term_lib" = unknown ; then
-               echo $ac_n "checking if we can link with $cf_curs_lib library""... $ac_c" 1>&6
-echo "configure:2858: checking if we can link with $cf_curs_lib library" >&5
-               cat > conftest.$ac_ext <<EOF
-#line 2860 "configure"
+    done
+    test $cf_curs_lib = unknown && { echo "configure: error: no curses library found" 1>&2; exit 1; }
+
+    LIBS="-l$cf_curs_lib $cf_save_LIBS"
+    if test "$cf_term_lib" = unknown ; then
+        echo $ac_n "checking if we can link with $cf_curs_lib library""... $ac_c" 1>&6
+echo "configure:3092: checking if we can link with $cf_curs_lib library" >&5
+        cat > conftest.$ac_ext <<EOF
+#line 3094 "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:2867: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3101: \"$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
@@ -2873,22 +3107,22 @@ else
   cf_result=no
 fi
 rm -f conftest*
   cf_result=no
 fi
 rm -f conftest*
-               echo "$ac_t""$cf_result" 1>&6
-               test $cf_result = no && { echo "configure: error: Cannot link curses library" 1>&2; exit 1; }
-       elif test "$cf_curs_lib" = "$cf_term_lib" ; then
-               :
-       elif test "$cf_term_lib" != predefined ; then
-               echo $ac_n "checking if we need both $cf_curs_lib and $cf_term_lib libraries""... $ac_c" 1>&6
-echo "configure:2883: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
-               cat > conftest.$ac_ext <<EOF
-#line 2885 "configure"
+        echo "$ac_t""$cf_result" 1>&6
+        test $cf_result = no && { echo "configure: error: Cannot link curses library" 1>&2; exit 1; }
+    elif test "$cf_curs_lib" = "$cf_term_lib" ; then
+        :
+    elif test "$cf_term_lib" != predefined ; then
+        echo $ac_n "checking if we need both $cf_curs_lib and $cf_term_lib libraries""... $ac_c" 1>&6
+echo "configure:3117: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
+        cat > conftest.$ac_ext <<EOF
+#line 3119 "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:2892: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3126: \"$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
@@ -2896,16 +3130,16 @@ else
   cat conftest.$ac_ext >&5
   rm -rf conftest*
   
   cat conftest.$ac_ext >&5
   rm -rf conftest*
   
-                       LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
-                       cat > conftest.$ac_ext <<EOF
-#line 2902 "configure"
+            LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
+            cat > conftest.$ac_ext <<EOF
+#line 3136 "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:2909: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3143: \"$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
@@ -2915,11 +3149,11 @@ else
   cf_result=error
 fi
 rm -f conftest*
   cf_result=error
 fi
 rm -f conftest*
-                       
+            
 fi
 rm -f conftest*
 fi
 rm -f conftest*
-               echo "$ac_t""$cf_result" 1>&6
-       fi
+        echo "$ac_t""$cf_result" 1>&6
+    fi
 fi
 fi
 
 fi
 fi
 
        ;;
 ncurses)
        
        ;;
 ncurses)
        
+cf_ncuconfig_root=ncurses
+
+echo "Looking for ${cf_ncuconfig_root}-config"
+for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
+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:3173: 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
+  case "$NCURSES_CONFIG" in
+  /*)
+  ac_cv_path_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test with a path.
+  ;;
+  ?:/*)                         
+  ac_cv_path_NCURSES_CONFIG="$NCURSES_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_NCURSES_CONFIG="$ac_dir/$ac_word"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+  ;;
+esac
+fi
+NCURSES_CONFIG="$ac_cv_path_NCURSES_CONFIG"
+if test -n "$NCURSES_CONFIG"; then
+  echo "$ac_t""$NCURSES_CONFIG" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+test -n "$NCURSES_CONFIG" && break
+done
+test -n "$NCURSES_CONFIG" || NCURSES_CONFIG="none"
+
+
+if test "$NCURSES_CONFIG" != none ; then
+
+cf_cv_ncurses_header=curses.h
+
+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`
+
+else
+
+
 
 cf_ncuhdr_root=ncurses
 
 test -n "$cf_cv_curses_dir" && \
 
 cf_ncuhdr_root=ncurses
 
 test -n "$cf_cv_curses_dir" && \
-test "$cf_cv_curses_dir" != "no" && \
-CPPFLAGS="-I$cf_cv_curses_dir/include -I$cf_cv_curses_dir/include/$cf_ncuhdr_root $CPPFLAGS"
+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 3265 "configure"
+#include "confdefs.h"
+#include <stdio.h>
+int main() {
+printf("Hello")
+; return 0; }
+EOF
+if { (eval echo configure:3272: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  :
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  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}:3289: testing adding $cf_add_incdir to include-path ..." 1>&5
+
+
+                 CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
+
+                 cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
+                 test "$cf_top_incdir" = "$cf_add_incdir" && break
+                 cf_add_incdir="$cf_top_incdir"
+               else
+                 break
+               fi
+         fi
+       done
+  done
+fi
+
+}
 
 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:2939: checking for $cf_ncuhdr_root header in include-path" >&5
+echo "configure:3308: 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
@@ -2946,7 +3315,7 @@ else
        do
                
        cat > conftest.$ac_ext <<EOF
        do
                
        cat > conftest.$ac_ext <<EOF
-#line 2950 "configure"
+#line 3319 "configure"
 #include "confdefs.h"
 
 
 #include "confdefs.h"
 
 
@@ -2967,7 +3336,7 @@ printf("old\n");
        
 ; return 0; }
 EOF
        
 ; return 0; }
 EOF
-if { (eval echo configure:2971: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3340: \"$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
        
@@ -2993,42 +3362,57 @@ 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:2997: checking for $cf_ncuhdr_root include-path" >&5
+echo "configure:3366: 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=""
-
-test -d "$HOME" && {
-       test -n "$verbose" && echo "    ... testing include-directories under $HOME"
-       test -d "$HOME/include" &&          cf_search="$cf_search $HOME/include"
-       test -d "$HOME/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $HOME/include/$cf_ncuhdr_root"
-       test -d "$HOME/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $HOME/include/$cf_ncuhdr_root/include"
+       
+cf_header_path_list=""
+if test -n "${CFLAGS}${CPPFLAGS}" ; then
+       for cf_header_path in $CPPFLAGS $CFLAGS
+       do
+               case $cf_header_path in #(vi
+               -I*)
+                       cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
+                       
+test "$cf_header_path" != "NONE" && \
+test -d "$cf_header_path" && \
+ {
+       test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
+       test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
+       test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
+       test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
+       test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
+       test -d $cf_header_path/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
 }
 
 }
 
-# For other stuff under the home directory, it should be sufficient to put
-# a symbolic link for $HOME/$cf_ncuhdr_root to the actual package location:
-test -d "$HOME/$cf_ncuhdr_root" && {
-       test -n "$verbose" && echo "    ... testing include-directories under $HOME/$cf_ncuhdr_root"
-       test -d "$HOME/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $HOME/$cf_ncuhdr_root/include"
-       test -d "$HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root" &&    cf_search="$cf_search $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
-}
+                       cf_header_path_list="$cf_header_path_list $cf_search"
+                       ;;
+               esac
+       done
+fi
+
+cf_search=""
 
 
-test "$prefix" != /usr/local && \
-test -d /usr/local && {
-       test -n "$verbose" && echo "    ... testing include-directories under /usr/local"
-       test -d /usr/local/include &&       cf_search="$cf_search /usr/local/include"
-       test -d /usr/local/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root"
-       test -d /usr/local/include/$cf_ncuhdr_root/include && cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root/include"
-       test -d /usr/local/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include"
-       test -d /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
+
+test "/usr" != "$prefix" && \
+test -d "/usr" && \
+(test $prefix = NONE || test -d $prefix) && {
+       test -n "$verbose" && echo "    ... testing for include-directories under /usr"
+       test -d /usr/include &&          cf_search="$cf_search /usr/include"
+       test -d /usr/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/include/$cf_ncuhdr_root"
+       test -d /usr/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/include/$cf_ncuhdr_root/include"
+       test -d /usr/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/$cf_ncuhdr_root/include"
+       test -d /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
 }
 
 }
 
-test "$prefix" != NONE && \
-test -d $prefix && {
-       test -n "$verbose" && echo "    ... testing include-directories under $prefix"
+
+test "$prefix" != "NONE" && \
+test -d "$prefix" && \
+ {
+       test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
        test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
        test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
        test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
        test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
        test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
        test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
@@ -3036,25 +3420,44 @@ test -d $prefix && {
        test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
 }
 
        test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
 }
 
-test "$prefix" != /opt && \
-test -d /opt && {
-       test -n "$verbose" && echo "    ... testing include-directories under /opt"
-       test -d /opt/include &&             cf_search="$cf_search /opt/include"
-       test -d /opt/include/$cf_ncuhdr_root &&          cf_search="$cf_search /opt/include/$cf_ncuhdr_root"
-       test -d /opt/include/$cf_ncuhdr_root/include &&       cf_search="$cf_search /opt/include/$cf_ncuhdr_root/include"
-       test -d /opt/$cf_ncuhdr_root/include &&          cf_search="$cf_search /opt/$cf_ncuhdr_root/include"
-       test -d /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&       cf_search="$cf_search /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
+
+test "/usr/local" != "$prefix" && \
+test -d "/usr/local" && \
+(test $prefix = NONE || test -d $prefix) && {
+       test -n "$verbose" && echo "    ... testing for include-directories under /usr/local"
+       test -d /usr/local/include &&          cf_search="$cf_search /usr/local/include"
+       test -d /usr/local/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root"
+       test -d /usr/local/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root/include"
+       test -d /usr/local/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include"
+       test -d /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
 }
 
 }
 
-test "$prefix" != /usr && \
-test -d /usr && {
-       test -n "$verbose" && echo "    ... testing include-directories under /usr"
-       test -d /usr/include &&             cf_search="$cf_search /usr/include"
-       test -d /usr/include/$cf_ncuhdr_root &&          cf_search="$cf_search /usr/include/$cf_ncuhdr_root"
-       test -d /usr/include/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/include/$cf_ncuhdr_root/include"
-       test -d /usr/$cf_ncuhdr_root/include &&          cf_search="$cf_search /usr/$cf_ncuhdr_root/include"
+
+test "/opt" != "$prefix" && \
+test -d "/opt" && \
+(test $prefix = NONE || test -d $prefix) && {
+       test -n "$verbose" && echo "    ... testing for include-directories under /opt"
+       test -d /opt/include &&          cf_search="$cf_search /opt/include"
+       test -d /opt/include/$cf_ncuhdr_root &&       cf_search="$cf_search /opt/include/$cf_ncuhdr_root"
+       test -d /opt/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /opt/include/$cf_ncuhdr_root/include"
+       test -d /opt/$cf_ncuhdr_root/include &&       cf_search="$cf_search /opt/$cf_ncuhdr_root/include"
+       test -d /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
+}
+
+
+test "$HOME" != "$prefix" && \
+test -d "$HOME" && \
+(test $prefix = NONE || test -d $prefix) && {
+       test -n "$verbose" && echo "    ... testing for include-directories under $HOME"
+       test -d $HOME/include &&          cf_search="$cf_search $HOME/include"
+       test -d $HOME/include/$cf_ncuhdr_root &&       cf_search="$cf_search $HOME/include/$cf_ncuhdr_root"
+       test -d $HOME/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $HOME/include/$cf_ncuhdr_root/include"
+       test -d $HOME/$cf_ncuhdr_root/include &&       cf_search="$cf_search $HOME/$cf_ncuhdr_root/include"
+       test -d $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
 }
 
 }
 
+
+
 test "$includedir" != NONE && \
 test "$includedir" != "/usr/include" && \
 test -d "$includedir" && {
 test "$includedir" != NONE && \
 test "$includedir" != "/usr/include" && \
 test -d "$includedir" && {
@@ -3069,52 +3472,76 @@ 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"
 
        test -n "$verbose" && echo search path $cf_search
        cf_save2_CPPFLAGS="$CPPFLAGS"
        for cf_incdir in $cf_search
        do
                
 
        test -n "$verbose" && echo search path $cf_search
        cf_save2_CPPFLAGS="$CPPFLAGS"
        for cf_incdir in $cf_search
        do
                
-for cf_add_incdir in $cf_incdir
-do
-       while true
+if test -n "$cf_incdir" ; then
+  for cf_add_incdir in $cf_incdir
+  do
+       while test $cf_add_incdir != /usr/include
        do
        do
-               case $cf_add_incdir in
-               /usr/include) # (vi
-                       ;;
-               /usr/local/include) # (vi
+         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
                        if test "$GCC" = yes
                        then
-                               cf_save_CPPFLAGS="$CPPFLAGS"
-                               CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
-                               cat > conftest.$ac_ext <<EOF
-#line 3092 "configure"
+                         cf_save_CPPFLAGS=$CPPFLAGS
+                         CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
+                         cat > conftest.$ac_ext <<EOF
+#line 3507 "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:3099: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3514: \"$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*
   :
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  CPPFLAGS="$cf_save_CPPFLAGS"
+  cf_have_incdir=yes
 fi
 rm -f conftest*
 fi
 rm -f conftest*
+                         CPPFLAGS=$cf_save_CPPFLAGS
                        fi
                        fi
-                       ;;
-               *) # (vi
-                       CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
-                       ;;
-               esac
-               cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
-               test "$cf_top_incdir" = "$cf_add_incdir" && break
-               cf_add_incdir="$cf_top_incdir"
+                 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}:3531: testing adding $cf_add_incdir to include-path ..." 1>&5
+
+
+                 CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
+
+                 cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
+                 test "$cf_top_incdir" = "$cf_add_incdir" && break
+                 cf_add_incdir="$cf_top_incdir"
+               else
+                 break
+               fi
+         fi
        done
        done
-done
+  done
+fi
 
                for cf_header in \
                        ncurses.h \
 
                for cf_header in \
                        ncurses.h \
@@ -3122,7 +3549,7 @@ done
                do
                        
        cat > conftest.$ac_ext <<EOF
                do
                        
        cat > conftest.$ac_ext <<EOF
-#line 3126 "configure"
+#line 3553 "configure"
 #include "confdefs.h"
 
 
 #include "confdefs.h"
 
 
@@ -3143,7 +3570,7 @@ printf("old\n");
        
 ; return 0; }
 EOF
        
 ; return 0; }
 EOF
-if { (eval echo configure:3147: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3574: \"$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
        
@@ -3177,46 +3604,69 @@ echo "$ac_t""$cf_cv_ncurses_h2" 1>&6
                cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
        fi
        
                cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
        fi
        
-for cf_add_incdir in $cf_1st_incdir
-do
-       while true
+if test -n "$cf_1st_incdir" ; then
+  for cf_add_incdir in $cf_1st_incdir
+  do
+       while test $cf_add_incdir != /usr/include
        do
        do
-               case $cf_add_incdir in
-               /usr/include) # (vi
-                       ;;
-               /usr/local/include) # (vi
+         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
                        if test "$GCC" = yes
                        then
-                               cf_save_CPPFLAGS="$CPPFLAGS"
-                               CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
-                               cat > conftest.$ac_ext <<EOF
-#line 3194 "configure"
+                         cf_save_CPPFLAGS=$CPPFLAGS
+                         CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
+                         cat > conftest.$ac_ext <<EOF
+#line 3632 "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:3201: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3639: \"$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*
   :
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  CPPFLAGS="$cf_save_CPPFLAGS"
+  cf_have_incdir=yes
 fi
 rm -f conftest*
 fi
 rm -f conftest*
+                         CPPFLAGS=$cf_save_CPPFLAGS
                        fi
                        fi
-                       ;;
-               *) # (vi
-                       CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
-                       ;;
-               esac
-               cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
-               test "$cf_top_incdir" = "$cf_add_incdir" && break
-               cf_add_incdir="$cf_top_incdir"
+                 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}:3656: testing adding $cf_add_incdir to include-path ..." 1>&5
+
+
+                 CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
+
+                 cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
+                 test "$cf_top_incdir" = "$cf_add_incdir" && break
+                 cf_add_incdir="$cf_top_incdir"
+               else
+                 break
+               fi
+         fi
        done
        done
-done
+  done
+fi
 
 
 fi
 
 
 fi
@@ -3250,7 +3700,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:3254: checking for terminfo header" >&5
+echo "configure:3704: 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
@@ -3267,7 +3717,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 3271 "configure"
+#line 3721 "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}>
@@ -3277,7 +3727,7 @@ int main() {
 int x = auto_left_margin
 ; return 0; }
 EOF
 int x = auto_left_margin
 ; return 0; }
 EOF
-if { (eval echo configure:3281: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3731: \"$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"
@@ -3332,7 +3782,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:3336: checking for ncurses version" >&5
+echo "configure:3786: 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
@@ -3358,7 +3808,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:3362: \"$cf_try\") 1>&5; (eval $cf_try) 2>&5; }
+       { (eval echo configure:3812: \"$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"
@@ -3367,7 +3817,7 @@ EOF
 
 else
   cat > conftest.$ac_ext <<EOF
 
 else
   cat > conftest.$ac_ext <<EOF
-#line 3371 "configure"
+#line 3821 "configure"
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header-curses.h}>
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header-curses.h}>
@@ -3388,10 +3838,10 @@ int main()
        make an error
 # endif
 #endif
        make an error
 # endif
 #endif
-       exit(0);
+       ${cf_cv_main_return-return}(0);
 }
 EOF
 }
 EOF
-if { (eval echo configure:3395: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3845: \"$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`
@@ -3413,7 +3863,7 @@ EOF
 
 
 
 
 
 
-       
+
 
 cf_nculib_root=ncurses
        # This works, except for the special case where we find gpm, but
 
 cf_nculib_root=ncurses
        # This works, except for the special case where we find gpm, but
@@ -3422,7 +3872,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:3426: checking for Gpm_Open in -lgpm" >&5
+echo "configure:3876: 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
@@ -3430,7 +3880,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 3434 "configure"
+#line 3884 "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
@@ -3441,7 +3891,7 @@ int main() {
 Gpm_Open()
 ; return 0; }
 EOF
 Gpm_Open()
 ; return 0; }
 EOF
-if { (eval echo configure:3445: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3895: \"$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
@@ -3457,7 +3907,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:3461: checking for initscr in -lgpm" >&5
+echo "configure:3911: 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
@@ -3465,7 +3915,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 3469 "configure"
+#line 3919 "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
@@ -3476,7 +3926,7 @@ int main() {
 initscr()
 ; return 0; }
 EOF
 initscr()
 ; return 0; }
 EOF
-if { (eval echo configure:3480: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3930: \"$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
@@ -3508,7 +3958,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:3512: checking for tgoto in -lmytinfo" >&5
+echo "configure:3962: 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
@@ -3516,7 +3966,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 3520 "configure"
+#line 3970 "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
@@ -3527,7 +3977,7 @@ int main() {
 tgoto()
 ; return 0; }
 EOF
 tgoto()
 ; return 0; }
 EOF
-if { (eval echo configure:3531: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3981: \"$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
@@ -3555,18 +4005,47 @@ LIBS="$cf_ncurses_LIBS $LIBS"
 
 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
 then
 
 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
 then
-       LIBS="-L$cf_cv_curses_dir/lib -l$cf_nculib_root $LIBS"
+       
+if test -n "$cf_cv_curses_dir/lib" ; then
+  for cf_add_libdir in $cf_cv_curses_dir/lib
+  do
+    if test $cf_add_libdir = /usr/lib ; then
+      :
+    elif test -d $cf_add_libdir
+    then
+      cf_have_libdir=no
+      if test -n "$LDFLAGS$LIBS" ; then
+        # a loop is needed to ensure we can add subdirs of existing dirs
+        for cf_test_libdir in $LDFLAGS $LIBS ; do
+          if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
+            cf_have_libdir=yes; break
+          fi
+        done
+      fi
+      if test "$cf_have_libdir" = no ; then
+        test -n "$verbose" && echo "   adding $cf_add_libdir to library-path" 1>&6
+
+echo "${as_me-configure}:4029: testing adding $cf_add_libdir to library-path ..." 1>&5
+
+
+        LDFLAGS="-L$cf_add_libdir $LDFLAGS"
+      fi
+    fi
+  done
+fi
+
+       LIBS="-l$cf_nculib_root $LIBS"
 else
        
        eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
        cf_libdir=""
        echo $ac_n "checking for initscr""... $ac_c" 1>&6
 else
        
        eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
        cf_libdir=""
        echo $ac_n "checking for initscr""... $ac_c" 1>&6
-echo "configure:3565: checking for initscr" >&5
+echo "configure:4044: 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 3570 "configure"
+#line 4049 "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.  */
@@ -3589,7 +4068,7 @@ initscr();
 
 ; return 0; }
 EOF
 
 ; return 0; }
 EOF
-if { (eval echo configure:3593: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4072: \"$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
@@ -3609,17 +4088,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:3613: checking for initscr in -l$cf_nculib_root" >&5
+echo "configure:4092: 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 3616 "configure"
+#line 4095 "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:3623: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4102: \"$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'
@@ -3629,36 +4108,51 @@ else
   cat conftest.$ac_ext >&5
   rm -rf conftest*
   echo "$ac_t""no" 1>&6
   cat conftest.$ac_ext >&5
   rm -rf conftest*
   echo "$ac_t""no" 1>&6
-                       cf_search=""
-
-test -d "$HOME" && {
-       test -n "$verbose" && echo "    ... testing lib-directories under $HOME"
-       test -d "$HOME/lib" &&          cf_search="$cf_search $HOME/lib"
-       test -d "$HOME/lib/$cf_nculib_root" &&       cf_search="$cf_search $HOME/lib/$cf_nculib_root"
-       test -d "$HOME/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $HOME/lib/$cf_nculib_root/lib"
+                       
+cf_library_path_list=""
+if test -n "${LDFLAGS}${LIBS}" ; then
+       for cf_library_path in $LDFLAGS $LIBS
+       do
+               case $cf_library_path in #(vi
+               -L*)
+                       cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
+                       
+test "$cf_library_path" != "NONE" && \
+test -d "$cf_library_path" && \
+ {
+       test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
+       test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
+       test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
+       test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
+       test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
+       test -d $cf_library_path/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib/$cf_nculib_root"
 }
 
 }
 
-# For other stuff under the home directory, it should be sufficient to put
-# a symbolic link for $HOME/$cf_nculib_root to the actual package location:
-test -d "$HOME/$cf_nculib_root" && {
-       test -n "$verbose" && echo "    ... testing lib-directories under $HOME/$cf_nculib_root"
-       test -d "$HOME/$cf_nculib_root/lib" &&       cf_search="$cf_search $HOME/$cf_nculib_root/lib"
-       test -d "$HOME/$cf_nculib_root/lib/$cf_nculib_root" &&    cf_search="$cf_search $HOME/$cf_nculib_root/lib/$cf_nculib_root"
-}
+                       cf_library_path_list="$cf_library_path_list $cf_search"
+                       ;;
+               esac
+       done
+fi
+
+cf_search=""
+
 
 
-test "$prefix" != /usr/local && \
-test -d /usr/local && {
-       test -n "$verbose" && echo "    ... testing lib-directories under /usr/local"
-       test -d /usr/local/lib &&       cf_search="$cf_search /usr/local/lib"
-       test -d /usr/local/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/local/lib/$cf_nculib_root"
-       test -d /usr/local/lib/$cf_nculib_root/lib && cf_search="$cf_search /usr/local/lib/$cf_nculib_root/lib"
-       test -d /usr/local/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/local/$cf_nculib_root/lib"
-       test -d /usr/local/$cf_nculib_root/lib/$cf_nculib_root && cf_search="$cf_search /usr/local/$cf_nculib_root/lib/$cf_nculib_root"
+test "/usr" != "$prefix" && \
+test -d "/usr" && \
+(test $prefix = NONE || test -d $prefix) && {
+       test -n "$verbose" && echo "    ... testing for lib-directories under /usr"
+       test -d /usr/lib &&          cf_search="$cf_search /usr/lib"
+       test -d /usr/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/lib/$cf_nculib_root"
+       test -d /usr/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/lib/$cf_nculib_root/lib"
+       test -d /usr/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/$cf_nculib_root/lib"
+       test -d /usr/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/$cf_nculib_root/lib/$cf_nculib_root"
 }
 
 }
 
-test "$prefix" != NONE && \
-test -d $prefix && {
-       test -n "$verbose" && echo "    ... testing lib-directories under $prefix"
+
+test "$prefix" != "NONE" && \
+test -d "$prefix" && \
+ {
+       test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
        test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
        test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
        test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
        test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
        test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
        test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
@@ -3666,39 +4160,60 @@ test -d $prefix && {
        test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
 }
 
        test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
 }
 
-test "$prefix" != /opt && \
-test -d /opt && {
-       test -n "$verbose" && echo "    ... testing lib-directories under /opt"
-       test -d /opt/lib &&             cf_search="$cf_search /opt/lib"
-       test -d /opt/lib/$cf_nculib_root &&          cf_search="$cf_search /opt/lib/$cf_nculib_root"
-       test -d /opt/lib/$cf_nculib_root/lib &&       cf_search="$cf_search /opt/lib/$cf_nculib_root/lib"
-       test -d /opt/$cf_nculib_root/lib &&          cf_search="$cf_search /opt/$cf_nculib_root/lib"
-       test -d /opt/$cf_nculib_root/lib/$cf_nculib_root &&       cf_search="$cf_search /opt/$cf_nculib_root/lib/$cf_nculib_root"
+
+test "/usr/local" != "$prefix" && \
+test -d "/usr/local" && \
+(test $prefix = NONE || test -d $prefix) && {
+       test -n "$verbose" && echo "    ... testing for lib-directories under /usr/local"
+       test -d /usr/local/lib &&          cf_search="$cf_search /usr/local/lib"
+       test -d /usr/local/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/local/lib/$cf_nculib_root"
+       test -d /usr/local/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/local/lib/$cf_nculib_root/lib"
+       test -d /usr/local/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/local/$cf_nculib_root/lib"
+       test -d /usr/local/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/local/$cf_nculib_root/lib/$cf_nculib_root"
+}
+
+
+test "/opt" != "$prefix" && \
+test -d "/opt" && \
+(test $prefix = NONE || test -d $prefix) && {
+       test -n "$verbose" && echo "    ... testing for lib-directories under /opt"
+       test -d /opt/lib &&          cf_search="$cf_search /opt/lib"
+       test -d /opt/lib/$cf_nculib_root &&       cf_search="$cf_search /opt/lib/$cf_nculib_root"
+       test -d /opt/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /opt/lib/$cf_nculib_root/lib"
+       test -d /opt/$cf_nculib_root/lib &&       cf_search="$cf_search /opt/$cf_nculib_root/lib"
+       test -d /opt/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /opt/$cf_nculib_root/lib/$cf_nculib_root"
 }
 
 }
 
-test "$prefix" != /usr && \
-test -d /usr && {
-       test -n "$verbose" && echo "    ... testing lib-directories under /usr"
-       test -d /usr/lib &&             cf_search="$cf_search /usr/lib"
-       test -d /usr/lib/$cf_nculib_root &&          cf_search="$cf_search /usr/lib/$cf_nculib_root"
-       test -d /usr/lib/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/lib/$cf_nculib_root/lib"
-       test -d /usr/$cf_nculib_root/lib &&          cf_search="$cf_search /usr/$cf_nculib_root/lib"
+
+test "$HOME" != "$prefix" && \
+test -d "$HOME" && \
+(test $prefix = NONE || test -d $prefix) && {
+       test -n "$verbose" && echo "    ... testing for lib-directories under $HOME"
+       test -d $HOME/lib &&          cf_search="$cf_search $HOME/lib"
+       test -d $HOME/lib/$cf_nculib_root &&       cf_search="$cf_search $HOME/lib/$cf_nculib_root"
+       test -d $HOME/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $HOME/lib/$cf_nculib_root/lib"
+       test -d $HOME/$cf_nculib_root/lib &&       cf_search="$cf_search $HOME/$cf_nculib_root/lib"
+       test -d $HOME/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $HOME/$cf_nculib_root/lib/$cf_nculib_root"
 }
 
 }
 
+
+
+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:3692: checking for -l$cf_nculib_root in $cf_libdir" >&5
+echo "configure:4207: 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 3695 "configure"
+#line 4210 "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:3702: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4217: \"$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'
@@ -3707,140 +4222,706 @@ else
   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*
-  echo "$ac_t""no" 1>&6
-                                        LIBS="$cf_save_LIBS"
+  echo "$ac_t""no" 1>&6
+                                        LIBS="$cf_save_LIBS"
+fi
+rm -f conftest*
+                       done
+                       
+fi
+rm -f conftest*
+               
+fi
+
+eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
+
+if test $cf_found_library = no ; then
+       { echo "configure: error: Cannot link $cf_nculib_root library" 1>&2; exit 1; }
+fi
+
+
+fi
+
+if test -n "$cf_ncurses_LIBS" ; then
+       echo $ac_n "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS""... $ac_c" 1>&6
+echo "configure:4248: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
+       cf_ncurses_SAVE="$LIBS"
+       for p in $cf_ncurses_LIBS ; do
+               q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
+               if test "$q" != "$LIBS" ; then
+                       LIBS="$q"
+               fi
+       done
+       cat > conftest.$ac_ext <<EOF
+#line 4257 "configure"
+#include "confdefs.h"
+#include <${cf_cv_ncurses_header-curses.h}>
+int main() {
+initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
+; return 0; }
+EOF
+if { (eval echo configure:4264: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  echo "$ac_t""yes" 1>&6
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  echo "$ac_t""no" 1>&6
+                LIBS="$cf_ncurses_SAVE"
+fi
+rm -f conftest*
+fi
+
+
+cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
+
+cat >> confdefs.h <<EOF
+#define $cf_nculib_ROOT 1
+EOF
+
+
+
+fi
+
+       ;;
+ncursesw)
+       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
+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"
+#include "confdefs.h"
+
+#include <stdlib.h>
+int main() {
+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
+  rm -rf conftest*
+  cf_cv_utf8_lib=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  
+
+# If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
+# will be set on completion of the AC_TRY_LINK below.
+cf_cv_header_path_utf8=
+cf_cv_library_path_utf8=
+
+
+echo "${as_me-configure}:4323: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
+
+
+cat > conftest.$ac_ext <<EOF
+#line 4327 "configure"
+#include "confdefs.h"
+
+#include <libutf8.h>
+int main() {
+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
+  rm -rf conftest*
+  cf_cv_find_linkage_utf8=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  
+    cf_cv_find_linkage_utf8=no
+
+    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}:4351: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
+
+
+    cf_save_CPPFLAGS="$CPPFLAGS"
+    cf_test_CPPFLAGS="$CPPFLAGS"
+
+    
+cf_header_path_list=""
+if test -n "${CFLAGS}${CPPFLAGS}" ; then
+       for cf_header_path in $CPPFLAGS $CFLAGS
+       do
+               case $cf_header_path in #(vi
+               -I*)
+                       cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
+                       
+test "$cf_header_path" != "NONE" && \
+test -d "$cf_header_path" && \
+ {
+       test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
+       test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
+       test -d $cf_header_path/include/utf8 &&       cf_search="$cf_search $cf_header_path/include/utf8"
+       test -d $cf_header_path/include/utf8/include &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
+       test -d $cf_header_path/utf8/include &&       cf_search="$cf_search $cf_header_path/utf8/include"
+       test -d $cf_header_path/utf8/include/utf8 &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
+}
+
+                       cf_header_path_list="$cf_header_path_list $cf_search"
+                       ;;
+               esac
+       done
+fi
+
+cf_search=""
+
+
+test "/usr" != "$prefix" && \
+test -d "/usr" && \
+(test $prefix = NONE || test -d $prefix) && {
+       test -n "$verbose" && echo "    ... testing for include-directories under /usr"
+       test -d /usr/include &&          cf_search="$cf_search /usr/include"
+       test -d /usr/include/utf8 &&       cf_search="$cf_search /usr/include/utf8"
+       test -d /usr/include/utf8/include &&    cf_search="$cf_search /usr/include/utf8/include"
+       test -d /usr/utf8/include &&       cf_search="$cf_search /usr/utf8/include"
+       test -d /usr/utf8/include/utf8 &&    cf_search="$cf_search /usr/utf8/include/utf8"
+}
+
+
+test "$prefix" != "NONE" && \
+test -d "$prefix" && \
+ {
+       test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
+       test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
+       test -d $prefix/include/utf8 &&       cf_search="$cf_search $prefix/include/utf8"
+       test -d $prefix/include/utf8/include &&    cf_search="$cf_search $prefix/include/utf8/include"
+       test -d $prefix/utf8/include &&       cf_search="$cf_search $prefix/utf8/include"
+       test -d $prefix/utf8/include/utf8 &&    cf_search="$cf_search $prefix/utf8/include/utf8"
+}
+
+
+test "/usr/local" != "$prefix" && \
+test -d "/usr/local" && \
+(test $prefix = NONE || test -d $prefix) && {
+       test -n "$verbose" && echo "    ... testing for include-directories under /usr/local"
+       test -d /usr/local/include &&          cf_search="$cf_search /usr/local/include"
+       test -d /usr/local/include/utf8 &&       cf_search="$cf_search /usr/local/include/utf8"
+       test -d /usr/local/include/utf8/include &&    cf_search="$cf_search /usr/local/include/utf8/include"
+       test -d /usr/local/utf8/include &&       cf_search="$cf_search /usr/local/utf8/include"
+       test -d /usr/local/utf8/include/utf8 &&    cf_search="$cf_search /usr/local/utf8/include/utf8"
+}
+
+
+test "/opt" != "$prefix" && \
+test -d "/opt" && \
+(test $prefix = NONE || test -d $prefix) && {
+       test -n "$verbose" && echo "    ... testing for include-directories under /opt"
+       test -d /opt/include &&          cf_search="$cf_search /opt/include"
+       test -d /opt/include/utf8 &&       cf_search="$cf_search /opt/include/utf8"
+       test -d /opt/include/utf8/include &&    cf_search="$cf_search /opt/include/utf8/include"
+       test -d /opt/utf8/include &&       cf_search="$cf_search /opt/utf8/include"
+       test -d /opt/utf8/include/utf8 &&    cf_search="$cf_search /opt/utf8/include/utf8"
+}
+
+
+test "$HOME" != "$prefix" && \
+test -d "$HOME" && \
+(test $prefix = NONE || test -d $prefix) && {
+       test -n "$verbose" && echo "    ... testing for include-directories under $HOME"
+       test -d $HOME/include &&          cf_search="$cf_search $HOME/include"
+       test -d $HOME/include/utf8 &&       cf_search="$cf_search $HOME/include/utf8"
+       test -d $HOME/include/utf8/include &&    cf_search="$cf_search $HOME/include/utf8/include"
+       test -d $HOME/utf8/include &&       cf_search="$cf_search $HOME/utf8/include"
+       test -d $HOME/utf8/include/utf8 &&    cf_search="$cf_search $HOME/utf8/include/utf8"
+}
+
+
+
+test "$includedir" != NONE && \
+test "$includedir" != "/usr/include" && \
+test -d "$includedir" && {
+       test -d $includedir &&    cf_search="$cf_search $includedir"
+       test -d $includedir/utf8 && cf_search="$cf_search $includedir/utf8"
+}
+
+test "$oldincludedir" != NONE && \
+test "$oldincludedir" != "/usr/include" && \
+test -d "$oldincludedir" && {
+       test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
+       test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8"
+}
+
+cf_search="$cf_header_path_list $cf_search"
+
+    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
+
+
+        CPPFLAGS="$cf_save_CPPFLAGS -I$cf_cv_header_path_utf8"
+        cat > conftest.$ac_ext <<EOF
+#line 4473 "configure"
+#include "confdefs.h"
+
+#include <libutf8.h>
+int main() {
+putwc(0,0);
+; return 0; }
+EOF
+if { (eval echo configure:4481: \"$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
+
+echo "${as_me-configure}:4486: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
+
+
+            cf_cv_find_linkage_utf8=maybe
+            cf_test_CPPFLAGS="$CPPFLAGS"
+            break
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  
+            CPPFLAGS="$cf_save_CPPFLAGS"
+            
+fi
+rm -f conftest*
+      fi
+    done
+
+    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
+
+
+      cf_save_LIBS="$LIBS"
+      cf_save_LDFLAGS="$LDFLAGS"
+
+      
+
+      if test "$cf_cv_find_linkage_utf8" != yes ; then
+        
+cf_library_path_list=""
+if test -n "${LDFLAGS}${LIBS}" ; then
+       for cf_library_path in $LDFLAGS $LIBS
+       do
+               case $cf_library_path in #(vi
+               -L*)
+                       cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
+                       
+test "$cf_library_path" != "NONE" && \
+test -d "$cf_library_path" && \
+ {
+       test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
+       test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
+       test -d $cf_library_path/lib/utf8 &&       cf_search="$cf_search $cf_library_path/lib/utf8"
+       test -d $cf_library_path/lib/utf8/lib &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
+       test -d $cf_library_path/utf8/lib &&       cf_search="$cf_search $cf_library_path/utf8/lib"
+       test -d $cf_library_path/utf8/lib/utf8 &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
+}
+
+                       cf_library_path_list="$cf_library_path_list $cf_search"
+                       ;;
+               esac
+       done
+fi
+
+cf_search=""
+
+
+test "/usr" != "$prefix" && \
+test -d "/usr" && \
+(test $prefix = NONE || test -d $prefix) && {
+       test -n "$verbose" && echo "    ... testing for lib-directories under /usr"
+       test -d /usr/lib &&          cf_search="$cf_search /usr/lib"
+       test -d /usr/lib/utf8 &&       cf_search="$cf_search /usr/lib/utf8"
+       test -d /usr/lib/utf8/lib &&    cf_search="$cf_search /usr/lib/utf8/lib"
+       test -d /usr/utf8/lib &&       cf_search="$cf_search /usr/utf8/lib"
+       test -d /usr/utf8/lib/utf8 &&    cf_search="$cf_search /usr/utf8/lib/utf8"
+}
+
+
+test "$prefix" != "NONE" && \
+test -d "$prefix" && \
+ {
+       test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
+       test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
+       test -d $prefix/lib/utf8 &&       cf_search="$cf_search $prefix/lib/utf8"
+       test -d $prefix/lib/utf8/lib &&    cf_search="$cf_search $prefix/lib/utf8/lib"
+       test -d $prefix/utf8/lib &&       cf_search="$cf_search $prefix/utf8/lib"
+       test -d $prefix/utf8/lib/utf8 &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
+}
+
+
+test "/usr/local" != "$prefix" && \
+test -d "/usr/local" && \
+(test $prefix = NONE || test -d $prefix) && {
+       test -n "$verbose" && echo "    ... testing for lib-directories under /usr/local"
+       test -d /usr/local/lib &&          cf_search="$cf_search /usr/local/lib"
+       test -d /usr/local/lib/utf8 &&       cf_search="$cf_search /usr/local/lib/utf8"
+       test -d /usr/local/lib/utf8/lib &&    cf_search="$cf_search /usr/local/lib/utf8/lib"
+       test -d /usr/local/utf8/lib &&       cf_search="$cf_search /usr/local/utf8/lib"
+       test -d /usr/local/utf8/lib/utf8 &&    cf_search="$cf_search /usr/local/utf8/lib/utf8"
+}
+
+
+test "/opt" != "$prefix" && \
+test -d "/opt" && \
+(test $prefix = NONE || test -d $prefix) && {
+       test -n "$verbose" && echo "    ... testing for lib-directories under /opt"
+       test -d /opt/lib &&          cf_search="$cf_search /opt/lib"
+       test -d /opt/lib/utf8 &&       cf_search="$cf_search /opt/lib/utf8"
+       test -d /opt/lib/utf8/lib &&    cf_search="$cf_search /opt/lib/utf8/lib"
+       test -d /opt/utf8/lib &&       cf_search="$cf_search /opt/utf8/lib"
+       test -d /opt/utf8/lib/utf8 &&    cf_search="$cf_search /opt/utf8/lib/utf8"
+}
+
+
+test "$HOME" != "$prefix" && \
+test -d "$HOME" && \
+(test $prefix = NONE || test -d $prefix) && {
+       test -n "$verbose" && echo "    ... testing for lib-directories under $HOME"
+       test -d $HOME/lib &&          cf_search="$cf_search $HOME/lib"
+       test -d $HOME/lib/utf8 &&       cf_search="$cf_search $HOME/lib/utf8"
+       test -d $HOME/lib/utf8/lib &&    cf_search="$cf_search $HOME/lib/utf8/lib"
+       test -d $HOME/utf8/lib &&       cf_search="$cf_search $HOME/utf8/lib"
+       test -d $HOME/utf8/lib/utf8 &&    cf_search="$cf_search $HOME/utf8/lib/utf8"
+}
+
+
+
+cf_search="$cf_library_path_list $cf_search"
+
+        for cf_cv_library_path_utf8 in $cf_search
+        do
+          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
+
+
+            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"
+#include "confdefs.h"
+
+#include <libutf8.h>
+int main() {
+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
+  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
+
+
+                cf_cv_find_linkage_utf8=yes
+                cf_cv_library_file_utf8="-lutf8"
+                break
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  
+                CPPFLAGS="$cf_save_CPPFLAGS"
+                LIBS="$cf_save_LIBS"
+                LDFLAGS="$cf_save_LDFLAGS"
+                
 fi
 rm -f conftest*
 fi
 rm -f conftest*
-                       done
-                       
+          fi
+        done
+        LIBS="$cf_save_LIBS"
+        CPPFLAGS="$cf_save_CPPFLAGS"
+        LDFLAGS="$cf_save_LDFLAGS"
+      fi
+
+    else
+      cf_cv_find_linkage_utf8=no
+    fi
+    
 fi
 rm -f conftest*
 fi
 rm -f conftest*
-               
+
+if test "$cf_cv_find_linkage_utf8" = yes ; then
+cf_cv_utf8_lib=add-on
+else
+cf_cv_utf8_lib=no
 fi
 
 fi
 
-eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
 
 
-if test $cf_found_library = no ; then
-       { echo "configure: error: Cannot link $cf_nculib_root library" 1>&2; exit 1; }
+fi
+rm -f conftest*
 fi
 
 fi
 
+echo "$ac_t""$cf_cv_utf8_lib" 1>&6
 
 
-fi
+# HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
+# ncurses/ncursesw:
+if test "$cf_cv_utf8_lib" = "add-on" ; then
+       cat >> confdefs.h <<\EOF
+#define HAVE_LIBUTF8_H 1
+EOF
 
 
-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:3733: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
-       cf_ncurses_SAVE="$LIBS"
-       for p in $cf_ncurses_LIBS ; do
-               q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
-               if test "$q" != "$LIBS" ; then
-                       LIBS="$q"
+       
+if test -n "$cf_cv_header_path_utf8" ; then
+  for cf_add_incdir in $cf_cv_header_path_utf8
+  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
                fi
-       done
-       cat > conftest.$ac_ext <<EOF
-#line 3742 "configure"
+
+               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 4709 "configure"
 #include "confdefs.h"
 #include "confdefs.h"
-#include <${cf_cv_ncurses_header-curses.h}>
+#include <stdio.h>
 int main() {
 int main() {
-initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
+printf("Hello")
 ; return 0; }
 EOF
 ; return 0; }
 EOF
-if { (eval echo configure:3749: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  echo "$ac_t""yes" 1>&6
+if { (eval echo configure:4716: \"$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*
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  echo "$ac_t""no" 1>&6
-                LIBS="$cf_ncurses_SAVE"
+  cf_have_incdir=yes
 fi
 rm -f conftest*
 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}:4733: testing adding $cf_add_incdir to include-path ..." 1>&5
+
+
+                 CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
+
+                 cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
+                 test "$cf_top_incdir" = "$cf_add_incdir" && break
+                 cf_add_incdir="$cf_top_incdir"
+               else
+                 break
+               fi
+         fi
+       done
+  done
 fi
 
 fi
 
+       
+if test -n "$cf_cv_library_path_utf8" ; then
+  for cf_add_libdir in $cf_cv_library_path_utf8
+  do
+    if test $cf_add_libdir = /usr/lib ; then
+      :
+    elif test -d $cf_add_libdir
+    then
+      cf_have_libdir=no
+      if test -n "$LDFLAGS$LIBS" ; then
+        # a loop is needed to ensure we can add subdirs of existing dirs
+        for cf_test_libdir in $LDFLAGS $LIBS ; do
+          if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
+            cf_have_libdir=yes; break
+          fi
+        done
+      fi
+      if test "$cf_have_libdir" = no ; then
+        test -n "$verbose" && echo "   adding $cf_add_libdir to library-path" 1>&6
+
+echo "${as_me-configure}:4769: testing adding $cf_add_libdir to library-path ..." 1>&5
 
 
-cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
 
 
-cat >> confdefs.h <<EOF
-#define $cf_nculib_ROOT 1
-EOF
+        LDFLAGS="-L$cf_add_libdir $LDFLAGS"
+      fi
+    fi
+  done
+fi
 
 
+       LIBS="-lutf8 $LIBS"
+fi
 
 
-       ;;
-ncursesw)
-       cf_cv_libtype=w
        
        
-echo $ac_n "checking for multibyte character support""... $ac_c" 1>&6
-echo "configure:3775: checking for multibyte character support" >&5
-if eval "test \"`echo '$''{'cf_cv_utf8_lib'+set}'`\" = set"; then
+cf_ncuconfig_root=ncursesw
+
+echo "Looking for ${cf_ncuconfig_root}-config"
+for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
+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:4790: 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
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  
-       cf_save_LIBS="$LIBS"
-       cat > conftest.$ac_ext <<EOF
-#line 3782 "configure"
-#include "confdefs.h"
+  case "$NCURSES_CONFIG" in
+  /*)
+  ac_cv_path_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test with a path.
+  ;;
+  ?:/*)                         
+  ac_cv_path_NCURSES_CONFIG="$NCURSES_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_NCURSES_CONFIG="$ac_dir/$ac_word"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+  ;;
+esac
+fi
+NCURSES_CONFIG="$ac_cv_path_NCURSES_CONFIG"
+if test -n "$NCURSES_CONFIG"; then
+  echo "$ac_t""$NCURSES_CONFIG" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
 
 
-#include <stdlib.h>
-int main() {
-putwc(0,0);
-; return 0; }
+test -n "$NCURSES_CONFIG" && break
+done
+test -n "$NCURSES_CONFIG" || NCURSES_CONFIG="none"
+
+
+if test "$NCURSES_CONFIG" != none ; then
+
+cf_cv_ncurses_header=curses.h
+
+CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
+LIBS="`$NCURSES_CONFIG --libs` $LIBS"
+
+cat >> confdefs.h <<\EOF
+#define NCURSES 1
 EOF
 EOF
-if { (eval echo configure:3790: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  cf_cv_utf8_lib=yes
+
+
+
+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
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  LIBS="-lutf8 $LIBS"
-        cat > conftest.$ac_ext <<EOF
-#line 3799 "configure"
-#include "confdefs.h"
 
 
-#include <libutf8.h>
+
+
+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"
+#include "confdefs.h"
+#include <stdio.h>
 int main() {
 int main() {
-putwc(0,0);
+printf("Hello")
 ; return 0; }
 EOF
 ; return 0; }
 EOF
-if { (eval echo configure:3807: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  cf_cv_utf8_lib=add-on
+if { (eval echo configure:4889: \"$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*
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  cf_cv_utf8_lib=no
-fi
-rm -f conftest*
-       LIBS="$cf_save_LIBS"
-
+  cf_have_incdir=yes
 fi
 rm -f conftest*
 fi
 rm -f conftest*
-fi
+                         CPPFLAGS=$cf_save_CPPFLAGS
+                       fi
+                 fi
+               fi
 
 
-echo "$ac_t""$cf_cv_utf8_lib" 1>&6
+               if test "$cf_have_incdir" = no ; then
+                 test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
 
 
-# HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
-# ncurses/ncursesw:
-if test "$cf_cv_utf8_lib" = "add-on" ; then
-       cat >> confdefs.h <<\EOF
-#define HAVE_LIBUTF8_H 1
-EOF
+echo "${as_me-configure}:4906: testing adding $cf_add_incdir to include-path ..." 1>&5
 
 
-       LIBS="-lutf8 $LIBS"
-fi
 
 
-       
+                 CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
 
 
-cf_ncuhdr_root=ncursesw
+                 cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
+                 test "$cf_top_incdir" = "$cf_add_incdir" && break
+                 cf_add_incdir="$cf_top_incdir"
+               else
+                 break
+               fi
+         fi
+       done
+  done
+fi
 
 
-test -n "$cf_cv_curses_dir" && \
-test "$cf_cv_curses_dir" != "no" && \
-CPPFLAGS="-I$cf_cv_curses_dir/include -I$cf_cv_curses_dir/include/$cf_ncuhdr_root $CPPFLAGS"
+}
 
 echo $ac_n "checking for $cf_ncuhdr_root header in include-path""... $ac_c" 1>&6
 
 echo $ac_n "checking for $cf_ncuhdr_root header in include-path""... $ac_c" 1>&6
-echo "configure:3844: checking for $cf_ncuhdr_root header in include-path" >&5
+echo "configure:4925: 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
@@ -3851,7 +4932,7 @@ else
        do
                
        cat > conftest.$ac_ext <<EOF
        do
                
        cat > conftest.$ac_ext <<EOF
-#line 3855 "configure"
+#line 4936 "configure"
 #include "confdefs.h"
 
 
 #include "confdefs.h"
 
 
@@ -3880,7 +4961,7 @@ printf("old\n");
        
 ; return 0; }
 EOF
        
 ; return 0; }
 EOF
-if { (eval echo configure:3884: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4965: \"$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
        
@@ -3906,42 +4987,57 @@ 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:3910: checking for $cf_ncuhdr_root include-path" >&5
+echo "configure:4991: 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=""
-
-test -d "$HOME" && {
-       test -n "$verbose" && echo "    ... testing include-directories under $HOME"
-       test -d "$HOME/include" &&          cf_search="$cf_search $HOME/include"
-       test -d "$HOME/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $HOME/include/$cf_ncuhdr_root"
-       test -d "$HOME/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $HOME/include/$cf_ncuhdr_root/include"
+       
+cf_header_path_list=""
+if test -n "${CFLAGS}${CPPFLAGS}" ; then
+       for cf_header_path in $CPPFLAGS $CFLAGS
+       do
+               case $cf_header_path in #(vi
+               -I*)
+                       cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
+                       
+test "$cf_header_path" != "NONE" && \
+test -d "$cf_header_path" && \
+ {
+       test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
+       test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
+       test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
+       test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
+       test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
+       test -d $cf_header_path/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
 }
 
 }
 
-# For other stuff under the home directory, it should be sufficient to put
-# a symbolic link for $HOME/$cf_ncuhdr_root to the actual package location:
-test -d "$HOME/$cf_ncuhdr_root" && {
-       test -n "$verbose" && echo "    ... testing include-directories under $HOME/$cf_ncuhdr_root"
-       test -d "$HOME/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $HOME/$cf_ncuhdr_root/include"
-       test -d "$HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root" &&    cf_search="$cf_search $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
-}
+                       cf_header_path_list="$cf_header_path_list $cf_search"
+                       ;;
+               esac
+       done
+fi
+
+cf_search=""
 
 
-test "$prefix" != /usr/local && \
-test -d /usr/local && {
-       test -n "$verbose" && echo "    ... testing include-directories under /usr/local"
-       test -d /usr/local/include &&       cf_search="$cf_search /usr/local/include"
-       test -d /usr/local/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root"
-       test -d /usr/local/include/$cf_ncuhdr_root/include && cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root/include"
-       test -d /usr/local/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include"
-       test -d /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
+
+test "/usr" != "$prefix" && \
+test -d "/usr" && \
+(test $prefix = NONE || test -d $prefix) && {
+       test -n "$verbose" && echo "    ... testing for include-directories under /usr"
+       test -d /usr/include &&          cf_search="$cf_search /usr/include"
+       test -d /usr/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/include/$cf_ncuhdr_root"
+       test -d /usr/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/include/$cf_ncuhdr_root/include"
+       test -d /usr/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/$cf_ncuhdr_root/include"
+       test -d /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
 }
 
 }
 
-test "$prefix" != NONE && \
-test -d $prefix && {
-       test -n "$verbose" && echo "    ... testing include-directories under $prefix"
+
+test "$prefix" != "NONE" && \
+test -d "$prefix" && \
+ {
+       test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
        test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
        test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
        test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
        test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
        test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
        test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
@@ -3949,25 +5045,44 @@ test -d $prefix && {
        test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
 }
 
        test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
 }
 
-test "$prefix" != /opt && \
-test -d /opt && {
-       test -n "$verbose" && echo "    ... testing include-directories under /opt"
-       test -d /opt/include &&             cf_search="$cf_search /opt/include"
-       test -d /opt/include/$cf_ncuhdr_root &&          cf_search="$cf_search /opt/include/$cf_ncuhdr_root"
-       test -d /opt/include/$cf_ncuhdr_root/include &&       cf_search="$cf_search /opt/include/$cf_ncuhdr_root/include"
-       test -d /opt/$cf_ncuhdr_root/include &&          cf_search="$cf_search /opt/$cf_ncuhdr_root/include"
-       test -d /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&       cf_search="$cf_search /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
+
+test "/usr/local" != "$prefix" && \
+test -d "/usr/local" && \
+(test $prefix = NONE || test -d $prefix) && {
+       test -n "$verbose" && echo "    ... testing for include-directories under /usr/local"
+       test -d /usr/local/include &&          cf_search="$cf_search /usr/local/include"
+       test -d /usr/local/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root"
+       test -d /usr/local/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root/include"
+       test -d /usr/local/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include"
+       test -d /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
+}
+
+
+test "/opt" != "$prefix" && \
+test -d "/opt" && \
+(test $prefix = NONE || test -d $prefix) && {
+       test -n "$verbose" && echo "    ... testing for include-directories under /opt"
+       test -d /opt/include &&          cf_search="$cf_search /opt/include"
+       test -d /opt/include/$cf_ncuhdr_root &&       cf_search="$cf_search /opt/include/$cf_ncuhdr_root"
+       test -d /opt/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /opt/include/$cf_ncuhdr_root/include"
+       test -d /opt/$cf_ncuhdr_root/include &&       cf_search="$cf_search /opt/$cf_ncuhdr_root/include"
+       test -d /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
 }
 
 }
 
-test "$prefix" != /usr && \
-test -d /usr && {
-       test -n "$verbose" && echo "    ... testing include-directories under /usr"
-       test -d /usr/include &&             cf_search="$cf_search /usr/include"
-       test -d /usr/include/$cf_ncuhdr_root &&          cf_search="$cf_search /usr/include/$cf_ncuhdr_root"
-       test -d /usr/include/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/include/$cf_ncuhdr_root/include"
-       test -d /usr/$cf_ncuhdr_root/include &&          cf_search="$cf_search /usr/$cf_ncuhdr_root/include"
+
+test "$HOME" != "$prefix" && \
+test -d "$HOME" && \
+(test $prefix = NONE || test -d $prefix) && {
+       test -n "$verbose" && echo "    ... testing for include-directories under $HOME"
+       test -d $HOME/include &&          cf_search="$cf_search $HOME/include"
+       test -d $HOME/include/$cf_ncuhdr_root &&       cf_search="$cf_search $HOME/include/$cf_ncuhdr_root"
+       test -d $HOME/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $HOME/include/$cf_ncuhdr_root/include"
+       test -d $HOME/$cf_ncuhdr_root/include &&       cf_search="$cf_search $HOME/$cf_ncuhdr_root/include"
+       test -d $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
 }
 
 }
 
+
+
 test "$includedir" != NONE && \
 test "$includedir" != "/usr/include" && \
 test -d "$includedir" && {
 test "$includedir" != NONE && \
 test "$includedir" != "/usr/include" && \
 test -d "$includedir" && {
@@ -3982,52 +5097,76 @@ 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"
 
        test -n "$verbose" && echo search path $cf_search
        cf_save2_CPPFLAGS="$CPPFLAGS"
        for cf_incdir in $cf_search
        do
                
 
        test -n "$verbose" && echo search path $cf_search
        cf_save2_CPPFLAGS="$CPPFLAGS"
        for cf_incdir in $cf_search
        do
                
-for cf_add_incdir in $cf_incdir
-do
-       while true
+if test -n "$cf_incdir" ; then
+  for cf_add_incdir in $cf_incdir
+  do
+       while test $cf_add_incdir != /usr/include
        do
        do
-               case $cf_add_incdir in
-               /usr/include) # (vi
-                       ;;
-               /usr/local/include) # (vi
+         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
                        if test "$GCC" = yes
                        then
-                               cf_save_CPPFLAGS="$CPPFLAGS"
-                               CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
-                               cat > conftest.$ac_ext <<EOF
-#line 4005 "configure"
+                         cf_save_CPPFLAGS=$CPPFLAGS
+                         CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
+                         cat > conftest.$ac_ext <<EOF
+#line 5132 "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:4012: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5139: \"$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*
   :
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  CPPFLAGS="$cf_save_CPPFLAGS"
+  cf_have_incdir=yes
 fi
 rm -f conftest*
 fi
 rm -f conftest*
+                         CPPFLAGS=$cf_save_CPPFLAGS
                        fi
                        fi
-                       ;;
-               *) # (vi
-                       CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
-                       ;;
-               esac
-               cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
-               test "$cf_top_incdir" = "$cf_add_incdir" && break
-               cf_add_incdir="$cf_top_incdir"
+                 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}:5156: testing adding $cf_add_incdir to include-path ..." 1>&5
+
+
+                 CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
+
+                 cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
+                 test "$cf_top_incdir" = "$cf_add_incdir" && break
+                 cf_add_incdir="$cf_top_incdir"
+               else
+                 break
+               fi
+         fi
        done
        done
-done
+  done
+fi
 
                for cf_header in \
                        ncurses.h \
 
                for cf_header in \
                        ncurses.h \
@@ -4035,7 +5174,7 @@ done
                do
                        
        cat > conftest.$ac_ext <<EOF
                do
                        
        cat > conftest.$ac_ext <<EOF
-#line 4039 "configure"
+#line 5178 "configure"
 #include "confdefs.h"
 
 
 #include "confdefs.h"
 
 
@@ -4056,7 +5195,7 @@ printf("old\n");
        
 ; return 0; }
 EOF
        
 ; return 0; }
 EOF
-if { (eval echo configure:4060: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5199: \"$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
        
@@ -4090,46 +5229,69 @@ echo "$ac_t""$cf_cv_ncurses_h2" 1>&6
                cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
        fi
        
                cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
        fi
        
-for cf_add_incdir in $cf_1st_incdir
-do
-       while true
+if test -n "$cf_1st_incdir" ; then
+  for cf_add_incdir in $cf_1st_incdir
+  do
+       while test $cf_add_incdir != /usr/include
        do
        do
-               case $cf_add_incdir in
-               /usr/include) # (vi
-                       ;;
-               /usr/local/include) # (vi
+         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
                        if test "$GCC" = yes
                        then
-                               cf_save_CPPFLAGS="$CPPFLAGS"
-                               CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
-                               cat > conftest.$ac_ext <<EOF
-#line 4107 "configure"
+                         cf_save_CPPFLAGS=$CPPFLAGS
+                         CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
+                         cat > conftest.$ac_ext <<EOF
+#line 5257 "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:4114: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5264: \"$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*
   :
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  CPPFLAGS="$cf_save_CPPFLAGS"
+  cf_have_incdir=yes
 fi
 rm -f conftest*
 fi
 rm -f conftest*
+                         CPPFLAGS=$cf_save_CPPFLAGS
                        fi
                        fi
-                       ;;
-               *) # (vi
-                       CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
-                       ;;
-               esac
-               cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
-               test "$cf_top_incdir" = "$cf_add_incdir" && break
-               cf_add_incdir="$cf_top_incdir"
+                 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}:5281: testing adding $cf_add_incdir to include-path ..." 1>&5
+
+
+                 CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
+
+                 cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
+                 test "$cf_top_incdir" = "$cf_add_incdir" && break
+                 cf_add_incdir="$cf_top_incdir"
+               else
+                 break
+               fi
+         fi
        done
        done
-done
+  done
+fi
 
 
 fi
 
 
 fi
@@ -4163,7 +5325,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:4167: checking for terminfo header" >&5
+echo "configure:5329: 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
@@ -4180,7 +5342,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 4184 "configure"
+#line 5346 "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}>
@@ -4190,7 +5352,7 @@ int main() {
 int x = auto_left_margin
 ; return 0; }
 EOF
 int x = auto_left_margin
 ; return 0; }
 EOF
-if { (eval echo configure:4194: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5356: \"$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"
@@ -4245,7 +5407,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:4249: checking for ncurses version" >&5
+echo "configure:5411: 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
@@ -4271,7 +5433,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:4275: \"$cf_try\") 1>&5; (eval $cf_try) 2>&5; }
+       { (eval echo configure:5437: \"$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"
@@ -4280,7 +5442,7 @@ EOF
 
 else
   cat > conftest.$ac_ext <<EOF
 
 else
   cat > conftest.$ac_ext <<EOF
-#line 4284 "configure"
+#line 5446 "configure"
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header-curses.h}>
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header-curses.h}>
@@ -4301,10 +5463,10 @@ int main()
        make an error
 # endif
 #endif
        make an error
 # endif
 #endif
-       exit(0);
+       ${cf_cv_main_return-return}(0);
 }
 EOF
 }
 EOF
-if { (eval echo configure:4308: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:5470: \"$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`
@@ -4326,7 +5488,7 @@ EOF
 
 
 
 
 
 
-       
+
 
 cf_nculib_root=ncursesw
        # This works, except for the special case where we find gpm, but
 
 cf_nculib_root=ncursesw
        # This works, except for the special case where we find gpm, but
@@ -4335,7 +5497,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:4339: checking for Gpm_Open in -lgpm" >&5
+echo "configure:5501: 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
@@ -4343,7 +5505,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 4347 "configure"
+#line 5509 "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
@@ -4354,7 +5516,7 @@ int main() {
 Gpm_Open()
 ; return 0; }
 EOF
 Gpm_Open()
 ; return 0; }
 EOF
-if { (eval echo configure:4358: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5520: \"$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
@@ -4370,7 +5532,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:4374: checking for initscr in -lgpm" >&5
+echo "configure:5536: 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
@@ -4378,7 +5540,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 4382 "configure"
+#line 5544 "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
@@ -4389,7 +5551,7 @@ int main() {
 initscr()
 ; return 0; }
 EOF
 initscr()
 ; return 0; }
 EOF
-if { (eval echo configure:4393: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5555: \"$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
@@ -4421,7 +5583,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:4425: checking for tgoto in -lmytinfo" >&5
+echo "configure:5587: 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
@@ -4429,7 +5591,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 4433 "configure"
+#line 5595 "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
@@ -4440,7 +5602,7 @@ int main() {
 tgoto()
 ; return 0; }
 EOF
 tgoto()
 ; return 0; }
 EOF
-if { (eval echo configure:4444: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5606: \"$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
@@ -4464,22 +5626,51 @@ fi
        ;;
 esac
 
        ;;
 esac
 
-LIBS="$cf_ncurses_LIBS $LIBS"
+LIBS="$cf_ncurses_LIBS $LIBS"
+
+if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
+then
+       
+if test -n "$cf_cv_curses_dir/lib" ; then
+  for cf_add_libdir in $cf_cv_curses_dir/lib
+  do
+    if test $cf_add_libdir = /usr/lib ; then
+      :
+    elif test -d $cf_add_libdir
+    then
+      cf_have_libdir=no
+      if test -n "$LDFLAGS$LIBS" ; then
+        # a loop is needed to ensure we can add subdirs of existing dirs
+        for cf_test_libdir in $LDFLAGS $LIBS ; do
+          if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
+            cf_have_libdir=yes; break
+          fi
+        done
+      fi
+      if test "$cf_have_libdir" = no ; then
+        test -n "$verbose" && echo "   adding $cf_add_libdir to library-path" 1>&6
+
+echo "${as_me-configure}:5654: testing adding $cf_add_libdir to library-path ..." 1>&5
+
+
+        LDFLAGS="-L$cf_add_libdir $LDFLAGS"
+      fi
+    fi
+  done
+fi
 
 
-if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
-then
-       LIBS="-L$cf_cv_curses_dir/lib -l$cf_nculib_root $LIBS"
+       LIBS="-l$cf_nculib_root $LIBS"
 else
        
        eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
        cf_libdir=""
        echo $ac_n "checking for initscr""... $ac_c" 1>&6
 else
        
        eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
        cf_libdir=""
        echo $ac_n "checking for initscr""... $ac_c" 1>&6
-echo "configure:4478: checking for initscr" >&5
+echo "configure:5669: 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 4483 "configure"
+#line 5674 "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.  */
@@ -4502,7 +5693,7 @@ initscr();
 
 ; return 0; }
 EOF
 
 ; return 0; }
 EOF
-if { (eval echo configure:4506: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5697: \"$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
@@ -4522,17 +5713,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:4526: checking for initscr in -l$cf_nculib_root" >&5
+echo "configure:5717: 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 4529 "configure"
+#line 5720 "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:4536: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5727: \"$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'
@@ -4542,36 +5733,51 @@ else
   cat conftest.$ac_ext >&5
   rm -rf conftest*
   echo "$ac_t""no" 1>&6
   cat conftest.$ac_ext >&5
   rm -rf conftest*
   echo "$ac_t""no" 1>&6
-                       cf_search=""
-
-test -d "$HOME" && {
-       test -n "$verbose" && echo "    ... testing lib-directories under $HOME"
-       test -d "$HOME/lib" &&          cf_search="$cf_search $HOME/lib"
-       test -d "$HOME/lib/$cf_nculib_root" &&       cf_search="$cf_search $HOME/lib/$cf_nculib_root"
-       test -d "$HOME/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $HOME/lib/$cf_nculib_root/lib"
+                       
+cf_library_path_list=""
+if test -n "${LDFLAGS}${LIBS}" ; then
+       for cf_library_path in $LDFLAGS $LIBS
+       do
+               case $cf_library_path in #(vi
+               -L*)
+                       cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
+                       
+test "$cf_library_path" != "NONE" && \
+test -d "$cf_library_path" && \
+ {
+       test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
+       test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
+       test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
+       test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
+       test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
+       test -d $cf_library_path/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib/$cf_nculib_root"
 }
 
 }
 
-# For other stuff under the home directory, it should be sufficient to put
-# a symbolic link for $HOME/$cf_nculib_root to the actual package location:
-test -d "$HOME/$cf_nculib_root" && {
-       test -n "$verbose" && echo "    ... testing lib-directories under $HOME/$cf_nculib_root"
-       test -d "$HOME/$cf_nculib_root/lib" &&       cf_search="$cf_search $HOME/$cf_nculib_root/lib"
-       test -d "$HOME/$cf_nculib_root/lib/$cf_nculib_root" &&    cf_search="$cf_search $HOME/$cf_nculib_root/lib/$cf_nculib_root"
-}
+                       cf_library_path_list="$cf_library_path_list $cf_search"
+                       ;;
+               esac
+       done
+fi
 
 
-test "$prefix" != /usr/local && \
-test -d /usr/local && {
-       test -n "$verbose" && echo "    ... testing lib-directories under /usr/local"
-       test -d /usr/local/lib &&       cf_search="$cf_search /usr/local/lib"
-       test -d /usr/local/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/local/lib/$cf_nculib_root"
-       test -d /usr/local/lib/$cf_nculib_root/lib && cf_search="$cf_search /usr/local/lib/$cf_nculib_root/lib"
-       test -d /usr/local/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/local/$cf_nculib_root/lib"
-       test -d /usr/local/$cf_nculib_root/lib/$cf_nculib_root && cf_search="$cf_search /usr/local/$cf_nculib_root/lib/$cf_nculib_root"
+cf_search=""
+
+
+test "/usr" != "$prefix" && \
+test -d "/usr" && \
+(test $prefix = NONE || test -d $prefix) && {
+       test -n "$verbose" && echo "    ... testing for lib-directories under /usr"
+       test -d /usr/lib &&          cf_search="$cf_search /usr/lib"
+       test -d /usr/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/lib/$cf_nculib_root"
+       test -d /usr/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/lib/$cf_nculib_root/lib"
+       test -d /usr/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/$cf_nculib_root/lib"
+       test -d /usr/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/$cf_nculib_root/lib/$cf_nculib_root"
 }
 
 }
 
-test "$prefix" != NONE && \
-test -d $prefix && {
-       test -n "$verbose" && echo "    ... testing lib-directories under $prefix"
+
+test "$prefix" != "NONE" && \
+test -d "$prefix" && \
+ {
+       test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
        test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
        test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
        test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
        test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
        test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
        test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
@@ -4579,39 +5785,60 @@ test -d $prefix && {
        test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
 }
 
        test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
 }
 
-test "$prefix" != /opt && \
-test -d /opt && {
-       test -n "$verbose" && echo "    ... testing lib-directories under /opt"
-       test -d /opt/lib &&             cf_search="$cf_search /opt/lib"
-       test -d /opt/lib/$cf_nculib_root &&          cf_search="$cf_search /opt/lib/$cf_nculib_root"
-       test -d /opt/lib/$cf_nculib_root/lib &&       cf_search="$cf_search /opt/lib/$cf_nculib_root/lib"
-       test -d /opt/$cf_nculib_root/lib &&          cf_search="$cf_search /opt/$cf_nculib_root/lib"
-       test -d /opt/$cf_nculib_root/lib/$cf_nculib_root &&       cf_search="$cf_search /opt/$cf_nculib_root/lib/$cf_nculib_root"
+
+test "/usr/local" != "$prefix" && \
+test -d "/usr/local" && \
+(test $prefix = NONE || test -d $prefix) && {
+       test -n "$verbose" && echo "    ... testing for lib-directories under /usr/local"
+       test -d /usr/local/lib &&          cf_search="$cf_search /usr/local/lib"
+       test -d /usr/local/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/local/lib/$cf_nculib_root"
+       test -d /usr/local/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/local/lib/$cf_nculib_root/lib"
+       test -d /usr/local/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/local/$cf_nculib_root/lib"
+       test -d /usr/local/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/local/$cf_nculib_root/lib/$cf_nculib_root"
+}
+
+
+test "/opt" != "$prefix" && \
+test -d "/opt" && \
+(test $prefix = NONE || test -d $prefix) && {
+       test -n "$verbose" && echo "    ... testing for lib-directories under /opt"
+       test -d /opt/lib &&          cf_search="$cf_search /opt/lib"
+       test -d /opt/lib/$cf_nculib_root &&       cf_search="$cf_search /opt/lib/$cf_nculib_root"
+       test -d /opt/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /opt/lib/$cf_nculib_root/lib"
+       test -d /opt/$cf_nculib_root/lib &&       cf_search="$cf_search /opt/$cf_nculib_root/lib"
+       test -d /opt/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /opt/$cf_nculib_root/lib/$cf_nculib_root"
 }
 
 }
 
-test "$prefix" != /usr && \
-test -d /usr && {
-       test -n "$verbose" && echo "    ... testing lib-directories under /usr"
-       test -d /usr/lib &&             cf_search="$cf_search /usr/lib"
-       test -d /usr/lib/$cf_nculib_root &&          cf_search="$cf_search /usr/lib/$cf_nculib_root"
-       test -d /usr/lib/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/lib/$cf_nculib_root/lib"
-       test -d /usr/$cf_nculib_root/lib &&          cf_search="$cf_search /usr/$cf_nculib_root/lib"
+
+test "$HOME" != "$prefix" && \
+test -d "$HOME" && \
+(test $prefix = NONE || test -d $prefix) && {
+       test -n "$verbose" && echo "    ... testing for lib-directories under $HOME"
+       test -d $HOME/lib &&          cf_search="$cf_search $HOME/lib"
+       test -d $HOME/lib/$cf_nculib_root &&       cf_search="$cf_search $HOME/lib/$cf_nculib_root"
+       test -d $HOME/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $HOME/lib/$cf_nculib_root/lib"
+       test -d $HOME/$cf_nculib_root/lib &&       cf_search="$cf_search $HOME/$cf_nculib_root/lib"
+       test -d $HOME/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $HOME/$cf_nculib_root/lib/$cf_nculib_root"
 }
 
 }
 
+
+
+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:4605: checking for -l$cf_nculib_root in $cf_libdir" >&5
+echo "configure:5832: 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 4608 "configure"
+#line 5835 "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:4615: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5842: \"$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'
@@ -4642,7 +5869,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:4646: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
+echo "configure:5873: 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$%%"`
@@ -4651,14 +5878,14 @@ echo "configure:4646: 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 4655 "configure"
+#line 5882 "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:4662: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5889: \"$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
@@ -4679,6 +5906,9 @@ cat >> confdefs.h <<EOF
 EOF
 
 
 EOF
 
 
+
+fi
+
        ;;
 pdcurses) #(vi
        if test "$no_x" = yes; then
        ;;
 pdcurses) #(vi
        if test "$no_x" = yes; then
@@ -4701,17 +5931,17 @@ else
     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
     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:4705: checking whether -R must be followed by a space" >&5
+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
       ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries"
       cat > conftest.$ac_ext <<EOF
-#line 4708 "configure"
+#line 5938 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:4715: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+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
 else
   rm -rf conftest*
   ac_R_nospace=yes
 else
@@ -4727,14 +5957,14 @@ rm -f conftest*
       else
        LIBS="$ac_xsave_LIBS -R $x_libraries"
        cat > conftest.$ac_ext <<EOF
       else
        LIBS="$ac_xsave_LIBS -R $x_libraries"
        cat > conftest.$ac_ext <<EOF
-#line 4731 "configure"
+#line 5961 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:4738: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5968: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_R_space=yes
 else
   rm -rf conftest*
   ac_R_space=yes
 else
@@ -4766,7 +5996,7 @@ rm -f conftest*
     # 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
     # 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:4770: checking for dnet_ntoa in -ldnet" >&5
+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
 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
@@ -4774,7 +6004,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ldnet  $LIBS"
 cat > conftest.$ac_ext <<EOF
   ac_save_LIBS="$LIBS"
 LIBS="-ldnet  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4778 "configure"
+#line 6008 "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
@@ -4785,7 +6015,7 @@ int main() {
 dnet_ntoa()
 ; return 0; }
 EOF
 dnet_ntoa()
 ; return 0; }
 EOF
-if { (eval echo configure:4789: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6019: \"$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
@@ -4807,7 +6037,7 @@ 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
 
     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:4811: checking for dnet_ntoa in -ldnet_stub" >&5
+echo "configure:6041: 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
 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
@@ -4815,7 +6045,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ldnet_stub  $LIBS"
 cat > conftest.$ac_ext <<EOF
   ac_save_LIBS="$LIBS"
 LIBS="-ldnet_stub  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4819 "configure"
+#line 6049 "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
@@ -4826,7 +6056,7 @@ int main() {
 dnet_ntoa()
 ; return 0; }
 EOF
 dnet_ntoa()
 ; return 0; }
 EOF
-if { (eval echo configure:4830: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6060: \"$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
@@ -4855,12 +6085,12 @@ fi
     # 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
     # 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:4859: checking for gethostbyname" >&5
+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
 else
   cat > conftest.$ac_ext <<EOF
 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 4864 "configure"
+#line 6094 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char gethostbyname(); below.  */
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char gethostbyname(); below.  */
@@ -4883,7 +6113,7 @@ gethostbyname();
 
 ; return 0; }
 EOF
 
 ; return 0; }
 EOF
-if { (eval echo configure:4887: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+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"
 else
   rm -rf conftest*
   eval "ac_cv_func_gethostbyname=yes"
 else
@@ -4904,7 +6134,7 @@ fi
 
     if test $ac_cv_func_gethostbyname = no; then
       echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
 
     if test $ac_cv_func_gethostbyname = no; then
       echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
-echo "configure:4908: checking for gethostbyname in -lnsl" >&5
+echo "configure:6138: 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
 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
@@ -4912,7 +6142,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lnsl  $LIBS"
 cat > conftest.$ac_ext <<EOF
   ac_save_LIBS="$LIBS"
 LIBS="-lnsl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4916 "configure"
+#line 6146 "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
@@ -4923,7 +6153,7 @@ int main() {
 gethostbyname()
 ; return 0; }
 EOF
 gethostbyname()
 ; return 0; }
 EOF
-if { (eval echo configure:4927: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6157: \"$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
@@ -4953,12 +6183,12 @@ fi
     # -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
     # -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:4957: checking for connect" >&5
+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
 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 4962 "configure"
+#line 6192 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char connect(); below.  */
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char connect(); below.  */
@@ -4981,7 +6211,7 @@ connect();
 
 ; return 0; }
 EOF
 
 ; return 0; }
 EOF
-if { (eval echo configure:4985: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+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
   rm -rf conftest*
   eval "ac_cv_func_connect=yes"
 else
@@ -5002,7 +6232,7 @@ fi
 
     if test $ac_cv_func_connect = no; then
       echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6
 
     if test $ac_cv_func_connect = no; then
       echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6
-echo "configure:5006: checking for connect in -lsocket" >&5
+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
 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
@@ -5010,7 +6240,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
 cat > conftest.$ac_ext <<EOF
   ac_save_LIBS="$LIBS"
 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5014 "configure"
+#line 6244 "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
@@ -5021,7 +6251,7 @@ int main() {
 connect()
 ; return 0; }
 EOF
 connect()
 ; return 0; }
 EOF
-if { (eval echo configure:5025: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+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"
 else
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5045,12 +6275,12 @@ fi
 
     # gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX.
     echo $ac_n "checking for remove""... $ac_c" 1>&6
 
     # gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX.
     echo $ac_n "checking for remove""... $ac_c" 1>&6
-echo "configure:5049: checking for remove" >&5
+echo "configure:6279: 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
 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 5054 "configure"
+#line 6284 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char remove(); below.  */
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char remove(); below.  */
@@ -5073,7 +6303,7 @@ remove();
 
 ; return 0; }
 EOF
 
 ; return 0; }
 EOF
-if { (eval echo configure:5077: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6307: \"$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
   rm -rf conftest*
   eval "ac_cv_func_remove=yes"
 else
@@ -5094,7 +6324,7 @@ fi
 
     if test $ac_cv_func_remove = no; then
       echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6
 
     if test $ac_cv_func_remove = no; then
       echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6
-echo "configure:5098: checking for remove in -lposix" >&5
+echo "configure:6328: 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
 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
@@ -5102,7 +6332,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lposix  $LIBS"
 cat > conftest.$ac_ext <<EOF
   ac_save_LIBS="$LIBS"
 LIBS="-lposix  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5106 "configure"
+#line 6336 "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
@@ -5113,7 +6343,7 @@ int main() {
 remove()
 ; return 0; }
 EOF
 remove()
 ; return 0; }
 EOF
-if { (eval echo configure:5117: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6347: \"$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
@@ -5137,12 +6367,12 @@ fi
 
     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
     echo $ac_n "checking for shmat""... $ac_c" 1>&6
 
     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
     echo $ac_n "checking for shmat""... $ac_c" 1>&6
-echo "configure:5141: checking for shmat" >&5
+echo "configure:6371: 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
 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 5146 "configure"
+#line 6376 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char shmat(); below.  */
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char shmat(); below.  */
@@ -5165,7 +6395,7 @@ shmat();
 
 ; return 0; }
 EOF
 
 ; return 0; }
 EOF
-if { (eval echo configure:5169: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6399: \"$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
   rm -rf conftest*
   eval "ac_cv_func_shmat=yes"
 else
@@ -5186,7 +6416,7 @@ fi
 
     if test $ac_cv_func_shmat = no; then
       echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6
 
     if test $ac_cv_func_shmat = no; then
       echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6
-echo "configure:5190: checking for shmat in -lipc" >&5
+echo "configure:6420: 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
 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
@@ -5194,7 +6424,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lipc  $LIBS"
 cat > conftest.$ac_ext <<EOF
   ac_save_LIBS="$LIBS"
 LIBS="-lipc  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5198 "configure"
+#line 6428 "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
@@ -5205,7 +6435,7 @@ int main() {
 shmat()
 ; return 0; }
 EOF
 shmat()
 ; return 0; }
 EOF
-if { (eval echo configure:5209: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6439: \"$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
@@ -5238,7 +6468,7 @@ fi
   # 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
   # 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:5242: checking for IceConnectionNumber in -lICE" >&5
+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
 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
@@ -5246,7 +6476,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
 cat > conftest.$ac_ext <<EOF
   ac_save_LIBS="$LIBS"
 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5250 "configure"
+#line 6480 "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
@@ -5257,7 +6487,7 @@ int main() {
 IceConnectionNumber()
 ; return 0; }
 EOF
 IceConnectionNumber()
 ; return 0; }
 EOF
-if { (eval echo configure:5261: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6491: \"$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
@@ -5293,6 +6523,9 @@ LDFLAGS="$X_LIBS $LDFLAGS"
 
 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
+
+
 cf_check_cflags="$CFLAGS"
 cf_check_cppflags="$CPPFLAGS"
 
 cf_check_cflags="$CFLAGS"
 cf_check_cppflags="$CPPFLAGS"
 
@@ -5352,18 +6585,27 @@ 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
+
+
        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
 
        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
 
-       CPPFLAGS="$cf_new_cppflags $CPPFLAGS"
+echo "${as_me-configure}:6598: 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
 
 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}:6607: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
+
+
        EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
 fi
 
        EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
 fi
 
@@ -5372,14 +6614,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 5376 "configure"
+#line 6618 "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:5383: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6625: \"$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
@@ -5387,9 +6629,15 @@ 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
+
+
         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
+
+
         fi
         CFLAGS="$cf_check_flags"
 fi
         fi
         CFLAGS="$cf_check_flags"
 fi
@@ -5398,12 +6646,12 @@ fi
 
 
 echo $ac_n "checking for XOpenDisplay""... $ac_c" 1>&6
 
 
 echo $ac_n "checking for XOpenDisplay""... $ac_c" 1>&6
-echo "configure:5402: checking for XOpenDisplay" >&5
+echo "configure:6650: 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
 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
-#line 5407 "configure"
+#line 6655 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char XOpenDisplay(); below.  */
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char XOpenDisplay(); below.  */
@@ -5426,7 +6674,7 @@ XOpenDisplay();
 
 ; return 0; }
 EOF
 
 ; return 0; }
 EOF
-if { (eval echo configure:5430: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6678: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_XOpenDisplay=yes"
 else
   rm -rf conftest*
   eval "ac_cv_func_XOpenDisplay=yes"
 else
@@ -5445,7 +6693,7 @@ else
   echo "$ac_t""no" 1>&6
 
 echo $ac_n "checking for XOpenDisplay in -lX11""... $ac_c" 1>&6
   echo "$ac_t""no" 1>&6
 
 echo $ac_n "checking for XOpenDisplay in -lX11""... $ac_c" 1>&6
-echo "configure:5449: checking for XOpenDisplay in -lX11" >&5
+echo "configure:6697: 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
 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
@@ -5453,7 +6701,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
 cat > conftest.$ac_ext <<EOF
   ac_save_LIBS="$LIBS"
 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5457 "configure"
+#line 6705 "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
@@ -5464,7 +6712,7 @@ int main() {
 XOpenDisplay()
 ; return 0; }
 EOF
 XOpenDisplay()
 ; return 0; }
 EOF
-if { (eval echo configure:5468: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6716: \"$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
@@ -5488,12 +6736,12 @@ fi
 
 
 echo $ac_n "checking for XtAppInitialize""... $ac_c" 1>&6
 
 
 echo $ac_n "checking for XtAppInitialize""... $ac_c" 1>&6
-echo "configure:5492: checking for XtAppInitialize" >&5
+echo "configure:6740: 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
 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
-#line 5497 "configure"
+#line 6745 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char XtAppInitialize(); below.  */
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char XtAppInitialize(); below.  */
@@ -5516,7 +6764,7 @@ XtAppInitialize();
 
 ; return 0; }
 EOF
 
 ; 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:6768: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_XtAppInitialize=yes"
 else
   rm -rf conftest*
   eval "ac_cv_func_XtAppInitialize=yes"
 else
@@ -5535,7 +6783,7 @@ else
   echo "$ac_t""no" 1>&6
 
 echo $ac_n "checking for XtAppInitialize in -lXt""... $ac_c" 1>&6
   echo "$ac_t""no" 1>&6
 
 echo $ac_n "checking for XtAppInitialize in -lXt""... $ac_c" 1>&6
-echo "configure:5539: checking for XtAppInitialize in -lXt" >&5
+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 "(cached) $ac_c" 1>&6
 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
@@ -5543,7 +6791,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
 cat > conftest.$ac_ext <<EOF
   ac_save_LIBS="$LIBS"
 LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5547 "configure"
+#line 6795 "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
@@ -5554,7 +6802,7 @@ int main() {
 XtAppInitialize()
 ; return 0; }
 EOF
 XtAppInitialize()
 ; return 0; }
 EOF
-if { (eval echo configure:5558: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6806: \"$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
@@ -5592,7 +6840,7 @@ 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
 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:5596: checking if you want to link with Xaw 3d library" >&5
+echo "configure:6844: checking if you want to link with Xaw 3d library" >&5
 withval=
 
 # Check whether --with-Xaw3d or --without-Xaw3d was given.
 withval=
 
 # Check whether --with-Xaw3d or --without-Xaw3d was given.
@@ -5609,7 +6857,7 @@ else
 fi
 
 echo $ac_n "checking if you want to link with neXT Athena library""... $ac_c" 1>&6
 fi
 
 echo $ac_n "checking if you want to link with neXT Athena library""... $ac_c" 1>&6
-echo "configure:5613: checking if you want to link with neXT Athena library" >&5
+echo "configure:6861: checking if you want to link with neXT Athena library" >&5
 withval=
 
 # Check whether --with-neXtaw or --without-neXtaw was given.
 withval=
 
 # Check whether --with-neXtaw or --without-neXtaw was given.
@@ -5626,7 +6874,7 @@ else
 fi
 
 echo $ac_n "checking if you want to link with Athena-Plus library""... $ac_c" 1>&6
 fi
 
 echo $ac_n "checking if you want to link with Athena-Plus library""... $ac_c" 1>&6
-echo "configure:5630: checking if you want to link with Athena-Plus library" >&5
+echo "configure:6878: checking if you want to link with Athena-Plus library" >&5
 withval=
 
 # Check whether --with-XawPlus or --without-XawPlus was given.
 withval=
 
 # Check whether --with-XawPlus or --without-XawPlus was given.
@@ -5643,7 +6891,7 @@ else
 fi
 
 echo $ac_n "checking for XextCreateExtension in -lXext""... $ac_c" 1>&6
 fi
 
 echo $ac_n "checking for XextCreateExtension in -lXext""... $ac_c" 1>&6
-echo "configure:5647: checking for XextCreateExtension in -lXext" >&5
+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
 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
@@ -5651,7 +6899,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lXext  $LIBS"
 cat > conftest.$ac_ext <<EOF
   ac_save_LIBS="$LIBS"
 LIBS="-lXext  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5655 "configure"
+#line 6903 "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
@@ -5662,7 +6910,7 @@ int main() {
 XextCreateExtension()
 ; return 0; }
 EOF
 XextCreateExtension()
 ; return 0; }
 EOF
-if { (eval echo configure:5666: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+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"
 else
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5699,15 +6947,15 @@ do
                cf_save="$CPPFLAGS"
                cf_test=X11/$cf_x_athena_root/SimpleMenu.h
                if test $cf_path != default ; then
                cf_save="$CPPFLAGS"
                cf_test=X11/$cf_x_athena_root/SimpleMenu.h
                if test $cf_path != default ; then
-                       CPPFLAGS="-I$cf_path/include $cf_save"
+                       CPPFLAGS="$cf_save -I$cf_path/include"
                        echo $ac_n "checking for $cf_test in $cf_path""... $ac_c" 1>&6
                        echo $ac_n "checking for $cf_test in $cf_path""... $ac_c" 1>&6
-echo "configure:5705: checking for $cf_test in $cf_path" >&5
+echo "configure:6953: checking for $cf_test in $cf_path" >&5
                else
                        echo $ac_n "checking for $cf_test""... $ac_c" 1>&6
                else
                        echo $ac_n "checking for $cf_test""... $ac_c" 1>&6
-echo "configure:5708: checking for $cf_test" >&5
+echo "configure:6956: checking for $cf_test" >&5
                fi
                cat > conftest.$ac_ext <<EOF
                fi
                cat > conftest.$ac_ext <<EOF
-#line 5711 "configure"
+#line 6959 "configure"
 #include "confdefs.h"
 
 #include <X11/Intrinsic.h>
 #include "confdefs.h"
 
 #include <X11/Intrinsic.h>
@@ -5716,7 +6964,7 @@ int main() {
 
 ; return 0; }
 EOF
 
 ; return 0; }
 EOF
-if { (eval echo configure:5720: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6968: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_result=yes
 else
   rm -rf conftest*
   cf_result=yes
 else
@@ -5763,21 +7011,21 @@ do
                        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
                        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:5767: checking for $cf_lib in $cf_path" >&5
+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
                        else
                                LIBS="$cf_lib $LIBS"
                                echo $ac_n "checking for $cf_test in $cf_lib""... $ac_c" 1>&6
-echo "configure:5771: checking for $cf_test in $cf_lib" >&5
+echo "configure:7019: checking for $cf_test in $cf_lib" >&5
                        fi
                        cat > conftest.$ac_ext <<EOF
                        fi
                        cat > conftest.$ac_ext <<EOF
-#line 5774 "configure"
+#line 7022 "configure"
 #include "confdefs.h"
 
 int main() {
 $cf_test()
 ; return 0; }
 EOF
 #include "confdefs.h"
 
 int main() {
 $cf_test()
 ; return 0; }
 EOF
-if { (eval echo configure:5781: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7029: \"$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
@@ -5818,7 +7066,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:5822: checking for $ac_word" >&5
+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
 if eval "test \"`echo '$''{'ac_cv_path_XCURSES_CONFIG'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5857,7 +7105,7 @@ test -n "$XCURSES_CONFIG" || XCURSES_CONFIG="none"
 
 if test "$XCURSES_CONFIG" != none ; then
 
 
 if test "$XCURSES_CONFIG" != none ; then
 
-CPPFLAGS="`$XCURSES_CONFIG --cflags` $CPPFLAGS"
+CPPFLAGS="$CPPFLAGS `$XCURSES_CONFIG --cflags`"
 LIBS="`$XCURSES_CONFIG --libs` $LIBS"
 
 cf_cv_lib_XCurses=yes
 LIBS="`$XCURSES_CONFIG --libs` $LIBS"
 
 cf_cv_lib_XCurses=yes
@@ -5868,6 +7116,9 @@ 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}:7120: testing checking additions to CFLAGS ..." 1>&5
+
+
 cf_check_cflags="$CFLAGS"
 cf_check_cppflags="$CPPFLAGS"
 
 cf_check_cflags="$CFLAGS"
 cf_check_cppflags="$CPPFLAGS"
 
@@ -5927,18 +7178,27 @@ 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}:7182: 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
 
        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
 
-       CPPFLAGS="$cf_new_cppflags $CPPFLAGS"
+echo "${as_me-configure}:7191: 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
 
 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
+
+
        EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
 fi
 
        EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
 fi
 
@@ -5947,14 +7207,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 5951 "configure"
+#line 7211 "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:5958: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7218: \"$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
@@ -5962,9 +7222,15 @@ 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}:7226: 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}:7232: testing but keeping change to \$CPPFLAGS ..." 1>&5
+
+
         fi
         CFLAGS="$cf_check_flags"
 fi
         fi
         CFLAGS="$cf_check_flags"
 fi
@@ -5972,7 +7238,7 @@ rm -f conftest*
 fi
 
 echo $ac_n "checking for XOpenDisplay in -lX11""... $ac_c" 1>&6
 fi
 
 echo $ac_n "checking for XOpenDisplay in -lX11""... $ac_c" 1>&6
-echo "configure:5976: checking for XOpenDisplay in -lX11" >&5
+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
   echo $ac_n "(cached) $ac_c" 1>&6
 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
@@ -5980,7 +7246,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
 cat > conftest.$ac_ext <<EOF
   ac_save_LIBS="$LIBS"
 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5984 "configure"
+#line 7250 "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
@@ -5991,7 +7257,7 @@ int main() {
 XOpenDisplay()
 ; return 0; }
 EOF
 XOpenDisplay()
 ; return 0; }
 EOF
-if { (eval echo configure:5995: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7261: \"$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
@@ -6012,14 +7278,14 @@ else
 fi
 
 echo $ac_n "checking for XCurses library""... $ac_c" 1>&6
 fi
 
 echo $ac_n "checking for XCurses library""... $ac_c" 1>&6
-echo "configure:6016: checking for XCurses library" >&5
+echo "configure:7282: 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
 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 6023 "configure"
+#line 7289 "configure"
 #include "confdefs.h"
 
 #include <xcurses.h>
 #include "confdefs.h"
 
 #include <xcurses.h>
@@ -6029,7 +7295,7 @@ int main() {
 XCursesExit();
 ; return 0; }
 EOF
 XCursesExit();
 ; return 0; }
 EOF
-if { (eval echo configure:6033: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7299: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   cf_cv_lib_XCurses=yes
 else
   rm -rf conftest*
   cf_cv_lib_XCurses=yes
 else
@@ -6074,7 +7340,7 @@ pdcurses) #(vi
 *)
        # look for curses-related libraries
        echo $ac_n "checking for new_panel in -lpanel$cf_cv_libtype""... $ac_c" 1>&6
 *)
        # look for curses-related libraries
        echo $ac_n "checking for new_panel in -lpanel$cf_cv_libtype""... $ac_c" 1>&6
-echo "configure:6078: checking for new_panel in -lpanel$cf_cv_libtype" >&5
+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
 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
@@ -6082,7 +7348,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lpanel$cf_cv_libtype  $LIBS"
 cat > conftest.$ac_ext <<EOF
   ac_save_LIBS="$LIBS"
 LIBS="-lpanel$cf_cv_libtype  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6086 "configure"
+#line 7352 "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
@@ -6093,7 +7359,7 @@ int main() {
 new_panel()
 ; return 0; }
 EOF
 new_panel()
 ; return 0; }
 EOF
-if { (eval echo configure:6097: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7363: \"$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
@@ -6121,7 +7387,7 @@ else
 fi
 
        echo $ac_n "checking for menu_driver in -lmenu$cf_cv_libtype""... $ac_c" 1>&6
 fi
 
        echo $ac_n "checking for menu_driver in -lmenu$cf_cv_libtype""... $ac_c" 1>&6
-echo "configure:6125: checking for menu_driver in -lmenu$cf_cv_libtype" >&5
+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 "(cached) $ac_c" 1>&6
 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
@@ -6129,7 +7395,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lmenu$cf_cv_libtype  $LIBS"
 cat > conftest.$ac_ext <<EOF
   ac_save_LIBS="$LIBS"
 LIBS="-lmenu$cf_cv_libtype  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6133 "configure"
+#line 7399 "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
@@ -6140,7 +7406,7 @@ int main() {
 menu_driver()
 ; return 0; }
 EOF
 menu_driver()
 ; return 0; }
 EOF
-if { (eval echo configure:6144: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7410: \"$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,7 +7434,7 @@ else
 fi
 
        echo $ac_n "checking for form_driver in -lform$cf_cv_libtype""... $ac_c" 1>&6
 fi
 
        echo $ac_n "checking for form_driver in -lform$cf_cv_libtype""... $ac_c" 1>&6
-echo "configure:6172: checking for form_driver in -lform$cf_cv_libtype" >&5
+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 "(cached) $ac_c" 1>&6
 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
@@ -6176,7 +7442,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lform$cf_cv_libtype  $LIBS"
 cat > conftest.$ac_ext <<EOF
   ac_save_LIBS="$LIBS"
 LIBS="-lform$cf_cv_libtype  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6180 "configure"
+#line 7446 "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
@@ -6187,7 +7453,7 @@ int main() {
 form_driver()
 ; return 0; }
 EOF
 form_driver()
 ; return 0; }
 EOF
-if { (eval echo configure:6191: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7457: \"$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
@@ -6226,17 +7492,17 @@ fi
 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:6230: checking for $ac_hdr" >&5
+echo "configure:7496: 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 6235 "configure"
+#line 7501 "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:6240: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7506: \"$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*
@@ -6266,12 +7532,12 @@ done
 esac
 
 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
 esac
 
 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:6270: checking return type of signal handlers" >&5
+echo "configure:7536: 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
 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6275 "configure"
+#line 7541 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <signal.h>
 #include "confdefs.h"
 #include <sys/types.h>
 #include <signal.h>
@@ -6288,7 +7554,7 @@ int main() {
 int i;
 ; return 0; }
 EOF
 int i;
 ; return 0; }
 EOF
-if { (eval echo configure:6292: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7558: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_type_signal=void
 else
   rm -rf conftest*
   ac_cv_type_signal=void
 else
@@ -6308,12 +7574,12 @@ EOF
 
 
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
 
 
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:6312: checking for ANSI C header files" >&5
+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
 else
   cat > conftest.$ac_ext <<EOF
 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6317 "configure"
+#line 7583 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -6321,7 +7587,7 @@ else
 #include <float.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
 #include <float.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6325: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (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_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6338,7 +7604,7 @@ rm -f conftest*
 if test $ac_cv_header_stdc = yes; then
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
 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 6342 "configure"
+#line 7608 "configure"
 #include "confdefs.h"
 #include <string.h>
 EOF
 #include "confdefs.h"
 #include <string.h>
 EOF
@@ -6356,7 +7622,7 @@ fi
 if test $ac_cv_header_stdc = yes; then
   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
 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 6360 "configure"
+#line 7626 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
@@ -6377,7 +7643,7 @@ if test "$cross_compiling" = yes; then
   :
 else
   cat > conftest.$ac_ext <<EOF
   :
 else
   cat > conftest.$ac_ext <<EOF
-#line 6381 "configure"
+#line 7647 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
 #include "confdefs.h"
 #include <ctype.h>
 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -6388,7 +7654,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
 exit (0); }
 
 EOF
 exit (0); }
 
 EOF
-if { (eval echo configure:6392: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:7658: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   :
 else
 then
   :
 else
@@ -6412,12 +7678,12 @@ EOF
 fi
 
 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
 fi
 
 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:6416: checking whether time.h and sys/time.h may both be included" >&5
+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_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
 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 6421 "configure"
+#line 7687 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/time.h>
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/time.h>
@@ -6426,7 +7692,7 @@ int main() {
 struct tm *tp;
 ; return 0; }
 EOF
 struct tm *tp;
 ; return 0; }
 EOF
-if { (eval echo configure:6430: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7696: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_time=yes
 else
   rm -rf conftest*
   ac_cv_header_time=yes
 else
@@ -6459,17 +7725,17 @@ unistd.h \
 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:6463: checking for $ac_hdr" >&5
+echo "configure:7729: 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 6468 "configure"
+#line 7734 "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:6473: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (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
   rm -rf conftest*
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6497,45 +7763,25 @@ done
 
 
 for ac_func in \
 
 
 for ac_func in \
-chgat \
-color_set \
-filter \
-getbegx \
-getcurx \
-getmaxx \
-getnstr \
 gettimeofday \
 gettimeofday \
-getwin \
-mvvline \
-mvwvline \
-napms \
-putwin \
-resize_term \
-resizeterm \
-ripoffline \
-setupterm \
-slk_color \
-slk_init \
+mblen \
+mbrlen \
+mbrtowc \
+mbsrtowcs \
+mbstowcs \
+mbtowc \
 strdup \
 strdup \
-termattrs \
-tgetent \
-tigetnum \
-tigetstr \
-typeahead \
-use_default_colors \
-vsscanf \
-wchgat \
-winsstr \
-wresize \
+wcsrtombs \
+wcstombs \
 
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
 
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6534: checking for $ac_func" >&5
+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
 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 6539 "configure"
+#line 7785 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -6558,7 +7804,7 @@ $ac_func();
 
 ; return 0; }
 EOF
 
 ; return 0; }
 EOF
-if { (eval echo configure:6562: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7808: \"$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
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
 done
 
 
 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
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+cat > conftest.$ac_ext <<EOF
+#line 7841 "configure"
+#include "confdefs.h"
+
+#include <stdlib.h>
+#include <${cf_cv_ncurses_header-curses.h}>
+int main() {
+
+       long x = winnstr(stdscr, "", 0);
+       int x1, y1;
+       getbegyx(stdscr, y1, x1)
+; return 0; }
+EOF
+if { (eval echo configure:7853: \"$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 7861 "configure"
+#include "confdefs.h"
+
+#define _XOPEN_SOURCE_EXTENDED
+#include <stdlib.h>
+#include <${cf_cv_ncurses_header-curses.h}>
+int main() {
+
+       long x = winnstr(stdscr, "", 0);
+       int x1, y1;
+       getbegyx(stdscr, y1, x1)
+; return 0; }
+EOF
+if { (eval echo configure:7874: \"$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
+
+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_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
+  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 7906 "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:7915: \"$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
+
+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
+
+       ;;
+ncursesw/term.h)
+       cat >> confdefs.h <<\EOF
+#define HAVE_NCURSESW_TERM_H 1
+EOF
+
+       ;;
+esac
+
+
+
+
+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 \
+
+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
+  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"
+#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
+#endif
+int main() {
+
+#ifndef ${cf_func}
+long foo = (long)(&${cf_func});
+${cf_cv_main_return-return}(foo == 0);
+#endif
+                       
+; return 0; }
+EOF
+if { (eval echo configure:8032: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  cf_result=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  cf_result=no
+fi
+rm -f conftest*
+               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 $ac_n "checking for ncurses extended functions""... $ac_c" 1>&6
-echo "configure:6588: checking for ncurses extended functions" >&5
+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
 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 6594 "configure"
+#line 8066 "configure"
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header-curses.h}>
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header-curses.h}>
@@ -6610,7 +8082,7 @@ int main() {
        (void) wresize (0, 0, 0);
 ; return 0; }
 EOF
        (void) wresize (0, 0, 0);
 ; return 0; }
 EOF
-if { (eval echo configure:6614: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8086: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   cf_cv_ncurses_ext_funcs=yes
 else
   rm -rf conftest*
   cf_cv_ncurses_ext_funcs=yes
 else
@@ -6630,13 +8102,13 @@ EOF
 
 
 echo $ac_n "checking for wide-character functions""... $ac_c" 1>&6
 
 
 echo $ac_n "checking for wide-character functions""... $ac_c" 1>&6
-echo "configure:6634: checking for wide-character functions" >&5
+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
   
 cat > conftest.$ac_ext <<EOF
 if eval "test \"`echo '$''{'cf_cv_widechar_funcs'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 cat > conftest.$ac_ext <<EOF
-#line 6640 "configure"
+#line 8112 "configure"
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header-curses.h}>
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header-curses.h}>
@@ -6648,7 +8120,7 @@ int main() {
        
 ; return 0; }
 EOF
        
 ; return 0; }
 EOF
-if { (eval echo configure:6652: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8124: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   cf_cv_widechar_funcs=yes
 else
   rm -rf conftest*
   cf_cv_widechar_funcs=yes
 else
@@ -6676,13 +8148,13 @@ fi
 
 
 echo $ac_n "checking if sys/time.h works with sys/select.h""... $ac_c" 1>&6
 
 
 echo $ac_n "checking if sys/time.h works with sys/select.h""... $ac_c" 1>&6
-echo "configure:6680: checking if sys/time.h works with sys/select.h" >&5
+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
   
 cat > conftest.$ac_ext <<EOF
 if eval "test \"`echo '$''{'cf_cv_sys_time_select'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 cat > conftest.$ac_ext <<EOF
-#line 6686 "configure"
+#line 8158 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -6697,7 +8169,7 @@ int main() {
 
 ; return 0; }
 EOF
 
 ; return 0; }
 EOF
-if { (eval echo configure:6701: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8173: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_sys_time_select=yes
 else
   rm -rf conftest*
   cf_cv_sys_time_select=yes
 else
@@ -6718,7 +8190,7 @@ EOF
 
 
 echo $ac_n "checking for function curses_version""... $ac_c" 1>&6
 
 
 echo $ac_n "checking for function curses_version""... $ac_c" 1>&6
-echo "configure:6722: checking for function curses_version" >&5
+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 eval "test \"`echo '$''{'cf_cv_func_curses_version'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -6727,7 +8199,7 @@ if test "$cross_compiling" = yes; then
   cf_cv_func_curses_version=unknown
 else
   cat > conftest.$ac_ext <<EOF
   cf_cv_func_curses_version=unknown
 else
   cat > conftest.$ac_ext <<EOF
-#line 6731 "configure"
+#line 8203 "configure"
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header-curses.h}>
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header-curses.h}>
@@ -6735,11 +8207,11 @@ int main()
 {
        char temp[1024];
        sprintf(temp, "%s\n", curses_version());
 {
        char temp[1024];
        sprintf(temp, "%s\n", curses_version());
-       exit(0);
+       ${cf_cv_main_return-return}(0);
 }
 
 EOF
 }
 
 EOF
-if { (eval echo configure:6743: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+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
 
 then
   cf_cv_func_curses_version=yes
 
@@ -6763,17 +8235,33 @@ 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
+  NCURSES_WRAP_PREFIX=_nc_
+fi
+
+echo "$ac_t""$NCURSES_WRAP_PREFIX" 1>&6
+
+
+
+
 echo $ac_n "checking for alternate character set array""... $ac_c" 1>&6
 echo $ac_n "checking for alternate character set array""... $ac_c" 1>&6
-echo "configure:6768: checking for alternate character set array" >&5
+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
 if eval "test \"`echo '$''{'cf_cv_curses_acs_map'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 cf_cv_curses_acs_map=unknown
-for name in acs_map _acs_map __acs_map _nc_acs_map
+for name in acs_map _acs_map __acs_map ${NCURSES_WRAP_PREFIX}acs_map
 do
 cat > conftest.$ac_ext <<EOF
 do
 cat > conftest.$ac_ext <<EOF
-#line 6777 "configure"
+#line 8265 "configure"
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header-curses.h}>
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header-curses.h}>
@@ -6784,7 +8272,7 @@ $name['k'] = ACS_PLUS
 
 ; return 0; }
 EOF
 
 ; return 0; }
 EOF
-if { (eval echo configure:6788: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8276: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   cf_cv_curses_acs_map=$name; break
 else
   rm -rf conftest*
   cf_cv_curses_acs_map=$name; break
 else
@@ -6805,7 +8293,7 @@ EOF
 
 
 echo $ac_n "checking for wide alternate character set array""... $ac_c" 1>&6
 
 
 echo $ac_n "checking for wide alternate character set array""... $ac_c" 1>&6
-echo "configure:6809: checking for wide alternate character set array" >&5
+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
 if eval "test \"`echo '$''{'cf_cv_curses_wacs_map'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -6814,7 +8302,7 @@ else
        for name in wacs_map _wacs_map __wacs_map _nc_wacs
        do
        cat > conftest.$ac_ext <<EOF
        for name in wacs_map _wacs_map __wacs_map _nc_wacs
        do
        cat > conftest.$ac_ext <<EOF
-#line 6818 "configure"
+#line 8306 "configure"
 #include "confdefs.h"
 
 #ifndef _XOPEN_SOURCE_EXTENDED
 #include "confdefs.h"
 
 #ifndef _XOPEN_SOURCE_EXTENDED
@@ -6825,7 +8313,7 @@ int main() {
 $name['k'] = *WACS_PLUS
 ; return 0; }
 EOF
 $name['k'] = *WACS_PLUS
 ; return 0; }
 EOF
-if { (eval echo configure:6829: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8317: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   cf_cv_curses_wacs_map=$name
         break
   rm -rf conftest*
   cf_cv_curses_wacs_map=$name
         break
@@ -6841,9 +8329,9 @@ echo "$ac_t""$cf_cv_curses_wacs_map" 1>&6
 
 
 echo $ac_n "checking for type attr_t in ${cf_cv_ncurses_header-curses.h}""... $ac_c" 1>&6
 
 
 echo $ac_n "checking for type attr_t in ${cf_cv_ncurses_header-curses.h}""... $ac_c" 1>&6
-echo "configure:6845: checking for type attr_t in ${cf_cv_ncurses_header-curses.h}" >&5
+echo "configure:8333: checking for type attr_t in ${cf_cv_ncurses_header-curses.h}" >&5
 cat > conftest.$ac_ext <<EOF
 cat > conftest.$ac_ext <<EOF
-#line 6847 "configure"
+#line 8335 "configure"
 #include "confdefs.h"
 
 #ifndef _XOPEN_SOURCE_EXTENDED
 #include "confdefs.h"
 
 #ifndef _XOPEN_SOURCE_EXTENDED
@@ -6856,7 +8344,7 @@ attr_t foo
 
 ; return 0; }
 EOF
 
 ; return 0; }
 EOF
-if { (eval echo configure:6860: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8348: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_result=yes
 else
   rm -rf conftest*
   cf_result=yes
 else
@@ -6884,9 +8372,9 @@ fi
 
 
 echo $ac_n "checking for type mbstate_t in ${cf_cv_ncurses_header-curses.h}""... $ac_c" 1>&6
 
 
 echo $ac_n "checking for type mbstate_t in ${cf_cv_ncurses_header-curses.h}""... $ac_c" 1>&6
-echo "configure:6888: checking for type mbstate_t in ${cf_cv_ncurses_header-curses.h}" >&5
+echo "configure:8376: checking for type mbstate_t in ${cf_cv_ncurses_header-curses.h}" >&5
 cat > conftest.$ac_ext <<EOF
 cat > conftest.$ac_ext <<EOF
-#line 6890 "configure"
+#line 8378 "configure"
 #include "confdefs.h"
 
 #ifndef _XOPEN_SOURCE_EXTENDED
 #include "confdefs.h"
 
 #ifndef _XOPEN_SOURCE_EXTENDED
@@ -6899,7 +8387,7 @@ mbstate_t foo
 
 ; return 0; }
 EOF
 
 ; return 0; }
 EOF
-if { (eval echo configure:6903: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8391: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_result=yes
 else
   rm -rf conftest*
   cf_result=yes
 else
@@ -7076,9 +8564,9 @@ s%@CC_SHARED_OPTS@%$CC_SHARED_OPTS%g
 s%@DFT_DEP_SUFFIX@%$DFT_DEP_SUFFIX%g
 s%@DFT_OBJ_SUBDIR@%$DFT_OBJ_SUBDIR%g
 s%@DFT_UPR_MODEL@%$DFT_UPR_MODEL%g
 s%@DFT_DEP_SUFFIX@%$DFT_DEP_SUFFIX%g
 s%@DFT_OBJ_SUBDIR@%$DFT_OBJ_SUBDIR%g
 s%@DFT_UPR_MODEL@%$DFT_UPR_MODEL%g
-s%@ECHO_LINK@%$ECHO_LINK%g
 s%@LD@%$LD%g
 s%@LDFLAGS_SHARED@%$LDFLAGS_SHARED%g
 s%@LD@%$LD%g
 s%@LDFLAGS_SHARED@%$LDFLAGS_SHARED%g
+s%@LDFLAGS_STATIC@%$LDFLAGS_STATIC%g
 s%@LD_MODEL@%$LD_MODEL%g
 s%@LD_SHARED_OPTS@%$LD_SHARED_OPTS%g
 s%@LIBTOOL@%$LIBTOOL%g
 s%@LD_MODEL@%$LD_MODEL%g
 s%@LD_SHARED_OPTS@%$LD_SHARED_OPTS%g
 s%@LIBTOOL@%$LIBTOOL%g
@@ -7090,21 +8578,29 @@ s%@LINT@%$LINT%g
 s%@LINT_OPTS@%$LINT_OPTS%g
 s%@LOCAL_LDFLAGS@%$LOCAL_LDFLAGS%g
 s%@MATH_LIB@%$MATH_LIB%g
 s%@LINT_OPTS@%$LINT_OPTS%g
 s%@LOCAL_LDFLAGS@%$LOCAL_LDFLAGS%g
 s%@MATH_LIB@%$MATH_LIB%g
+s%@PTHREAD@%$PTHREAD%g
 s%@TEST_ARGS@%$TEST_ARGS%g
 s%@TEST_DEPS@%$TEST_DEPS%g
 s%@TEST_ARGS@%$TEST_ARGS%g
 s%@TEST_DEPS@%$TEST_DEPS%g
-s%@TICS_LEAKS@%$TICS_LEAKS%g
+s%@TEST_LIBS@%$TEST_LIBS%g
 s%@TINFO_ARGS@%$TINFO_ARGS%g
 s%@cf_cv_abi_version@%$cf_cv_abi_version%g
 s%@cf_cv_rel_version@%$cf_cv_rel_version%g
 s%@EXEEXT@%$EXEEXT%g
 s%@OBJEXT@%$OBJEXT%g
 s%@EXTRA_CPPFLAGS@%$EXTRA_CPPFLAGS%g
 s%@TINFO_ARGS@%$TINFO_ARGS%g
 s%@cf_cv_abi_version@%$cf_cv_abi_version%g
 s%@cf_cv_rel_version@%$cf_cv_rel_version%g
 s%@EXEEXT@%$EXEEXT%g
 s%@OBJEXT@%$OBJEXT%g
 s%@EXTRA_CPPFLAGS@%$EXTRA_CPPFLAGS%g
+s%@ECHO_LT@%$ECHO_LT%g
+s%@ECHO_LD@%$ECHO_LD%g
+s%@RULE_CC@%$RULE_CC%g
+s%@SHOW_CC@%$SHOW_CC%g
+s%@ECHO_CC@%$ECHO_CC%g
 s%@EXTRA_CFLAGS@%$EXTRA_CFLAGS%g
 s%@EXTRA_CFLAGS@%$EXTRA_CFLAGS%g
+s%@NCURSES_CONFIG@%$NCURSES_CONFIG%g
 s%@X_CFLAGS@%$X_CFLAGS%g
 s%@X_PRE_LIBS@%$X_PRE_LIBS%g
 s%@X_LIBS@%$X_LIBS%g
 s%@X_EXTRA_LIBS@%$X_EXTRA_LIBS%g
 s%@XCURSES_CONFIG@%$XCURSES_CONFIG%g
 s%@X_CFLAGS@%$X_CFLAGS%g
 s%@X_PRE_LIBS@%$X_PRE_LIBS%g
 s%@X_LIBS@%$X_LIBS%g
 s%@X_EXTRA_LIBS@%$X_EXTRA_LIBS%g
 s%@XCURSES_CONFIG@%$XCURSES_CONFIG%g
+s%@NCURSES_WRAP_PREFIX@%$NCURSES_WRAP_PREFIX%g
 
 CEOF
 EOF
 
 CEOF
 EOF
@@ -7306,6 +8802,7 @@ cat >> $CONFIG_STATUS <<EOF
 # Extra initialization commands, if any
 
 AWK="$AWK"
 # Extra initialization commands, if any
 
 AWK="$AWK"
+ECHO_LD="$ECHO_LD"
 
 EOF
 cat >> $CONFIG_STATUS <<\EOF
 
 EOF
 cat >> $CONFIG_STATUS <<\EOF
@@ -7317,7 +8814,7 @@ do
        if test ! -d $srcdir/$cf_dir; then
                continue
        elif test -f $srcdir/$cf_dir/programs; then
        if test ! -d $srcdir/$cf_dir; then
                continue
        elif test -f $srcdir/$cf_dir/programs; then
-               $AWK -f $srcdir/mk-test.awk ECHO_LINK="$ECHO_LINK" $srcdir/$cf_dir/programs >>$cf_dir/Makefile
+               $AWK -f $srcdir/mk-test.awk ECHO_LINK="$ECHO_LD" $srcdir/$cf_dir/programs >>$cf_dir/Makefile
        fi
 done
 
        fi
 done