]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - test/configure
ncurses 6.1 - patch 20180825
[ncurses.git] / test / configure
index a5956500f8c4f300e157ffba5b1548daee42ca47..b05432c4fa42361bc4f08887f3f19167c6da001f 100755 (executable)
@@ -654,8 +654,9 @@ Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
 
-  --enable-string-hacks   work around bogus compiler/loader warnings
 General Options:
+  --disable-stripping     do not strip (debug info) installed executables
+  --enable-string-hacks   work around bogus compiler/loader warnings
   --with-pkg-config{=path} enable/disable use of pkg-config
   --disable-echo          do not display "compiling" commands
 Curses Version-dependent Options:
@@ -673,6 +674,7 @@ Curses Version-dependent Options:
   --with-neXtaw           link with neXT Athena library
   --with-XawPlus          link with Athena-Plus library
   --with-x                use the X Window System
+  --with-x11-rgb=FILE   file containing X11 rgb information (EPREFIX/lib/X11/rgb.txt)
   --disable-panel         disable checks for panel functions
   --disable-menu          disable checks for menu functions
   --disable-form          disable checks for form functions
@@ -876,7 +878,7 @@ if test -z "$CONFIG_SITE"; then
 fi
 for ac_site_file in $CONFIG_SITE; do
   if test -r "$ac_site_file"; then
-    { echo "$as_me:879: loading site script $ac_site_file" >&5
+    { echo "$as_me:881: loading site script $ac_site_file" >&5
 echo "$as_me: loading site script $ac_site_file" >&6;}
     cat "$ac_site_file" >&5
     . "$ac_site_file"
@@ -887,7 +889,7 @@ if test -r "$cache_file"; then
   # Some versions of bash will fail to source /dev/null (special
   # files actually), so we avoid doing that.
   if test -f "$cache_file"; then
-    { echo "$as_me:890: loading cache $cache_file" >&5
+    { echo "$as_me:892: loading cache $cache_file" >&5
 echo "$as_me: loading cache $cache_file" >&6;}
     case $cache_file in
       [\\/]* | ?:[\\/]* ) . $cache_file;;
@@ -895,7 +897,7 @@ echo "$as_me: loading cache $cache_file" >&6;}
     esac
   fi
 else
-  { echo "$as_me:898: creating cache $cache_file" >&5
+  { echo "$as_me:900: creating cache $cache_file" >&5
 echo "$as_me: creating cache $cache_file" >&6;}
   >$cache_file
 fi
@@ -911,21 +913,21 @@ for ac_var in `(set) 2>&1 |
   eval ac_new_val="\$ac_env_${ac_var}_value"
   case $ac_old_set,$ac_new_set in
     set,)
-      { echo "$as_me:914: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+      { echo "$as_me:916: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
       ac_cache_corrupted=: ;;
     ,set)
-      { echo "$as_me:918: error: \`$ac_var' was not set in the previous run" >&5
+      { echo "$as_me:920: error: \`$ac_var' was not set in the previous run" >&5
 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
       ac_cache_corrupted=: ;;
     ,);;
     *)
       if test "x$ac_old_val" != "x$ac_new_val"; then
-        { echo "$as_me:924: error: \`$ac_var' has changed since the previous run:" >&5
+        { echo "$as_me:926: error: \`$ac_var' has changed since the previous run:" >&5
 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
-        { echo "$as_me:926:   former value:  $ac_old_val" >&5
+        { echo "$as_me:928:   former value:  $ac_old_val" >&5
 echo "$as_me:   former value:  $ac_old_val" >&2;}
-        { echo "$as_me:928:   current value: $ac_new_val" >&5
+        { echo "$as_me:930:   current value: $ac_new_val" >&5
 echo "$as_me:   current value: $ac_new_val" >&2;}
         ac_cache_corrupted=:
       fi;;
@@ -944,9 +946,9 @@ echo "$as_me:   current value: $ac_new_val" >&2;}
   fi
 done
 if $ac_cache_corrupted; then
-  { echo "$as_me:947: error: changes in the environment can compromise the build" >&5
+  { echo "$as_me:949: error: changes in the environment can compromise the build" >&5
 echo "$as_me: error: changes in the environment can compromise the build" >&2;}
-  { { echo "$as_me:949: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
+  { { echo "$as_me:951: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
    { (exit 1); exit 1; }; }
 fi
@@ -967,10 +969,10 @@ esac
 echo "#! $SHELL" >conftest.sh
 echo  "exit 0"   >>conftest.sh
 chmod +x conftest.sh
-if { (echo "$as_me:970: PATH=\".;.\"; conftest.sh") >&5
+if { (echo "$as_me:972: PATH=\".;.\"; conftest.sh") >&5
   (PATH=".;."; conftest.sh) 2>&5
   ac_status=$?
-  echo "$as_me:973: \$? = $ac_status" >&5
+  echo "$as_me:975: \$? = $ac_status" >&5
   (exit $ac_status); }; then
   ac_path_separator=';'
 else
@@ -1002,7 +1004,7 @@ for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
   fi
 done
 if test -z "$ac_aux_dir"; then
-  { { echo "$as_me:1005: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
+  { { echo "$as_me:1007: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
    { (exit 1); exit 1; }; }
 fi
@@ -1012,11 +1014,11 @@ ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
 
 # Make sure we can run config.sub.
 $ac_config_sub sun4 >/dev/null 2>&1 ||
-  { { echo "$as_me:1015: error: cannot run $ac_config_sub" >&5
+  { { echo "$as_me:1017: error: cannot run $ac_config_sub" >&5
 echo "$as_me: error: cannot run $ac_config_sub" >&2;}
    { (exit 1); exit 1; }; }
 
-echo "$as_me:1019: checking build system type" >&5
+echo "$as_me:1021: checking build system type" >&5
 echo $ECHO_N "checking build system type... $ECHO_C" >&6
 if test "${ac_cv_build+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -1025,16 +1027,16 @@ else
 test -z "$ac_cv_build_alias" &&
   ac_cv_build_alias=`$ac_config_guess`
 test -z "$ac_cv_build_alias" &&
-  { { echo "$as_me:1028: error: cannot guess build type; you must specify one" >&5
+  { { echo "$as_me:1030: error: cannot guess build type; you must specify one" >&5
 echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
    { (exit 1); exit 1; }; }
 ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
-  { { echo "$as_me:1032: error: $ac_config_sub $ac_cv_build_alias failed." >&5
+  { { echo "$as_me:1034: error: $ac_config_sub $ac_cv_build_alias failed." >&5
 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;}
    { (exit 1); exit 1; }; }
 
 fi
-echo "$as_me:1037: result: $ac_cv_build" >&5
+echo "$as_me:1039: result: $ac_cv_build" >&5
 echo "${ECHO_T}$ac_cv_build" >&6
 build=$ac_cv_build
 build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
@@ -1042,7 +1044,7 @@ build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
 build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
 
 if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then
-       echo "$as_me:1045: checking host system type" >&5
+       echo "$as_me:1047: checking host system type" >&5
 echo $ECHO_N "checking host system type... $ECHO_C" >&6
 if test "${ac_cv_host+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -1051,12 +1053,12 @@ else
 test -z "$ac_cv_host_alias" &&
   ac_cv_host_alias=$ac_cv_build_alias
 ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
-  { { echo "$as_me:1054: error: $ac_config_sub $ac_cv_host_alias failed" >&5
+  { { echo "$as_me:1056: error: $ac_config_sub $ac_cv_host_alias failed" >&5
 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
    { (exit 1); exit 1; }; }
 
 fi
-echo "$as_me:1059: result: $ac_cv_host" >&5
+echo "$as_me:1061: result: $ac_cv_host" >&5
 echo "${ECHO_T}$ac_cv_host" >&6
 host=$ac_cv_host
 host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
@@ -1082,13 +1084,13 @@ else
 fi
 
 test -z "$system_name" && system_name="$cf_cv_system_name"
-test -n "$cf_cv_system_name" && echo "$as_me:1085: result: Configuring for $cf_cv_system_name" >&5
+test -n "$cf_cv_system_name" && echo "$as_me:1087: result: Configuring for $cf_cv_system_name" >&5
 echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6
 
 if test ".$system_name" != ".$cf_cv_system_name" ; then
-       echo "$as_me:1089: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5
+       echo "$as_me:1091: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5
 echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6
-       { { echo "$as_me:1091: error: \"Please remove config.cache and try again.\"" >&5
+       { { echo "$as_me:1093: error: \"Please remove config.cache and try again.\"" >&5
 echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;}
    { (exit 1); exit 1; }; }
 fi
@@ -1106,7 +1108,7 @@ _ACEOF
 program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
 rm conftest.sed
 
-echo "$as_me:1109: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "$as_me:1111: checking whether ${MAKE-make} sets \${MAKE}" >&5
 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
@@ -1126,11 +1128,11 @@ fi
 rm -f conftest.make
 fi
 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
-  echo "$as_me:1129: result: yes" >&5
+  echo "$as_me:1131: result: yes" >&5
 echo "${ECHO_T}yes" >&6
   SET_MAKE=
 else
-  echo "$as_me:1133: result: no" >&5
+  echo "$as_me:1135: result: no" >&5
 echo "${ECHO_T}no" >&6
   SET_MAKE="MAKE=${MAKE-make}"
 fi
@@ -1144,7 +1146,7 @@ ac_main_return=return
 if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
 set dummy ${ac_tool_prefix}gcc; ac_word=$2
-echo "$as_me:1147: checking for $ac_word" >&5
+echo "$as_me:1149: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_prog_CC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -1159,7 +1161,7 @@ for ac_dir in $ac_dummy; do
   test -z "$ac_dir" && ac_dir=.
   $as_executable_p "$ac_dir/$ac_word" || continue
 ac_cv_prog_CC="${ac_tool_prefix}gcc"
-echo "$as_me:1162: found $ac_dir/$ac_word" >&5
+echo "$as_me:1164: found $ac_dir/$ac_word" >&5
 break
 done
 
@@ -1167,10 +1169,10 @@ fi
 fi
 CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  echo "$as_me:1170: result: $CC" >&5
+  echo "$as_me:1172: result: $CC" >&5
 echo "${ECHO_T}$CC" >&6
 else
-  echo "$as_me:1173: result: no" >&5
+  echo "$as_me:1175: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -1179,7 +1181,7 @@ if test -z "$ac_cv_prog_CC"; then
   ac_ct_CC=$CC
   # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
-echo "$as_me:1182: checking for $ac_word" >&5
+echo "$as_me:1184: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -1194,7 +1196,7 @@ for ac_dir in $ac_dummy; do
   test -z "$ac_dir" && ac_dir=.
   $as_executable_p "$ac_dir/$ac_word" || continue
 ac_cv_prog_ac_ct_CC="gcc"
-echo "$as_me:1197: found $ac_dir/$ac_word" >&5
+echo "$as_me:1199: found $ac_dir/$ac_word" >&5
 break
 done
 
@@ -1202,10 +1204,10 @@ fi
 fi
 ac_ct_CC=$ac_cv_prog_ac_ct_CC
 if test -n "$ac_ct_CC"; then
-  echo "$as_me:1205: result: $ac_ct_CC" >&5
+  echo "$as_me:1207: result: $ac_ct_CC" >&5
 echo "${ECHO_T}$ac_ct_CC" >&6
 else
-  echo "$as_me:1208: result: no" >&5
+  echo "$as_me:1210: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -1218,7 +1220,7 @@ if test -z "$CC"; then
   if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
 set dummy ${ac_tool_prefix}cc; ac_word=$2
-echo "$as_me:1221: checking for $ac_word" >&5
+echo "$as_me:1223: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_prog_CC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -1233,7 +1235,7 @@ for ac_dir in $ac_dummy; do
   test -z "$ac_dir" && ac_dir=.
   $as_executable_p "$ac_dir/$ac_word" || continue
 ac_cv_prog_CC="${ac_tool_prefix}cc"
-echo "$as_me:1236: found $ac_dir/$ac_word" >&5
+echo "$as_me:1238: found $ac_dir/$ac_word" >&5
 break
 done
 
@@ -1241,10 +1243,10 @@ fi
 fi
 CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  echo "$as_me:1244: result: $CC" >&5
+  echo "$as_me:1246: result: $CC" >&5
 echo "${ECHO_T}$CC" >&6
 else
-  echo "$as_me:1247: result: no" >&5
+  echo "$as_me:1249: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -1253,7 +1255,7 @@ if test -z "$ac_cv_prog_CC"; then
   ac_ct_CC=$CC
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
-echo "$as_me:1256: checking for $ac_word" >&5
+echo "$as_me:1258: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -1268,7 +1270,7 @@ for ac_dir in $ac_dummy; do
   test -z "$ac_dir" && ac_dir=.
   $as_executable_p "$ac_dir/$ac_word" || continue
 ac_cv_prog_ac_ct_CC="cc"
-echo "$as_me:1271: found $ac_dir/$ac_word" >&5
+echo "$as_me:1273: found $ac_dir/$ac_word" >&5
 break
 done
 
@@ -1276,10 +1278,10 @@ fi
 fi
 ac_ct_CC=$ac_cv_prog_ac_ct_CC
 if test -n "$ac_ct_CC"; then
-  echo "$as_me:1279: result: $ac_ct_CC" >&5
+  echo "$as_me:1281: result: $ac_ct_CC" >&5
 echo "${ECHO_T}$ac_ct_CC" >&6
 else
-  echo "$as_me:1282: result: no" >&5
+  echo "$as_me:1284: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -1292,7 +1294,7 @@ fi
 if test -z "$CC"; then
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
-echo "$as_me:1295: checking for $ac_word" >&5
+echo "$as_me:1297: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_prog_CC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -1312,7 +1314,7 @@ if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
   continue
 fi
 ac_cv_prog_CC="cc"
-echo "$as_me:1315: found $ac_dir/$ac_word" >&5
+echo "$as_me:1317: found $ac_dir/$ac_word" >&5
 break
 done
 
@@ -1334,10 +1336,10 @@ fi
 fi
 CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  echo "$as_me:1337: result: $CC" >&5
+  echo "$as_me:1339: result: $CC" >&5
 echo "${ECHO_T}$CC" >&6
 else
-  echo "$as_me:1340: result: no" >&5
+  echo "$as_me:1342: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -1348,7 +1350,7 @@ if test -z "$CC"; then
   do
     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-echo "$as_me:1351: checking for $ac_word" >&5
+echo "$as_me:1353: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_prog_CC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -1363,7 +1365,7 @@ for ac_dir in $ac_dummy; do
   test -z "$ac_dir" && ac_dir=.
   $as_executable_p "$ac_dir/$ac_word" || continue
 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
-echo "$as_me:1366: found $ac_dir/$ac_word" >&5
+echo "$as_me:1368: found $ac_dir/$ac_word" >&5
 break
 done
 
@@ -1371,10 +1373,10 @@ fi
 fi
 CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  echo "$as_me:1374: result: $CC" >&5
+  echo "$as_me:1376: result: $CC" >&5
 echo "${ECHO_T}$CC" >&6
 else
-  echo "$as_me:1377: result: no" >&5
+  echo "$as_me:1379: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -1387,7 +1389,7 @@ if test -z "$CC"; then
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-echo "$as_me:1390: checking for $ac_word" >&5
+echo "$as_me:1392: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -1402,7 +1404,7 @@ for ac_dir in $ac_dummy; do
   test -z "$ac_dir" && ac_dir=.
   $as_executable_p "$ac_dir/$ac_word" || continue
 ac_cv_prog_ac_ct_CC="$ac_prog"
-echo "$as_me:1405: found $ac_dir/$ac_word" >&5
+echo "$as_me:1407: found $ac_dir/$ac_word" >&5
 break
 done
 
@@ -1410,10 +1412,10 @@ fi
 fi
 ac_ct_CC=$ac_cv_prog_ac_ct_CC
 if test -n "$ac_ct_CC"; then
-  echo "$as_me:1413: result: $ac_ct_CC" >&5
+  echo "$as_me:1415: result: $ac_ct_CC" >&5
 echo "${ECHO_T}$ac_ct_CC" >&6
 else
-  echo "$as_me:1416: result: no" >&5
+  echo "$as_me:1418: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -1425,32 +1427,32 @@ fi
 
 fi
 
-test -z "$CC" && { { echo "$as_me:1428: error: no acceptable cc found in \$PATH" >&5
+test -z "$CC" && { { echo "$as_me:1430: error: no acceptable cc found in \$PATH" >&5
 echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
    { (exit 1); exit 1; }; }
 
 # Provide some information about the compiler.
-echo "$as_me:1433:" \
+echo "$as_me:1435:" \
      "checking for C compiler version" >&5
 ac_compiler=`set X $ac_compile; echo $2`
-{ (eval echo "$as_me:1436: \"$ac_compiler --version </dev/null >&5\"") >&5
+{ (eval echo "$as_me:1438: \"$ac_compiler --version </dev/null >&5\"") >&5
   (eval $ac_compiler --version </dev/null >&5) 2>&5
   ac_status=$?
-  echo "$as_me:1439: \$? = $ac_status" >&5
+  echo "$as_me:1441: \$? = $ac_status" >&5
   (exit $ac_status); }
-{ (eval echo "$as_me:1441: \"$ac_compiler -v </dev/null >&5\"") >&5
+{ (eval echo "$as_me:1443: \"$ac_compiler -v </dev/null >&5\"") >&5
   (eval $ac_compiler -v </dev/null >&5) 2>&5
   ac_status=$?
-  echo "$as_me:1444: \$? = $ac_status" >&5
+  echo "$as_me:1446: \$? = $ac_status" >&5
   (exit $ac_status); }
-{ (eval echo "$as_me:1446: \"$ac_compiler -V </dev/null >&5\"") >&5
+{ (eval echo "$as_me:1448: \"$ac_compiler -V </dev/null >&5\"") >&5
   (eval $ac_compiler -V </dev/null >&5) 2>&5
   ac_status=$?
-  echo "$as_me:1449: \$? = $ac_status" >&5
+  echo "$as_me:1451: \$? = $ac_status" >&5
   (exit $ac_status); }
 
 cat >conftest.$ac_ext <<_ACEOF
-#line 1453 "configure"
+#line 1455 "configure"
 #include "confdefs.h"
 
 int
@@ -1466,13 +1468,13 @@ ac_clean_files="$ac_clean_files a.out a.exe"
 # Try to create an executable without -o first, disregard a.out.
 # It will help us diagnose broken compilers, and finding out an intuition
 # of exeext.
-echo "$as_me:1469: checking for C compiler default output" >&5
+echo "$as_me:1471: checking for C compiler default output" >&5
 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
-if { (eval echo "$as_me:1472: \"$ac_link_default\"") >&5
+if { (eval echo "$as_me:1474: \"$ac_link_default\"") >&5
   (eval $ac_link_default) 2>&5
   ac_status=$?
-  echo "$as_me:1475: \$? = $ac_status" >&5
+  echo "$as_me:1477: \$? = $ac_status" >&5
   (exit $ac_status); }; then
   # Find the output, starting from the most likely.  This scheme is
 # not robust to junk in `.', hence go to wildcards (a.*) only as a last
@@ -1495,34 +1497,34 @@ done
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
-{ { echo "$as_me:1498: error: C compiler cannot create executables" >&5
+{ { echo "$as_me:1500: error: C compiler cannot create executables" >&5
 echo "$as_me: error: C compiler cannot create executables" >&2;}
    { (exit 77); exit 77; }; }
 fi
 
 ac_exeext=$ac_cv_exeext
-echo "$as_me:1504: result: $ac_file" >&5
+echo "$as_me:1506: result: $ac_file" >&5
 echo "${ECHO_T}$ac_file" >&6
 
 # Check the compiler produces executables we can run.  If not, either
 # the compiler is broken, or we cross compile.
-echo "$as_me:1509: checking whether the C compiler works" >&5
+echo "$as_me:1511: checking whether the C compiler works" >&5
 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
 # If not cross compiling, check that we can run a simple program.
 if test "$cross_compiling" != yes; then
   if { ac_try='./$ac_file'
-  { (eval echo "$as_me:1515: \"$ac_try\"") >&5
+  { (eval echo "$as_me:1517: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:1518: \$? = $ac_status" >&5
+  echo "$as_me:1520: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
     cross_compiling=no
   else
     if test "$cross_compiling" = maybe; then
        cross_compiling=yes
     else
-       { { echo "$as_me:1525: error: cannot run C compiled programs.
+       { { echo "$as_me:1527: error: cannot run C compiled programs.
 If you meant to cross compile, use \`--host'." >&5
 echo "$as_me: error: cannot run C compiled programs.
 If you meant to cross compile, use \`--host'." >&2;}
@@ -1530,24 +1532,24 @@ If you meant to cross compile, use \`--host'." >&2;}
     fi
   fi
 fi
-echo "$as_me:1533: result: yes" >&5
+echo "$as_me:1535: result: yes" >&5
 echo "${ECHO_T}yes" >&6
 
 rm -f a.out a.exe conftest$ac_cv_exeext
 ac_clean_files=$ac_clean_files_save
 # Check the compiler produces executables we can run.  If not, either
 # the compiler is broken, or we cross compile.
-echo "$as_me:1540: checking whether we are cross compiling" >&5
+echo "$as_me:1542: checking whether we are cross compiling" >&5
 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
-echo "$as_me:1542: result: $cross_compiling" >&5
+echo "$as_me:1544: result: $cross_compiling" >&5
 echo "${ECHO_T}$cross_compiling" >&6
 
-echo "$as_me:1545: checking for executable suffix" >&5
+echo "$as_me:1547: checking for executable suffix" >&5
 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6
-if { (eval echo "$as_me:1547: \"$ac_link\"") >&5
+if { (eval echo "$as_me:1549: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:1550: \$? = $ac_status" >&5
+  echo "$as_me:1552: \$? = $ac_status" >&5
   (exit $ac_status); }; then
   # If both `conftest.exe' and `conftest' are `present' (well, observable)
 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
@@ -1563,25 +1565,25 @@ for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
   esac
 done
 else
-  { { echo "$as_me:1566: error: cannot compute EXEEXT: cannot compile and link" >&5
+  { { echo "$as_me:1568: error: cannot compute EXEEXT: cannot compile and link" >&5
 echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;}
    { (exit 1); exit 1; }; }
 fi
 
 rm -f conftest$ac_cv_exeext
-echo "$as_me:1572: result: $ac_cv_exeext" >&5
+echo "$as_me:1574: result: $ac_cv_exeext" >&5
 echo "${ECHO_T}$ac_cv_exeext" >&6
 
 rm -f conftest.$ac_ext
 EXEEXT=$ac_cv_exeext
 ac_exeext=$EXEEXT
-echo "$as_me:1578: checking for object suffix" >&5
+echo "$as_me:1580: checking for object suffix" >&5
 echo $ECHO_N "checking for object suffix... $ECHO_C" >&6
 if test "${ac_cv_objext+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 1584 "configure"
+#line 1586 "configure"
 #include "confdefs.h"
 
 int
@@ -1593,10 +1595,10 @@ main (void)
 }
 _ACEOF
 rm -f conftest.o conftest.obj
-if { (eval echo "$as_me:1596: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:1598: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:1599: \$? = $ac_status" >&5
+  echo "$as_me:1601: \$? = $ac_status" >&5
   (exit $ac_status); }; then
   for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
   case $ac_file in
@@ -1608,24 +1610,24 @@ done
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
-{ { echo "$as_me:1611: error: cannot compute OBJEXT: cannot compile" >&5
+{ { echo "$as_me:1613: error: cannot compute OBJEXT: cannot compile" >&5
 echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;}
    { (exit 1); exit 1; }; }
 fi
 
 rm -f conftest.$ac_cv_objext conftest.$ac_ext
 fi
-echo "$as_me:1618: result: $ac_cv_objext" >&5
+echo "$as_me:1620: result: $ac_cv_objext" >&5
 echo "${ECHO_T}$ac_cv_objext" >&6
 OBJEXT=$ac_cv_objext
 ac_objext=$OBJEXT
-echo "$as_me:1622: checking whether we are using the GNU C compiler" >&5
+echo "$as_me:1624: checking whether we are using the GNU C compiler" >&5
 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
 if test "${ac_cv_c_compiler_gnu+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 1628 "configure"
+#line 1630 "configure"
 #include "confdefs.h"
 
 int
@@ -1640,16 +1642,16 @@ main (void)
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:1643: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:1645: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:1646: \$? = $ac_status" >&5
+  echo "$as_me:1648: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:1649: \"$ac_try\"") >&5
+  { (eval echo "$as_me:1651: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:1652: \$? = $ac_status" >&5
+  echo "$as_me:1654: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_compiler_gnu=yes
 else
@@ -1661,19 +1663,19 @@ rm -f conftest.$ac_objext conftest.$ac_ext
 ac_cv_c_compiler_gnu=$ac_compiler_gnu
 
 fi
-echo "$as_me:1664: result: $ac_cv_c_compiler_gnu" >&5
+echo "$as_me:1666: result: $ac_cv_c_compiler_gnu" >&5
 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
 GCC=`test $ac_compiler_gnu = yes && echo yes`
 ac_test_CFLAGS=${CFLAGS+set}
 ac_save_CFLAGS=$CFLAGS
 CFLAGS="-g"
-echo "$as_me:1670: checking whether $CC accepts -g" >&5
+echo "$as_me:1672: checking whether $CC accepts -g" >&5
 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
 if test "${ac_cv_prog_cc_g+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 1676 "configure"
+#line 1678 "configure"
 #include "confdefs.h"
 
 int
@@ -1685,16 +1687,16 @@ main (void)
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:1688: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:1690: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:1691: \$? = $ac_status" >&5
+  echo "$as_me:1693: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:1694: \"$ac_try\"") >&5
+  { (eval echo "$as_me:1696: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:1697: \$? = $ac_status" >&5
+  echo "$as_me:1699: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_prog_cc_g=yes
 else
@@ -1704,7 +1706,7 @@ ac_cv_prog_cc_g=no
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:1707: result: $ac_cv_prog_cc_g" >&5
+echo "$as_me:1709: result: $ac_cv_prog_cc_g" >&5
 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
 if test "$ac_test_CFLAGS" = set; then
   CFLAGS=$ac_save_CFLAGS
@@ -1731,16 +1733,16 @@ cat >conftest.$ac_ext <<_ACEOF
 #endif
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:1734: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:1736: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:1737: \$? = $ac_status" >&5
+  echo "$as_me:1739: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:1740: \"$ac_try\"") >&5
+  { (eval echo "$as_me:1742: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:1743: \$? = $ac_status" >&5
+  echo "$as_me:1745: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   for ac_declaration in \
    ''\
@@ -1752,7 +1754,7 @@ if { (eval echo "$as_me:1734: \"$ac_compile\"") >&5
    'void exit (int);'
 do
   cat >conftest.$ac_ext <<_ACEOF
-#line 1755 "configure"
+#line 1757 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 $ac_declaration
@@ -1765,16 +1767,16 @@ exit (42);
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:1768: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:1770: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:1771: \$? = $ac_status" >&5
+  echo "$as_me:1773: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:1774: \"$ac_try\"") >&5
+  { (eval echo "$as_me:1776: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:1777: \$? = $ac_status" >&5
+  echo "$as_me:1779: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   :
 else
@@ -1784,7 +1786,7 @@ continue
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
   cat >conftest.$ac_ext <<_ACEOF
-#line 1787 "configure"
+#line 1789 "configure"
 #include "confdefs.h"
 $ac_declaration
 int
@@ -1796,16 +1798,16 @@ exit (42);
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:1799: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:1801: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:1802: \$? = $ac_status" >&5
+  echo "$as_me:1804: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:1805: \"$ac_try\"") >&5
+  { (eval echo "$as_me:1807: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:1808: \$? = $ac_status" >&5
+  echo "$as_me:1810: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   break
 else
@@ -1835,15 +1837,15 @@ ac_main_return=return
 
 GCC_VERSION=none
 if test "$GCC" = yes ; then
-       echo "$as_me:1838: checking version of $CC" >&5
+       echo "$as_me:1840: checking version of $CC" >&5
 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
        GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(GCC[^)]*) //' -e 's/^.*(Debian[^)]*) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
        test -z "$GCC_VERSION" && GCC_VERSION=unknown
-       echo "$as_me:1842: result: $GCC_VERSION" >&5
+       echo "$as_me:1844: result: $GCC_VERSION" >&5
 echo "${ECHO_T}$GCC_VERSION" >&6
 fi
 
-echo "$as_me:1846: checking for $CC option to accept ANSI C" >&5
+echo "$as_me:1848: checking for $CC option to accept ANSI C" >&5
 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
 if test "${ac_cv_prog_cc_stdc+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -1851,7 +1853,7 @@ else
   ac_cv_prog_cc_stdc=no
 ac_save_CC=$CC
 cat >conftest.$ac_ext <<_ACEOF
-#line 1854 "configure"
+#line 1856 "configure"
 #include "confdefs.h"
 #include <stdarg.h>
 #include <stdio.h>
@@ -1900,16 +1902,16 @@ for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIO
 do
   CC="$ac_save_CC $ac_arg"
   rm -f conftest.$ac_objext
-if { (eval echo "$as_me:1903: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:1905: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:1906: \$? = $ac_status" >&5
+  echo "$as_me:1908: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:1909: \"$ac_try\"") >&5
+  { (eval echo "$as_me:1911: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:1912: \$? = $ac_status" >&5
+  echo "$as_me:1914: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_prog_cc_stdc=$ac_arg
 break
@@ -1926,10 +1928,10 @@ fi
 
 case "x$ac_cv_prog_cc_stdc" in
   x|xno)
-    echo "$as_me:1929: result: none needed" >&5
+    echo "$as_me:1931: result: none needed" >&5
 echo "${ECHO_T}none needed" >&6 ;;
   *)
-    echo "$as_me:1932: result: $ac_cv_prog_cc_stdc" >&5
+    echo "$as_me:1934: result: $ac_cv_prog_cc_stdc" >&5
 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
     CC="$CC $ac_cv_prog_cc_stdc" ;;
 esac
@@ -1937,14 +1939,133 @@ esac
 # This should have been defined by AC_PROG_CC
 : ${CC:=cc}
 
-echo "$as_me:1940: checking \$CC variable" >&5
+echo "$as_me:1942: checking \$CFLAGS variable" >&5
+echo $ECHO_N "checking \$CFLAGS variable... $ECHO_C" >&6
+case "x$CFLAGS" in
+(*-[IUD]*)
+       echo "$as_me:1946: result: broken" >&5
+echo "${ECHO_T}broken" >&6
+       { echo "$as_me:1948: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&5
+echo "$as_me: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&2;}
+       cf_flags="$CFLAGS"
+       CFLAGS=
+       for cf_arg in $cf_flags
+       do
+
+cf_fix_cppflags=no
+cf_new_cflags=
+cf_new_cppflags=
+cf_new_extra_cppflags=
+
+for cf_add_cflags in $cf_arg
+do
+case $cf_fix_cppflags in
+(no)
+       case $cf_add_cflags in
+       (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
+               case $cf_add_cflags in
+               (-D*)
+                       cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
+
+                       test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
+                               && test -z "${cf_tst_cflags}" \
+                               && cf_fix_cppflags=yes
+
+                       if test $cf_fix_cppflags = yes ; then
+
+       test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+       cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
+                               continue
+                       elif test "${cf_tst_cflags}" = "\"'" ; then
+
+       test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+       cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
+                               continue
+                       fi
+                       ;;
+               esac
+               case "$CPPFLAGS" in
+               (*$cf_add_cflags)
+                       ;;
+               (*)
+                       case $cf_add_cflags in
+                       (-D*)
+                               cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
+
+CPPFLAGS=`echo "$CPPFLAGS" | \
+       sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
+               -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
+
+                               ;;
+                       esac
+
+       test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
+       cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
+
+                       ;;
+               esac
+               ;;
+       (*)
+
+       test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
+       cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
+
+               ;;
+       esac
+       ;;
+(yes)
+
+       test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+       cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
+       cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
+
+       test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
+               && test -z "${cf_tst_cflags}" \
+               && cf_fix_cppflags=no
+       ;;
+esac
+done
+
+if test -n "$cf_new_cflags" ; then
+
+       test -n "$CFLAGS" && CFLAGS="$CFLAGS "
+       CFLAGS="${CFLAGS}$cf_new_cflags"
+
+fi
+
+if test -n "$cf_new_cppflags" ; then
+
+       test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
+       CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
+
+fi
+
+if test -n "$cf_new_extra_cppflags" ; then
+
+       test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
+       EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
+
+fi
+
+       done
+       ;;
+(*)
+       echo "$as_me:2056: result: ok" >&5
+echo "${ECHO_T}ok" >&6
+       ;;
+esac
+
+echo "$as_me:2061: checking \$CC variable" >&5
 echo $ECHO_N "checking \$CC variable... $ECHO_C" >&6
 case "$CC" in
 (*[\ \ ]-*)
-       echo "$as_me:1944: result: broken" >&5
+       echo "$as_me:2065: result: broken" >&5
 echo "${ECHO_T}broken" >&6
-       { echo "$as_me:1946: WARNING: your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options" >&5
-echo "$as_me: WARNING: your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options" >&2;}
+       { echo "$as_me:2067: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&5
+echo "$as_me: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&2;}
        # humor him...
        cf_prog=`echo "$CC" | sed -e 's/        / /g' -e 's/[ ]* / /g' -e 's/[ ]*[ ]-[^ ].*//'`
        cf_flags=`echo "$CC" | ${AWK:-awk} -v prog="$cf_prog" '{ printf("%s", substr($0,1+length(prog))); }'`
@@ -2060,24 +2181,24 @@ fi
        done
        test -n "$verbose" && echo "    resulting CC: '$CC'" 1>&6
 
-echo "${as_me:-configure}:2063: testing resulting CC: '$CC' ..." 1>&5
+echo "${as_me:-configure}:2184: testing resulting CC: '$CC' ..." 1>&5
 
        test -n "$verbose" && echo "    resulting CFLAGS: '$CFLAGS'" 1>&6
 
-echo "${as_me:-configure}:2067: testing resulting CFLAGS: '$CFLAGS' ..." 1>&5
+echo "${as_me:-configure}:2188: testing resulting CFLAGS: '$CFLAGS' ..." 1>&5
 
        test -n "$verbose" && echo "    resulting CPPFLAGS: '$CPPFLAGS'" 1>&6
 
-echo "${as_me:-configure}:2071: testing resulting CPPFLAGS: '$CPPFLAGS' ..." 1>&5
+echo "${as_me:-configure}:2192: testing resulting CPPFLAGS: '$CPPFLAGS' ..." 1>&5
 
        ;;
 (*)
-       echo "$as_me:2075: result: ok" >&5
+       echo "$as_me:2196: result: ok" >&5
 echo "${ECHO_T}ok" >&6
        ;;
 esac
 
-echo "$as_me:2080: checking for inline" >&5
+echo "$as_me:2201: checking for inline" >&5
 echo $ECHO_N "checking for inline... $ECHO_C" >&6
 if test "${ac_cv_c_inline+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -2085,7 +2206,7 @@ else
   ac_cv_c_inline=no
 for ac_kw in inline __inline__ __inline; do
   cat >conftest.$ac_ext <<_ACEOF
-#line 2088 "configure"
+#line 2209 "configure"
 #include "confdefs.h"
 #ifndef __cplusplus
 static $ac_kw int static_foo () {return 0; }
@@ -2094,16 +2215,16 @@ $ac_kw int foo () {return 0; }
 
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:2097: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:2218: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:2100: \$? = $ac_status" >&5
+  echo "$as_me:2221: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:2103: \"$ac_try\"") >&5
+  { (eval echo "$as_me:2224: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:2106: \$? = $ac_status" >&5
+  echo "$as_me:2227: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_c_inline=$ac_kw; break
 else
@@ -2114,7 +2235,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext
 done
 
 fi
-echo "$as_me:2117: result: $ac_cv_c_inline" >&5
+echo "$as_me:2238: result: $ac_cv_c_inline" >&5
 echo "${ECHO_T}$ac_cv_c_inline" >&6
 case $ac_cv_c_inline in
   inline | yes) ;;
@@ -2135,7 +2256,7 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 ac_main_return=return
-echo "$as_me:2138: checking how to run the C preprocessor" >&5
+echo "$as_me:2259: checking how to run the C preprocessor" >&5
 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
@@ -2156,18 +2277,18 @@ do
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp. "Syntax error" is here to catch this case.
   cat >conftest.$ac_ext <<_ACEOF
-#line 2159 "configure"
+#line 2280 "configure"
 #include "confdefs.h"
 #include <assert.h>
                      Syntax error
 _ACEOF
-if { (eval echo "$as_me:2164: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:2285: \"$ac_cpp conftest.$ac_ext\"") >&5
   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
   ac_status=$?
   egrep -v '^ *\+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:2170: \$? = $ac_status" >&5
+  echo "$as_me:2291: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
@@ -2190,17 +2311,17 @@ rm -f conftest.err conftest.$ac_ext
   # OK, works on sane cases.  Now check whether non-existent headers
   # can be detected and how.
   cat >conftest.$ac_ext <<_ACEOF
-#line 2193 "configure"
+#line 2314 "configure"
 #include "confdefs.h"
 #include <ac_nonexistent.h>
 _ACEOF
-if { (eval echo "$as_me:2197: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:2318: \"$ac_cpp conftest.$ac_ext\"") >&5
   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
   ac_status=$?
   egrep -v '^ *\+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:2203: \$? = $ac_status" >&5
+  echo "$as_me:2324: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
@@ -2237,7 +2358,7 @@ fi
 else
   ac_cv_prog_CPP=$CPP
 fi
-echo "$as_me:2240: result: $CPP" >&5
+echo "$as_me:2361: result: $CPP" >&5
 echo "${ECHO_T}$CPP" >&6
 ac_preproc_ok=false
 for ac_c_preproc_warn_flag in '' yes
@@ -2247,18 +2368,18 @@ do
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp. "Syntax error" is here to catch this case.
   cat >conftest.$ac_ext <<_ACEOF
-#line 2250 "configure"
+#line 2371 "configure"
 #include "confdefs.h"
 #include <assert.h>
                      Syntax error
 _ACEOF
-if { (eval echo "$as_me:2255: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:2376: \"$ac_cpp conftest.$ac_ext\"") >&5
   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
   ac_status=$?
   egrep -v '^ *\+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:2261: \$? = $ac_status" >&5
+  echo "$as_me:2382: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
@@ -2281,17 +2402,17 @@ rm -f conftest.err conftest.$ac_ext
   # OK, works on sane cases.  Now check whether non-existent headers
   # can be detected and how.
   cat >conftest.$ac_ext <<_ACEOF
-#line 2284 "configure"
+#line 2405 "configure"
 #include "confdefs.h"
 #include <ac_nonexistent.h>
 _ACEOF
-if { (eval echo "$as_me:2288: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:2409: \"$ac_cpp conftest.$ac_ext\"") >&5
   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
   ac_status=$?
   egrep -v '^ *\+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:2294: \$? = $ac_status" >&5
+  echo "$as_me:2415: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
@@ -2319,7 +2440,7 @@ rm -f conftest.err conftest.$ac_ext
 if $ac_preproc_ok; then
   :
 else
-  { { echo "$as_me:2322: error: C preprocessor \"$CPP\" fails sanity check" >&5
+  { { echo "$as_me:2443: error: C preprocessor \"$CPP\" fails sanity check" >&5
 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
    { (exit 1); exit 1; }; }
 fi
@@ -2335,7 +2456,7 @@ for ac_prog in mawk gawk nawk awk
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-echo "$as_me:2338: checking for $ac_word" >&5
+echo "$as_me:2459: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_prog_AWK+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -2350,7 +2471,7 @@ for ac_dir in $ac_dummy; do
   test -z "$ac_dir" && ac_dir=.
   $as_executable_p "$ac_dir/$ac_word" || continue
 ac_cv_prog_AWK="$ac_prog"
-echo "$as_me:2353: found $ac_dir/$ac_word" >&5
+echo "$as_me:2474: found $ac_dir/$ac_word" >&5
 break
 done
 
@@ -2358,10 +2479,10 @@ fi
 fi
 AWK=$ac_cv_prog_AWK
 if test -n "$AWK"; then
-  echo "$as_me:2361: result: $AWK" >&5
+  echo "$as_me:2482: result: $AWK" >&5
 echo "${ECHO_T}$AWK" >&6
 else
-  echo "$as_me:2364: result: no" >&5
+  echo "$as_me:2485: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -2380,7 +2501,7 @@ done
 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # ./install, which can be erroneously created by make from ./install.sh.
-echo "$as_me:2383: checking for a BSD compatible install" >&5
+echo "$as_me:2504: checking for a BSD compatible install" >&5
 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
 if test -z "$INSTALL"; then
 if test "${ac_cv_path_install+set}" = set; then
@@ -2429,7 +2550,7 @@ fi
     INSTALL=$ac_install_sh
   fi
 fi
-echo "$as_me:2432: result: $INSTALL" >&5
+echo "$as_me:2553: result: $INSTALL" >&5
 echo "${ECHO_T}$INSTALL" >&6
 
 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
@@ -2450,11 +2571,93 @@ case $INSTALL in
        ;;
 esac
 
+echo "$as_me:2574: checking if you want to install stripped executables" >&5
+echo $ECHO_N "checking if you want to install stripped executables... $ECHO_C" >&6
+
+# Check whether --enable-stripping or --disable-stripping was given.
+if test "${enable_stripping+set}" = set; then
+  enableval="$enable_stripping"
+  test "$enableval" != no && enableval=yes
+       if test "$enableval" != "yes" ; then
+    with_stripping=no
+       else
+               with_stripping=yes
+       fi
+else
+  enableval=yes
+       with_stripping=yes
+
+fi;
+echo "$as_me:2591: result: $with_stripping" >&5
+echo "${ECHO_T}$with_stripping" >&6
+
+if test "$with_stripping" = yes
+then
+       INSTALL_OPT_S="-s"
+else
+       INSTALL_OPT_S=
+fi
+
+: ${INSTALL:=install}
+echo "$as_me:2602: checking if install accepts -p option" >&5
+echo $ECHO_N "checking if install accepts -p option... $ECHO_C" >&6
+if test "${cf_cv_install_p+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+       rm -rf conftest*
+       date >conftest.in
+       mkdir conftest.out
+       sleep 3
+       if $INSTALL -p conftest.in conftest.out 2>/dev/null
+       then
+               if test -f conftest.out/conftest.in
+               then
+                       test conftest.in -nt conftest.out/conftest.in 2>conftest.err && \
+                       test conftest.out/conftest.in -nt conftest.in 2>conftest.err
+                       if test -s conftest.err
+                       then
+                               cf_cv_install_p=no
+                       else
+                               cf_cv_install_p=yes
+                       fi
+               else
+                       cf_cv_install_p=no
+               fi
+       else
+               cf_cv_install_p=no
+       fi
+       rm -rf conftest*
+
+fi
+echo "$as_me:2633: result: $cf_cv_install_p" >&5
+echo "${ECHO_T}$cf_cv_install_p" >&6
+
+echo "$as_me:2636: checking if install needs to be told about ownership" >&5
+echo $ECHO_N "checking if install needs to be told about ownership... $ECHO_C" >&6
+case `$ac_config_guess` in
+(*minix)
+       with_install_o=yes
+       ;;
+(*)
+       with_install_o=no
+       ;;
+esac
+
+echo "$as_me:2647: result: $with_install_o" >&5
+echo "${ECHO_T}$with_install_o" >&6
+if test "x$with_install_o" = xyes
+then
+       INSTALL_OPT_O=`id root|sed -e 's/uid=[0-9]*(/ -o /' -e 's/gid=[0-9]*(/ -g /' -e 's/ [^=[:space:]][^=[:space:]]*=.*/ /' -e 's/)//g'`
+else
+       INSTALL_OPT_O=
+fi
+
 for ac_prog in lint cppcheck splint
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-echo "$as_me:2457: checking for $ac_word" >&5
+echo "$as_me:2660: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_prog_LINT+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -2469,7 +2672,7 @@ for ac_dir in $ac_dummy; do
   test -z "$ac_dir" && ac_dir=.
   $as_executable_p "$ac_dir/$ac_word" || continue
 ac_cv_prog_LINT="$ac_prog"
-echo "$as_me:2472: found $ac_dir/$ac_word" >&5
+echo "$as_me:2675: found $ac_dir/$ac_word" >&5
 break
 done
 
@@ -2477,17 +2680,17 @@ fi
 fi
 LINT=$ac_cv_prog_LINT
 if test -n "$LINT"; then
-  echo "$as_me:2480: result: $LINT" >&5
+  echo "$as_me:2683: result: $LINT" >&5
 echo "${ECHO_T}$LINT" >&6
 else
-  echo "$as_me:2483: result: no" >&5
+  echo "$as_me:2686: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
   test -n "$LINT" && break
 done
 
-echo "$as_me:2490: checking if filesystem supports mixed-case filenames" >&5
+echo "$as_me:2693: checking if filesystem supports mixed-case filenames" >&5
 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
 if test "${cf_cv_mixedcase+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -2514,7 +2717,7 @@ else
 fi
 
 fi
-echo "$as_me:2517: result: $cf_cv_mixedcase" >&5
+echo "$as_me:2720: result: $cf_cv_mixedcase" >&5
 echo "${ECHO_T}$cf_cv_mixedcase" >&6
 test "$cf_cv_mixedcase" = yes &&
 cat >>confdefs.h <<\EOF
@@ -2525,7 +2728,7 @@ for ac_prog in exctags ctags
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-echo "$as_me:2528: checking for $ac_word" >&5
+echo "$as_me:2731: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_prog_CTAGS+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -2540,7 +2743,7 @@ for ac_dir in $ac_dummy; do
   test -z "$ac_dir" && ac_dir=.
   $as_executable_p "$ac_dir/$ac_word" || continue
 ac_cv_prog_CTAGS="$ac_prog"
-echo "$as_me:2543: found $ac_dir/$ac_word" >&5
+echo "$as_me:2746: found $ac_dir/$ac_word" >&5
 break
 done
 
@@ -2548,10 +2751,10 @@ fi
 fi
 CTAGS=$ac_cv_prog_CTAGS
 if test -n "$CTAGS"; then
-  echo "$as_me:2551: result: $CTAGS" >&5
+  echo "$as_me:2754: result: $CTAGS" >&5
 echo "${ECHO_T}$CTAGS" >&6
 else
-  echo "$as_me:2554: result: no" >&5
+  echo "$as_me:2757: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -2562,7 +2765,7 @@ for ac_prog in exetags etags
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-echo "$as_me:2565: checking for $ac_word" >&5
+echo "$as_me:2768: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_prog_ETAGS+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -2577,7 +2780,7 @@ for ac_dir in $ac_dummy; do
   test -z "$ac_dir" && ac_dir=.
   $as_executable_p "$ac_dir/$ac_word" || continue
 ac_cv_prog_ETAGS="$ac_prog"
-echo "$as_me:2580: found $ac_dir/$ac_word" >&5
+echo "$as_me:2783: found $ac_dir/$ac_word" >&5
 break
 done
 
@@ -2585,10 +2788,10 @@ fi
 fi
 ETAGS=$ac_cv_prog_ETAGS
 if test -n "$ETAGS"; then
-  echo "$as_me:2588: result: $ETAGS" >&5
+  echo "$as_me:2791: result: $ETAGS" >&5
 echo "${ECHO_T}$ETAGS" >&6
 else
-  echo "$as_me:2591: result: no" >&5
+  echo "$as_me:2794: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -2597,7 +2800,7 @@ done
 
 # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
 set dummy ${CTAGS:-ctags}; ac_word=$2
-echo "$as_me:2600: checking for $ac_word" >&5
+echo "$as_me:2803: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -2612,7 +2815,7 @@ for ac_dir in $ac_dummy; do
   test -z "$ac_dir" && ac_dir=.
   $as_executable_p "$ac_dir/$ac_word" || continue
 ac_cv_prog_MAKE_LOWER_TAGS="yes"
-echo "$as_me:2615: found $ac_dir/$ac_word" >&5
+echo "$as_me:2818: found $ac_dir/$ac_word" >&5
 break
 done
 
@@ -2621,17 +2824,17 @@ fi
 fi
 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
 if test -n "$MAKE_LOWER_TAGS"; then
-  echo "$as_me:2624: result: $MAKE_LOWER_TAGS" >&5
+  echo "$as_me:2827: result: $MAKE_LOWER_TAGS" >&5
 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
 else
-  echo "$as_me:2627: result: no" >&5
+  echo "$as_me:2830: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
 if test "$cf_cv_mixedcase" = yes ; then
        # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
 set dummy ${ETAGS:-etags}; ac_word=$2
-echo "$as_me:2634: checking for $ac_word" >&5
+echo "$as_me:2837: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -2646,7 +2849,7 @@ for ac_dir in $ac_dummy; do
   test -z "$ac_dir" && ac_dir=.
   $as_executable_p "$ac_dir/$ac_word" || continue
 ac_cv_prog_MAKE_UPPER_TAGS="yes"
-echo "$as_me:2649: found $ac_dir/$ac_word" >&5
+echo "$as_me:2852: found $ac_dir/$ac_word" >&5
 break
 done
 
@@ -2655,10 +2858,10 @@ fi
 fi
 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
 if test -n "$MAKE_UPPER_TAGS"; then
-  echo "$as_me:2658: result: $MAKE_UPPER_TAGS" >&5
+  echo "$as_me:2861: result: $MAKE_UPPER_TAGS" >&5
 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
 else
-  echo "$as_me:2661: result: no" >&5
+  echo "$as_me:2864: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -2678,14 +2881,14 @@ else
        MAKE_LOWER_TAGS="#"
 fi
 
-echo "$as_me:2681: checking if -lm needed for math functions" >&5
+echo "$as_me:2884: checking if -lm needed for math functions" >&5
 echo $ECHO_N "checking if -lm needed for math functions... $ECHO_C" >&6
 if test "${cf_cv_need_libm+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
        cat >conftest.$ac_ext <<_ACEOF
-#line 2688 "configure"
+#line 2891 "configure"
 #include "confdefs.h"
 
        #include <stdio.h>
@@ -2701,16 +2904,16 @@ double x = rand(); printf("result = %g\n", pow(sin(x),x))
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:2704: \"$ac_link\"") >&5
+if { (eval echo "$as_me:2907: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:2707: \$? = $ac_status" >&5
+  echo "$as_me:2910: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:2710: \"$ac_try\"") >&5
+  { (eval echo "$as_me:2913: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:2713: \$? = $ac_status" >&5
+  echo "$as_me:2916: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_need_libm=no
 else
@@ -2720,7 +2923,7 @@ cf_cv_need_libm=yes
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:2723: result: $cf_cv_need_libm" >&5
+echo "$as_me:2926: result: $cf_cv_need_libm" >&5
 echo "${ECHO_T}$cf_cv_need_libm" >&6
 if test "$cf_cv_need_libm" = yes
 then
@@ -2779,10 +2982,10 @@ cat > conftest.i <<EOF
 EOF
 if test "$GCC" = yes
 then
-       { echo "$as_me:2782: checking for $CC __attribute__ directives..." >&5
+       { echo "$as_me:2985: checking for $CC __attribute__ directives..." >&5
 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
 cat > conftest.$ac_ext <<EOF
-#line 2785 "${as_me:-configure}"
+#line 2988 "${as_me:-configure}"
 #include "confdefs.h"
 #include "conftest.h"
 #include "conftest.i"
@@ -2831,12 +3034,12 @@ EOF
                        ;;
                esac
 
-               if { (eval echo "$as_me:2834: \"$ac_compile\"") >&5
+               if { (eval echo "$as_me:3037: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:2837: \$? = $ac_status" >&5
+  echo "$as_me:3040: \$? = $ac_status" >&5
   (exit $ac_status); }; then
-                       test -n "$verbose" && echo "$as_me:2839: result: ... $cf_attribute" >&5
+                       test -n "$verbose" && echo "$as_me:3042: result: ... $cf_attribute" >&5
 echo "${ECHO_T}... $cf_attribute" >&6
                        cat conftest.h >>confdefs.h
                        case $cf_attribute in
@@ -2895,7 +3098,7 @@ fi
 rm -rf conftest*
 fi
 
-echo "$as_me:2898: checking if you want to work around bogus compiler/loader warnings" >&5
+echo "$as_me:3101: checking if you want to work around bogus compiler/loader warnings" >&5
 echo $ECHO_N "checking if you want to work around bogus compiler/loader warnings... $ECHO_C" >&6
 
 # Check whether --enable-string-hacks or --disable-string-hacks was given.
@@ -2905,7 +3108,7 @@ if test "${enable_string_hacks+set}" = set; then
 else
   with_string_hacks=no
 fi;
-echo "$as_me:2908: result: $with_string_hacks" >&5
+echo "$as_me:3111: result: $with_string_hacks" >&5
 echo "${ECHO_T}$with_string_hacks" >&6
 
 if test "x$with_string_hacks" = "xyes"; then
@@ -2914,15 +3117,15 @@ cat >>confdefs.h <<\EOF
 #define USE_STRING_HACKS 1
 EOF
 
-       { echo "$as_me:2917: WARNING: enabling string-hacks to work around bogus compiler/loader warnings" >&5
+       { echo "$as_me:3120: WARNING: enabling string-hacks to work around bogus compiler/loader warnings" >&5
 echo "$as_me: WARNING: enabling string-hacks to work around bogus compiler/loader warnings" >&2;}
-       echo "$as_me:2919: checking for strlcat" >&5
+       echo "$as_me:3122: checking for strlcat" >&5
 echo $ECHO_N "checking for strlcat... $ECHO_C" >&6
 if test "${ac_cv_func_strlcat+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 2925 "configure"
+#line 3128 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char strlcat (); below.  */
@@ -2953,16 +3156,16 @@ f = strlcat; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:2956: \"$ac_link\"") >&5
+if { (eval echo "$as_me:3159: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:2959: \$? = $ac_status" >&5
+  echo "$as_me:3162: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:2962: \"$ac_try\"") >&5
+  { (eval echo "$as_me:3165: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:2965: \$? = $ac_status" >&5
+  echo "$as_me:3168: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_func_strlcat=yes
 else
@@ -2972,7 +3175,7 @@ ac_cv_func_strlcat=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:2975: result: $ac_cv_func_strlcat" >&5
+echo "$as_me:3178: result: $ac_cv_func_strlcat" >&5
 echo "${ECHO_T}$ac_cv_func_strlcat" >&6
 if test $ac_cv_func_strlcat = yes; then
 
@@ -2982,7 +3185,7 @@ EOF
 
 else
 
-               echo "$as_me:2985: checking for strlcat in -lbsd" >&5
+               echo "$as_me:3188: checking for strlcat in -lbsd" >&5
 echo $ECHO_N "checking for strlcat in -lbsd... $ECHO_C" >&6
 if test "${ac_cv_lib_bsd_strlcat+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -2990,7 +3193,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lbsd  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 2993 "configure"
+#line 3196 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -3009,16 +3212,16 @@ strlcat ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:3012: \"$ac_link\"") >&5
+if { (eval echo "$as_me:3215: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:3015: \$? = $ac_status" >&5
+  echo "$as_me:3218: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:3018: \"$ac_try\"") >&5
+  { (eval echo "$as_me:3221: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:3021: \$? = $ac_status" >&5
+  echo "$as_me:3224: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_bsd_strlcat=yes
 else
@@ -3029,7 +3232,7 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:3032: result: $ac_cv_lib_bsd_strlcat" >&5
+echo "$as_me:3235: result: $ac_cv_lib_bsd_strlcat" >&5
 echo "${ECHO_T}$ac_cv_lib_bsd_strlcat" >&6
 if test $ac_cv_lib_bsd_strlcat = yes; then
 
@@ -3052,23 +3255,23 @@ LIBS="$cf_add_libs"
 for ac_header in bsd/string.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-echo "$as_me:3055: checking for $ac_header" >&5
+echo "$as_me:3258: checking for $ac_header" >&5
 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
 if eval "test \"\${$as_ac_Header+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 3061 "configure"
+#line 3264 "configure"
 #include "confdefs.h"
 #include <$ac_header>
 _ACEOF
-if { (eval echo "$as_me:3065: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:3268: \"$ac_cpp conftest.$ac_ext\"") >&5
   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
   ac_status=$?
   egrep -v '^ *\+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:3071: \$? = $ac_status" >&5
+  echo "$as_me:3274: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
@@ -3087,7 +3290,7 @@ else
 fi
 rm -f conftest.err conftest.$ac_ext
 fi
-echo "$as_me:3090: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "$as_me:3293: result: `eval echo '${'$as_ac_Header'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
 if test `eval echo '${'$as_ac_Header'}'` = yes; then
   cat >>confdefs.h <<EOF
@@ -3108,13 +3311,13 @@ fi
 for ac_func in strlcpy snprintf
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:3111: checking for $ac_func" >&5
+echo "$as_me:3314: checking for $ac_func" >&5
 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
 if eval "test \"\${$as_ac_var+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 3117 "configure"
+#line 3320 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func (); below.  */
@@ -3145,16 +3348,16 @@ f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:3148: \"$ac_link\"") >&5
+if { (eval echo "$as_me:3351: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:3151: \$? = $ac_status" >&5
+  echo "$as_me:3354: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:3154: \"$ac_try\"") >&5
+  { (eval echo "$as_me:3357: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:3157: \$? = $ac_status" >&5
+  echo "$as_me:3360: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   eval "$as_ac_var=yes"
 else
@@ -3164,7 +3367,7 @@ eval "$as_ac_var=no"
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:3167: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "$as_me:3370: result: `eval echo '${'$as_ac_var'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<EOF
@@ -3176,7 +3379,7 @@ done
 
 fi
 
-cf_XOPEN_SOURCE=500
+cf_XOPEN_SOURCE=600
 cf_POSIX_C_SOURCE=199506L
 cf_xopen_source=
 
@@ -3214,332 +3417,149 @@ case $host_os in
        ;;
 (linux*|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin)
 
-echo "$as_me:3217: checking if we must define _GNU_SOURCE" >&5
-echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
-if test "${cf_cv_gnu_source+set}" = set; then
+cf_gnu_xopen_source=$cf_XOPEN_SOURCE
+
+echo "$as_me:3422: checking if this is the GNU C library" >&5
+echo $ECHO_N "checking if this is the GNU C library... $ECHO_C" >&6
+if test "${cf_cv_gnu_library+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
 cat >conftest.$ac_ext <<_ACEOF
-#line 3224 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
-int
-main (void)
-{
-
-#ifndef _XOPEN_SOURCE
-make an error
-#endif
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:3239: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:3242: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:3245: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:3248: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  cf_cv_gnu_source=no
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-cf_save="$CPPFLAGS"
-        CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
-        cat >conftest.$ac_ext <<_ACEOF
-#line 3257 "configure"
+#line 3429 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 int
 main (void)
 {
 
-#ifdef _XOPEN_SOURCE
-make an error
-#endif
+       #if __GLIBC__ > 0 && __GLIBC_MINOR__ >= 0
+               return 0;
+       #else
+       #       error not GNU C library
+       #endif
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:3272: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:3446: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:3275: \$? = $ac_status" >&5
+  echo "$as_me:3449: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:3278: \"$ac_try\"") >&5
+  { (eval echo "$as_me:3452: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:3281: \$? = $ac_status" >&5
+  echo "$as_me:3455: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  cf_cv_gnu_source=no
+  cf_cv_gnu_library=yes
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
-cf_cv_gnu_source=yes
+cf_cv_gnu_library=no
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
-       CPPFLAGS="$cf_save"
 
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:3466: result: $cf_cv_gnu_library" >&5
+echo "${ECHO_T}$cf_cv_gnu_library" >&6
 
-fi
-echo "$as_me:3296: result: $cf_cv_gnu_source" >&5
-echo "${ECHO_T}$cf_cv_gnu_source" >&6
+if test x$cf_cv_gnu_library = xyes; then
 
-if test "$cf_cv_gnu_source" = yes
-then
-echo "$as_me:3301: checking if we should also define _DEFAULT_SOURCE" >&5
-echo $ECHO_N "checking if we should also define _DEFAULT_SOURCE... $ECHO_C" >&6
-if test "${cf_cv_default_source+set}" = set; then
+       # With glibc 2.19 (13 years after this check was begun), _DEFAULT_SOURCE
+       # was changed to help a little...
+       echo "$as_me:3473: checking if _DEFAULT_SOURCE can be used as a basis" >&5
+echo $ECHO_N "checking if _DEFAULT_SOURCE can be used as a basis... $ECHO_C" >&6
+if test "${cf_cv_gnu_library_219+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
-       cat >conftest.$ac_ext <<_ACEOF
-#line 3309 "configure"
+               cf_save="$CPPFLAGS"
+
+       test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
+       CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
+
+               cat >conftest.$ac_ext <<_ACEOF
+#line 3485 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 int
 main (void)
 {
 
-#ifdef _DEFAULT_SOURCE
-make an error
-#endif
+                       #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 19) || (__GLIBC__ > 2)
+                               return 0;
+                       #else
+                       #       error GNU C library __GLIBC__.__GLIBC_MINOR__ is too old
+                       #endif
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:3324: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:3502: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:3327: \$? = $ac_status" >&5
+  echo "$as_me:3505: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:3330: \"$ac_try\"") >&5
+  { (eval echo "$as_me:3508: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:3333: \$? = $ac_status" >&5
+  echo "$as_me:3511: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  cf_cv_default_source=no
+  cf_cv_gnu_library_219=yes
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
-cf_cv_default_source=yes
+cf_cv_gnu_library_219=no
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
+               CPPFLAGS="$cf_save"
 
 fi
-echo "$as_me:3344: result: $cf_cv_default_source" >&5
-echo "${ECHO_T}$cf_cv_default_source" >&6
-test "$cf_cv_default_source" = yes && CPPFLAGS="$CPPFLAGS -D_DEFAULT_SOURCE"
-fi
+echo "$as_me:3523: result: $cf_cv_gnu_library_219" >&5
+echo "${ECHO_T}$cf_cv_gnu_library_219" >&6
 
-       ;;
-(minix*)
-       cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
-       ;;
-(mirbsd*)
-       # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
-       cf_XOPEN_SOURCE=
+       if test "x$cf_cv_gnu_library_219" = xyes; then
+               cf_save="$CPPFLAGS"
+               echo "$as_me:3528: checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE" >&5
+echo $ECHO_N "checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE... $ECHO_C" >&6
+if test "${cf_cv_gnu_dftsrc_219+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
 
-cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
+cf_fix_cppflags=no
+cf_new_cflags=
+cf_new_cppflags=
+cf_new_extra_cppflags=
 
-cf_save_CFLAGS="$CFLAGS"
-cf_save_CPPFLAGS="$CPPFLAGS"
+for cf_add_cflags in -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=$cf_gnu_xopen_source
+do
+case $cf_fix_cppflags in
+(no)
+       case $cf_add_cflags in
+       (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
+               case $cf_add_cflags in
+               (-D*)
+                       cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
 
-cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
-       sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
-               -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
+                       test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
+                               && test -z "${cf_tst_cflags}" \
+                               && cf_fix_cppflags=yes
 
-cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
-       sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
-               -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
+                       if test $cf_fix_cppflags = yes ; then
 
-echo "$as_me:3370: checking if we should define _POSIX_C_SOURCE" >&5
-echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
-if test "${cf_cv_posix_c_source+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
+       test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+       cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
 
-echo "${as_me:-configure}:3376: testing if the symbol is already defined go no further ..." 1>&5
+                               continue
+                       elif test "${cf_tst_cflags}" = "\"'" ; then
 
-       cat >conftest.$ac_ext <<_ACEOF
-#line 3379 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
-int
-main (void)
-{
-
-#ifndef _POSIX_C_SOURCE
-make an error
-#endif
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:3394: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:3397: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:3400: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:3403: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  cf_cv_posix_c_source=no
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-cf_want_posix_source=no
-        case .$cf_POSIX_C_SOURCE in
-        (.[12]??*)
-               cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
-               ;;
-        (.2)
-               cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
-               cf_want_posix_source=yes
-               ;;
-        (.*)
-               cf_want_posix_source=yes
-               ;;
-        esac
-        if test "$cf_want_posix_source" = yes ; then
-               cat >conftest.$ac_ext <<_ACEOF
-#line 3424 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
-int
-main (void)
-{
-
-#ifdef _POSIX_SOURCE
-make an error
-#endif
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:3439: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:3442: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:3445: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:3448: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  :
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-        fi
-
-echo "${as_me:-configure}:3459: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
-
-        CFLAGS="$cf_trim_CFLAGS"
-        CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
-
-echo "${as_me:-configure}:3464: testing if the second compile does not leave our definition intact error ..." 1>&5
-
-        cat >conftest.$ac_ext <<_ACEOF
-#line 3467 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
-int
-main (void)
-{
-
-#ifndef _POSIX_C_SOURCE
-make an error
-#endif
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:3482: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:3485: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:3488: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:3491: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  :
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-cf_cv_posix_c_source=no
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-        CFLAGS="$cf_save_CFLAGS"
-        CPPFLAGS="$cf_save_CPPFLAGS"
-
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-
-fi
-echo "$as_me:3507: result: $cf_cv_posix_c_source" >&5
-echo "${ECHO_T}$cf_cv_posix_c_source" >&6
-
-if test "$cf_cv_posix_c_source" != no ; then
-       CFLAGS="$cf_trim_CFLAGS"
-       CPPFLAGS="$cf_trim_CPPFLAGS"
-
-cf_fix_cppflags=no
-cf_new_cflags=
-cf_new_cppflags=
-cf_new_extra_cppflags=
-
-for cf_add_cflags in $cf_cv_posix_c_source
-do
-case $cf_fix_cppflags in
-(no)
-       case $cf_add_cflags in
-       (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
-               case $cf_add_cflags in
-               (-D*)
-                       cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
-
-                       test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
-                               && test -z "${cf_tst_cflags}" \
-                               && cf_fix_cppflags=yes
-
-                       if test $cf_fix_cppflags = yes ; then
-
-       test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
-       cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
-
-                               continue
-                       elif test "${cf_tst_cflags}" = "\"'" ; then
-
-       test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
-       cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+       test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+       cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
 
                                continue
                        fi
@@ -3609,147 +3629,101 @@ if test -n "$cf_new_extra_cppflags" ; then
 
 fi
 
-fi
-
-       ;;
-(netbsd*)
-       cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
-       ;;
-(openbsd[4-9]*)
-       # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
-       cf_xopen_source="-D_BSD_SOURCE"
-       cf_XOPEN_SOURCE=600
-       ;;
-(openbsd*)
-       # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
-       ;;
-(osf[45]*)
-       cf_xopen_source="-D_OSF_SOURCE"
-       ;;
-(nto-qnx*)
-       cf_xopen_source="-D_QNX_SOURCE"
-       ;;
-(sco*)
-       # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
-       ;;
-(solaris2.*)
-       cf_xopen_source="-D__EXTENSIONS__"
-       cf_cv_xopen_source=broken
-       ;;
-(sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
-       cf_XOPEN_SOURCE=
-       cf_POSIX_C_SOURCE=
-       ;;
-(*)
-
-echo "$as_me:3645: checking if we should define _XOPEN_SOURCE" >&5
-echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
-if test "${cf_cv_xopen_source+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-       cat >conftest.$ac_ext <<_ACEOF
-#line 3652 "configure"
+                       cat >conftest.$ac_ext <<_ACEOF
+#line 3633 "configure"
 #include "confdefs.h"
 
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
+                               #include <limits.h>
+                               #include <sys/types.h>
 
 int
 main (void)
 {
 
-#ifndef _XOPEN_SOURCE
-make an error
-#endif
+                               #if (_XOPEN_SOURCE >= $cf_gnu_xopen_source) && (MB_LEN_MAX > 1)
+                                       return 0;
+                               #else
+                               #       error GNU C library is too old
+                               #endif
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:3671: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:3653: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:3674: \$? = $ac_status" >&5
+  echo "$as_me:3656: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:3677: \"$ac_try\"") >&5
+  { (eval echo "$as_me:3659: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:3680: \$? = $ac_status" >&5
+  echo "$as_me:3662: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  cf_cv_xopen_source=no
+  cf_cv_gnu_dftsrc_219=yes
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
-cf_save="$CPPFLAGS"
-        CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
-        cat >conftest.$ac_ext <<_ACEOF
+cf_cv_gnu_dftsrc_219=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+
+fi
+echo "$as_me:3673: result: $cf_cv_gnu_dftsrc_219" >&5
+echo "${ECHO_T}$cf_cv_gnu_dftsrc_219" >&6
+               test "x$cf_cv_gnu_dftsrc_219" = "xyes" || CPPFLAGS="$cf_save"
+       else
+               cf_cv_gnu_dftsrc_219=maybe
+       fi
+
+       if test "x$cf_cv_gnu_dftsrc_219" != xyes; then
+
+               echo "$as_me:3682: checking if we must define _GNU_SOURCE" >&5
+echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
+if test "${cf_cv_gnu_source+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+               cat >conftest.$ac_ext <<_ACEOF
 #line 3689 "configure"
 #include "confdefs.h"
-
-#include <stdlib.h>
-#include <string.h>
 #include <sys/types.h>
-
 int
 main (void)
 {
 
-#ifdef _XOPEN_SOURCE
-make an error
-#endif
+                       #ifndef _XOPEN_SOURCE
+                       #error  expected _XOPEN_SOURCE to be defined
+                       #endif
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:3708: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:3704: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:3711: \$? = $ac_status" >&5
+  echo "$as_me:3707: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:3714: \"$ac_try\"") >&5
+  { (eval echo "$as_me:3710: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:3717: \$? = $ac_status" >&5
+  echo "$as_me:3713: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  cf_cv_xopen_source=no
+  cf_cv_gnu_source=no
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
-cf_cv_xopen_source=$cf_XOPEN_SOURCE
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-       CPPFLAGS="$cf_save"
-
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-
-fi
-echo "$as_me:3732: result: $cf_cv_xopen_source" >&5
-echo "${ECHO_T}$cf_cv_xopen_source" >&6
-
-if test "$cf_cv_xopen_source" != no ; then
-
-CFLAGS=`echo "$CFLAGS" | \
-       sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
-               -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
-
-CPPFLAGS=`echo "$CPPFLAGS" | \
-       sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
-               -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
-
-       cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
+cf_save="$CPPFLAGS"
 
 cf_fix_cppflags=no
 cf_new_cflags=
 cf_new_cppflags=
 cf_new_extra_cppflags=
 
-for cf_add_cflags in $cf_temp_xopen_source
+for cf_add_cflags in -D_GNU_SOURCE
 do
 case $cf_fix_cppflags in
 (no)
@@ -3842,31 +3816,141 @@ if test -n "$cf_new_extra_cppflags" ; then
 
 fi
 
-fi
-
-cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
-
-cf_save_CFLAGS="$CFLAGS"
-cf_save_CPPFLAGS="$CPPFLAGS"
-
-cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
-       sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
-               -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
-
-cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
-       sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
-               -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
+                        cat >conftest.$ac_ext <<_ACEOF
+#line 3820 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+int
+main (void)
+{
 
-echo "$as_me:3860: checking if we should define _POSIX_C_SOURCE" >&5
-echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
-if test "${cf_cv_posix_c_source+set}" = set; then
+                               #ifdef _XOPEN_SOURCE
+                               #error  expected _XOPEN_SOURCE to be undefined
+                               #endif
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:3835: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:3838: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:3841: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:3844: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_cv_gnu_source=no
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_gnu_source=yes
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+                       CPPFLAGS="$cf_save"
+
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+
+fi
+echo "$as_me:3859: result: $cf_cv_gnu_source" >&5
+echo "${ECHO_T}$cf_cv_gnu_source" >&6
+
+               if test "$cf_cv_gnu_source" = yes
+               then
+               echo "$as_me:3864: checking if we should also define _DEFAULT_SOURCE" >&5
+echo $ECHO_N "checking if we should also define _DEFAULT_SOURCE... $ECHO_C" >&6
+if test "${cf_cv_default_source+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+       test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
+       CPPFLAGS="${CPPFLAGS}-D_GNU_SOURCE"
+
+                       cat >conftest.$ac_ext <<_ACEOF
+#line 3874 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+int
+main (void)
+{
+
+                               #ifdef _DEFAULT_SOURCE
+                               #error  expected _DEFAULT_SOURCE to be undefined
+                               #endif
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:3889: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:3892: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:3895: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:3898: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_cv_default_source=no
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_default_source=yes
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+
+fi
+echo "$as_me:3909: result: $cf_cv_default_source" >&5
+echo "${ECHO_T}$cf_cv_default_source" >&6
+                       if test "$cf_cv_default_source" = yes
+                       then
+
+       test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
+       CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
+
+                       fi
+               fi
+       fi
+
+fi
+
+       ;;
+(minix*)
+       cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
+       ;;
+(mirbsd*)
+       # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
+       cf_XOPEN_SOURCE=
+
+cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
+
+cf_save_CFLAGS="$CFLAGS"
+cf_save_CPPFLAGS="$CPPFLAGS"
+
+cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
+       sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
+               -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
+
+cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
+       sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
+               -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
+
+echo "$as_me:3944: checking if we should define _POSIX_C_SOURCE" >&5
+echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
+if test "${cf_cv_posix_c_source+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-echo "${as_me:-configure}:3866: testing if the symbol is already defined go no further ..." 1>&5
+echo "${as_me:-configure}:3950: testing if the symbol is already defined go no further ..." 1>&5
 
        cat >conftest.$ac_ext <<_ACEOF
-#line 3869 "configure"
+#line 3953 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 int
@@ -3881,16 +3965,16 @@ make an error
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:3884: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:3968: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:3887: \$? = $ac_status" >&5
+  echo "$as_me:3971: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:3890: \"$ac_try\"") >&5
+  { (eval echo "$as_me:3974: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:3893: \$? = $ac_status" >&5
+  echo "$as_me:3977: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_posix_c_source=no
 else
@@ -3911,7 +3995,7 @@ cf_want_posix_source=no
         esac
         if test "$cf_want_posix_source" = yes ; then
                cat >conftest.$ac_ext <<_ACEOF
-#line 3914 "configure"
+#line 3998 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 int
@@ -3926,16 +4010,16 @@ make an error
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:3929: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:4013: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:3932: \$? = $ac_status" >&5
+  echo "$as_me:4016: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:3935: \"$ac_try\"") >&5
+  { (eval echo "$as_me:4019: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:3938: \$? = $ac_status" >&5
+  echo "$as_me:4022: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   :
 else
@@ -3946,15 +4030,18 @@ fi
 rm -f conftest.$ac_objext conftest.$ac_ext
         fi
 
-echo "${as_me:-configure}:3949: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
+echo "${as_me:-configure}:4033: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
 
         CFLAGS="$cf_trim_CFLAGS"
-        CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
+        CPPFLAGS="$cf_trim_CPPFLAGS"
+
+       test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
+       CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
 
-echo "${as_me:-configure}:3954: testing if the second compile does not leave our definition intact error ..." 1>&5
+echo "${as_me:-configure}:4041: testing if the second compile does not leave our definition intact error ..." 1>&5
 
         cat >conftest.$ac_ext <<_ACEOF
-#line 3957 "configure"
+#line 4044 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 int
@@ -3969,16 +4056,16 @@ make an error
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:3972: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:4059: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:3975: \$? = $ac_status" >&5
+  echo "$as_me:4062: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:3978: \"$ac_try\"") >&5
+  { (eval echo "$as_me:4065: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:3981: \$? = $ac_status" >&5
+  echo "$as_me:4068: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   :
 else
@@ -3994,7 +4081,7 @@ fi
 rm -f conftest.$ac_objext conftest.$ac_ext
 
 fi
-echo "$as_me:3997: result: $cf_cv_posix_c_source" >&5
+echo "$as_me:4084: result: $cf_cv_posix_c_source" >&5
 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
 
 if test "$cf_cv_posix_c_source" != no ; then
 fi
 
        ;;
-esac
+(netbsd*)
+       cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
+       ;;
+(openbsd[4-9]*)
+       # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
+       cf_xopen_source="-D_BSD_SOURCE"
+       cf_XOPEN_SOURCE=600
+       ;;
+(openbsd*)
+       # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
+       ;;
+(osf[45]*)
+       cf_xopen_source="-D_OSF_SOURCE"
+       ;;
+(nto-qnx*)
+       cf_xopen_source="-D_QNX_SOURCE"
+       ;;
+(sco*)
+       # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
+       ;;
+(solaris2.*)
+       cf_xopen_source="-D__EXTENSIONS__"
+       cf_cv_xopen_source=broken
+       ;;
+(sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
+       cf_XOPEN_SOURCE=
+       cf_POSIX_C_SOURCE=
+       ;;
+(*)
 
-if test -n "$cf_xopen_source" ; then
+echo "$as_me:4222: checking if we should define _XOPEN_SOURCE" >&5
+echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
+if test "${cf_cv_xopen_source+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+       cat >conftest.$ac_ext <<_ACEOF
+#line 4229 "configure"
+#include "confdefs.h"
+
+#include <stdlib.h>
+#include <string.h>
+#include <sys/types.h>
+
+int
+main (void)
+{
+
+#ifndef _XOPEN_SOURCE
+make an error
+#endif
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:4248: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:4251: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:4254: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:4257: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_cv_xopen_source=no
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_save="$CPPFLAGS"
+
+       test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
+       CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
+
+        cat >conftest.$ac_ext <<_ACEOF
+#line 4269 "configure"
+#include "confdefs.h"
+
+#include <stdlib.h>
+#include <string.h>
+#include <sys/types.h>
+
+int
+main (void)
+{
+
+#ifdef _XOPEN_SOURCE
+make an error
+#endif
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:4288: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:4291: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:4294: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:4297: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_cv_xopen_source=no
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_xopen_source=$cf_XOPEN_SOURCE
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+       CPPFLAGS="$cf_save"
+
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+
+fi
+echo "$as_me:4312: result: $cf_cv_xopen_source" >&5
+echo "${ECHO_T}$cf_cv_xopen_source" >&6
+
+if test "$cf_cv_xopen_source" != no ; then
+
+CFLAGS=`echo "$CFLAGS" | \
+       sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
+               -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
+
+CPPFLAGS=`echo "$CPPFLAGS" | \
+       sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
+               -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
+
+       cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
 
 cf_fix_cppflags=no
 cf_new_cflags=
 cf_new_cppflags=
 cf_new_extra_cppflags=
 
-for cf_add_cflags in $cf_xopen_source
+for cf_add_cflags in $cf_temp_xopen_source
 do
 case $cf_fix_cppflags in
 (no)
@@ -4184,9 +4402,6 @@ esac
 done
 
 if test -n "$cf_new_cflags" ; then
-       test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
-
-echo "${as_me:-configure}:4189: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
 
        test -n "$CFLAGS" && CFLAGS="$CFLAGS "
        CFLAGS="${CFLAGS}$cf_new_cflags"
@@ -4194,9 +4409,6 @@ echo "${as_me:-configure}:4189: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
 fi
 
 if test -n "$cf_new_cppflags" ; then
-       test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
-
-echo "${as_me:-configure}:4199: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
 
        test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
        CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
@@ -4204,9 +4416,6 @@ echo "${as_me:-configure}:4199: testing add to \$CPPFLAGS $cf_new_cppflags ..."
 fi
 
 if test -n "$cf_new_extra_cppflags" ; then
-       test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
-
-echo "${as_me:-configure}:4209: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
 
        test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
        EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
@@ -4215,18 +4424,36 @@ fi
 
 fi
 
-if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
-       echo "$as_me:4219: checking if _XOPEN_SOURCE really is set" >&5
-echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
+cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
+
+cf_save_CFLAGS="$CFLAGS"
+cf_save_CPPFLAGS="$CPPFLAGS"
+
+cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
+       sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
+               -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
+
+cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
+       sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
+               -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
+
+echo "$as_me:4440: checking if we should define _POSIX_C_SOURCE" >&5
+echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
+if test "${cf_cv_posix_c_source+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+echo "${as_me:-configure}:4446: testing if the symbol is already defined go no further ..." 1>&5
+
        cat >conftest.$ac_ext <<_ACEOF
-#line 4222 "configure"
+#line 4449 "configure"
 #include "confdefs.h"
-#include <stdlib.h>
+#include <sys/types.h>
 int
 main (void)
 {
 
-#ifndef _XOPEN_SOURCE
+#ifndef _POSIX_C_SOURCE
 make an error
 #endif
   ;
@@ -4234,37 +4461,44 @@ make an error
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:4237: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:4464: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:4240: \$? = $ac_status" >&5
+  echo "$as_me:4467: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:4243: \"$ac_try\"") >&5
+  { (eval echo "$as_me:4470: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:4246: \$? = $ac_status" >&5
+  echo "$as_me:4473: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  cf_XOPEN_SOURCE_set=yes
+  cf_cv_posix_c_source=no
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
-cf_XOPEN_SOURCE_set=no
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-       echo "$as_me:4255: result: $cf_XOPEN_SOURCE_set" >&5
-echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
-       if test $cf_XOPEN_SOURCE_set = yes
-       then
+cf_want_posix_source=no
+        case .$cf_POSIX_C_SOURCE in
+        (.[12]??*)
+               cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
+               ;;
+        (.2)
+               cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
+               cf_want_posix_source=yes
+               ;;
+        (.*)
+               cf_want_posix_source=yes
+               ;;
+        esac
+        if test "$cf_want_posix_source" = yes ; then
                cat >conftest.$ac_ext <<_ACEOF
-#line 4260 "configure"
+#line 4494 "configure"
 #include "confdefs.h"
-#include <stdlib.h>
+#include <sys/types.h>
 int
 main (void)
 {
 
-#if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
+#ifdef _POSIX_SOURCE
 make an error
 #endif
   ;
@@ -4272,87 +4506,45 @@ make an error
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:4275: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:4509: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:4278: \$? = $ac_status" >&5
+  echo "$as_me:4512: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:4281: \"$ac_try\"") >&5
+  { (eval echo "$as_me:4515: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:4284: \$? = $ac_status" >&5
+  echo "$as_me:4518: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  cf_XOPEN_SOURCE_set_ok=yes
+  :
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
-cf_XOPEN_SOURCE_set_ok=no
+cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
-               if test $cf_XOPEN_SOURCE_set_ok = no
-               then
-                       { echo "$as_me:4295: WARNING: _XOPEN_SOURCE is lower than requested" >&5
-echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
-               fi
-       else
+        fi
 
-echo "$as_me:4300: checking if we should define _XOPEN_SOURCE" >&5
-echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
-if test "${cf_cv_xopen_source+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
+echo "${as_me:-configure}:4529: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
 
-       cat >conftest.$ac_ext <<_ACEOF
-#line 4307 "configure"
-#include "confdefs.h"
+        CFLAGS="$cf_trim_CFLAGS"
+        CPPFLAGS="$cf_trim_CPPFLAGS"
 
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
+       test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
+       CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
 
-int
-main (void)
-{
+echo "${as_me:-configure}:4537: testing if the second compile does not leave our definition intact error ..." 1>&5
 
-#ifndef _XOPEN_SOURCE
-make an error
-#endif
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:4326: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:4329: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:4332: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:4335: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  cf_cv_xopen_source=no
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-cf_save="$CPPFLAGS"
-        CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
         cat >conftest.$ac_ext <<_ACEOF
-#line 4344 "configure"
+#line 4540 "configure"
 #include "confdefs.h"
-
-#include <stdlib.h>
-#include <string.h>
 #include <sys/types.h>
-
 int
 main (void)
 {
 
-#ifdef _XOPEN_SOURCE
+#ifndef _POSIX_C_SOURCE
 make an error
 #endif
   ;
@@ -4360,51 +4552,149 @@ make an error
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:4363: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:4555: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:4366: \$? = $ac_status" >&5
+  echo "$as_me:4558: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:4369: \"$ac_try\"") >&5
+  { (eval echo "$as_me:4561: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:4372: \$? = $ac_status" >&5
+  echo "$as_me:4564: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  cf_cv_xopen_source=no
+  :
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
-cf_cv_xopen_source=$cf_XOPEN_SOURCE
+cf_cv_posix_c_source=no
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
-       CPPFLAGS="$cf_save"
+        CFLAGS="$cf_save_CFLAGS"
+        CPPFLAGS="$cf_save_CPPFLAGS"
 
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
 
 fi
-echo "$as_me:4387: result: $cf_cv_xopen_source" >&5
-echo "${ECHO_T}$cf_cv_xopen_source" >&6
+echo "$as_me:4580: result: $cf_cv_posix_c_source" >&5
+echo "${ECHO_T}$cf_cv_posix_c_source" >&6
 
-if test "$cf_cv_xopen_source" != no ; then
+if test "$cf_cv_posix_c_source" != no ; then
+       CFLAGS="$cf_trim_CFLAGS"
+       CPPFLAGS="$cf_trim_CPPFLAGS"
 
-CFLAGS=`echo "$CFLAGS" | \
-       sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
-               -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
+cf_fix_cppflags=no
+cf_new_cflags=
+cf_new_cppflags=
+cf_new_extra_cppflags=
+
+for cf_add_cflags in $cf_cv_posix_c_source
+do
+case $cf_fix_cppflags in
+(no)
+       case $cf_add_cflags in
+       (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
+               case $cf_add_cflags in
+               (-D*)
+                       cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
+
+                       test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
+                               && test -z "${cf_tst_cflags}" \
+                               && cf_fix_cppflags=yes
+
+                       if test $cf_fix_cppflags = yes ; then
+
+       test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+       cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
+                               continue
+                       elif test "${cf_tst_cflags}" = "\"'" ; then
+
+       test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+       cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
+                               continue
+                       fi
+                       ;;
+               esac
+               case "$CPPFLAGS" in
+               (*$cf_add_cflags)
+                       ;;
+               (*)
+                       case $cf_add_cflags in
+                       (-D*)
+                               cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
 
 CPPFLAGS=`echo "$CPPFLAGS" | \
-       sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
-               -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
+       sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
+               -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
 
-       cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
+                               ;;
+                       esac
+
+       test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
+       cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
+
+                       ;;
+               esac
+               ;;
+       (*)
+
+       test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
+       cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
+
+               ;;
+       esac
+       ;;
+(yes)
+
+       test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+       cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
+       cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
+
+       test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
+               && test -z "${cf_tst_cflags}" \
+               && cf_fix_cppflags=no
+       ;;
+esac
+done
+
+if test -n "$cf_new_cflags" ; then
+
+       test -n "$CFLAGS" && CFLAGS="$CFLAGS "
+       CFLAGS="${CFLAGS}$cf_new_cflags"
+
+fi
+
+if test -n "$cf_new_cppflags" ; then
+
+       test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
+       CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
+
+fi
+
+if test -n "$cf_new_extra_cppflags" ; then
+
+       test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
+       EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
+
+fi
+
+fi
+
+       ;;
+esac
+
+if test -n "$cf_xopen_source" ; then
 
 cf_fix_cppflags=no
 cf_new_cflags=
 cf_new_cppflags=
 cf_new_extra_cppflags=
 
-for cf_add_cflags in $cf_temp_xopen_source
+for cf_add_cflags in $cf_xopen_source
 do
 case $cf_fix_cppflags in
 (no)
@@ -4477,6 +4767,9 @@ esac
 done
 
 if test -n "$cf_new_cflags" ; then
+       test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
+
+echo "${as_me:-configure}:4772: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
 
        test -n "$CFLAGS" && CFLAGS="$CFLAGS "
        CFLAGS="${CFLAGS}$cf_new_cflags"
@@ -4484,6 +4777,9 @@ if test -n "$cf_new_cflags" ; then
 fi
 
 if test -n "$cf_new_cppflags" ; then
+       test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
+
+echo "${as_me:-configure}:4782: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
 
        test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
        CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
@@ -4491,6 +4787,9 @@ if test -n "$cf_new_cppflags" ; then
 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}:4792: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
 
        test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
        EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
 
 fi
 
-       fi
-fi
-
-echo "$as_me:4505: checking for signal global datatype" >&5
-echo $ECHO_N "checking for signal global datatype... $ECHO_C" >&6
-if test "${cf_cv_sig_atomic_t+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-       for cf_type in \
-               "volatile sig_atomic_t" \
-               "sig_atomic_t" \
-               "int"
-       do
+if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
+       echo "$as_me:4802: checking if _XOPEN_SOURCE really is set" >&5
+echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
        cat >conftest.$ac_ext <<_ACEOF
-#line 4517 "configure"
+#line 4805 "configure"
 #include "confdefs.h"
-
-#include <sys/types.h>
-#include <signal.h>
-#include <stdio.h>
-
-extern $cf_type x;
-$cf_type x;
-static void handler(int sig)
-{
-       x = 5;
-}
+#include <stdlib.h>
 int
 main (void)
 {
-signal(SIGINT, handler);
-                x = 1
+
+#ifndef _XOPEN_SOURCE
+make an error
+#endif
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:4540: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:4820: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:4543: \$? = $ac_status" >&5
+  echo "$as_me:4823: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:4546: \"$ac_try\"") >&5
+  { (eval echo "$as_me:4826: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:4549: \$? = $ac_status" >&5
+  echo "$as_me:4829: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  cf_cv_sig_atomic_t=$cf_type
+  cf_XOPEN_SOURCE_set=yes
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
-cf_cv_sig_atomic_t=no
+cf_XOPEN_SOURCE_set=no
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
-               test "$cf_cv_sig_atomic_t" != no && break
-       done
-
-fi
+       echo "$as_me:4838: result: $cf_XOPEN_SOURCE_set" >&5
+echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
+       if test $cf_XOPEN_SOURCE_set = yes
+       then
+               cat >conftest.$ac_ext <<_ACEOF
+#line 4843 "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+int
+main (void)
+{
 
-echo "$as_me:4563: result: $cf_cv_sig_atomic_t" >&5
-echo "${ECHO_T}$cf_cv_sig_atomic_t" >&6
-test "$cf_cv_sig_atomic_t" != no &&
-cat >>confdefs.h <<EOF
-#define SIG_ATOMIC_T $cf_cv_sig_atomic_t
-EOF
-
-# Work around breakage on OS X
+#if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
+make an error
+#endif
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:4858: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:4861: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:4864: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:4867: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_XOPEN_SOURCE_set_ok=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_XOPEN_SOURCE_set_ok=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+               if test $cf_XOPEN_SOURCE_set_ok = no
+               then
+                       { echo "$as_me:4878: WARNING: _XOPEN_SOURCE is lower than requested" >&5
+echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
+               fi
+       else
 
-echo "$as_me:4572: checking if SIGWINCH is defined" >&5
-echo $ECHO_N "checking if SIGWINCH is defined... $ECHO_C" >&6
-if test "${cf_cv_define_sigwinch+set}" = set; then
+echo "$as_me:4883: checking if we should define _XOPEN_SOURCE" >&5
+echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
+if test "${cf_cv_xopen_source+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
        cat >conftest.$ac_ext <<_ACEOF
-#line 4579 "configure"
+#line 4890 "configure"
 #include "confdefs.h"
 
+#include <stdlib.h>
+#include <string.h>
 #include <sys/types.h>
-#include <sys/signal.h>
 
 int
 main (void)
 {
-int x = SIGWINCH
+
+#ifndef _XOPEN_SOURCE
+make an error
+#endif
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:4594: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:4909: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:4597: \$? = $ac_status" >&5
+  echo "$as_me:4912: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:4600: \"$ac_try\"") >&5
+  { (eval echo "$as_me:4915: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:4603: \$? = $ac_status" >&5
+  echo "$as_me:4918: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  cf_cv_define_sigwinch=yes
+  cf_cv_xopen_source=no
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
-cat >conftest.$ac_ext <<_ACEOF
-#line 4610 "configure"
+cf_save="$CPPFLAGS"
+
+       test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
+       CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
+
+        cat >conftest.$ac_ext <<_ACEOF
+#line 4930 "configure"
 #include "confdefs.h"
 
-#undef _XOPEN_SOURCE
-#undef _POSIX_SOURCE
-#undef _POSIX_C_SOURCE
+#include <stdlib.h>
+#include <string.h>
 #include <sys/types.h>
-#include <sys/signal.h>
 
 int
 main (void)
 {
-int x = SIGWINCH
+
+#ifdef _XOPEN_SOURCE
+make an error
+#endif
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:4628: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:4949: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:4631: \$? = $ac_status" >&5
+  echo "$as_me:4952: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:4634: \"$ac_try\"") >&5
+  { (eval echo "$as_me:4955: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:4637: \$? = $ac_status" >&5
+  echo "$as_me:4958: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  cf_cv_define_sigwinch=maybe
+  cf_cv_xopen_source=no
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
-cf_cv_define_sigwinch=no
+cf_cv_xopen_source=$cf_XOPEN_SOURCE
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
+       CPPFLAGS="$cf_save"
 
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
 
 fi
-echo "$as_me:4651: result: $cf_cv_define_sigwinch" >&5
-echo "${ECHO_T}$cf_cv_define_sigwinch" >&6
+echo "$as_me:4973: result: $cf_cv_xopen_source" >&5
+echo "${ECHO_T}$cf_cv_xopen_source" >&6
 
-if test "$cf_cv_define_sigwinch" = maybe ; then
-echo "$as_me:4655: checking for actual SIGWINCH definition" >&5
-echo $ECHO_N "checking for actual SIGWINCH definition... $ECHO_C" >&6
-if test "${cf_cv_fixup_sigwinch+set}" = set; then
+if test "$cf_cv_xopen_source" != no ; then
+
+CFLAGS=`echo "$CFLAGS" | \
+       sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
+               -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
+
+CPPFLAGS=`echo "$CPPFLAGS" | \
+       sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
+               -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
+
+       cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
+
+cf_fix_cppflags=no
+cf_new_cflags=
+cf_new_cppflags=
+cf_new_extra_cppflags=
+
+for cf_add_cflags in $cf_temp_xopen_source
+do
+case $cf_fix_cppflags in
+(no)
+       case $cf_add_cflags in
+       (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
+               case $cf_add_cflags in
+               (-D*)
+                       cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
+
+                       test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
+                               && test -z "${cf_tst_cflags}" \
+                               && cf_fix_cppflags=yes
+
+                       if test $cf_fix_cppflags = yes ; then
+
+       test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+       cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
+                               continue
+                       elif test "${cf_tst_cflags}" = "\"'" ; then
+
+       test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+       cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
+                               continue
+                       fi
+                       ;;
+               esac
+               case "$CPPFLAGS" in
+               (*$cf_add_cflags)
+                       ;;
+               (*)
+                       case $cf_add_cflags in
+                       (-D*)
+                               cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
+
+CPPFLAGS=`echo "$CPPFLAGS" | \
+       sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
+               -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
+
+                               ;;
+                       esac
+
+       test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
+       cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
+
+                       ;;
+               esac
+               ;;
+       (*)
+
+       test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
+       cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
+
+               ;;
+       esac
+       ;;
+(yes)
+
+       test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+       cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
+       cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
+
+       test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
+               && test -z "${cf_tst_cflags}" \
+               && cf_fix_cppflags=no
+       ;;
+esac
+done
+
+if test -n "$cf_new_cflags" ; then
+
+       test -n "$CFLAGS" && CFLAGS="$CFLAGS "
+       CFLAGS="${CFLAGS}$cf_new_cflags"
+
+fi
+
+if test -n "$cf_new_cppflags" ; then
+
+       test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
+       CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
+
+fi
+
+if test -n "$cf_new_extra_cppflags" ; then
+
+       test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
+       EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
+
+fi
+
+fi
+
+       fi
+fi
+
+echo "$as_me:5091: checking for signal global datatype" >&5
+echo $ECHO_N "checking for signal global datatype... $ECHO_C" >&6
+if test "${cf_cv_sig_atomic_t+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-cf_cv_fixup_sigwinch=unknown
-cf_sigwinch=32
-while test $cf_sigwinch != 1
-do
+       for cf_type in \
+               "volatile sig_atomic_t" \
+               "sig_atomic_t" \
+               "int"
+       do
        cat >conftest.$ac_ext <<_ACEOF
-#line 4666 "configure"
+#line 5103 "configure"
 #include "confdefs.h"
 
-#undef _XOPEN_SOURCE
-#undef _POSIX_SOURCE
-#undef _POSIX_C_SOURCE
 #include <sys/types.h>
-#include <sys/signal.h>
+#include <signal.h>
+#include <stdio.h>
 
+extern $cf_type x;
+$cf_type x;
+static void handler(int sig)
+{
+       x = 5;
+}
 int
 main (void)
 {
-
-#if SIGWINCH != $cf_sigwinch
-make an error
-#endif
-int x = SIGWINCH
+signal(SIGINT, handler);
+                x = 1
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:4688: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:5126: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:4691: \$? = $ac_status" >&5
+  echo "$as_me:5129: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:4694: \"$ac_try\"") >&5
+  { (eval echo "$as_me:5132: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:4697: \$? = $ac_status" >&5
+  echo "$as_me:5135: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  cf_cv_fixup_sigwinch=$cf_sigwinch
-        break
+  cf_cv_sig_atomic_t=$cf_type
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
+cf_cv_sig_atomic_t=no
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
-
-cf_sigwinch=`expr $cf_sigwinch - 1`
-done
+               test "$cf_cv_sig_atomic_t" != no && break
+       done
 
 fi
-echo "$as_me:4711: result: $cf_cv_fixup_sigwinch" >&5
-echo "${ECHO_T}$cf_cv_fixup_sigwinch" >&6
 
-       if test "$cf_cv_fixup_sigwinch" != unknown ; then
-               CPPFLAGS="$CPPFLAGS -DSIGWINCH=$cf_cv_fixup_sigwinch"
-       fi
-fi
+echo "$as_me:5149: result: $cf_cv_sig_atomic_t" >&5
+echo "${ECHO_T}$cf_cv_sig_atomic_t" >&6
+test "$cf_cv_sig_atomic_t" != no &&
+cat >>confdefs.h <<EOF
+#define SIG_ATOMIC_T $cf_cv_sig_atomic_t
+EOF
 
-# Checks for CODESET support.
+# Work around breakage on OS X
 
-echo "$as_me:4721: checking for nl_langinfo and CODESET" >&5
-echo $ECHO_N "checking for nl_langinfo and CODESET... $ECHO_C" >&6
-if test "${am_cv_langinfo_codeset+set}" = set; then
+echo "$as_me:5158: checking if SIGWINCH is defined" >&5
+echo $ECHO_N "checking if SIGWINCH is defined... $ECHO_C" >&6
+if test "${cf_cv_define_sigwinch+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
-#line 4727 "configure"
+
+       cat >conftest.$ac_ext <<_ACEOF
+#line 5165 "configure"
 #include "confdefs.h"
-#include <langinfo.h>
+
+#include <sys/types.h>
+#include <sys/signal.h>
+
 int
 main (void)
 {
-char* cs = nl_langinfo(CODESET);
+int x = SIGWINCH
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:4739: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:5180: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:4742: \$? = $ac_status" >&5
+  echo "$as_me:5183: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:4745: \"$ac_try\"") >&5
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:5186: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:5189: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_cv_define_sigwinch=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cat >conftest.$ac_ext <<_ACEOF
+#line 5196 "configure"
+#include "confdefs.h"
+
+#undef _XOPEN_SOURCE
+#undef _POSIX_SOURCE
+#undef _POSIX_C_SOURCE
+#include <sys/types.h>
+#include <sys/signal.h>
+
+int
+main (void)
+{
+int x = SIGWINCH
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:5214: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:5217: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:5220: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:5223: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_cv_define_sigwinch=maybe
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_define_sigwinch=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+
+fi
+echo "$as_me:5237: result: $cf_cv_define_sigwinch" >&5
+echo "${ECHO_T}$cf_cv_define_sigwinch" >&6
+
+if test "$cf_cv_define_sigwinch" = maybe ; then
+echo "$as_me:5241: checking for actual SIGWINCH definition" >&5
+echo $ECHO_N "checking for actual SIGWINCH definition... $ECHO_C" >&6
+if test "${cf_cv_fixup_sigwinch+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+cf_cv_fixup_sigwinch=unknown
+cf_sigwinch=32
+while test $cf_sigwinch != 1
+do
+       cat >conftest.$ac_ext <<_ACEOF
+#line 5252 "configure"
+#include "confdefs.h"
+
+#undef _XOPEN_SOURCE
+#undef _POSIX_SOURCE
+#undef _POSIX_C_SOURCE
+#include <sys/types.h>
+#include <sys/signal.h>
+
+int
+main (void)
+{
+
+#if SIGWINCH != $cf_sigwinch
+make an error
+#endif
+int x = SIGWINCH
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:5274: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:5277: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:5280: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:5283: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_cv_fixup_sigwinch=$cf_sigwinch
+        break
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+
+cf_sigwinch=`expr $cf_sigwinch - 1`
+done
+
+fi
+echo "$as_me:5297: result: $cf_cv_fixup_sigwinch" >&5
+echo "${ECHO_T}$cf_cv_fixup_sigwinch" >&6
+
+       if test "$cf_cv_fixup_sigwinch" != unknown ; then
+               CPPFLAGS="$CPPFLAGS -DSIGWINCH=$cf_cv_fixup_sigwinch"
+       fi
+fi
+
+# Checks for CODESET support.
+
+echo "$as_me:5307: checking for nl_langinfo and CODESET" >&5
+echo $ECHO_N "checking for nl_langinfo and CODESET... $ECHO_C" >&6
+if test "${am_cv_langinfo_codeset+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 5313 "configure"
+#include "confdefs.h"
+#include <langinfo.h>
+int
+main (void)
+{
+char* cs = nl_langinfo(CODESET);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:5325: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:5328: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:5331: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:4748: \$? = $ac_status" >&5
+  echo "$as_me:5334: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   am_cv_langinfo_codeset=yes
 else
@@ -4756,7 +5342,7 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 
 fi
-echo "$as_me:4759: result: $am_cv_langinfo_codeset" >&5
+echo "$as_me:5345: result: $am_cv_langinfo_codeset" >&5
 echo "${ECHO_T}$am_cv_langinfo_codeset" >&6
        if test $am_cv_langinfo_codeset = yes; then
 
@@ -4766,7 +5352,7 @@ EOF
 
        fi
 
-echo "$as_me:4769: checking if you want to use pkg-config" >&5
+echo "$as_me:5355: checking if you want to use pkg-config" >&5
 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
 
 # Check whether --with-pkg-config or --without-pkg-config was given.
@@ -4776,7 +5362,7 @@ if test "${with_pkg_config+set}" = set; then
 else
   cf_pkg_config=yes
 fi;
-echo "$as_me:4779: result: $cf_pkg_config" >&5
+echo "$as_me:5365: result: $cf_pkg_config" >&5
 echo "${ECHO_T}$cf_pkg_config" >&6
 
 case $cf_pkg_config in
@@ -4788,7 +5374,7 @@ case $cf_pkg_config in
 if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
-echo "$as_me:4791: checking for $ac_word" >&5
+echo "$as_me:5377: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -4805,7 +5391,7 @@ for ac_dir in $ac_dummy; do
   test -z "$ac_dir" && ac_dir=.
   if $as_executable_p "$ac_dir/$ac_word"; then
    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
-   echo "$as_me:4808: found $ac_dir/$ac_word" >&5
+   echo "$as_me:5394: found $ac_dir/$ac_word" >&5
    break
 fi
 done
@@ -4816,10 +5402,10 @@ fi
 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
 
 if test -n "$PKG_CONFIG"; then
-  echo "$as_me:4819: result: $PKG_CONFIG" >&5
+  echo "$as_me:5405: result: $PKG_CONFIG" >&5
 echo "${ECHO_T}$PKG_CONFIG" >&6
 else
-  echo "$as_me:4822: result: no" >&5
+  echo "$as_me:5408: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -4828,7 +5414,7 @@ if test -z "$ac_cv_path_PKG_CONFIG"; then
   ac_pt_PKG_CONFIG=$PKG_CONFIG
   # Extract the first word of "pkg-config", so it can be a program name with args.
 set dummy pkg-config; ac_word=$2
-echo "$as_me:4831: checking for $ac_word" >&5
+echo "$as_me:5417: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -4845,7 +5431,7 @@ for ac_dir in $ac_dummy; do
   test -z "$ac_dir" && ac_dir=.
   if $as_executable_p "$ac_dir/$ac_word"; then
    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
-   echo "$as_me:4848: found $ac_dir/$ac_word" >&5
+   echo "$as_me:5434: found $ac_dir/$ac_word" >&5
    break
 fi
 done
@@ -4857,10 +5443,10 @@ fi
 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
 
 if test -n "$ac_pt_PKG_CONFIG"; then
-  echo "$as_me:4860: result: $ac_pt_PKG_CONFIG" >&5
+  echo "$as_me:5446: result: $ac_pt_PKG_CONFIG" >&5
 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
 else
-  echo "$as_me:4863: result: no" >&5
+  echo "$as_me:5449: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -4903,18 +5489,18 @@ case ".$PKG_CONFIG" in
        PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
        ;;
 (*)
-       { { echo "$as_me:4906: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
+       { { echo "$as_me:5492: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
    { (exit 1); exit 1; }; }
        ;;
 esac
 
 elif test "x$cf_pkg_config" != xno ; then
-       { echo "$as_me:4913: WARNING: pkg-config is not installed" >&5
+       { echo "$as_me:5499: WARNING: pkg-config is not installed" >&5
 echo "$as_me: WARNING: pkg-config is not installed" >&2;}
 fi
 
-echo "$as_me:4917: checking if you want to see long compiling messages" >&5
+echo "$as_me:5503: checking if you want to see long compiling messages" >&5
 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
 
 # Check whether --enable-echo or --disable-echo was given.
@@ -4948,10 +5534,10 @@ else
        ECHO_CC=''
 
 fi;
-echo "$as_me:4951: result: $enableval" >&5
+echo "$as_me:5537: result: $enableval" >&5
 echo "${ECHO_T}$enableval" >&6
 
-echo "$as_me:4954: checking for ncurses wrap-prefix" >&5
+echo "$as_me:5540: checking for ncurses wrap-prefix" >&5
 echo $ECHO_N "checking for ncurses wrap-prefix... $ECHO_C" >&6
 
 # Check whether --with-ncurses-wrap-prefix or --without-ncurses-wrap-prefix was given.
@@ -4961,10 +5547,10 @@ if test "${with_ncurses_wrap_prefix+set}" = set; then
 else
   NCURSES_WRAP_PREFIX=_nc_
 fi;
-echo "$as_me:4964: result: $NCURSES_WRAP_PREFIX" >&5
+echo "$as_me:5550: result: $NCURSES_WRAP_PREFIX" >&5
 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
 
-echo "$as_me:4967: checking if you want to check for wide-character functions" >&5
+echo "$as_me:5553: checking if you want to check for wide-character functions" >&5
 echo $ECHO_N "checking if you want to check for wide-character functions... $ECHO_C" >&6
 
 # Check whether --enable-widec or --disable-widec was given.
@@ -4981,10 +5567,10 @@ else
        cf_enable_widec=yes
 
 fi;
-echo "$as_me:4984: result: $cf_enable_widec" >&5
+echo "$as_me:5570: result: $cf_enable_widec" >&5
 echo "${ECHO_T}$cf_enable_widec" >&6
 
-echo "$as_me:4987: checking for specific curses-directory" >&5
+echo "$as_me:5573: checking for specific curses-directory" >&5
 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
 
 # Check whether --with-curses-dir or --without-curses-dir was given.
@@ -4994,7 +5580,7 @@ if test "${with_curses_dir+set}" = set; then
 else
   cf_cv_curses_dir=no
 fi;
-echo "$as_me:4997: result: $cf_cv_curses_dir" >&5
+echo "$as_me:5583: result: $cf_cv_curses_dir" >&5
 echo "${ECHO_T}$cf_cv_curses_dir" >&6
 
 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
@@ -5025,7 +5611,7 @@ case ".$withval" in
        withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
        ;;
 (*)
-       { { echo "$as_me:5028: error: expected a pathname, not \"$withval\"" >&5
+       { { echo "$as_me:5614: error: expected a pathname, not \"$withval\"" >&5
 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
    { (exit 1); exit 1; }; }
        ;;
@@ -5056,9 +5642,12 @@ if test -n "$cf_cv_curses_dir/include" ; then
                        if test "$GCC" = yes
                        then
                          cf_save_CPPFLAGS=$CPPFLAGS
-                         CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
+
+       test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
+       CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
+
                          cat >conftest.$ac_ext <<_ACEOF
-#line 5061 "configure"
+#line 5650 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 int
@@ -5070,16 +5659,16 @@ printf("Hello")
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:5073: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:5662: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:5076: \$? = $ac_status" >&5
+  echo "$as_me:5665: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:5079: \"$ac_try\"") >&5
+  { (eval echo "$as_me:5668: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:5082: \$? = $ac_status" >&5
+  echo "$as_me:5671: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   :
 else
@@ -5096,7 +5685,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext
                if test "$cf_have_incdir" = no ; then
                  test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
 
-echo "${as_me:-configure}:5099: testing adding $cf_add_incdir to include-path ..." 1>&5
+echo "${as_me:-configure}:5688: testing adding $cf_add_incdir to include-path ..." 1>&5
 
                  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
 
@@ -5132,7 +5721,7 @@ if test -n "$cf_cv_curses_dir/lib" ; then
                        if test "$cf_have_libdir" = no ; then
                                test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
 
-echo "${as_me:-configure}:5135: testing adding $cf_add_libdir to library-path ..." 1>&5
+echo "${as_me:-configure}:5724: testing adding $cf_add_libdir to library-path ..." 1>&5
 
                                LDFLAGS="-L$cf_add_libdir $LDFLAGS"
                        fi
@@ -5145,7 +5734,7 @@ fi
 
 cf_cv_screen=curses
 
-echo "$as_me:5148: checking for specified curses library type" >&5
+echo "$as_me:5737: checking for specified curses library type" >&5
 echo $ECHO_N "checking for specified curses library type... $ECHO_C" >&6
 
 # Check whether --with-screen or --without-screen was given.
@@ -5189,13 +5778,13 @@ fi;
 fi;
 fi;
 
-echo "$as_me:5192: result: $cf_cv_screen" >&5
+echo "$as_me:5781: result: $cf_cv_screen" >&5
 echo "${ECHO_T}$cf_cv_screen" >&6
 
 case $cf_cv_screen in
 (curses|curses_*)
 
-echo "$as_me:5198: checking for extra include directories" >&5
+echo "$as_me:5787: checking for extra include directories" >&5
 echo $ECHO_N "checking for extra include directories... $ECHO_C" >&6
 if test "${cf_cv_curses_incdir+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -5221,11 +5810,17 @@ case $host_os in
 esac
 
 fi
-echo "$as_me:5224: result: $cf_cv_curses_incdir" >&5
+echo "$as_me:5813: result: $cf_cv_curses_incdir" >&5
 echo "${ECHO_T}$cf_cv_curses_incdir" >&6
-test "$cf_cv_curses_incdir" != no && CPPFLAGS="$CPPFLAGS $cf_cv_curses_incdir"
+if test "$cf_cv_curses_incdir" != no
+then
+
+       test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
+       CPPFLAGS="${CPPFLAGS}$cf_cv_curses_incdir"
+
+fi
 
-echo "$as_me:5228: checking if we have identified curses headers" >&5
+echo "$as_me:5823: checking if we have identified curses headers" >&5
 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
 if test "${cf_cv_ncurses_header+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -5237,7 +5832,7 @@ for cf_header in \
        curses.h  ncurses/ncurses.h ncurses/curses.h
 do
 cat >conftest.$ac_ext <<_ACEOF
-#line 5240 "configure"
+#line 5835 "configure"
 #include "confdefs.h"
 #include <${cf_header}>
 int
@@ -5249,16 +5844,16 @@ initscr(); tgoto("?", 0,0)
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:5252: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:5847: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:5255: \$? = $ac_status" >&5
+  echo "$as_me:5850: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:5258: \"$ac_try\"") >&5
+  { (eval echo "$as_me:5853: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:5261: \$? = $ac_status" >&5
+  echo "$as_me:5856: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_ncurses_header=$cf_header; break
 else
@@ -5269,11 +5864,11 @@ rm -f conftest.$ac_objext conftest.$ac_ext
 done
 
 fi
-echo "$as_me:5272: result: $cf_cv_ncurses_header" >&5
+echo "$as_me:5867: result: $cf_cv_ncurses_header" >&5
 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
 
 if test "$cf_cv_ncurses_header" = none ; then
-       { { echo "$as_me:5276: error: No curses header-files found" >&5
+       { { echo "$as_me:5871: error: No curses header-files found" >&5
 echo "$as_me: error: No curses header-files found" >&2;}
    { (exit 1); exit 1; }; }
 fi
@@ -5283,23 +5878,23 @@ fi
 for ac_header in $cf_cv_ncurses_header
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-echo "$as_me:5286: checking for $ac_header" >&5
+echo "$as_me:5881: checking for $ac_header" >&5
 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
 if eval "test \"\${$as_ac_Header+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 5292 "configure"
+#line 5887 "configure"
 #include "confdefs.h"
 #include <$ac_header>
 _ACEOF
-if { (eval echo "$as_me:5296: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:5891: \"$ac_cpp conftest.$ac_ext\"") >&5
   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
   ac_status=$?
   egrep -v '^ *\+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:5302: \$? = $ac_status" >&5
+  echo "$as_me:5897: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
@@ -5318,7 +5913,7 @@ else
 fi
 rm -f conftest.err conftest.$ac_ext
 fi
-echo "$as_me:5321: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "$as_me:5916: result: `eval echo '${'$as_ac_Header'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
 if test `eval echo '${'$as_ac_Header'}'` = yes; then
   cat >>confdefs.h <<EOF
@@ -5328,7 +5923,7 @@ EOF
 fi
 done
 
-echo "$as_me:5331: checking for terminfo header" >&5
+echo "$as_me:5926: checking for terminfo header" >&5
 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
 if test "${cf_cv_term_header+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -5346,7 +5941,7 @@ esac
 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
 do
 cat >conftest.$ac_ext <<_ACEOF
-#line 5349 "configure"
+#line 5944 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 #include <${cf_cv_ncurses_header:-curses.h}>
@@ -5361,16 +5956,16 @@ int x = auto_left_margin
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:5364: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:5959: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:5367: \$? = $ac_status" >&5
+  echo "$as_me:5962: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:5370: \"$ac_try\"") >&5
+  { (eval echo "$as_me:5965: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:5373: \$? = $ac_status" >&5
+  echo "$as_me:5968: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
        cf_cv_term_header="$cf_test"
@@ -5386,7 +5981,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext
 done
 
 fi
-echo "$as_me:5389: result: $cf_cv_term_header" >&5
+echo "$as_me:5984: result: $cf_cv_term_header" >&5
 echo "${ECHO_T}$cf_cv_term_header" >&6
 
 # Set definitions to allow ifdef'ing to accommodate subdirectories
@@ -5418,7 +6013,7 @@ EOF
        ;;
 esac
 
-echo "$as_me:5421: checking for ncurses version" >&5
+echo "$as_me:6016: checking for ncurses version" >&5
 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
 if test "${cf_cv_ncurses_version+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -5444,10 +6039,10 @@ Autoconf "old"
 #endif
 EOF
        cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
-       { (eval echo "$as_me:5447: \"$cf_try\"") >&5
+       { (eval echo "$as_me:6042: \"$cf_try\"") >&5
   (eval $cf_try) 2>&5
   ac_status=$?
-  echo "$as_me:5450: \$? = $ac_status" >&5
+  echo "$as_me:6045: \$? = $ac_status" >&5
   (exit $ac_status); }
        if test -f conftest.out ; then
                cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
@@ -5457,7 +6052,7 @@ EOF
 
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 5460 "configure"
+#line 6055 "configure"
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header:-curses.h}>
@@ -5482,15 +6077,15 @@ int main(void)
 }
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:5485: \"$ac_link\"") >&5
+if { (eval echo "$as_me:6080: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:5488: \$? = $ac_status" >&5
+  echo "$as_me:6083: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:5490: \"$ac_try\"") >&5
+  { (eval echo "$as_me:6085: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:5493: \$? = $ac_status" >&5
+  echo "$as_me:6088: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
        cf_cv_ncurses_version=`cat $cf_tempfile`
@@ -5504,17 +6099,17 @@ fi
        rm -f $cf_tempfile
 
 fi
-echo "$as_me:5507: result: $cf_cv_ncurses_version" >&5
+echo "$as_me:6102: result: $cf_cv_ncurses_version" >&5
 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
 test "$cf_cv_ncurses_version" = no ||
 cat >>confdefs.h <<\EOF
 #define NCURSES 1
 EOF
 
-echo "$as_me:5514: checking if we have identified curses libraries" >&5
+echo "$as_me:6109: checking if we have identified curses libraries" >&5
 echo $ECHO_N "checking if we have identified curses libraries... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
-#line 5517 "configure"
+#line 6112 "configure"
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header:-curses.h}>
 int
@@ -5526,16 +6121,16 @@ initscr(); tgoto("?", 0,0)
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:5529: \"$ac_link\"") >&5
+if { (eval echo "$as_me:6124: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:5532: \$? = $ac_status" >&5
+  echo "$as_me:6127: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:5535: \"$ac_try\"") >&5
+  { (eval echo "$as_me:6130: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:5538: \$? = $ac_status" >&5
+  echo "$as_me:6133: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_result=yes
 else
@@ -5544,13 +6139,13 @@ cat conftest.$ac_ext >&5
 cf_result=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-echo "$as_me:5547: result: $cf_result" >&5
+echo "$as_me:6142: result: $cf_result" >&5
 echo "${ECHO_T}$cf_result" >&6
 
 if test "$cf_result" = no ; then
 case $host_os in
 (freebsd*)
-       echo "$as_me:5553: checking for tgoto in -lmytinfo" >&5
+       echo "$as_me:6148: checking for tgoto in -lmytinfo" >&5
 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -5558,7 +6153,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lmytinfo  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 5561 "configure"
+#line 6156 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -5577,16 +6172,16 @@ tgoto ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:5580: \"$ac_link\"") >&5
+if { (eval echo "$as_me:6175: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:5583: \$? = $ac_status" >&5
+  echo "$as_me:6178: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:5586: \"$ac_try\"") >&5
+  { (eval echo "$as_me:6181: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:5589: \$? = $ac_status" >&5
+  echo "$as_me:6184: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_mytinfo_tgoto=yes
 else
@@ -5597,7 +6192,7 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:5600: result: $ac_cv_lib_mytinfo_tgoto" >&5
+echo "$as_me:6195: result: $ac_cv_lib_mytinfo_tgoto" >&5
 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
 if test $ac_cv_lib_mytinfo_tgoto = yes; then
 
@@ -5627,7 +6222,7 @@ fi
        # term.h) for cur_colr
        if test "x$cf_cv_screen" = "xcurses_colr"
        then
-               echo "$as_me:5630: checking for initscr in -lcur_colr" >&5
+               echo "$as_me:6225: checking for initscr in -lcur_colr" >&5
 echo $ECHO_N "checking for initscr in -lcur_colr... $ECHO_C" >&6
 if test "${ac_cv_lib_cur_colr_initscr+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -5635,7 +6230,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lcur_colr  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 5638 "configure"
+#line 6233 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -5654,16 +6249,16 @@ initscr ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:5657: \"$ac_link\"") >&5
+if { (eval echo "$as_me:6252: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:5660: \$? = $ac_status" >&5
+  echo "$as_me:6255: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:5663: \"$ac_try\"") >&5
+  { (eval echo "$as_me:6258: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:5666: \$? = $ac_status" >&5
+  echo "$as_me:6261: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_cur_colr_initscr=yes
 else
@@ -5674,7 +6269,7 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:5677: result: $ac_cv_lib_cur_colr_initscr" >&5
+echo "$as_me:6272: result: $ac_cv_lib_cur_colr_initscr" >&5
 echo "${ECHO_T}$ac_cv_lib_cur_colr_initscr" >&6
 if test $ac_cv_lib_cur_colr_initscr = yes; then
 
@@ -5698,7 +6293,7 @@ LIBS="$cf_add_libs"
 
 else
 
-               echo "$as_me:5701: checking for initscr in -lHcurses" >&5
+               echo "$as_me:6296: checking for initscr in -lHcurses" >&5
 echo $ECHO_N "checking for initscr in -lHcurses... $ECHO_C" >&6
 if test "${ac_cv_lib_Hcurses_initscr+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -5706,7 +6301,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lHcurses  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 5709 "configure"
+#line 6304 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -5725,16 +6320,16 @@ initscr ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:5728: \"$ac_link\"") >&5
+if { (eval echo "$as_me:6323: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:5731: \$? = $ac_status" >&5
+  echo "$as_me:6326: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:5734: \"$ac_try\"") >&5
+  { (eval echo "$as_me:6329: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:5737: \$? = $ac_status" >&5
+  echo "$as_me:6332: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_Hcurses_initscr=yes
 else
@@ -5745,7 +6340,7 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:5748: result: $ac_cv_lib_Hcurses_initscr" >&5
+echo "$as_me:6343: result: $ac_cv_lib_Hcurses_initscr" >&5
 echo "${ECHO_T}$ac_cv_lib_Hcurses_initscr" >&6
 if test $ac_cv_lib_Hcurses_initscr = yes; then
 
@@ -5767,7 +6362,9 @@ do
 done
 LIBS="$cf_add_libs"
 
-                       CPPFLAGS="$CPPFLAGS -D__HP_CURSES -D_HP_CURSES"
+       test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
+       CPPFLAGS="${CPPFLAGS}-D__HP_CURSES -D_HP_CURSES"
+
                        ac_cv_func_initscr=yes
 
 fi
@@ -5801,7 +6398,7 @@ if test -n "/lib64" ; then
                        if test "$cf_have_libdir" = no ; then
                                test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
 
-echo "${as_me:-configure}:5804: testing adding $cf_add_libdir to library-path ..." 1>&5
+echo "${as_me:-configure}:6401: testing adding $cf_add_libdir to library-path ..." 1>&5
 
                                LDFLAGS="-L$cf_add_libdir $LDFLAGS"
                        fi
@@ -5830,7 +6427,7 @@ if test -n "/lib" ; then
                        if test "$cf_have_libdir" = no ; then
                                test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
 
-echo "${as_me:-configure}:5833: testing adding $cf_add_libdir to library-path ..." 1>&5
+echo "${as_me:-configure}:6430: testing adding $cf_add_libdir to library-path ..." 1>&5
 
                                LDFLAGS="-L$cf_add_libdir $LDFLAGS"
                        fi
@@ -5861,7 +6458,7 @@ if test -n "/lib" ; then
                        if test "$cf_have_libdir" = no ; then
                                test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
 
-echo "${as_me:-configure}:5864: testing adding $cf_add_libdir to library-path ..." 1>&5
+echo "${as_me:-configure}:6461: testing adding $cf_add_libdir to library-path ..." 1>&5
 
                                LDFLAGS="-L$cf_add_libdir $LDFLAGS"
                        fi
@@ -5896,7 +6493,7 @@ if test -n "/usr/5lib" ; then
                        if test "$cf_have_libdir" = no ; then
                                test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
 
-echo "${as_me:-configure}:5899: testing adding $cf_add_libdir to library-path ..." 1>&5
+echo "${as_me:-configure}:6496: testing adding $cf_add_libdir to library-path ..." 1>&5
 
                                LDFLAGS="-L$cf_add_libdir $LDFLAGS"
                        fi
@@ -5940,13 +6537,13 @@ if test ".$ac_cv_func_initscr" != .yes ; then
        # because it may be needed to link the test-case for initscr.
        if test "x$cf_term_lib" = x
        then
-               echo "$as_me:5943: checking for tgoto" >&5
+               echo "$as_me:6540: checking for tgoto" >&5
 echo $ECHO_N "checking for tgoto... $ECHO_C" >&6
 if test "${ac_cv_func_tgoto+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 5949 "configure"
+#line 6546 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char tgoto (); below.  */
@@ -5977,16 +6574,16 @@ f = tgoto; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:5980: \"$ac_link\"") >&5
+if { (eval echo "$as_me:6577: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:5983: \$? = $ac_status" >&5
+  echo "$as_me:6580: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:5986: \"$ac_try\"") >&5
+  { (eval echo "$as_me:6583: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:5989: \$? = $ac_status" >&5
+  echo "$as_me:6586: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_func_tgoto=yes
 else
@@ -5996,7 +6593,7 @@ ac_cv_func_tgoto=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:5999: result: $ac_cv_func_tgoto" >&5
+echo "$as_me:6596: result: $ac_cv_func_tgoto" >&5
 echo "${ECHO_T}$ac_cv_func_tgoto" >&6
 if test $ac_cv_func_tgoto = yes; then
   cf_term_lib=predefined
@@ -6005,7 +6602,7 @@ else
                        for cf_term_lib in $cf_check_list otermcap termcap tinfo termlib unknown
                        do
                                as_ac_Lib=`echo "ac_cv_lib_$cf_term_lib''_tgoto" | $as_tr_sh`
-echo "$as_me:6008: checking for tgoto in -l$cf_term_lib" >&5
+echo "$as_me:6605: checking for tgoto in -l$cf_term_lib" >&5
 echo $ECHO_N "checking for tgoto in -l$cf_term_lib... $ECHO_C" >&6
 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -6013,7 +6610,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-l$cf_term_lib  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 6016 "configure"
+#line 6613 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -6032,16 +6629,16 @@ tgoto ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:6035: \"$ac_link\"") >&5
+if { (eval echo "$as_me:6632: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:6038: \$? = $ac_status" >&5
+  echo "$as_me:6635: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:6041: \"$ac_try\"") >&5
+  { (eval echo "$as_me:6638: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:6044: \$? = $ac_status" >&5
+  echo "$as_me:6641: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   eval "$as_ac_Lib=yes"
 else
@@ -6052,10 +6649,13 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:6055: result: `eval echo '${'$as_ac_Lib'}'`" >&5
+echo "$as_me:6652: result: `eval echo '${'$as_ac_Lib'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
-  break
+
+                                       : ${cf_nculib_root:=$cf_term_lib}
+                                       break
+
 fi
 
                        done
@@ -6072,10 +6672,10 @@ fi
                do
                        LIBS="-l$cf_curs_lib $cf_save_LIBS"
                        if test "$cf_term_lib" = unknown || test "$cf_term_lib" = "$cf_curs_lib" ; then
-                               echo "$as_me:6075: checking if we can link with $cf_curs_lib library" >&5
+                               echo "$as_me:6675: checking if we can link with $cf_curs_lib library" >&5
 echo $ECHO_N "checking if we can link with $cf_curs_lib library... $ECHO_C" >&6
                                cat >conftest.$ac_ext <<_ACEOF
-#line 6078 "configure"
+#line 6678 "configure"
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header:-curses.h}>
 int
@@ -6087,16 +6687,16 @@ initscr()
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:6090: \"$ac_link\"") >&5
+if { (eval echo "$as_me:6690: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:6093: \$? = $ac_status" >&5
+  echo "$as_me:6693: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:6096: \"$ac_try\"") >&5
+  { (eval echo "$as_me:6696: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:6099: \$? = $ac_status" >&5
+  echo "$as_me:6699: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_result=yes
 else
@@ -6105,16 +6705,16 @@ cat conftest.$ac_ext >&5
 cf_result=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-                               echo "$as_me:6108: result: $cf_result" >&5
+                               echo "$as_me:6708: result: $cf_result" >&5
 echo "${ECHO_T}$cf_result" >&6
                                test $cf_result = yes && break
                        elif test "$cf_curs_lib" = "$cf_term_lib" ; then
                                cf_result=no
                        elif test "$cf_term_lib" != predefined ; then
-                               echo "$as_me:6114: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
+                               echo "$as_me:6714: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
 echo $ECHO_N "checking if we need both $cf_curs_lib and $cf_term_lib libraries... $ECHO_C" >&6
                                cat >conftest.$ac_ext <<_ACEOF
-#line 6117 "configure"
+#line 6717 "configure"
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header:-curses.h}>
 int
@@ -6126,16 +6726,16 @@ initscr(); tgoto((char *)0, 0, 0);
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:6129: \"$ac_link\"") >&5
+if { (eval echo "$as_me:6729: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:6132: \$? = $ac_status" >&5
+  echo "$as_me:6732: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:6135: \"$ac_try\"") >&5
+  { (eval echo "$as_me:6735: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:6138: \$? = $ac_status" >&5
+  echo "$as_me:6738: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_result=no
 else
@@ -6144,7 +6744,7 @@ cat conftest.$ac_ext >&5
 
                                        LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
                                        cat >conftest.$ac_ext <<_ACEOF
-#line 6147 "configure"
+#line 6747 "configure"
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header:-curses.h}>
 int
@@ -6156,16 +6756,16 @@ initscr()
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:6159: \"$ac_link\"") >&5
+if { (eval echo "$as_me:6759: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:6162: \$? = $ac_status" >&5
+  echo "$as_me:6762: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:6165: \"$ac_try\"") >&5
+  { (eval echo "$as_me:6765: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:6168: \$? = $ac_status" >&5
+  echo "$as_me:6768: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_result=yes
 else
@@ -6177,13 +6777,13 @@ rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-                               echo "$as_me:6180: result: $cf_result" >&5
+                               echo "$as_me:6780: result: $cf_result" >&5
 echo "${ECHO_T}$cf_result" >&6
                                test $cf_result != error && break
                        fi
                done
        fi
-       test $cf_curs_lib = unknown && { { echo "$as_me:6186: error: no curses library found" >&5
+       test $cf_curs_lib = unknown && { { echo "$as_me:6786: error: no curses library found" >&5
 echo "$as_me: error: no curses library found" >&2;}
    { (exit 1); exit 1; }; }
 fi
@@ -6192,7 +6792,7 @@ fi
        ;;
 (ncursesw*)
 
-echo "$as_me:6195: checking for multibyte character support" >&5
+echo "$as_me:6795: checking for multibyte character support" >&5
 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
 if test "${cf_cv_utf8_lib+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -6200,7 +6800,7 @@ else
 
        cf_save_LIBS="$LIBS"
        cat >conftest.$ac_ext <<_ACEOF
-#line 6203 "configure"
+#line 6803 "configure"
 #include "confdefs.h"
 
 #include <stdlib.h>
@@ -6213,16 +6813,16 @@ putwc(0,0);
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:6216: \"$ac_link\"") >&5
+if { (eval echo "$as_me:6816: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:6219: \$? = $ac_status" >&5
+  echo "$as_me:6819: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:6222: \"$ac_try\"") >&5
+  { (eval echo "$as_me:6822: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:6225: \$? = $ac_status" >&5
+  echo "$as_me:6825: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_utf8_lib=yes
 else
@@ -6234,12 +6834,12 @@ cat conftest.$ac_ext >&5
 cf_cv_header_path_utf8=
 cf_cv_library_path_utf8=
 
-echo "${as_me:-configure}:6237: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
+echo "${as_me:-configure}:6837: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
 
 cf_save_LIBS="$LIBS"
 
 cat >conftest.$ac_ext <<_ACEOF
-#line 6242 "configure"
+#line 6842 "configure"
 #include "confdefs.h"
 
 #include <libutf8.h>
@@ -6252,16 +6852,16 @@ putwc(0,0);
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:6255: \"$ac_link\"") >&5
+if { (eval echo "$as_me:6855: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:6258: \$? = $ac_status" >&5
+  echo "$as_me:6858: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:6261: \"$ac_try\"") >&5
+  { (eval echo "$as_me:6861: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:6264: \$? = $ac_status" >&5
+  echo "$as_me:6864: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
        cf_cv_find_linkage_utf8=yes
@@ -6275,7 +6875,7 @@ cat conftest.$ac_ext >&5
 LIBS="-lutf8  $cf_save_LIBS"
 
 cat >conftest.$ac_ext <<_ACEOF
-#line 6278 "configure"
+#line 6878 "configure"
 #include "confdefs.h"
 
 #include <libutf8.h>
@@ -6288,16 +6888,16 @@ putwc(0,0);
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:6291: \"$ac_link\"") >&5
+if { (eval echo "$as_me:6891: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:6294: \$? = $ac_status" >&5
+  echo "$as_me:6894: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:6297: \"$ac_try\"") >&5
+  { (eval echo "$as_me:6897: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:6300: \$? = $ac_status" >&5
+  echo "$as_me:6900: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
        cf_cv_find_linkage_utf8=yes
@@ -6314,9 +6914,9 @@ cat conftest.$ac_ext >&5
 
        test -n "$verbose" && echo "    find linkage for utf8 library" 1>&6
 
-echo "${as_me:-configure}:6317: testing find linkage for utf8 library ..." 1>&5
+echo "${as_me:-configure}:6917: testing find linkage for utf8 library ..." 1>&5
 
-echo "${as_me:-configure}:6319: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
+echo "${as_me:-configure}:6919: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
 
        cf_save_CPPFLAGS="$CPPFLAGS"
        cf_test_CPPFLAGS="$CPPFLAGS"
@@ -6407,11 +7007,15 @@ cf_search="$cf_search $cf_header_path_list"
                if test -d $cf_cv_header_path_utf8 ; then
                        test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
 
-echo "${as_me:-configure}:6410: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
+echo "${as_me:-configure}:7010: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
+
+                       CPPFLAGS="$cf_save_CPPFLAGS"
+
+       test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
+       CPPFLAGS="${CPPFLAGS}-I$cf_cv_header_path_utf8"
 
-                       CPPFLAGS="$cf_save_CPPFLAGS -I$cf_cv_header_path_utf8"
                        cat >conftest.$ac_ext <<_ACEOF
-#line 6414 "configure"
+#line 7018 "configure"
 #include "confdefs.h"
 
 #include <libutf8.h>
@@ -6424,21 +7028,21 @@ putwc(0,0);
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:6427: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:7031: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:6430: \$? = $ac_status" >&5
+  echo "$as_me:7034: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:6433: \"$ac_try\"") >&5
+  { (eval echo "$as_me:7037: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:6436: \$? = $ac_status" >&5
+  echo "$as_me:7040: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
                                test -n "$verbose" && echo "    ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
 
-echo "${as_me:-configure}:6441: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
+echo "${as_me:-configure}:7045: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
 
                                cf_cv_find_linkage_utf8=maybe
                                cf_test_CPPFLAGS="$CPPFLAGS"
@@ -6456,7 +7060,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext
 
        if test "$cf_cv_find_linkage_utf8" = maybe ; then
 
-echo "${as_me:-configure}:6459: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
+echo "${as_me:-configure}:7063: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
 
                cf_save_LIBS="$LIBS"
                cf_save_LDFLAGS="$LDFLAGS"
@@ -6531,13 +7135,13 @@ cf_search="$cf_library_path_list $cf_search"
                                if test -d $cf_cv_library_path_utf8 ; then
                                        test -n "$verbose" && echo "    ... testing $cf_cv_library_path_utf8" 1>&6
 
-echo "${as_me:-configure}:6534: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
+echo "${as_me:-configure}:7138: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
 
                                        CPPFLAGS="$cf_test_CPPFLAGS"
                                        LIBS="-lutf8  $cf_save_LIBS"
                                        LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
                                        cat >conftest.$ac_ext <<_ACEOF
-#line 6540 "configure"
+#line 7144 "configure"
 #include "confdefs.h"
 
 #include <libutf8.h>
@@ -6550,21 +7154,21 @@ putwc(0,0);
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:6553: \"$ac_link\"") >&5
+if { (eval echo "$as_me:7157: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:6556: \$? = $ac_status" >&5
+  echo "$as_me:7160: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:6559: \"$ac_try\"") >&5
+  { (eval echo "$as_me:7163: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:6562: \$? = $ac_status" >&5
+  echo "$as_me:7166: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
                                        test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
 
-echo "${as_me:-configure}:6567: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
+echo "${as_me:-configure}:7171: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
 
                                        cf_cv_find_linkage_utf8=yes
                                        cf_cv_library_file_utf8="-lutf8"
@@ -6606,7 +7210,7 @@ fi
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:6609: result: $cf_cv_utf8_lib" >&5
+echo "$as_me:7213: result: $cf_cv_utf8_lib" >&5
 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
 
 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
@@ -6639,9 +7243,12 @@ if test -n "$cf_cv_header_path_utf8" ; then
                        if test "$GCC" = yes
                        then
                          cf_save_CPPFLAGS=$CPPFLAGS
-                         CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
+
+       test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
+       CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
+
                          cat >conftest.$ac_ext <<_ACEOF
-#line 6644 "configure"
+#line 7251 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 int
@@ -6653,16 +7260,16 @@ printf("Hello")
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:6656: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:7263: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:6659: \$? = $ac_status" >&5
+  echo "$as_me:7266: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:6662: \"$ac_try\"") >&5
+  { (eval echo "$as_me:7269: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:6665: \$? = $ac_status" >&5
+  echo "$as_me:7272: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   :
 else
@@ -6679,7 +7286,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext
                if test "$cf_have_incdir" = no ; then
                  test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
 
-echo "${as_me:-configure}:6682: testing adding $cf_add_incdir to include-path ..." 1>&5
+echo "${as_me:-configure}:7289: testing adding $cf_add_incdir to include-path ..." 1>&5
 
                  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
 
@@ -6715,7 +7322,7 @@ if test -n "$cf_cv_library_path_utf8" ; then
                        if test "$cf_have_libdir" = no ; then
                                test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
 
-echo "${as_me:-configure}:6718: testing adding $cf_add_libdir to library-path ..." 1>&5
+echo "${as_me:-configure}:7325: testing adding $cf_add_libdir to library-path ..." 1>&5
 
                                LDFLAGS="-L$cf_add_libdir $LDFLAGS"
                        fi
@@ -6745,20 +7352,116 @@ cf_ncuconfig_root=$cf_cv_screen
 cf_have_ncuconfig=no
 
 if test "x${PKG_CONFIG:=none}" != xnone; then
-       echo "$as_me:6748: checking pkg-config for $cf_ncuconfig_root" >&5
+       echo "$as_me:7355: checking pkg-config for $cf_ncuconfig_root" >&5
 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
        if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
-               echo "$as_me:6751: result: yes" >&5
+               echo "$as_me:7358: result: yes" >&5
 echo "${ECHO_T}yes" >&6
 
-               echo "$as_me:6754: checking if the $cf_ncuconfig_root package files work" >&5
+               echo "$as_me:7361: checking if the $cf_ncuconfig_root package files work" >&5
 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
                cf_have_ncuconfig=unknown
 
                cf_save_CPPFLAGS="$CPPFLAGS"
                cf_save_LIBS="$LIBS"
 
-               CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags $cf_ncuconfig_root`"
+cf_fix_cppflags=no
+cf_new_cflags=
+cf_new_cppflags=
+cf_new_extra_cppflags=
+
+for cf_add_cflags in `$PKG_CONFIG --cflags $cf_ncuconfig_root`
+do
+case $cf_fix_cppflags in
+(no)
+       case $cf_add_cflags in
+       (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
+               case $cf_add_cflags in
+               (-D*)
+                       cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
+
+                       test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
+                               && test -z "${cf_tst_cflags}" \
+                               && cf_fix_cppflags=yes
+
+                       if test $cf_fix_cppflags = yes ; then
+
+       test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+       cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
+                               continue
+                       elif test "${cf_tst_cflags}" = "\"'" ; then
+
+       test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+       cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
+                               continue
+                       fi
+                       ;;
+               esac
+               case "$CPPFLAGS" in
+               (*$cf_add_cflags)
+                       ;;
+               (*)
+                       case $cf_add_cflags in
+                       (-D*)
+                               cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
+
+CPPFLAGS=`echo "$CPPFLAGS" | \
+       sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
+               -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
+
+                               ;;
+                       esac
+
+       test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
+       cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
+
+                       ;;
+               esac
+               ;;
+       (*)
+
+       test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
+       cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
+
+               ;;
+       esac
+       ;;
+(yes)
+
+       test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+       cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
+       cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
+
+       test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
+               && test -z "${cf_tst_cflags}" \
+               && cf_fix_cppflags=no
+       ;;
+esac
+done
+
+if test -n "$cf_new_cflags" ; then
+
+       test -n "$CFLAGS" && CFLAGS="$CFLAGS "
+       CFLAGS="${CFLAGS}$cf_new_cflags"
+
+fi
+
+if test -n "$cf_new_cppflags" ; then
+
+       test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
+       CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
+
+fi
+
+if test -n "$cf_new_extra_cppflags" ; then
+
+       test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
+       EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
+
+fi
 
 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
 # Filter out duplicates - this happens with badly-designed ".pc" files...
@@ -6777,7 +7480,7 @@ done
 LIBS="$cf_add_libs"
 
                cat >conftest.$ac_ext <<_ACEOF
-#line 6780 "configure"
+#line 7483 "configure"
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header:-curses.h}>
 int
@@ -6789,37 +7492,37 @@ initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:6792: \"$ac_link\"") >&5
+if { (eval echo "$as_me:7495: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:6795: \$? = $ac_status" >&5
+  echo "$as_me:7498: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:6798: \"$ac_try\"") >&5
+  { (eval echo "$as_me:7501: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:6801: \$? = $ac_status" >&5
+  echo "$as_me:7504: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   if test "$cross_compiling" = yes; then
   cf_have_ncuconfig=maybe
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 6807 "configure"
+#line 7510 "configure"
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header:-curses.h}>
                                int main(void)
                                { char *xx = curses_version(); return (xx == 0); }
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:6814: \"$ac_link\"") >&5
+if { (eval echo "$as_me:7517: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:6817: \$? = $ac_status" >&5
+  echo "$as_me:7520: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:6819: \"$ac_try\"") >&5
+  { (eval echo "$as_me:7522: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:6822: \$? = $ac_status" >&5
+  echo "$as_me:7525: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_have_ncuconfig=yes
 else
@@ -6836,7 +7539,7 @@ cat conftest.$ac_ext >&5
 cf_have_ncuconfig=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-               echo "$as_me:6839: result: $cf_have_ncuconfig" >&5
+               echo "$as_me:7542: result: $cf_have_ncuconfig" >&5
 echo "${ECHO_T}$cf_have_ncuconfig" >&6
                test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
                if test "$cf_have_ncuconfig" != "yes"
@@ -6851,9 +7554,8 @@ cat >>confdefs.h <<\EOF
 EOF
 
                        NCURSES_CONFIG_PKG=$cf_ncuconfig_root
-               fi
 
-echo "$as_me:6856: checking for terminfo header" >&5
+echo "$as_me:7558: checking for terminfo header" >&5
 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
 if test "${cf_cv_term_header+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -6871,7 +7573,7 @@ esac
 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
 do
 cat >conftest.$ac_ext <<_ACEOF
-#line 6874 "configure"
+#line 7576 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 #include <${cf_cv_ncurses_header:-curses.h}>
@@ -6886,16 +7588,16 @@ int x = auto_left_margin
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:6889: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:7591: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:6892: \$? = $ac_status" >&5
+  echo "$as_me:7594: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:6895: \"$ac_try\"") >&5
+  { (eval echo "$as_me:7597: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:6898: \$? = $ac_status" >&5
+  echo "$as_me:7600: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
        cf_cv_term_header="$cf_test"
@@ -6911,7 +7613,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext
 done
 
 fi
-echo "$as_me:6914: result: $cf_cv_term_header" >&5
+echo "$as_me:7616: result: $cf_cv_term_header" >&5
 echo "${ECHO_T}$cf_cv_term_header" >&6
 
 # Set definitions to allow ifdef'ing to accommodate subdirectories
@@ -6943,8 +7645,10 @@ EOF
        ;;
 esac
 
+               fi
+
        else
-               echo "$as_me:6947: result: no" >&5
+               echo "$as_me:7651: result: no" >&5
 echo "${ECHO_T}no" >&6
                NCURSES_CONFIG_PKG=none
        fi
@@ -6953,14 +7657,14 @@ else
 fi
 
 if test "x$cf_have_ncuconfig" = "xno"; then
-       echo "Looking for ${cf_ncuconfig_root}-config"
+       cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
 
 if test -n "$ac_tool_prefix"; then
-  for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
+  for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
   do
     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-echo "$as_me:6963: checking for $ac_word" >&5
+echo "$as_me:7667: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -6975,7 +7679,7 @@ for ac_dir in $ac_dummy; do
   test -z "$ac_dir" && ac_dir=.
   $as_executable_p "$ac_dir/$ac_word" || continue
 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
-echo "$as_me:6978: found $ac_dir/$ac_word" >&5
+echo "$as_me:7682: found $ac_dir/$ac_word" >&5
 break
 done
 
@@ -6983,10 +7687,10 @@ fi
 fi
 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
 if test -n "$NCURSES_CONFIG"; then
-  echo "$as_me:6986: result: $NCURSES_CONFIG" >&5
+  echo "$as_me:7690: result: $NCURSES_CONFIG" >&5
 echo "${ECHO_T}$NCURSES_CONFIG" >&6
 else
-  echo "$as_me:6989: result: no" >&5
+  echo "$as_me:7693: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -6995,11 +7699,11 @@ fi
 fi
 if test -z "$NCURSES_CONFIG"; then
   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
-  for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
+  for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-echo "$as_me:7002: checking for $ac_word" >&5
+echo "$as_me:7706: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -7014,7 +7718,7 @@ for ac_dir in $ac_dummy; do
   test -z "$ac_dir" && ac_dir=.
   $as_executable_p "$ac_dir/$ac_word" || continue
 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
-echo "$as_me:7017: found $ac_dir/$ac_word" >&5
+echo "$as_me:7721: found $ac_dir/$ac_word" >&5
 break
 done
 
@@ -7022,10 +7726,10 @@ fi
 fi
 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
 if test -n "$ac_ct_NCURSES_CONFIG"; then
-  echo "$as_me:7025: result: $ac_ct_NCURSES_CONFIG" >&5
+  echo "$as_me:7729: result: $ac_ct_NCURSES_CONFIG" >&5
 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
 else
-  echo "$as_me:7028: result: no" >&5
+  echo "$as_me:7732: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
 
        if test "$NCURSES_CONFIG" != none ; then
 
-               CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
+cf_fix_cppflags=no
+cf_new_cflags=
+cf_new_cppflags=
+cf_new_extra_cppflags=
 
-cf_add_libs="`$NCURSES_CONFIG --libs`"
-# Filter out duplicates - this happens with badly-designed ".pc" files...
-for cf_add_1lib in $LIBS
+for cf_add_cflags in `$NCURSES_CONFIG --cflags`
 do
-       for cf_add_2lib in $cf_add_libs
+case $cf_fix_cppflags in
+(no)
+       case $cf_add_cflags in
+       (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
+               case $cf_add_cflags in
+               (-D*)
+                       cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
+
+                       test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
+                               && test -z "${cf_tst_cflags}" \
+                               && cf_fix_cppflags=yes
+
+                       if test $cf_fix_cppflags = yes ; then
+
+       test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+       cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
+                               continue
+                       elif test "${cf_tst_cflags}" = "\"'" ; then
+
+       test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+       cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
+                               continue
+                       fi
+                       ;;
+               esac
+               case "$CPPFLAGS" in
+               (*$cf_add_cflags)
+                       ;;
+               (*)
+                       case $cf_add_cflags in
+                       (-D*)
+                               cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
+
+CPPFLAGS=`echo "$CPPFLAGS" | \
+       sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
+               -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
+
+                               ;;
+                       esac
+
+       test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
+       cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
+
+                       ;;
+               esac
+               ;;
+       (*)
+
+       test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
+       cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
+
+               ;;
+       esac
+       ;;
+(yes)
+
+       test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+       cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
+       cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
+
+       test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
+               && test -z "${cf_tst_cflags}" \
+               && cf_fix_cppflags=no
+       ;;
+esac
+done
+
+if test -n "$cf_new_cflags" ; then
+
+       test -n "$CFLAGS" && CFLAGS="$CFLAGS "
+       CFLAGS="${CFLAGS}$cf_new_cflags"
+
+fi
+
+if test -n "$cf_new_cppflags" ; then
+
+       test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
+       CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
+
+fi
+
+if test -n "$cf_new_extra_cppflags" ; then
+
+       test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
+       EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
+
+fi
+
+cf_add_libs="`$NCURSES_CONFIG --libs`"
+# Filter out duplicates - this happens with badly-designed ".pc" files...
+for cf_add_1lib in $LIBS
+do
+       for cf_add_2lib in $cf_add_libs
        do
                if test "x$cf_add_1lib" = "x$cf_add_2lib"
                then
@@ -7058,7 +7858,7 @@ LIBS="$cf_add_libs"
 
                # even with config script, some packages use no-override for curses.h
 
-echo "$as_me:7061: checking if we have identified curses headers" >&5
+echo "$as_me:7861: checking if we have identified curses headers" >&5
 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
 if test "${cf_cv_ncurses_header+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -7070,7 +7870,7 @@ for cf_header in \
        curses.h $cf_cv_screen/curses.h
 do
 cat >conftest.$ac_ext <<_ACEOF
-#line 7073 "configure"
+#line 7873 "configure"
 #include "confdefs.h"
 #include <${cf_header}>
 int
@@ -7082,16 +7882,16 @@ initscr(); tgoto("?", 0,0)
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:7085: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:7885: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:7088: \$? = $ac_status" >&5
+  echo "$as_me:7888: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:7091: \"$ac_try\"") >&5
+  { (eval echo "$as_me:7891: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:7094: \$? = $ac_status" >&5
+  echo "$as_me:7894: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_ncurses_header=$cf_header; break
 else
@@ -7102,11 +7902,11 @@ rm -f conftest.$ac_objext conftest.$ac_ext
 done
 
 fi
-echo "$as_me:7105: result: $cf_cv_ncurses_header" >&5
+echo "$as_me:7905: result: $cf_cv_ncurses_header" >&5
 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
 
 if test "$cf_cv_ncurses_header" = none ; then
-       { { echo "$as_me:7109: error: No curses header-files found" >&5
+       { { echo "$as_me:7909: error: No curses header-files found" >&5
 echo "$as_me: error: No curses header-files found" >&2;}
    { (exit 1); exit 1; }; }
 fi
@@ -7116,23 +7916,23 @@ fi
 for ac_header in $cf_cv_ncurses_header
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-echo "$as_me:7119: checking for $ac_header" >&5
+echo "$as_me:7919: checking for $ac_header" >&5
 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
 if eval "test \"\${$as_ac_Header+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 7125 "configure"
+#line 7925 "configure"
 #include "confdefs.h"
 #include <$ac_header>
 _ACEOF
-if { (eval echo "$as_me:7129: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:7929: \"$ac_cpp conftest.$ac_ext\"") >&5
   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
   ac_status=$?
   egrep -v '^ *\+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:7135: \$? = $ac_status" >&5
+  echo "$as_me:7935: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
@@ -7151,7 +7951,7 @@ else
 fi
 rm -f conftest.err conftest.$ac_ext
 fi
-echo "$as_me:7154: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "$as_me:7954: result: `eval echo '${'$as_ac_Header'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
 if test `eval echo '${'$as_ac_Header'}'` = yes; then
   cat >>confdefs.h <<EOF
@@ -7202,9 +8002,12 @@ if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
                        if test "$GCC" = yes
                        then
                          cf_save_CPPFLAGS=$CPPFLAGS
-                         CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
+
+       test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
+       CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
+
                          cat >conftest.$ac_ext <<_ACEOF
-#line 7207 "configure"
+#line 8010 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 int
@@ -7216,16 +8019,16 @@ printf("Hello")
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:7219: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:8022: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:7222: \$? = $ac_status" >&5
+  echo "$as_me:8025: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:7225: \"$ac_try\"") >&5
+  { (eval echo "$as_me:8028: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:7228: \$? = $ac_status" >&5
+  echo "$as_me:8031: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   :
 else
@@ -7242,7 +8045,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext
                if test "$cf_have_incdir" = no ; then
                  test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
 
-echo "${as_me:-configure}:7245: testing adding $cf_add_incdir to include-path ..." 1>&5
+echo "${as_me:-configure}:8048: testing adding $cf_add_incdir to include-path ..." 1>&5
 
                  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
 
@@ -7261,7 +8064,7 @@ fi
 
 }
 
-echo "$as_me:7264: checking for $cf_ncuhdr_root header in include-path" >&5
+echo "$as_me:8067: checking for $cf_ncuhdr_root header in include-path" >&5
 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
 if test "${cf_cv_ncurses_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -7273,7 +8076,7 @@ else
        do
 
        cat >conftest.$ac_ext <<_ACEOF
-#line 7276 "configure"
+#line 8079 "configure"
 #include "confdefs.h"
 
 #include <$cf_header>
@@ -7297,16 +8100,16 @@ printf("old\n");
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:7300: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:8103: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:7303: \$? = $ac_status" >&5
+  echo "$as_me:8106: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:7306: \"$ac_try\"") >&5
+  { (eval echo "$as_me:8109: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:7309: \$? = $ac_status" >&5
+  echo "$as_me:8112: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_ncurses_h=$cf_header
 
@@ -7321,14 +8124,14 @@ rm -f conftest.$ac_objext conftest.$ac_ext
        done
 
 fi
-echo "$as_me:7324: result: $cf_cv_ncurses_h" >&5
+echo "$as_me:8127: result: $cf_cv_ncurses_h" >&5
 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
 
 if test "$cf_cv_ncurses_h" != no ; then
        cf_cv_ncurses_header=$cf_cv_ncurses_h
 else
 
-echo "$as_me:7331: checking for $cf_ncuhdr_root include-path" >&5
+echo "$as_me:8134: checking for $cf_ncuhdr_root include-path" >&5
 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
 if test "${cf_cv_ncurses_h2+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -7444,9 +8247,12 @@ if test -n "$cf_incdir" ; then
                        if test "$GCC" = yes
                        then
                          cf_save_CPPFLAGS=$CPPFLAGS
-                         CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
+
+       test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
+       CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
+
                          cat >conftest.$ac_ext <<_ACEOF
-#line 7449 "configure"
+#line 8255 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 int
@@ -7458,16 +8264,16 @@ printf("Hello")
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:7461: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:8267: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:7464: \$? = $ac_status" >&5
+  echo "$as_me:8270: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:7467: \"$ac_try\"") >&5
+  { (eval echo "$as_me:8273: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:7470: \$? = $ac_status" >&5
+  echo "$as_me:8276: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   :
 else
@@ -7484,7 +8290,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext
                if test "$cf_have_incdir" = no ; then
                  test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
 
-echo "${as_me:-configure}:7487: testing adding $cf_add_incdir to include-path ..." 1>&5
+echo "${as_me:-configure}:8293: testing adding $cf_add_incdir to include-path ..." 1>&5
 
                  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
 
@@ -7507,7 +8313,7 @@ fi
                do
 
        cat >conftest.$ac_ext <<_ACEOF
-#line 7510 "configure"
+#line 8316 "configure"
 #include "confdefs.h"
 
 #include <$cf_header>
@@ -7531,16 +8337,16 @@ printf("old\n");
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:7534: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:8340: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:7537: \$? = $ac_status" >&5
+  echo "$as_me:8343: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:7540: \"$ac_try\"") >&5
+  { (eval echo "$as_me:8346: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:7543: \$? = $ac_status" >&5
+  echo "$as_me:8349: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_ncurses_h2=$cf_header
 
@@ -7561,12 +8367,12 @@ rm -f conftest.$ac_objext conftest.$ac_ext
                CPPFLAGS="$cf_save2_CPPFLAGS"
                test "$cf_cv_ncurses_h2" != no && break
        done
-       test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:7564: error: not found" >&5
+       test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:8370: error: not found" >&5
 echo "$as_me: error: not found" >&2;}
    { (exit 1); exit 1; }; }
 
 fi
-echo "$as_me:7569: result: $cf_cv_ncurses_h2" >&5
+echo "$as_me:8375: result: $cf_cv_ncurses_h2" >&5
 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
 
        cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
@@ -7597,9 +8403,12 @@ if test -n "$cf_1st_incdir" ; then
                        if test "$GCC" = yes
                        then
                          cf_save_CPPFLAGS=$CPPFLAGS
-                         CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
+
+       test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
+       CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
+
                          cat >conftest.$ac_ext <<_ACEOF
-#line 7602 "configure"
+#line 8411 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 int
@@ -7611,16 +8420,16 @@ printf("Hello")
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:7614: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:8423: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:7617: \$? = $ac_status" >&5
+  echo "$as_me:8426: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:7620: \"$ac_try\"") >&5
+  { (eval echo "$as_me:8429: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:7623: \$? = $ac_status" >&5
+  echo "$as_me:8432: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   :
 else
@@ -7637,7 +8446,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext
                if test "$cf_have_incdir" = no ; then
                  test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
 
-echo "${as_me:-configure}:7640: testing adding $cf_add_incdir to include-path ..." 1>&5
+echo "${as_me:-configure}:8449: testing adding $cf_add_incdir to include-path ..." 1>&5
 
                  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
 
@@ -7685,7 +8494,7 @@ EOF
        ;;
 esac
 
-echo "$as_me:7688: checking for terminfo header" >&5
+echo "$as_me:8497: checking for terminfo header" >&5
 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
 if test "${cf_cv_term_header+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -7703,7 +8512,7 @@ esac
 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
 do
 cat >conftest.$ac_ext <<_ACEOF
-#line 7706 "configure"
+#line 8515 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 #include <${cf_cv_ncurses_header:-curses.h}>
@@ -7718,16 +8527,16 @@ int x = auto_left_margin
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:7721: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:8530: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:7724: \$? = $ac_status" >&5
+  echo "$as_me:8533: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:7727: \"$ac_try\"") >&5
+  { (eval echo "$as_me:8536: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:7730: \$? = $ac_status" >&5
+  echo "$as_me:8539: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
        cf_cv_term_header="$cf_test"
@@ -7743,7 +8552,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext
 done
 
 fi
-echo "$as_me:7746: result: $cf_cv_term_header" >&5
+echo "$as_me:8555: result: $cf_cv_term_header" >&5
 echo "${ECHO_T}$cf_cv_term_header" >&6
 
 # Set definitions to allow ifdef'ing to accommodate subdirectories
@@ -7781,7 +8590,7 @@ cat >>confdefs.h <<\EOF
 #define NCURSES 1
 EOF
 
-echo "$as_me:7784: checking for ncurses version" >&5
+echo "$as_me:8593: checking for ncurses version" >&5
 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
 if test "${cf_cv_ncurses_version+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -7807,10 +8616,10 @@ Autoconf "old"
 #endif
 EOF
        cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
-       { (eval echo "$as_me:7810: \"$cf_try\"") >&5
+       { (eval echo "$as_me:8619: \"$cf_try\"") >&5
   (eval $cf_try) 2>&5
   ac_status=$?
-  echo "$as_me:7813: \$? = $ac_status" >&5
+  echo "$as_me:8622: \$? = $ac_status" >&5
   (exit $ac_status); }
        if test -f conftest.out ; then
                cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
@@ -7820,7 +8629,7 @@ EOF
 
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 7823 "configure"
+#line 8632 "configure"
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header:-curses.h}>
@@ -7845,15 +8654,15 @@ int main(void)
 }
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:7848: \"$ac_link\"") >&5
+if { (eval echo "$as_me:8657: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:7851: \$? = $ac_status" >&5
+  echo "$as_me:8660: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:7853: \"$ac_try\"") >&5
+  { (eval echo "$as_me:8662: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:7856: \$? = $ac_status" >&5
+  echo "$as_me:8665: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
        cf_cv_ncurses_version=`cat $cf_tempfile`
@@ -7867,7 +8676,7 @@ fi
        rm -f $cf_tempfile
 
 fi
-echo "$as_me:7870: result: $cf_cv_ncurses_version" >&5
+echo "$as_me:8679: result: $cf_cv_ncurses_version" >&5
 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
 test "$cf_cv_ncurses_version" = no ||
 cat >>confdefs.h <<\EOF
@@ -7880,7 +8689,7 @@ cf_nculib_root=$cf_cv_screen
        # to link gpm.
 cf_ncurses_LIBS=""
 cf_ncurses_SAVE="$LIBS"
-echo "$as_me:7883: checking for Gpm_Open in -lgpm" >&5
+echo "$as_me:8692: checking for Gpm_Open in -lgpm" >&5
 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -7888,7 +8697,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lgpm  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 7891 "configure"
+#line 8700 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -7907,16 +8716,16 @@ Gpm_Open ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:7910: \"$ac_link\"") >&5
+if { (eval echo "$as_me:8719: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:7913: \$? = $ac_status" >&5
+  echo "$as_me:8722: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:7916: \"$ac_try\"") >&5
+  { (eval echo "$as_me:8725: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:7919: \$? = $ac_status" >&5
+  echo "$as_me:8728: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_gpm_Gpm_Open=yes
 else
@@ -7927,10 +8736,10 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:7930: result: $ac_cv_lib_gpm_Gpm_Open" >&5
+echo "$as_me:8739: result: $ac_cv_lib_gpm_Gpm_Open" >&5
 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
-  echo "$as_me:7933: checking for initscr in -lgpm" >&5
+  echo "$as_me:8742: checking for initscr in -lgpm" >&5
 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -7938,7 +8747,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lgpm  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 7941 "configure"
+#line 8750 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -7957,16 +8766,16 @@ initscr ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:7960: \"$ac_link\"") >&5
+if { (eval echo "$as_me:8769: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:7963: \$? = $ac_status" >&5
+  echo "$as_me:8772: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:7966: \"$ac_try\"") >&5
+  { (eval echo "$as_me:8775: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:7969: \$? = $ac_status" >&5
+  echo "$as_me:8778: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_gpm_initscr=yes
 else
@@ -7977,7 +8786,7 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:7980: result: $ac_cv_lib_gpm_initscr" >&5
+echo "$as_me:8789: result: $ac_cv_lib_gpm_initscr" >&5
 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
 if test $ac_cv_lib_gpm_initscr = yes; then
   LIBS="$cf_ncurses_SAVE"
@@ -7992,7 +8801,7 @@ case $host_os in
        # This is only necessary if you are linking against an obsolete
        # version of ncurses (but it should do no harm, since it's static).
        if test "$cf_nculib_root" = ncurses ; then
-               echo "$as_me:7995: checking for tgoto in -lmytinfo" >&5
+               echo "$as_me:8804: checking for tgoto in -lmytinfo" >&5
 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -8000,7 +8809,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lmytinfo  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 8003 "configure"
+#line 8812 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -8019,16 +8828,16 @@ tgoto ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:8022: \"$ac_link\"") >&5
+if { (eval echo "$as_me:8831: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:8025: \$? = $ac_status" >&5
+  echo "$as_me:8834: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:8028: \"$ac_try\"") >&5
+  { (eval echo "$as_me:8837: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:8031: \$? = $ac_status" >&5
+  echo "$as_me:8840: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_mytinfo_tgoto=yes
 else
@@ -8039,7 +8848,7 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:8042: result: $ac_cv_lib_mytinfo_tgoto" >&5
+echo "$as_me:8851: result: $ac_cv_lib_mytinfo_tgoto" >&5
 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
 if test $ac_cv_lib_mytinfo_tgoto = yes; then
   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
@@ -8088,13 +8897,13 @@ else
 
        eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
        cf_libdir=""
-       echo "$as_me:8091: checking for initscr" >&5
+       echo "$as_me:8900: checking for initscr" >&5
 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
 if test "${ac_cv_func_initscr+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 8097 "configure"
+#line 8906 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char initscr (); below.  */
@@ -8125,16 +8934,16 @@ f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:8128: \"$ac_link\"") >&5
+if { (eval echo "$as_me:8937: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:8131: \$? = $ac_status" >&5
+  echo "$as_me:8940: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:8134: \"$ac_try\"") >&5
+  { (eval echo "$as_me:8943: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:8137: \$? = $ac_status" >&5
+  echo "$as_me:8946: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_func_initscr=yes
 else
@@ -8144,18 +8953,18 @@ ac_cv_func_initscr=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:8147: result: $ac_cv_func_initscr" >&5
+echo "$as_me:8956: result: $ac_cv_func_initscr" >&5
 echo "${ECHO_T}$ac_cv_func_initscr" >&6
 if test $ac_cv_func_initscr = yes; then
   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
 else
 
                cf_save_LIBS="$LIBS"
-               echo "$as_me:8154: checking for initscr in -l$cf_nculib_root" >&5
+               echo "$as_me:8963: checking for initscr in -l$cf_nculib_root" >&5
 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
                LIBS="-l$cf_nculib_root $LIBS"
                cat >conftest.$ac_ext <<_ACEOF
-#line 8158 "configure"
+#line 8967 "configure"
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header:-curses.h}>
 int
@@ -8167,25 +8976,25 @@ initscr()
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:8170: \"$ac_link\"") >&5
+if { (eval echo "$as_me:8979: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:8173: \$? = $ac_status" >&5
+  echo "$as_me:8982: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:8176: \"$ac_try\"") >&5
+  { (eval echo "$as_me:8985: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:8179: \$? = $ac_status" >&5
+  echo "$as_me:8988: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  echo "$as_me:8181: result: yes" >&5
+  echo "$as_me:8990: result: yes" >&5
 echo "${ECHO_T}yes" >&6
                         eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
 
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
-echo "$as_me:8188: result: no" >&5
+echo "$as_me:8997: result: no" >&5
 echo "${ECHO_T}no" >&6
 
 cf_search=
@@ -8253,11 +9062,11 @@ cf_search="$cf_library_path_list $cf_search"
 
                        for cf_libdir in $cf_search
                        do
-                               echo "$as_me:8256: checking for -l$cf_nculib_root in $cf_libdir" >&5
+                               echo "$as_me:9065: checking for -l$cf_nculib_root in $cf_libdir" >&5
 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
                                LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
                                cat >conftest.$ac_ext <<_ACEOF
-#line 8260 "configure"
+#line 9069 "configure"
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header:-curses.h}>
 int
@@ -8269,25 +9078,25 @@ initscr()
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:8272: \"$ac_link\"") >&5
+if { (eval echo "$as_me:9081: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:8275: \$? = $ac_status" >&5
+  echo "$as_me:9084: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:8278: \"$ac_try\"") >&5
+  { (eval echo "$as_me:9087: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:8281: \$? = $ac_status" >&5
+  echo "$as_me:9090: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  echo "$as_me:8283: result: yes" >&5
+  echo "$as_me:9092: result: yes" >&5
 echo "${ECHO_T}yes" >&6
                                         eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
                                         break
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
-echo "$as_me:8290: result: no" >&5
+echo "$as_me:9099: result: no" >&5
 echo "${ECHO_T}no" >&6
                                         LIBS="$cf_save_LIBS"
 fi
@@ -8302,7 +9111,7 @@ fi
 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
 
 if test $cf_found_library = no ; then
-       { { echo "$as_me:8305: error: Cannot link $cf_nculib_root library" >&5
+       { { echo "$as_me:9114: error: Cannot link $cf_nculib_root library" >&5
 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
    { (exit 1); exit 1; }; }
 fi
@@ -8310,7 +9119,7 @@ fi
 fi
 
 if test -n "$cf_ncurses_LIBS" ; then
-       echo "$as_me:8313: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
+       echo "$as_me:9122: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
        cf_ncurses_SAVE="$LIBS"
        for p in $cf_ncurses_LIBS ; do
@@ -8320,7 +9129,7 @@ echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS..
                fi
        done
        cat >conftest.$ac_ext <<_ACEOF
-#line 8323 "configure"
+#line 9132 "configure"
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header:-curses.h}>
 int
@@ -8332,23 +9141,23 @@ initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:8335: \"$ac_link\"") >&5
+if { (eval echo "$as_me:9144: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:8338: \$? = $ac_status" >&5
+  echo "$as_me:9147: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:8341: \"$ac_try\"") >&5
+  { (eval echo "$as_me:9150: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:8344: \$? = $ac_status" >&5
+  echo "$as_me:9153: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  echo "$as_me:8346: result: yes" >&5
+  echo "$as_me:9155: result: yes" >&5
 echo "${ECHO_T}yes" >&6
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
-echo "$as_me:8351: result: no" >&5
+echo "$as_me:9160: result: no" >&5
 echo "${ECHO_T}no" >&6
                 LIBS="$cf_ncurses_SAVE"
 fi
@@ -8373,20 +9182,116 @@ cf_ncuconfig_root=$cf_cv_screen
 cf_have_ncuconfig=no
 
 if test "x${PKG_CONFIG:=none}" != xnone; then
-       echo "$as_me:8376: checking pkg-config for $cf_ncuconfig_root" >&5
+       echo "$as_me:9185: checking pkg-config for $cf_ncuconfig_root" >&5
 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
        if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
-               echo "$as_me:8379: result: yes" >&5
+               echo "$as_me:9188: result: yes" >&5
 echo "${ECHO_T}yes" >&6
 
-               echo "$as_me:8382: checking if the $cf_ncuconfig_root package files work" >&5
+               echo "$as_me:9191: checking if the $cf_ncuconfig_root package files work" >&5
 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
                cf_have_ncuconfig=unknown
 
                cf_save_CPPFLAGS="$CPPFLAGS"
                cf_save_LIBS="$LIBS"
 
-               CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags $cf_ncuconfig_root`"
+cf_fix_cppflags=no
+cf_new_cflags=
+cf_new_cppflags=
+cf_new_extra_cppflags=
+
+for cf_add_cflags in `$PKG_CONFIG --cflags $cf_ncuconfig_root`
+do
+case $cf_fix_cppflags in
+(no)
+       case $cf_add_cflags in
+       (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
+               case $cf_add_cflags in
+               (-D*)
+                       cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
+
+                       test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
+                               && test -z "${cf_tst_cflags}" \
+                               && cf_fix_cppflags=yes
+
+                       if test $cf_fix_cppflags = yes ; then
+
+       test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+       cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
+                               continue
+                       elif test "${cf_tst_cflags}" = "\"'" ; then
+
+       test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+       cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
+                               continue
+                       fi
+                       ;;
+               esac
+               case "$CPPFLAGS" in
+               (*$cf_add_cflags)
+                       ;;
+               (*)
+                       case $cf_add_cflags in
+                       (-D*)
+                               cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
+
+CPPFLAGS=`echo "$CPPFLAGS" | \
+       sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
+               -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
+
+                               ;;
+                       esac
+
+       test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
+       cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
+
+                       ;;
+               esac
+               ;;
+       (*)
+
+       test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
+       cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
+
+               ;;
+       esac
+       ;;
+(yes)
+
+       test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+       cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
+       cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
+
+       test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
+               && test -z "${cf_tst_cflags}" \
+               && cf_fix_cppflags=no
+       ;;
+esac
+done
+
+if test -n "$cf_new_cflags" ; then
+
+       test -n "$CFLAGS" && CFLAGS="$CFLAGS "
+       CFLAGS="${CFLAGS}$cf_new_cflags"
+
+fi
+
+if test -n "$cf_new_cppflags" ; then
+
+       test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
+       CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
+
+fi
+
+if test -n "$cf_new_extra_cppflags" ; then
+
+       test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
+       EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
+
+fi
 
 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
 # Filter out duplicates - this happens with badly-designed ".pc" files...
@@ -8405,7 +9310,7 @@ done
 LIBS="$cf_add_libs"
 
                cat >conftest.$ac_ext <<_ACEOF
-#line 8408 "configure"
+#line 9313 "configure"
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header:-curses.h}>
 int
@@ -8417,37 +9322,37 @@ initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:8420: \"$ac_link\"") >&5
+if { (eval echo "$as_me:9325: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:8423: \$? = $ac_status" >&5
+  echo "$as_me:9328: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:8426: \"$ac_try\"") >&5
+  { (eval echo "$as_me:9331: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:8429: \$? = $ac_status" >&5
+  echo "$as_me:9334: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   if test "$cross_compiling" = yes; then
   cf_have_ncuconfig=maybe
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 8435 "configure"
+#line 9340 "configure"
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header:-curses.h}>
                                int main(void)
                                { char *xx = curses_version(); return (xx == 0); }
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:8442: \"$ac_link\"") >&5
+if { (eval echo "$as_me:9347: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:8445: \$? = $ac_status" >&5
+  echo "$as_me:9350: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:8447: \"$ac_try\"") >&5
+  { (eval echo "$as_me:9352: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:8450: \$? = $ac_status" >&5
+  echo "$as_me:9355: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_have_ncuconfig=yes
 else
@@ -8464,7 +9369,7 @@ cat conftest.$ac_ext >&5
 cf_have_ncuconfig=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-               echo "$as_me:8467: result: $cf_have_ncuconfig" >&5
+               echo "$as_me:9372: result: $cf_have_ncuconfig" >&5
 echo "${ECHO_T}$cf_have_ncuconfig" >&6
                test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
                if test "$cf_have_ncuconfig" != "yes"
@@ -8479,9 +9384,8 @@ cat >>confdefs.h <<\EOF
 EOF
 
                        NCURSES_CONFIG_PKG=$cf_ncuconfig_root
-               fi
 
-echo "$as_me:8484: checking for terminfo header" >&5
+echo "$as_me:9388: checking for terminfo header" >&5
 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
 if test "${cf_cv_term_header+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -8499,7 +9403,7 @@ esac
 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
 do
 cat >conftest.$ac_ext <<_ACEOF
-#line 8502 "configure"
+#line 9406 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 #include <${cf_cv_ncurses_header:-curses.h}>
@@ -8514,16 +9418,16 @@ int x = auto_left_margin
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:8517: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:9421: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:8520: \$? = $ac_status" >&5
+  echo "$as_me:9424: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:8523: \"$ac_try\"") >&5
+  { (eval echo "$as_me:9427: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:8526: \$? = $ac_status" >&5
+  echo "$as_me:9430: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
        cf_cv_term_header="$cf_test"
@@ -8539,7 +9443,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext
 done
 
 fi
-echo "$as_me:8542: result: $cf_cv_term_header" >&5
+echo "$as_me:9446: result: $cf_cv_term_header" >&5
 echo "${ECHO_T}$cf_cv_term_header" >&6
 
 # Set definitions to allow ifdef'ing to accommodate subdirectories
@@ -8571,8 +9475,10 @@ EOF
        ;;
 esac
 
+               fi
+
        else
-               echo "$as_me:8575: result: no" >&5
+               echo "$as_me:9481: result: no" >&5
 echo "${ECHO_T}no" >&6
                NCURSES_CONFIG_PKG=none
        fi
@@ -8581,14 +9487,14 @@ else
 fi
 
 if test "x$cf_have_ncuconfig" = "xno"; then
-       echo "Looking for ${cf_ncuconfig_root}-config"
+       cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
 
 if test -n "$ac_tool_prefix"; then
-  for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
+  for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
   do
     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-echo "$as_me:8591: checking for $ac_word" >&5
+echo "$as_me:9497: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -8603,7 +9509,7 @@ for ac_dir in $ac_dummy; do
   test -z "$ac_dir" && ac_dir=.
   $as_executable_p "$ac_dir/$ac_word" || continue
 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
-echo "$as_me:8606: found $ac_dir/$ac_word" >&5
+echo "$as_me:9512: found $ac_dir/$ac_word" >&5
 break
 done
 
@@ -8611,10 +9517,10 @@ fi
 fi
 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
 if test -n "$NCURSES_CONFIG"; then
-  echo "$as_me:8614: result: $NCURSES_CONFIG" >&5
+  echo "$as_me:9520: result: $NCURSES_CONFIG" >&5
 echo "${ECHO_T}$NCURSES_CONFIG" >&6
 else
-  echo "$as_me:8617: result: no" >&5
+  echo "$as_me:9523: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -8623,11 +9529,11 @@ fi
 fi
 if test -z "$NCURSES_CONFIG"; then
   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
-  for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
+  for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-echo "$as_me:8630: checking for $ac_word" >&5
+echo "$as_me:9536: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -8642,7 +9548,7 @@ for ac_dir in $ac_dummy; do
   test -z "$ac_dir" && ac_dir=.
   $as_executable_p "$ac_dir/$ac_word" || continue
 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
-echo "$as_me:8645: found $ac_dir/$ac_word" >&5
+echo "$as_me:9551: found $ac_dir/$ac_word" >&5
 break
 done
 
@@ -8650,10 +9556,10 @@ fi
 fi
 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
 if test -n "$ac_ct_NCURSES_CONFIG"; then
-  echo "$as_me:8653: result: $ac_ct_NCURSES_CONFIG" >&5
+  echo "$as_me:9559: result: $ac_ct_NCURSES_CONFIG" >&5
 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
 else
-  echo "$as_me:8656: result: no" >&5
+  echo "$as_me:9562: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
 
        if test "$NCURSES_CONFIG" != none ; then
 
-               CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
+cf_fix_cppflags=no
+cf_new_cflags=
+cf_new_cppflags=
+cf_new_extra_cppflags=
 
-cf_add_libs="`$NCURSES_CONFIG --libs`"
-# Filter out duplicates - this happens with badly-designed ".pc" files...
-for cf_add_1lib in $LIBS
+for cf_add_cflags in `$NCURSES_CONFIG --cflags`
 do
-       for cf_add_2lib in $cf_add_libs
-       do
-               if test "x$cf_add_1lib" = "x$cf_add_2lib"
-               then
-                       cf_add_1lib=
-                       break
-               fi
-       done
-       test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
-done
-LIBS="$cf_add_libs"
+case $cf_fix_cppflags in
+(no)
+       case $cf_add_cflags in
+       (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
+               case $cf_add_cflags in
+               (-D*)
+                       cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
 
-               # even with config script, some packages use no-override for curses.h
+                       test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
+                               && test -z "${cf_tst_cflags}" \
+                               && cf_fix_cppflags=yes
 
-echo "$as_me:8689: checking if we have identified curses headers" >&5
-echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
-if test "${cf_cv_ncurses_header+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
+                       if test $cf_fix_cppflags = yes ; then
 
-cf_cv_ncurses_header=none
-for cf_header in \
-       ncurses.h $cf_cv_screen/ncurses.h \
-       curses.h $cf_cv_screen/curses.h
-do
-cat >conftest.$ac_ext <<_ACEOF
-#line 8701 "configure"
-#include "confdefs.h"
-#include <${cf_header}>
-int
-main (void)
+       test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+       cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
+                               continue
+                       elif test "${cf_tst_cflags}" = "\"'" ; then
+
+       test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+       cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
+                               continue
+                       fi
+                       ;;
+               esac
+               case "$CPPFLAGS" in
+               (*$cf_add_cflags)
+                       ;;
+               (*)
+                       case $cf_add_cflags in
+                       (-D*)
+                               cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
+
+CPPFLAGS=`echo "$CPPFLAGS" | \
+       sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
+               -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
+
+                               ;;
+                       esac
+
+       test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
+       cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
+
+                       ;;
+               esac
+               ;;
+       (*)
+
+       test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
+       cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
+
+               ;;
+       esac
+       ;;
+(yes)
+
+       test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+       cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
+       cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
+
+       test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
+               && test -z "${cf_tst_cflags}" \
+               && cf_fix_cppflags=no
+       ;;
+esac
+done
+
+if test -n "$cf_new_cflags" ; then
+
+       test -n "$CFLAGS" && CFLAGS="$CFLAGS "
+       CFLAGS="${CFLAGS}$cf_new_cflags"
+
+fi
+
+if test -n "$cf_new_cppflags" ; then
+
+       test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
+       CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
+
+fi
+
+if test -n "$cf_new_extra_cppflags" ; then
+
+       test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
+       EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
+
+fi
+
+cf_add_libs="`$NCURSES_CONFIG --libs`"
+# Filter out duplicates - this happens with badly-designed ".pc" files...
+for cf_add_1lib in $LIBS
+do
+       for cf_add_2lib in $cf_add_libs
+       do
+               if test "x$cf_add_1lib" = "x$cf_add_2lib"
+               then
+                       cf_add_1lib=
+                       break
+               fi
+       done
+       test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
+done
+LIBS="$cf_add_libs"
+
+               # even with config script, some packages use no-override for curses.h
+
+echo "$as_me:9691: checking if we have identified curses headers" >&5
+echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
+if test "${cf_cv_ncurses_header+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+cf_cv_ncurses_header=none
+for cf_header in \
+       ncurses.h $cf_cv_screen/ncurses.h \
+       curses.h $cf_cv_screen/curses.h
+do
+cat >conftest.$ac_ext <<_ACEOF
+#line 9703 "configure"
+#include "confdefs.h"
+#include <${cf_header}>
+int
+main (void)
 {
 initscr(); tgoto("?", 0,0)
   ;
@@ -8710,16 +9712,16 @@ initscr(); tgoto("?", 0,0)
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:8713: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:9715: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:8716: \$? = $ac_status" >&5
+  echo "$as_me:9718: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:8719: \"$ac_try\"") >&5
+  { (eval echo "$as_me:9721: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:8722: \$? = $ac_status" >&5
+  echo "$as_me:9724: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_ncurses_header=$cf_header; break
 else
@@ -8730,11 +9732,11 @@ rm -f conftest.$ac_objext conftest.$ac_ext
 done
 
 fi
-echo "$as_me:8733: result: $cf_cv_ncurses_header" >&5
+echo "$as_me:9735: result: $cf_cv_ncurses_header" >&5
 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
 
 if test "$cf_cv_ncurses_header" = none ; then
-       { { echo "$as_me:8737: error: No curses header-files found" >&5
+       { { echo "$as_me:9739: error: No curses header-files found" >&5
 echo "$as_me: error: No curses header-files found" >&2;}
    { (exit 1); exit 1; }; }
 fi
@@ -8744,23 +9746,23 @@ fi
 for ac_header in $cf_cv_ncurses_header
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-echo "$as_me:8747: checking for $ac_header" >&5
+echo "$as_me:9749: checking for $ac_header" >&5
 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
 if eval "test \"\${$as_ac_Header+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 8753 "configure"
+#line 9755 "configure"
 #include "confdefs.h"
 #include <$ac_header>
 _ACEOF
-if { (eval echo "$as_me:8757: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:9759: \"$ac_cpp conftest.$ac_ext\"") >&5
   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
   ac_status=$?
   egrep -v '^ *\+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:8763: \$? = $ac_status" >&5
+  echo "$as_me:9765: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
@@ -8779,7 +9781,7 @@ else
 fi
 rm -f conftest.err conftest.$ac_ext
 fi
-echo "$as_me:8782: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "$as_me:9784: result: `eval echo '${'$as_ac_Header'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
 if test `eval echo '${'$as_ac_Header'}'` = yes; then
   cat >>confdefs.h <<EOF
@@ -8830,9 +9832,12 @@ if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
                        if test "$GCC" = yes
                        then
                          cf_save_CPPFLAGS=$CPPFLAGS
-                         CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
+
+       test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
+       CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
+
                          cat >conftest.$ac_ext <<_ACEOF
-#line 8835 "configure"
+#line 9840 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 int
@@ -8844,16 +9849,16 @@ printf("Hello")
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:8847: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:9852: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:8850: \$? = $ac_status" >&5
+  echo "$as_me:9855: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:8853: \"$ac_try\"") >&5
+  { (eval echo "$as_me:9858: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:8856: \$? = $ac_status" >&5
+  echo "$as_me:9861: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   :
 else
@@ -8870,7 +9875,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext
                if test "$cf_have_incdir" = no ; then
                  test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
 
-echo "${as_me:-configure}:8873: testing adding $cf_add_incdir to include-path ..." 1>&5
+echo "${as_me:-configure}:9878: testing adding $cf_add_incdir to include-path ..." 1>&5
 
                  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
 
@@ -8889,7 +9894,7 @@ fi
 
 }
 
-echo "$as_me:8892: checking for $cf_ncuhdr_root header in include-path" >&5
+echo "$as_me:9897: checking for $cf_ncuhdr_root header in include-path" >&5
 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
 if test "${cf_cv_ncurses_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -8901,7 +9906,7 @@ else
        do
 
        cat >conftest.$ac_ext <<_ACEOF
-#line 8904 "configure"
+#line 9909 "configure"
 #include "confdefs.h"
 
 #include <$cf_header>
@@ -8925,16 +9930,16 @@ printf("old\n");
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:8928: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:9933: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:8931: \$? = $ac_status" >&5
+  echo "$as_me:9936: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:8934: \"$ac_try\"") >&5
+  { (eval echo "$as_me:9939: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:8937: \$? = $ac_status" >&5
+  echo "$as_me:9942: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_ncurses_h=$cf_header
 
@@ -8949,14 +9954,14 @@ rm -f conftest.$ac_objext conftest.$ac_ext
        done
 
 fi
-echo "$as_me:8952: result: $cf_cv_ncurses_h" >&5
+echo "$as_me:9957: result: $cf_cv_ncurses_h" >&5
 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
 
 if test "$cf_cv_ncurses_h" != no ; then
        cf_cv_ncurses_header=$cf_cv_ncurses_h
 else
 
-echo "$as_me:8959: checking for $cf_ncuhdr_root include-path" >&5
+echo "$as_me:9964: checking for $cf_ncuhdr_root include-path" >&5
 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
 if test "${cf_cv_ncurses_h2+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -9072,9 +10077,12 @@ if test -n "$cf_incdir" ; then
                        if test "$GCC" = yes
                        then
                          cf_save_CPPFLAGS=$CPPFLAGS
-                         CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
+
+       test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
+       CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
+
                          cat >conftest.$ac_ext <<_ACEOF
-#line 9077 "configure"
+#line 10085 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 int
@@ -9086,16 +10094,16 @@ printf("Hello")
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:9089: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:10097: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:9092: \$? = $ac_status" >&5
+  echo "$as_me:10100: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:9095: \"$ac_try\"") >&5
+  { (eval echo "$as_me:10103: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:9098: \$? = $ac_status" >&5
+  echo "$as_me:10106: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   :
 else
@@ -9112,7 +10120,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext
                if test "$cf_have_incdir" = no ; then
                  test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
 
-echo "${as_me:-configure}:9115: testing adding $cf_add_incdir to include-path ..." 1>&5
+echo "${as_me:-configure}:10123: testing adding $cf_add_incdir to include-path ..." 1>&5
 
                  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
 
@@ -9135,7 +10143,7 @@ fi
                do
 
        cat >conftest.$ac_ext <<_ACEOF
-#line 9138 "configure"
+#line 10146 "configure"
 #include "confdefs.h"
 
 #include <$cf_header>
@@ -9159,16 +10167,16 @@ printf("old\n");
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:9162: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:10170: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:9165: \$? = $ac_status" >&5
+  echo "$as_me:10173: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:9168: \"$ac_try\"") >&5
+  { (eval echo "$as_me:10176: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:9171: \$? = $ac_status" >&5
+  echo "$as_me:10179: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_ncurses_h2=$cf_header
 
@@ -9189,12 +10197,12 @@ rm -f conftest.$ac_objext conftest.$ac_ext
                CPPFLAGS="$cf_save2_CPPFLAGS"
                test "$cf_cv_ncurses_h2" != no && break
        done
-       test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:9192: error: not found" >&5
+       test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:10200: error: not found" >&5
 echo "$as_me: error: not found" >&2;}
    { (exit 1); exit 1; }; }
 
 fi
-echo "$as_me:9197: result: $cf_cv_ncurses_h2" >&5
+echo "$as_me:10205: result: $cf_cv_ncurses_h2" >&5
 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
 
        cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
@@ -9225,9 +10233,12 @@ if test -n "$cf_1st_incdir" ; then
                        if test "$GCC" = yes
                        then
                          cf_save_CPPFLAGS=$CPPFLAGS
-                         CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
+
+       test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
+       CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
+
                          cat >conftest.$ac_ext <<_ACEOF
-#line 9230 "configure"
+#line 10241 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 int
@@ -9239,16 +10250,16 @@ printf("Hello")
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:9242: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:10253: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:9245: \$? = $ac_status" >&5
+  echo "$as_me:10256: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:9248: \"$ac_try\"") >&5
+  { (eval echo "$as_me:10259: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:9251: \$? = $ac_status" >&5
+  echo "$as_me:10262: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   :
 else
@@ -9265,7 +10276,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext
                if test "$cf_have_incdir" = no ; then
                  test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
 
-echo "${as_me:-configure}:9268: testing adding $cf_add_incdir to include-path ..." 1>&5
+echo "${as_me:-configure}:10279: testing adding $cf_add_incdir to include-path ..." 1>&5
 
                  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
 
@@ -9313,7 +10324,7 @@ EOF
        ;;
 esac
 
-echo "$as_me:9316: checking for terminfo header" >&5
+echo "$as_me:10327: checking for terminfo header" >&5
 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
 if test "${cf_cv_term_header+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -9331,7 +10342,7 @@ esac
 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
 do
 cat >conftest.$ac_ext <<_ACEOF
-#line 9334 "configure"
+#line 10345 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 #include <${cf_cv_ncurses_header:-curses.h}>
@@ -9346,16 +10357,16 @@ int x = auto_left_margin
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:9349: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:10360: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:9352: \$? = $ac_status" >&5
+  echo "$as_me:10363: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:9355: \"$ac_try\"") >&5
+  { (eval echo "$as_me:10366: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:9358: \$? = $ac_status" >&5
+  echo "$as_me:10369: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
        cf_cv_term_header="$cf_test"
@@ -9371,7 +10382,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext
 done
 
 fi
-echo "$as_me:9374: result: $cf_cv_term_header" >&5
+echo "$as_me:10385: result: $cf_cv_term_header" >&5
 echo "${ECHO_T}$cf_cv_term_header" >&6
 
 # Set definitions to allow ifdef'ing to accommodate subdirectories
@@ -9409,7 +10420,7 @@ cat >>confdefs.h <<\EOF
 #define NCURSES 1
 EOF
 
-echo "$as_me:9412: checking for ncurses version" >&5
+echo "$as_me:10423: checking for ncurses version" >&5
 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
 if test "${cf_cv_ncurses_version+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -9435,10 +10446,10 @@ Autoconf "old"
 #endif
 EOF
        cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
-       { (eval echo "$as_me:9438: \"$cf_try\"") >&5
+       { (eval echo "$as_me:10449: \"$cf_try\"") >&5
   (eval $cf_try) 2>&5
   ac_status=$?
-  echo "$as_me:9441: \$? = $ac_status" >&5
+  echo "$as_me:10452: \$? = $ac_status" >&5
   (exit $ac_status); }
        if test -f conftest.out ; then
                cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
@@ -9448,7 +10459,7 @@ EOF
 
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 9451 "configure"
+#line 10462 "configure"
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header:-curses.h}>
@@ -9473,15 +10484,15 @@ int main(void)
 }
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:9476: \"$ac_link\"") >&5
+if { (eval echo "$as_me:10487: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:9479: \$? = $ac_status" >&5
+  echo "$as_me:10490: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:9481: \"$ac_try\"") >&5
+  { (eval echo "$as_me:10492: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:9484: \$? = $ac_status" >&5
+  echo "$as_me:10495: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
        cf_cv_ncurses_version=`cat $cf_tempfile`
@@ -9495,7 +10506,7 @@ fi
        rm -f $cf_tempfile
 
 fi
-echo "$as_me:9498: result: $cf_cv_ncurses_version" >&5
+echo "$as_me:10509: result: $cf_cv_ncurses_version" >&5
 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
 test "$cf_cv_ncurses_version" = no ||
 cat >>confdefs.h <<\EOF
@@ -9508,7 +10519,7 @@ cf_nculib_root=$cf_cv_screen
        # to link gpm.
 cf_ncurses_LIBS=""
 cf_ncurses_SAVE="$LIBS"
-echo "$as_me:9511: checking for Gpm_Open in -lgpm" >&5
+echo "$as_me:10522: checking for Gpm_Open in -lgpm" >&5
 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -9516,7 +10527,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lgpm  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 9519 "configure"
+#line 10530 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -9535,16 +10546,16 @@ Gpm_Open ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:9538: \"$ac_link\"") >&5
+if { (eval echo "$as_me:10549: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:9541: \$? = $ac_status" >&5
+  echo "$as_me:10552: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:9544: \"$ac_try\"") >&5
+  { (eval echo "$as_me:10555: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:9547: \$? = $ac_status" >&5
+  echo "$as_me:10558: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_gpm_Gpm_Open=yes
 else
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:9558: result: $ac_cv_lib_gpm_Gpm_Open" >&5
+echo "$as_me:10569: result: $ac_cv_lib_gpm_Gpm_Open" >&5
 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
-  echo "$as_me:9561: checking for initscr in -lgpm" >&5
+  echo "$as_me:10572: checking for initscr in -lgpm" >&5
 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -9566,7 +10577,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lgpm  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 9569 "configure"
+#line 10580 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -9585,16 +10596,16 @@ initscr ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:9588: \"$ac_link\"") >&5
+if { (eval echo "$as_me:10599: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:9591: \$? = $ac_status" >&5
+  echo "$as_me:10602: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:9594: \"$ac_try\"") >&5
+  { (eval echo "$as_me:10605: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:9597: \$? = $ac_status" >&5
+  echo "$as_me:10608: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_gpm_initscr=yes
 else
@@ -9605,7 +10616,7 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:9608: result: $ac_cv_lib_gpm_initscr" >&5
+echo "$as_me:10619: result: $ac_cv_lib_gpm_initscr" >&5
 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
 if test $ac_cv_lib_gpm_initscr = yes; then
   LIBS="$cf_ncurses_SAVE"
@@ -9620,7 +10631,7 @@ case $host_os in
        # This is only necessary if you are linking against an obsolete
        # version of ncurses (but it should do no harm, since it's static).
        if test "$cf_nculib_root" = ncurses ; then
-               echo "$as_me:9623: checking for tgoto in -lmytinfo" >&5
+               echo "$as_me:10634: checking for tgoto in -lmytinfo" >&5
 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -9628,7 +10639,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lmytinfo  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 9631 "configure"
+#line 10642 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -9647,16 +10658,16 @@ tgoto ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:9650: \"$ac_link\"") >&5
+if { (eval echo "$as_me:10661: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:9653: \$? = $ac_status" >&5
+  echo "$as_me:10664: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:9656: \"$ac_try\"") >&5
+  { (eval echo "$as_me:10667: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:9659: \$? = $ac_status" >&5
+  echo "$as_me:10670: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_mytinfo_tgoto=yes
 else
@@ -9667,7 +10678,7 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:9670: result: $ac_cv_lib_mytinfo_tgoto" >&5
+echo "$as_me:10681: result: $ac_cv_lib_mytinfo_tgoto" >&5
 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
 if test $ac_cv_lib_mytinfo_tgoto = yes; then
   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
@@ -9716,13 +10727,13 @@ else
 
        eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
        cf_libdir=""
-       echo "$as_me:9719: checking for initscr" >&5
+       echo "$as_me:10730: checking for initscr" >&5
 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
 if test "${ac_cv_func_initscr+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 9725 "configure"
+#line 10736 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char initscr (); below.  */
@@ -9753,16 +10764,16 @@ f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:9756: \"$ac_link\"") >&5
+if { (eval echo "$as_me:10767: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:9759: \$? = $ac_status" >&5
+  echo "$as_me:10770: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:9762: \"$ac_try\"") >&5
+  { (eval echo "$as_me:10773: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:9765: \$? = $ac_status" >&5
+  echo "$as_me:10776: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_func_initscr=yes
 else
@@ -9772,18 +10783,18 @@ ac_cv_func_initscr=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:9775: result: $ac_cv_func_initscr" >&5
+echo "$as_me:10786: result: $ac_cv_func_initscr" >&5
 echo "${ECHO_T}$ac_cv_func_initscr" >&6
 if test $ac_cv_func_initscr = yes; then
   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
 else
 
                cf_save_LIBS="$LIBS"
-               echo "$as_me:9782: checking for initscr in -l$cf_nculib_root" >&5
+               echo "$as_me:10793: checking for initscr in -l$cf_nculib_root" >&5
 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
                LIBS="-l$cf_nculib_root $LIBS"
                cat >conftest.$ac_ext <<_ACEOF
-#line 9786 "configure"
+#line 10797 "configure"
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header:-curses.h}>
 int
@@ -9795,25 +10806,25 @@ initscr()
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:9798: \"$ac_link\"") >&5
+if { (eval echo "$as_me:10809: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:9801: \$? = $ac_status" >&5
+  echo "$as_me:10812: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:9804: \"$ac_try\"") >&5
+  { (eval echo "$as_me:10815: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:9807: \$? = $ac_status" >&5
+  echo "$as_me:10818: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  echo "$as_me:9809: result: yes" >&5
+  echo "$as_me:10820: result: yes" >&5
 echo "${ECHO_T}yes" >&6
                         eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
 
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
-echo "$as_me:9816: result: no" >&5
+echo "$as_me:10827: result: no" >&5
 echo "${ECHO_T}no" >&6
 
 cf_search=
@@ -9881,11 +10892,11 @@ cf_search="$cf_library_path_list $cf_search"
 
                        for cf_libdir in $cf_search
                        do
-                               echo "$as_me:9884: checking for -l$cf_nculib_root in $cf_libdir" >&5
+                               echo "$as_me:10895: checking for -l$cf_nculib_root in $cf_libdir" >&5
 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
                                LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
                                cat >conftest.$ac_ext <<_ACEOF
-#line 9888 "configure"
+#line 10899 "configure"
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header:-curses.h}>
 int
@@ -9897,25 +10908,25 @@ initscr()
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:9900: \"$ac_link\"") >&5
+if { (eval echo "$as_me:10911: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:9903: \$? = $ac_status" >&5
+  echo "$as_me:10914: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:9906: \"$ac_try\"") >&5
+  { (eval echo "$as_me:10917: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:9909: \$? = $ac_status" >&5
+  echo "$as_me:10920: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  echo "$as_me:9911: result: yes" >&5
+  echo "$as_me:10922: result: yes" >&5
 echo "${ECHO_T}yes" >&6
                                         eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
                                         break
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
-echo "$as_me:9918: result: no" >&5
+echo "$as_me:10929: result: no" >&5
 echo "${ECHO_T}no" >&6
                                         LIBS="$cf_save_LIBS"
 fi
@@ -9930,7 +10941,7 @@ fi
 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
 
 if test $cf_found_library = no ; then
-       { { echo "$as_me:9933: error: Cannot link $cf_nculib_root library" >&5
+       { { echo "$as_me:10944: error: Cannot link $cf_nculib_root library" >&5
 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
    { (exit 1); exit 1; }; }
 fi
@@ -9938,7 +10949,7 @@ fi
 fi
 
 if test -n "$cf_ncurses_LIBS" ; then
-       echo "$as_me:9941: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
+       echo "$as_me:10952: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
        cf_ncurses_SAVE="$LIBS"
        for p in $cf_ncurses_LIBS ; do
@@ -9948,7 +10959,7 @@ echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS..
                fi
        done
        cat >conftest.$ac_ext <<_ACEOF
-#line 9951 "configure"
+#line 10962 "configure"
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header:-curses.h}>
 int
@@ -9960,23 +10971,23 @@ initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:9963: \"$ac_link\"") >&5
+if { (eval echo "$as_me:10974: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:9966: \$? = $ac_status" >&5
+  echo "$as_me:10977: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:9969: \"$ac_try\"") >&5
+  { (eval echo "$as_me:10980: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:9972: \$? = $ac_status" >&5
+  echo "$as_me:10983: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  echo "$as_me:9974: result: yes" >&5
+  echo "$as_me:10985: result: yes" >&5
 echo "${ECHO_T}yes" >&6
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
-echo "$as_me:9979: result: no" >&5
+echo "$as_me:10990: result: no" >&5
 echo "${ECHO_T}no" >&6
                 LIBS="$cf_ncurses_SAVE"
 fi
@@ -9996,7 +11007,7 @@ fi
 
        ;;
 (pdcurses)
-       echo "$as_me:9999: checking for X" >&5
+       echo "$as_me:11010: checking for X" >&5
 echo $ECHO_N "checking for X... $ECHO_C" >&6
 
 # Check whether --with-x or --without-x was given.
@@ -10093,17 +11104,17 @@ if test "$ac_x_includes" = no; then
   # Guess where to find include files, by looking for Intrinsic.h.
   # First, try using that file with no special directory specified.
   cat >conftest.$ac_ext <<_ACEOF
-#line 10096 "configure"
+#line 11107 "configure"
 #include "confdefs.h"
 #include <X11/Intrinsic.h>
 _ACEOF
-if { (eval echo "$as_me:10100: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:11111: \"$ac_cpp conftest.$ac_ext\"") >&5
   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
   ac_status=$?
   egrep -v '^ *\+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:10106: \$? = $ac_status" >&5
+  echo "$as_me:11117: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
@@ -10136,7 +11147,7 @@ if test "$ac_x_libraries" = no; then
   ac_save_LIBS=$LIBS
   LIBS="-lXt $LIBS"
   cat >conftest.$ac_ext <<_ACEOF
-#line 10139 "configure"
+#line 11150 "configure"
 #include "confdefs.h"
 #include <X11/Intrinsic.h>
 int
@@ -10148,16 +11159,16 @@ XtMalloc (0)
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:10151: \"$ac_link\"") >&5
+if { (eval echo "$as_me:11162: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:10154: \$? = $ac_status" >&5
+  echo "$as_me:11165: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:10157: \"$ac_try\"") >&5
+  { (eval echo "$as_me:11168: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:10160: \$? = $ac_status" >&5
+  echo "$as_me:11171: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   LIBS=$ac_save_LIBS
 # We can link X programs with no special library path.
@@ -10195,7 +11206,7 @@ fi
 fi # $with_x != no
 
 if test "$have_x" != yes; then
-  echo "$as_me:10198: result: $have_x" >&5
+  echo "$as_me:11209: result: $have_x" >&5
 echo "${ECHO_T}$have_x" >&6
   no_x=yes
 else
@@ -10205,7 +11216,7 @@ else
   # Update the cache value to reflect the command line values.
   ac_cv_have_x="have_x=yes \
                ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
-  echo "$as_me:10208: result: libraries $x_libraries, headers $x_includes" >&5
+  echo "$as_me:11219: result: libraries $x_libraries, headers $x_includes" >&5
 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
 fi
 
@@ -10229,11 +11240,11 @@ else
     # others require no space.  Words are not sufficient . . . .
     case `(uname -sr) 2>/dev/null` in
     "SunOS 5"*)
-      echo "$as_me:10232: checking whether -R must be followed by a space" >&5
+      echo "$as_me:11243: checking whether -R must be followed by a space" >&5
 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
       ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
       cat >conftest.$ac_ext <<_ACEOF
-#line 10236 "configure"
+#line 11247 "configure"
 #include "confdefs.h"
 
 int
@@ -10245,16 +11256,16 @@ main (void)
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:10248: \"$ac_link\"") >&5
+if { (eval echo "$as_me:11259: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:10251: \$? = $ac_status" >&5
+  echo "$as_me:11262: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:10254: \"$ac_try\"") >&5
+  { (eval echo "$as_me:11265: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:10257: \$? = $ac_status" >&5
+  echo "$as_me:11268: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_R_nospace=yes
 else
@@ -10264,13 +11275,13 @@ ac_R_nospace=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
       if test $ac_R_nospace = yes; then
-       echo "$as_me:10267: result: no" >&5
+       echo "$as_me:11278: result: no" >&5
 echo "${ECHO_T}no" >&6
        X_LIBS="$X_LIBS -R$x_libraries"
       else
        LIBS="$ac_xsave_LIBS -R $x_libraries"
        cat >conftest.$ac_ext <<_ACEOF
-#line 10273 "configure"
+#line 11284 "configure"
 #include "confdefs.h"
 
 int
@@ -10282,16 +11293,16 @@ main (void)
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:10285: \"$ac_link\"") >&5
+if { (eval echo "$as_me:11296: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:10288: \$? = $ac_status" >&5
+  echo "$as_me:11299: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:10291: \"$ac_try\"") >&5
+  { (eval echo "$as_me:11302: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:10294: \$? = $ac_status" >&5
+  echo "$as_me:11305: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_R_space=yes
 else
@@ -10301,11 +11312,11 @@ ac_R_space=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
        if test $ac_R_space = yes; then
-         echo "$as_me:10304: result: yes" >&5
+         echo "$as_me:11315: result: yes" >&5
 echo "${ECHO_T}yes" >&6
          X_LIBS="$X_LIBS -R $x_libraries"
        else
-         echo "$as_me:10308: result: neither works" >&5
+         echo "$as_me:11319: result: neither works" >&5
 echo "${ECHO_T}neither works" >&6
        fi
       fi
@@ -10325,7 +11336,7 @@ echo "${ECHO_T}neither works" >&6
     # the Alpha needs dnet_stub (dnet does not exist).
     ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
     cat >conftest.$ac_ext <<_ACEOF
-#line 10328 "configure"
+#line 11339 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -10344,22 +11355,22 @@ XOpenDisplay ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:10347: \"$ac_link\"") >&5
+if { (eval echo "$as_me:11358: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:10350: \$? = $ac_status" >&5
+  echo "$as_me:11361: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:10353: \"$ac_try\"") >&5
+  { (eval echo "$as_me:11364: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:10356: \$? = $ac_status" >&5
+  echo "$as_me:11367: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   :
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
-echo "$as_me:10362: checking for dnet_ntoa in -ldnet" >&5
+echo "$as_me:11373: checking for dnet_ntoa in -ldnet" >&5
 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
 if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -10367,7 +11378,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-ldnet  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 10370 "configure"
+#line 11381 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -10386,16 +11397,16 @@ dnet_ntoa ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:10389: \"$ac_link\"") >&5
+if { (eval echo "$as_me:11400: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:10392: \$? = $ac_status" >&5
+  echo "$as_me:11403: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:10395: \"$ac_try\"") >&5
+  { (eval echo "$as_me:11406: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:10398: \$? = $ac_status" >&5
+  echo "$as_me:11409: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_dnet_dnet_ntoa=yes
 else
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:10409: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
+echo "$as_me:11420: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
 if test $ac_cv_lib_dnet_dnet_ntoa = yes; then
   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
 fi
 
     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
-      echo "$as_me:10416: checking for dnet_ntoa in -ldnet_stub" >&5
+      echo "$as_me:11427: checking for dnet_ntoa in -ldnet_stub" >&5
 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
 if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -10421,7 +11432,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-ldnet_stub  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 10424 "configure"
+#line 11435 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -10440,16 +11451,16 @@ dnet_ntoa ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:10443: \"$ac_link\"") >&5
+if { (eval echo "$as_me:11454: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:10446: \$? = $ac_status" >&5
+  echo "$as_me:11457: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:10449: \"$ac_try\"") >&5
+  { (eval echo "$as_me:11460: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:10452: \$? = $ac_status" >&5
+  echo "$as_me:11463: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_dnet_stub_dnet_ntoa=yes
 else
@@ -10460,7 +11471,7 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:10463: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
+echo "$as_me:11474: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
 if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then
   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
@@ -10479,13 +11490,13 @@ rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
     # on Irix 5.2, according to T.E. Dickey.
     # The functions gethostbyname, getservbyname, and inet_addr are
     # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
-    echo "$as_me:10482: checking for gethostbyname" >&5
+    echo "$as_me:11493: checking for gethostbyname" >&5
 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
 if test "${ac_cv_func_gethostbyname+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 10488 "configure"
+#line 11499 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char gethostbyname (); below.  */
@@ -10516,16 +11527,16 @@ f = gethostbyname; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:10519: \"$ac_link\"") >&5
+if { (eval echo "$as_me:11530: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:10522: \$? = $ac_status" >&5
+  echo "$as_me:11533: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:10525: \"$ac_try\"") >&5
+  { (eval echo "$as_me:11536: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:10528: \$? = $ac_status" >&5
+  echo "$as_me:11539: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_func_gethostbyname=yes
 else
@@ -10535,11 +11546,11 @@ ac_cv_func_gethostbyname=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:10538: result: $ac_cv_func_gethostbyname" >&5
+echo "$as_me:11549: result: $ac_cv_func_gethostbyname" >&5
 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
 
     if test $ac_cv_func_gethostbyname = no; then
-      echo "$as_me:10542: checking for gethostbyname in -lnsl" >&5
+      echo "$as_me:11553: checking for gethostbyname in -lnsl" >&5
 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -10547,7 +11558,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lnsl  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 10550 "configure"
+#line 11561 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -10566,16 +11577,16 @@ gethostbyname ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:10569: \"$ac_link\"") >&5
+if { (eval echo "$as_me:11580: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:10572: \$? = $ac_status" >&5
+  echo "$as_me:11583: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:10575: \"$ac_try\"") >&5
+  { (eval echo "$as_me:11586: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:10578: \$? = $ac_status" >&5
+  echo "$as_me:11589: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_nsl_gethostbyname=yes
 else
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:10589: result: $ac_cv_lib_nsl_gethostbyname" >&5
+echo "$as_me:11600: result: $ac_cv_lib_nsl_gethostbyname" >&5
 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
 if test $ac_cv_lib_nsl_gethostbyname = yes; then
   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
 fi
 
       if test $ac_cv_lib_nsl_gethostbyname = no; then
-        echo "$as_me:10596: checking for gethostbyname in -lbsd" >&5
+        echo "$as_me:11607: checking for gethostbyname in -lbsd" >&5
 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
 if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -10601,7 +11612,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lbsd  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 10604 "configure"
+#line 11615 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -10620,16 +11631,16 @@ gethostbyname ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:10623: \"$ac_link\"") >&5
+if { (eval echo "$as_me:11634: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:10626: \$? = $ac_status" >&5
+  echo "$as_me:11637: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:10629: \"$ac_try\"") >&5
+  { (eval echo "$as_me:11640: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:10632: \$? = $ac_status" >&5
+  echo "$as_me:11643: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_bsd_gethostbyname=yes
 else
@@ -10640,7 +11651,7 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:10643: result: $ac_cv_lib_bsd_gethostbyname" >&5
+echo "$as_me:11654: result: $ac_cv_lib_bsd_gethostbyname" >&5
 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
 if test $ac_cv_lib_bsd_gethostbyname = yes; then
   X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
     # variants that don't use the nameserver (or something).  -lsocket
     # must be given before -lnsl if both are needed.  We assume that
     # if connect needs -lnsl, so does gethostbyname.
-    echo "$as_me:10659: checking for connect" >&5
+    echo "$as_me:11670: checking for connect" >&5
 echo $ECHO_N "checking for connect... $ECHO_C" >&6
 if test "${ac_cv_func_connect+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 10665 "configure"
+#line 11676 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char connect (); below.  */
@@ -10693,16 +11704,16 @@ f = connect; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:10696: \"$ac_link\"") >&5
+if { (eval echo "$as_me:11707: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:10699: \$? = $ac_status" >&5
+  echo "$as_me:11710: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:10702: \"$ac_try\"") >&5
+  { (eval echo "$as_me:11713: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:10705: \$? = $ac_status" >&5
+  echo "$as_me:11716: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_func_connect=yes
 else
@@ -10712,11 +11723,11 @@ ac_cv_func_connect=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:10715: result: $ac_cv_func_connect" >&5
+echo "$as_me:11726: result: $ac_cv_func_connect" >&5
 echo "${ECHO_T}$ac_cv_func_connect" >&6
 
     if test $ac_cv_func_connect = no; then
-      echo "$as_me:10719: checking for connect in -lsocket" >&5
+      echo "$as_me:11730: checking for connect in -lsocket" >&5
 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
 if test "${ac_cv_lib_socket_connect+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -10724,7 +11735,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 10727 "configure"
+#line 11738 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -10743,16 +11754,16 @@ connect ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:10746: \"$ac_link\"") >&5
+if { (eval echo "$as_me:11757: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:10749: \$? = $ac_status" >&5
+  echo "$as_me:11760: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:10752: \"$ac_try\"") >&5
+  { (eval echo "$as_me:11763: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:10755: \$? = $ac_status" >&5
+  echo "$as_me:11766: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_socket_connect=yes
 else
@@ -10763,7 +11774,7 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:10766: result: $ac_cv_lib_socket_connect" >&5
+echo "$as_me:11777: result: $ac_cv_lib_socket_connect" >&5
 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
 if test $ac_cv_lib_socket_connect = yes; then
   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
     fi
 
     # Guillermo Gomez says -lposix is necessary on A/UX.
-    echo "$as_me:10775: checking for remove" >&5
+    echo "$as_me:11786: checking for remove" >&5
 echo $ECHO_N "checking for remove... $ECHO_C" >&6
 if test "${ac_cv_func_remove+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 10781 "configure"
+#line 11792 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char remove (); below.  */
@@ -10809,16 +11820,16 @@ f = remove; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:10812: \"$ac_link\"") >&5
+if { (eval echo "$as_me:11823: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:10815: \$? = $ac_status" >&5
+  echo "$as_me:11826: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:10818: \"$ac_try\"") >&5
+  { (eval echo "$as_me:11829: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:10821: \$? = $ac_status" >&5
+  echo "$as_me:11832: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_func_remove=yes
 else
@@ -10828,11 +11839,11 @@ ac_cv_func_remove=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:10831: result: $ac_cv_func_remove" >&5
+echo "$as_me:11842: result: $ac_cv_func_remove" >&5
 echo "${ECHO_T}$ac_cv_func_remove" >&6
 
     if test $ac_cv_func_remove = no; then
-      echo "$as_me:10835: checking for remove in -lposix" >&5
+      echo "$as_me:11846: checking for remove in -lposix" >&5
 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
 if test "${ac_cv_lib_posix_remove+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -10840,7 +11851,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lposix  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 10843 "configure"
+#line 11854 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -10859,16 +11870,16 @@ remove ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:10862: \"$ac_link\"") >&5
+if { (eval echo "$as_me:11873: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:10865: \$? = $ac_status" >&5
+  echo "$as_me:11876: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:10868: \"$ac_try\"") >&5
+  { (eval echo "$as_me:11879: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:10871: \$? = $ac_status" >&5
+  echo "$as_me:11882: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_posix_remove=yes
 else
@@ -10879,7 +11890,7 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:10882: result: $ac_cv_lib_posix_remove" >&5
+echo "$as_me:11893: result: $ac_cv_lib_posix_remove" >&5
 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
 if test $ac_cv_lib_posix_remove = yes; then
   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
     fi
 
     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
-    echo "$as_me:10891: checking for shmat" >&5
+    echo "$as_me:11902: checking for shmat" >&5
 echo $ECHO_N "checking for shmat... $ECHO_C" >&6
 if test "${ac_cv_func_shmat+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 10897 "configure"
+#line 11908 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char shmat (); below.  */
@@ -10925,16 +11936,16 @@ f = shmat; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:10928: \"$ac_link\"") >&5
+if { (eval echo "$as_me:11939: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:10931: \$? = $ac_status" >&5
+  echo "$as_me:11942: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:10934: \"$ac_try\"") >&5
+  { (eval echo "$as_me:11945: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:10937: \$? = $ac_status" >&5
+  echo "$as_me:11948: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_func_shmat=yes
 else
@@ -10944,11 +11955,11 @@ ac_cv_func_shmat=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:10947: result: $ac_cv_func_shmat" >&5
+echo "$as_me:11958: result: $ac_cv_func_shmat" >&5
 echo "${ECHO_T}$ac_cv_func_shmat" >&6
 
     if test $ac_cv_func_shmat = no; then
-      echo "$as_me:10951: checking for shmat in -lipc" >&5
+      echo "$as_me:11962: checking for shmat in -lipc" >&5
 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
 if test "${ac_cv_lib_ipc_shmat+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -10956,7 +11967,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lipc  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 10959 "configure"
+#line 11970 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -10975,16 +11986,16 @@ shmat ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:10978: \"$ac_link\"") >&5
+if { (eval echo "$as_me:11989: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:10981: \$? = $ac_status" >&5
+  echo "$as_me:11992: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:10984: \"$ac_try\"") >&5
+  { (eval echo "$as_me:11995: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:10987: \$? = $ac_status" >&5
+  echo "$as_me:11998: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_ipc_shmat=yes
 else
@@ -10995,7 +12006,7 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:10998: result: $ac_cv_lib_ipc_shmat" >&5
+echo "$as_me:12009: result: $ac_cv_lib_ipc_shmat" >&5
 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
 if test $ac_cv_lib_ipc_shmat = yes; then
   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
@@ -11013,7 +12024,7 @@ fi
   # These have to be linked with before -lX11, unlike the other
   # libraries we check for below, so use a different variable.
   # John Interrante, Karl Berry
-  echo "$as_me:11016: checking for IceConnectionNumber in -lICE" >&5
+  echo "$as_me:12027: checking for IceConnectionNumber in -lICE" >&5
 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
 if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -11021,7 +12032,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 11024 "configure"
+#line 12035 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -11040,16 +12051,16 @@ IceConnectionNumber ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:11043: \"$ac_link\"") >&5
+if { (eval echo "$as_me:12054: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:11046: \$? = $ac_status" >&5
+  echo "$as_me:12057: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:11049: \"$ac_try\"") >&5
+  { (eval echo "$as_me:12060: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:11052: \$? = $ac_status" >&5
+  echo "$as_me:12063: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_ICE_IceConnectionNumber=yes
 else
@@ -11060,7 +12071,7 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:11063: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
+echo "$as_me:12074: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
 if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then
   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
@@ -11072,7 +12083,7 @@ fi
 
 cf_x_athena=${cf_x_athena:-Xaw}
 
-echo "$as_me:11075: checking if you want to link with Xaw 3d library" >&5
+echo "$as_me:12086: checking if you want to link with Xaw 3d library" >&5
 echo $ECHO_N "checking if you want to link with Xaw 3d library... $ECHO_C" >&6
 withval=
 
@@ -11083,14 +12094,14 @@ if test "${with_Xaw3d+set}" = set; then
 fi;
 if test "$withval" = yes ; then
        cf_x_athena=Xaw3d
-       echo "$as_me:11086: result: yes" >&5
+       echo "$as_me:12097: result: yes" >&5
 echo "${ECHO_T}yes" >&6
 else
-       echo "$as_me:11089: result: no" >&5
+       echo "$as_me:12100: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
-echo "$as_me:11093: checking if you want to link with Xaw 3d xft library" >&5
+echo "$as_me:12104: checking if you want to link with Xaw 3d xft library" >&5
 echo $ECHO_N "checking if you want to link with Xaw 3d xft library... $ECHO_C" >&6
 withval=
 
@@ -11101,14 +12112,14 @@ if test "${with_Xaw3dxft+set}" = set; then
 fi;
 if test "$withval" = yes ; then
        cf_x_athena=Xaw3dxft
-       echo "$as_me:11104: result: yes" >&5
+       echo "$as_me:12115: result: yes" >&5
 echo "${ECHO_T}yes" >&6
 else
-       echo "$as_me:11107: result: no" >&5
+       echo "$as_me:12118: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
-echo "$as_me:11111: checking if you want to link with neXT Athena library" >&5
+echo "$as_me:12122: checking if you want to link with neXT Athena library" >&5
 echo $ECHO_N "checking if you want to link with neXT Athena library... $ECHO_C" >&6
 withval=
 
@@ -11119,14 +12130,14 @@ if test "${with_neXtaw+set}" = set; then
 fi;
 if test "$withval" = yes ; then
        cf_x_athena=neXtaw
-       echo "$as_me:11122: result: yes" >&5
+       echo "$as_me:12133: result: yes" >&5
 echo "${ECHO_T}yes" >&6
 else
-       echo "$as_me:11125: result: no" >&5
+       echo "$as_me:12136: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
-echo "$as_me:11129: checking if you want to link with Athena-Plus library" >&5
+echo "$as_me:12140: checking if you want to link with Athena-Plus library" >&5
 echo $ECHO_N "checking if you want to link with Athena-Plus library... $ECHO_C" >&6
 withval=
 
@@ -11137,10 +12148,10 @@ if test "${with_XawPlus+set}" = set; then
 fi;
 if test "$withval" = yes ; then
        cf_x_athena=XawPlus
-       echo "$as_me:11140: result: yes" >&5
+       echo "$as_me:12151: result: yes" >&5
 echo "${ECHO_T}yes" >&6
 else
-       echo "$as_me:11143: result: no" >&5
+       echo "$as_me:12154: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -11160,17 +12171,17 @@ if test "$PKG_CONFIG" != none ; then
 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists $cf_athena_pkg; then
        test -n "$verbose" && echo "    found package $cf_athena_pkg" 1>&6
 
-echo "${as_me:-configure}:11163: testing found package $cf_athena_pkg ..." 1>&5
+echo "${as_me:-configure}:12174: testing found package $cf_athena_pkg ..." 1>&5
 
        cf_pkgconfig_incs="`$PKG_CONFIG --cflags $cf_athena_pkg 2>/dev/null`"
        cf_pkgconfig_libs="`$PKG_CONFIG --libs   $cf_athena_pkg 2>/dev/null`"
        test -n "$verbose" && echo "    package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs" 1>&6
 
-echo "${as_me:-configure}:11169: testing package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs ..." 1>&5
+echo "${as_me:-configure}:12180: testing package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs ..." 1>&5
 
        test -n "$verbose" && echo "    package $cf_athena_pkg LIBS: $cf_pkgconfig_libs" 1>&6
 
-echo "${as_me:-configure}:11173: testing package $cf_athena_pkg LIBS: $cf_pkgconfig_libs ..." 1>&5
+echo "${as_me:-configure}:12184: testing package $cf_athena_pkg LIBS: $cf_pkgconfig_libs ..." 1>&5
 
 cf_fix_cppflags=no
 cf_new_cflags=
@@ -11301,20 +12312,20 @@ EOF
                        LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
                        test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
 
-echo "${as_me:-configure}:11304: testing ..trimmed $LIBS ..." 1>&5
+echo "${as_me:-configure}:12315: testing ..trimmed $LIBS ..." 1>&5
 
                        ;;
                esac
        done
 
-echo "$as_me:11310: checking for usable $cf_x_athena/Xmu package" >&5
+echo "$as_me:12321: checking for usable $cf_x_athena/Xmu package" >&5
 echo $ECHO_N "checking for usable $cf_x_athena/Xmu package... $ECHO_C" >&6
 if test "${cf_cv_xaw_compat+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
 cat >conftest.$ac_ext <<_ACEOF
-#line 11317 "configure"
+#line 12328 "configure"
 #include "confdefs.h"
 
 #include <X11/Xmu/CharSet.h>
@@ -11330,16 +12341,16 @@ int check = XmuCompareISOLatin1("big", "small")
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:11333: \"$ac_link\"") >&5
+if { (eval echo "$as_me:12344: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:11336: \$? = $ac_status" >&5
+  echo "$as_me:12347: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:11339: \"$ac_try\"") >&5
+  { (eval echo "$as_me:12350: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:11342: \$? = $ac_status" >&5
+  echo "$as_me:12353: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_xaw_compat=yes
 else
@@ -11349,7 +12360,7 @@ cf_cv_xaw_compat=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:11352: result: $cf_cv_xaw_compat" >&5
+echo "$as_me:12363: result: $cf_cv_xaw_compat" >&5
 echo "${ECHO_T}$cf_cv_xaw_compat" >&6
 
                        if test "$cf_cv_xaw_compat" = no
@@ -11361,7 +12372,7 @@ echo "${ECHO_T}$cf_cv_xaw_compat" >&6
                                (*)
                                        test -n "$verbose" && echo "    work around broken package" 1>&6
 
-echo "${as_me:-configure}:11364: testing work around broken package ..." 1>&5
+echo "${as_me:-configure}:12375: testing work around broken package ..." 1>&5
 
                                        cf_save_xmu="$LIBS"
                                        cf_first_lib=`echo "$cf_save_xmu" | sed -e 's/^  *//' -e 's/ .*//'`
@@ -11369,17 +12380,17 @@ echo "${as_me:-configure}:11364: testing work around broken package ..." 1>&5
 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xmu; then
        test -n "$verbose" && echo "    found package xmu" 1>&6
 
-echo "${as_me:-configure}:11372: testing found package xmu ..." 1>&5
+echo "${as_me:-configure}:12383: testing found package xmu ..." 1>&5
 
        cf_pkgconfig_incs="`$PKG_CONFIG --cflags xmu 2>/dev/null`"
        cf_pkgconfig_libs="`$PKG_CONFIG --libs   xmu 2>/dev/null`"
        test -n "$verbose" && echo "    package xmu CFLAGS: $cf_pkgconfig_incs" 1>&6
 
-echo "${as_me:-configure}:11378: testing package xmu CFLAGS: $cf_pkgconfig_incs ..." 1>&5
+echo "${as_me:-configure}:12389: testing package xmu CFLAGS: $cf_pkgconfig_incs ..." 1>&5
 
        test -n "$verbose" && echo "    package xmu LIBS: $cf_pkgconfig_libs" 1>&6
 
-echo "${as_me:-configure}:11382: testing package xmu LIBS: $cf_pkgconfig_libs ..." 1>&5
+echo "${as_me:-configure}:12393: testing package xmu LIBS: $cf_pkgconfig_libs ..." 1>&5
 
 cf_fix_cppflags=no
 cf_new_cflags=
@@ -11499,12 +12510,12 @@ LIBS="$cf_add_libs"
 
 test -n "$verbose" && echo "   ...before $LIBS" 1>&6
 
-echo "${as_me:-configure}:11502: testing ...before $LIBS ..." 1>&5
+echo "${as_me:-configure}:12513: testing ...before $LIBS ..." 1>&5
 
 LIBS=`echo "$LIBS" | sed -e "s/[       ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib $cf_pkgconfig_libs %" -e 's%  % %g'`
 test -n "$verbose" && echo "   ...after  $LIBS" 1>&6
 
-echo "${as_me:-configure}:11507: testing ...after  $LIBS ..." 1>&5
+echo "${as_me:-configure}:12518: testing ...after  $LIBS ..." 1>&5
 
 else
        cf_pkgconfig_incs=
@@ -11512,12 +12523,12 @@ else
 
 test -n "$verbose" && echo "   ...before $LIBS" 1>&6
 
-echo "${as_me:-configure}:11515: testing ...before $LIBS ..." 1>&5
+echo "${as_me:-configure}:12526: testing ...before $LIBS ..." 1>&5
 
 LIBS=`echo "$LIBS" | sed -e "s/[       ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib -lXmu %" -e 's%  % %g'`
 test -n "$verbose" && echo "   ...after  $LIBS" 1>&6
 
-echo "${as_me:-configure}:11520: testing ...after  $LIBS ..." 1>&5
+echo "${as_me:-configure}:12531: testing ...after  $LIBS ..." 1>&5
 
 fi
 
@@ -11528,7 +12539,7 @@ fi
                        LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
                        test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
 
-echo "${as_me:-configure}:11531: testing ..trimmed $LIBS ..." 1>&5
+echo "${as_me:-configure}:12542: testing ..trimmed $LIBS ..." 1>&5
 
                        ;;
                esac
@@ -11553,17 +12564,17 @@ if test -z "$cf_x_athena_lib" ; then
 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists Xext; then
        test -n "$verbose" && echo "    found package Xext" 1>&6
 
-echo "${as_me:-configure}:11556: testing found package Xext ..." 1>&5
+echo "${as_me:-configure}:12567: testing found package Xext ..." 1>&5
 
        cf_pkgconfig_incs="`$PKG_CONFIG --cflags Xext 2>/dev/null`"
        cf_pkgconfig_libs="`$PKG_CONFIG --libs   Xext 2>/dev/null`"
        test -n "$verbose" && echo "    package Xext CFLAGS: $cf_pkgconfig_incs" 1>&6
 
-echo "${as_me:-configure}:11562: testing package Xext CFLAGS: $cf_pkgconfig_incs ..." 1>&5
+echo "${as_me:-configure}:12573: testing package Xext CFLAGS: $cf_pkgconfig_incs ..." 1>&5
 
        test -n "$verbose" && echo "    package Xext LIBS: $cf_pkgconfig_libs" 1>&6
 
-echo "${as_me:-configure}:11566: testing package Xext LIBS: $cf_pkgconfig_libs ..." 1>&5
+echo "${as_me:-configure}:12577: testing package Xext LIBS: $cf_pkgconfig_libs ..." 1>&5
 
 cf_fix_cppflags=no
 cf_new_cflags=
@@ -11684,7 +12695,7 @@ else
        cf_pkgconfig_incs=
        cf_pkgconfig_libs=
 
-       echo "$as_me:11687: checking for XextCreateExtension in -lXext" >&5
+       echo "$as_me:12698: checking for XextCreateExtension in -lXext" >&5
 echo $ECHO_N "checking for XextCreateExtension in -lXext... $ECHO_C" >&6
 if test "${ac_cv_lib_Xext_XextCreateExtension+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -11692,7 +12703,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lXext  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 11695 "configure"
+#line 12706 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -11711,16 +12722,16 @@ XextCreateExtension ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:11714: \"$ac_link\"") >&5
+if { (eval echo "$as_me:12725: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:11717: \$? = $ac_status" >&5
+  echo "$as_me:12728: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:11720: \"$ac_try\"") >&5
+  { (eval echo "$as_me:12731: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:11723: \$? = $ac_status" >&5
+  echo "$as_me:12734: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_Xext_XextCreateExtension=yes
 else
@@ -11731,7 +12742,7 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:11734: result: $ac_cv_lib_Xext_XextCreateExtension" >&5
+echo "$as_me:12745: result: $ac_cv_lib_Xext_XextCreateExtension" >&5
 echo "${ECHO_T}$ac_cv_lib_Xext_XextCreateExtension" >&6
 if test $ac_cv_lib_Xext_XextCreateExtension = yes; then
 
@@ -11767,17 +12778,17 @@ then
 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
        test -n "$verbose" && echo "    found package x11" 1>&6
 
-echo "${as_me:-configure}:11770: testing found package x11 ..." 1>&5
+echo "${as_me:-configure}:12781: testing found package x11 ..." 1>&5
 
        cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
        cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
        test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
 
-echo "${as_me:-configure}:11776: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
+echo "${as_me:-configure}:12787: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
 
        test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
 
-echo "${as_me:-configure}:11780: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
+echo "${as_me:-configure}:12791: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
 
 cf_fix_cppflags=no
 cf_new_cflags=
@@ -11897,24 +12908,24 @@ LIBS="$cf_add_libs"
 else
        cf_pkgconfig_incs=
        cf_pkgconfig_libs=
-       { echo "$as_me:11900: WARNING: unable to find X11 library" >&5
+       { echo "$as_me:12911: WARNING: unable to find X11 library" >&5
 echo "$as_me: WARNING: unable to find X11 library" >&2;}
 fi
 
 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
        test -n "$verbose" && echo "    found package ice" 1>&6
 
-echo "${as_me:-configure}:11907: testing found package ice ..." 1>&5
+echo "${as_me:-configure}:12918: testing found package ice ..." 1>&5
 
        cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
        cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
        test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
 
-echo "${as_me:-configure}:11913: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
+echo "${as_me:-configure}:12924: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
 
        test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
 
-echo "${as_me:-configure}:11917: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
+echo "${as_me:-configure}:12928: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
 
 cf_fix_cppflags=no
 cf_new_cflags=
@@ -12034,24 +13045,24 @@ LIBS="$cf_add_libs"
 else
        cf_pkgconfig_incs=
        cf_pkgconfig_libs=
-       { echo "$as_me:12037: WARNING: unable to find ICE library" >&5
+       { echo "$as_me:13048: WARNING: unable to find ICE library" >&5
 echo "$as_me: WARNING: unable to find ICE library" >&2;}
 fi
 
 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
        test -n "$verbose" && echo "    found package sm" 1>&6
 
-echo "${as_me:-configure}:12044: testing found package sm ..." 1>&5
+echo "${as_me:-configure}:13055: testing found package sm ..." 1>&5
 
        cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
        cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
        test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
 
-echo "${as_me:-configure}:12050: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
+echo "${as_me:-configure}:13061: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
 
        test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
 
-echo "${as_me:-configure}:12054: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
+echo "${as_me:-configure}:13065: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
 
 cf_fix_cppflags=no
 cf_new_cflags=
@@ -12171,24 +13182,24 @@ LIBS="$cf_add_libs"
 else
        cf_pkgconfig_incs=
        cf_pkgconfig_libs=
-       { echo "$as_me:12174: WARNING: unable to find SM library" >&5
+       { echo "$as_me:13185: WARNING: unable to find SM library" >&5
 echo "$as_me: WARNING: unable to find SM library" >&2;}
 fi
 
 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
        test -n "$verbose" && echo "    found package xt" 1>&6
 
-echo "${as_me:-configure}:12181: testing found package xt ..." 1>&5
+echo "${as_me:-configure}:13192: testing found package xt ..." 1>&5
 
        cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
        cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
        test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
 
-echo "${as_me:-configure}:12187: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
+echo "${as_me:-configure}:13198: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
 
        test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
 
-echo "${as_me:-configure}:12191: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
+echo "${as_me:-configure}:13202: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
 
 cf_fix_cppflags=no
 cf_new_cflags=
@@ -12308,7 +13319,7 @@ LIBS="$cf_add_libs"
 else
        cf_pkgconfig_incs=
        cf_pkgconfig_libs=
-       { echo "$as_me:12311: WARNING: unable to find Xt library" >&5
+       { echo "$as_me:13322: WARNING: unable to find Xt library" >&5
 echo "$as_me: WARNING: unable to find Xt library" >&2;}
 fi
 
@@ -12319,17 +13330,17 @@ cf_have_X_LIBS=no
 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
        test -n "$verbose" && echo "    found package xt" 1>&6
 
-echo "${as_me:-configure}:12322: testing found package xt ..." 1>&5
+echo "${as_me:-configure}:13333: testing found package xt ..." 1>&5
 
        cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
        cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
        test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
 
-echo "${as_me:-configure}:12328: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
+echo "${as_me:-configure}:13339: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
 
        test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
 
-echo "${as_me:-configure}:12332: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
+echo "${as_me:-configure}:13343: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
 
 cf_fix_cppflags=no
 cf_new_cflags=
@@ -12450,14 +13461,14 @@ LIBS="$cf_add_libs"
                ;;
        (*)
 # we have an "xt" package, but it may omit Xt's dependency on X11
-echo "$as_me:12453: checking for usable X dependency" >&5
+echo "$as_me:13464: checking for usable X dependency" >&5
 echo $ECHO_N "checking for usable X dependency... $ECHO_C" >&6
 if test "${cf_cv_xt_x11_compat+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
 cat >conftest.$ac_ext <<_ACEOF
-#line 12460 "configure"
+#line 13471 "configure"
 #include "confdefs.h"
 
 #include <X11/Xlib.h>
@@ -12476,16 +13487,16 @@ main (void)
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:12479: \"$ac_link\"") >&5
+if { (eval echo "$as_me:13490: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:12482: \$? = $ac_status" >&5
+  echo "$as_me:13493: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:12485: \"$ac_try\"") >&5
+  { (eval echo "$as_me:13496: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:12488: \$? = $ac_status" >&5
+  echo "$as_me:13499: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_xt_x11_compat=yes
 else
@@ -12495,30 +13506,30 @@ cf_cv_xt_x11_compat=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:12498: result: $cf_cv_xt_x11_compat" >&5
+echo "$as_me:13509: result: $cf_cv_xt_x11_compat" >&5
 echo "${ECHO_T}$cf_cv_xt_x11_compat" >&6
                if test "$cf_cv_xt_x11_compat" = no
                then
                        test -n "$verbose" && echo "    work around broken X11 dependency" 1>&6
 
-echo "${as_me:-configure}:12504: testing work around broken X11 dependency ..." 1>&5
+echo "${as_me:-configure}:13515: testing work around broken X11 dependency ..." 1>&5
 
                        # 2010/11/19 - good enough until a working Xt on Xcb is delivered.
 
 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
        test -n "$verbose" && echo "    found package x11" 1>&6
 
-echo "${as_me:-configure}:12511: testing found package x11 ..." 1>&5
+echo "${as_me:-configure}:13522: testing found package x11 ..." 1>&5
 
        cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
        cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
        test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
 
-echo "${as_me:-configure}:12517: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
+echo "${as_me:-configure}:13528: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
 
        test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
 
-echo "${as_me:-configure}:12521: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
+echo "${as_me:-configure}:13532: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
 
 cf_fix_cppflags=no
 cf_new_cflags=
@@ -12641,12 +13652,12 @@ else
 
 test -n "$verbose" && echo "   ...before $LIBS" 1>&6
 
-echo "${as_me:-configure}:12644: testing ...before $LIBS ..." 1>&5
+echo "${as_me:-configure}:13655: testing ...before $LIBS ..." 1>&5
 
 LIBS=`echo "$LIBS" | sed -e "s/[       ][      ]*/ /g" -e "s%-lXt %-lXt -lX11 %" -e 's%  % %g'`
 test -n "$verbose" && echo "   ...after  $LIBS" 1>&6
 
-echo "${as_me:-configure}:12649: testing ...after  $LIBS ..." 1>&5
+echo "${as_me:-configure}:13660: testing ...after  $LIBS ..." 1>&5
 
 fi
 
                ;;
        esac
 
-echo "$as_me:12657: checking for usable X Toolkit package" >&5
+echo "$as_me:13668: checking for usable X Toolkit package" >&5
 echo $ECHO_N "checking for usable X Toolkit package... $ECHO_C" >&6
 if test "${cf_cv_xt_ice_compat+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
 cat >conftest.$ac_ext <<_ACEOF
-#line 12664 "configure"
+#line 13675 "configure"
 #include "confdefs.h"
 
 #include <X11/Shell.h>
@@ -12676,16 +13687,16 @@ int num = IceConnectionNumber(0)
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:12679: \"$ac_link\"") >&5
+if { (eval echo "$as_me:13690: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:12682: \$? = $ac_status" >&5
+  echo "$as_me:13693: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:12685: \"$ac_try\"") >&5
+  { (eval echo "$as_me:13696: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:12688: \$? = $ac_status" >&5
+  echo "$as_me:13699: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_xt_ice_compat=yes
 else
@@ -12695,7 +13706,7 @@ cf_cv_xt_ice_compat=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:12698: result: $cf_cv_xt_ice_compat" >&5
+echo "$as_me:13709: result: $cf_cv_xt_ice_compat" >&5
 echo "${ECHO_T}$cf_cv_xt_ice_compat" >&6
 
        if test "$cf_cv_xt_ice_compat" = no
@@ -12709,22 +13720,22 @@ echo "${ECHO_T}$cf_cv_xt_ice_compat" >&6
                        (*)
                                test -n "$verbose" && echo "    work around broken ICE dependency" 1>&6
 
-echo "${as_me:-configure}:12712: testing work around broken ICE dependency ..." 1>&5
+echo "${as_me:-configure}:13723: testing work around broken ICE dependency ..." 1>&5
 
 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
        test -n "$verbose" && echo "    found package ice" 1>&6
 
-echo "${as_me:-configure}:12717: testing found package ice ..." 1>&5
+echo "${as_me:-configure}:13728: testing found package ice ..." 1>&5
 
        cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
        cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
        test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
 
-echo "${as_me:-configure}:12723: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
+echo "${as_me:-configure}:13734: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
 
        test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
 
-echo "${as_me:-configure}:12727: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
+echo "${as_me:-configure}:13738: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
 
 cf_fix_cppflags=no
 cf_new_cflags=
@@ -12843,17 +13854,17 @@ LIBS="$cf_add_libs"
 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
        test -n "$verbose" && echo "    found package sm" 1>&6
 
-echo "${as_me:-configure}:12846: testing found package sm ..." 1>&5
+echo "${as_me:-configure}:13857: testing found package sm ..." 1>&5
 
        cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
        cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
        test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
 
-echo "${as_me:-configure}:12852: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
+echo "${as_me:-configure}:13863: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
 
        test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
 
-echo "${as_me:-configure}:12856: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
+echo "${as_me:-configure}:13867: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
 
 cf_fix_cppflags=no
 cf_new_cflags=
@@ -12982,12 +13993,12 @@ else
 
 test -n "$verbose" && echo "   ...before $LIBS" 1>&6
 
-echo "${as_me:-configure}:12985: testing ...before $LIBS ..." 1>&5
+echo "${as_me:-configure}:13996: testing ...before $LIBS ..." 1>&5
 
 LIBS=`echo "$LIBS" | sed -e "s/[       ][      ]*/ /g" -e "s%-lXt %-lXt $X_PRE_LIBS %" -e 's%  % %g'`
 test -n "$verbose" && echo "   ...after  $LIBS" 1>&6
 
-echo "${as_me:-configure}:12990: testing ...after  $LIBS ..." 1>&5
+echo "${as_me:-configure}:14001: testing ...after  $LIBS ..." 1>&5
 
 fi
 
@@ -13007,7 +14018,7 @@ else
 
 test -n "$verbose" && echo "   checking additions to CFLAGS" 1>&6
 
-echo "${as_me:-configure}:13010: testing checking additions to CFLAGS ..." 1>&5
+echo "${as_me:-configure}:14021: testing checking additions to CFLAGS ..." 1>&5
 
 cf_check_cflags="$CFLAGS"
 cf_check_cppflags="$CPPFLAGS"
@@ -13092,7 +14103,7 @@ done
 if test -n "$cf_new_cflags" ; then
        test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
 
-echo "${as_me:-configure}:13095: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
+echo "${as_me:-configure}:14106: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
 
        test -n "$CFLAGS" && CFLAGS="$CFLAGS "
        CFLAGS="${CFLAGS}$cf_new_cflags"
@@ -13102,7 +14113,7 @@ fi
 if test -n "$cf_new_cppflags" ; then
        test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
 
-echo "${as_me:-configure}:13105: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
+echo "${as_me:-configure}:14116: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
 
        test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
        CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
@@ -13112,7 +14123,7 @@ 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}:13115: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
+echo "${as_me:-configure}:14126: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
 
        test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
        EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
@@ -13121,7 +14132,7 @@ fi
 
 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
 cat >conftest.$ac_ext <<_ACEOF
-#line 13124 "configure"
+#line 14135 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 int
@@ -13133,16 +14144,16 @@ printf("Hello world");
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:13136: \"$ac_link\"") >&5
+if { (eval echo "$as_me:14147: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:13139: \$? = $ac_status" >&5
+  echo "$as_me:14150: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:13142: \"$ac_try\"") >&5
+  { (eval echo "$as_me:14153: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:13145: \$? = $ac_status" >&5
+  echo "$as_me:14156: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   :
 else
@@ -13150,12 +14161,12 @@ else
 cat conftest.$ac_ext >&5
 test -n "$verbose" && echo "   test-compile failed.  Undoing change to \$CFLAGS" 1>&6
 
-echo "${as_me:-configure}:13153: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
+echo "${as_me:-configure}:14164: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
 
         if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
                 test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
 
-echo "${as_me:-configure}:13158: testing but keeping change to \$CPPFLAGS ..." 1>&5
+echo "${as_me:-configure}:14169: testing but keeping change to \$CPPFLAGS ..." 1>&5
 
         fi
         CFLAGS="$cf_check_flags"
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
 
-       echo "$as_me:13166: checking for XOpenDisplay" >&5
+       echo "$as_me:14177: checking for XOpenDisplay" >&5
 echo $ECHO_N "checking for XOpenDisplay... $ECHO_C" >&6
 if test "${ac_cv_func_XOpenDisplay+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 13172 "configure"
+#line 14183 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char XOpenDisplay (); below.  */
@@ -13200,16 +14211,16 @@ f = XOpenDisplay; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:13203: \"$ac_link\"") >&5
+if { (eval echo "$as_me:14214: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:13206: \$? = $ac_status" >&5
+  echo "$as_me:14217: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:13209: \"$ac_try\"") >&5
+  { (eval echo "$as_me:14220: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:13212: \$? = $ac_status" >&5
+  echo "$as_me:14223: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_func_XOpenDisplay=yes
 else
@@ -13219,13 +14230,13 @@ ac_cv_func_XOpenDisplay=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:13222: result: $ac_cv_func_XOpenDisplay" >&5
+echo "$as_me:14233: result: $ac_cv_func_XOpenDisplay" >&5
 echo "${ECHO_T}$ac_cv_func_XOpenDisplay" >&6
 if test $ac_cv_func_XOpenDisplay = yes; then
   :
 else
 
-       echo "$as_me:13228: checking for XOpenDisplay in -lX11" >&5
+       echo "$as_me:14239: checking for XOpenDisplay in -lX11" >&5
 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -13233,7 +14244,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 13236 "configure"
+#line 14247 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -13252,16 +14263,16 @@ XOpenDisplay ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:13255: \"$ac_link\"") >&5
+if { (eval echo "$as_me:14266: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:13258: \$? = $ac_status" >&5
+  echo "$as_me:14269: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:13261: \"$ac_try\"") >&5
+  { (eval echo "$as_me:14272: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:13264: \$? = $ac_status" >&5
+  echo "$as_me:14275: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_X11_XOpenDisplay=yes
 else
@@ -13272,7 +14283,7 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:13275: result: $ac_cv_lib_X11_XOpenDisplay" >&5
+echo "$as_me:14286: result: $ac_cv_lib_X11_XOpenDisplay" >&5
 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
 
 
 fi
 
-       echo "$as_me:13299: checking for XtAppInitialize" >&5
+       echo "$as_me:14310: checking for XtAppInitialize" >&5
 echo $ECHO_N "checking for XtAppInitialize... $ECHO_C" >&6
 if test "${ac_cv_func_XtAppInitialize+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 13305 "configure"
+#line 14316 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char XtAppInitialize (); below.  */
@@ -13333,16 +14344,16 @@ f = XtAppInitialize; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:13336: \"$ac_link\"") >&5
+if { (eval echo "$as_me:14347: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:13339: \$? = $ac_status" >&5
+  echo "$as_me:14350: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:13342: \"$ac_try\"") >&5
+  { (eval echo "$as_me:14353: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:13345: \$? = $ac_status" >&5
+  echo "$as_me:14356: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_func_XtAppInitialize=yes
 else
@@ -13352,13 +14363,13 @@ ac_cv_func_XtAppInitialize=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:13355: result: $ac_cv_func_XtAppInitialize" >&5
+echo "$as_me:14366: result: $ac_cv_func_XtAppInitialize" >&5
 echo "${ECHO_T}$ac_cv_func_XtAppInitialize" >&6
 if test $ac_cv_func_XtAppInitialize = yes; then
   :
 else
 
-       echo "$as_me:13361: checking for XtAppInitialize in -lXt" >&5
+       echo "$as_me:14372: checking for XtAppInitialize in -lXt" >&5
 echo $ECHO_N "checking for XtAppInitialize in -lXt... $ECHO_C" >&6
 if test "${ac_cv_lib_Xt_XtAppInitialize+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -13366,7 +14377,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 13369 "configure"
+#line 14380 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -13385,16 +14396,16 @@ XtAppInitialize ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:13388: \"$ac_link\"") >&5
+if { (eval echo "$as_me:14399: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:13391: \$? = $ac_status" >&5
+  echo "$as_me:14402: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:13394: \"$ac_try\"") >&5
+  { (eval echo "$as_me:14405: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:13397: \$? = $ac_status" >&5
+  echo "$as_me:14408: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_Xt_XtAppInitialize=yes
 else
@@ -13405,7 +14416,7 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:13408: result: $ac_cv_lib_Xt_XtAppInitialize" >&5
+echo "$as_me:14419: result: $ac_cv_lib_Xt_XtAppInitialize" >&5
 echo "${ECHO_T}$ac_cv_lib_Xt_XtAppInitialize" >&6
 if test $ac_cv_lib_Xt_XtAppInitialize = yes; then
 
@@ -13422,7 +14433,7 @@ fi
 fi
 
 if test $cf_have_X_LIBS = no ; then
-       { echo "$as_me:13425: WARNING: Unable to successfully link X Toolkit library (-lXt) with
+       { echo "$as_me:14436: WARNING: Unable to successfully link X Toolkit library (-lXt) with
 test program.  You will have to check and add the proper libraries by hand
 to makefile." >&5
 echo "$as_me: WARNING: Unable to successfully link X Toolkit library (-lXt) with
                cf_save="$CPPFLAGS"
                cf_test=X11/$cf_x_athena_root/SimpleMenu.h
                if test $cf_path != default ; then
-                       CPPFLAGS="$cf_save -I$cf_path/include"
-                       echo "$as_me:13447: checking for $cf_test in $cf_path" >&5
+                       CPPFLAGS="$cf_save"
+
+       test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
+       CPPFLAGS="${CPPFLAGS}-I$cf_path/include"
+
+                       echo "$as_me:14462: checking for $cf_test in $cf_path" >&5
 echo $ECHO_N "checking for $cf_test in $cf_path... $ECHO_C" >&6
                else
-                       echo "$as_me:13450: checking for $cf_test" >&5
+                       echo "$as_me:14465: checking for $cf_test" >&5
 echo $ECHO_N "checking for $cf_test... $ECHO_C" >&6
                fi
                cat >conftest.$ac_ext <<_ACEOF
-#line 13454 "configure"
+#line 14469 "configure"
 #include "confdefs.h"
 
 #include <X11/Intrinsic.h>
@@ -13465,16 +14480,16 @@ main (void)
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:13468: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:14483: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:13471: \$? = $ac_status" >&5
+  echo "$as_me:14486: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:13474: \"$ac_try\"") >&5
+  { (eval echo "$as_me:14489: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:13477: \$? = $ac_status" >&5
+  echo "$as_me:14492: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_result=yes
 else
@@ -13483,7 +14498,7 @@ cat conftest.$ac_ext >&5
 cf_result=no
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
-               echo "$as_me:13486: result: $cf_result" >&5
+               echo "$as_me:14501: result: $cf_result" >&5
 echo "${ECHO_T}$cf_result" >&6
                if test "$cf_result" = yes ; then
                        cf_x_athena_inc=$cf_path
@@ -13495,10 +14510,13 @@ echo "${ECHO_T}$cf_result" >&6
 done
 
 if test -z "$cf_x_athena_inc" ; then
-       { echo "$as_me:13498: WARNING: Unable to successfully find Athena header files with test program" >&5
+       { echo "$as_me:14513: WARNING: Unable to successfully find Athena header files with test program" >&5
 echo "$as_me: WARNING: Unable to successfully find Athena header files with test program" >&2;}
 elif test "$cf_x_athena_inc" != default ; then
-       CPPFLAGS="$CPPFLAGS -I$cf_x_athena_inc"
+
+       test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
+       CPPFLAGS="${CPPFLAGS}-I$cf_x_athena_inc"
+
 fi
 
 cf_x_athena_root=$cf_x_athena
@@ -13541,7 +14559,7 @@ do
 done
 LIBS="$cf_add_libs"
 
-                               echo "$as_me:13544: checking for $cf_libs in $cf_path" >&5
+                               echo "$as_me:14562: checking for $cf_libs in $cf_path" >&5
 echo $ECHO_N "checking for $cf_libs in $cf_path... $ECHO_C" >&6
                        else
 
 done
 LIBS="$cf_add_libs"
 
-                               echo "$as_me:13564: checking for $cf_test in $cf_libs" >&5
+                               echo "$as_me:14582: checking for $cf_test in $cf_libs" >&5
 echo $ECHO_N "checking for $cf_test in $cf_libs... $ECHO_C" >&6
                        fi
                        cat >conftest.$ac_ext <<_ACEOF
-#line 13568 "configure"
+#line 14586 "configure"
 #include "confdefs.h"
 
 #include <X11/Intrinsic.h>
@@ -13581,16 +14599,16 @@ $cf_test((XtAppContext) 0)
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:13584: \"$ac_link\"") >&5
+if { (eval echo "$as_me:14602: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:13587: \$? = $ac_status" >&5
+  echo "$as_me:14605: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:13590: \"$ac_try\"") >&5
+  { (eval echo "$as_me:14608: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:13593: \$? = $ac_status" >&5
+  echo "$as_me:14611: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_result=yes
 else
@@ -13599,7 +14617,7 @@ cat conftest.$ac_ext >&5
 cf_result=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-                       echo "$as_me:13602: result: $cf_result" >&5
+                       echo "$as_me:14620: result: $cf_result" >&5
 echo "${ECHO_T}$cf_result" >&6
                        if test "$cf_result" = yes ; then
                                cf_x_athena_lib="$cf_libs"
@@ -13613,7 +14631,7 @@ echo "${ECHO_T}$cf_result" >&6
 done
 
 if test -z "$cf_x_athena_lib" ; then
-       { { echo "$as_me:13616: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&5
+       { { echo "$as_me:14634: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&5
 echo "$as_me: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&2;}
    { (exit 1); exit 1; }; }
 fi
@@ -13631,7 +14649,7 @@ if test -n "$ac_tool_prefix"; then
   do
     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-echo "$as_me:13634: checking for $ac_word" >&5
+echo "$as_me:14652: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_prog_XCURSES_CONFIG+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -13646,7 +14664,7 @@ for ac_dir in $ac_dummy; do
   test -z "$ac_dir" && ac_dir=.
   $as_executable_p "$ac_dir/$ac_word" || continue
 ac_cv_prog_XCURSES_CONFIG="$ac_tool_prefix$ac_prog"
-echo "$as_me:13649: found $ac_dir/$ac_word" >&5
+echo "$as_me:14667: found $ac_dir/$ac_word" >&5
 break
 done
 
 fi
 XCURSES_CONFIG=$ac_cv_prog_XCURSES_CONFIG
 if test -n "$XCURSES_CONFIG"; then
-  echo "$as_me:13657: result: $XCURSES_CONFIG" >&5
+  echo "$as_me:14675: result: $XCURSES_CONFIG" >&5
 echo "${ECHO_T}$XCURSES_CONFIG" >&6
 else
-  echo "$as_me:13660: result: no" >&5
+  echo "$as_me:14678: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -13670,7 +14688,7 @@ if test -z "$XCURSES_CONFIG"; then
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-echo "$as_me:13673: checking for $ac_word" >&5
+echo "$as_me:14691: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_prog_ac_ct_XCURSES_CONFIG+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -13685,7 +14703,7 @@ for ac_dir in $ac_dummy; do
   test -z "$ac_dir" && ac_dir=.
   $as_executable_p "$ac_dir/$ac_word" || continue
 ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_prog"
-echo "$as_me:13688: found $ac_dir/$ac_word" >&5
+echo "$as_me:14706: found $ac_dir/$ac_word" >&5
 break
 done
 
 fi
 ac_ct_XCURSES_CONFIG=$ac_cv_prog_ac_ct_XCURSES_CONFIG
 if test -n "$ac_ct_XCURSES_CONFIG"; then
-  echo "$as_me:13696: result: $ac_ct_XCURSES_CONFIG" >&5
+  echo "$as_me:14714: result: $ac_ct_XCURSES_CONFIG" >&5
 echo "${ECHO_T}$ac_ct_XCURSES_CONFIG" >&6
 else
-  echo "$as_me:13699: result: no" >&5
+  echo "$as_me:14717: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
 
 if test "$XCURSES_CONFIG" != none ; then
 
-CPPFLAGS="$CPPFLAGS `$XCURSES_CONFIG --cflags`"
+cf_fix_cppflags=no
+cf_new_cflags=
+cf_new_cppflags=
+cf_new_extra_cppflags=
+
+for cf_add_cflags in `$XCURSES_CONFIG --cflags`
+do
+case $cf_fix_cppflags in
+(no)
+       case $cf_add_cflags in
+       (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
+               case $cf_add_cflags in
+               (-D*)
+                       cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
+
+                       test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
+                               && test -z "${cf_tst_cflags}" \
+                               && cf_fix_cppflags=yes
+
+                       if test $cf_fix_cppflags = yes ; then
+
+       test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+       cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
+                               continue
+                       elif test "${cf_tst_cflags}" = "\"'" ; then
+
+       test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+       cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
+                               continue
+                       fi
+                       ;;
+               esac
+               case "$CPPFLAGS" in
+               (*$cf_add_cflags)
+                       ;;
+               (*)
+                       case $cf_add_cflags in
+                       (-D*)
+                               cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
+
+CPPFLAGS=`echo "$CPPFLAGS" | \
+       sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
+               -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
+
+                               ;;
+                       esac
+
+       test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
+       cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
+
+                       ;;
+               esac
+               ;;
+       (*)
+
+       test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
+       cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
+
+               ;;
+       esac
+       ;;
+(yes)
+
+       test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+       cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
+       cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
+
+       test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
+               && test -z "${cf_tst_cflags}" \
+               && cf_fix_cppflags=no
+       ;;
+esac
+done
+
+if test -n "$cf_new_cflags" ; then
+
+       test -n "$CFLAGS" && CFLAGS="$CFLAGS "
+       CFLAGS="${CFLAGS}$cf_new_cflags"
+
+fi
+
+if test -n "$cf_new_cppflags" ; then
+
+       test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
+       CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
+
+fi
+
+if test -n "$cf_new_extra_cppflags" ; then
+
+       test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
+       EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
+
+fi
 
 cf_add_libs="`$XCURSES_CONFIG --libs`"
 # Filter out duplicates - this happens with badly-designed ".pc" files...
@@ -13735,7 +14849,7 @@ LDFLAGS="$LDFLAGS $X_LIBS"
 
 test -n "$verbose" && echo "   checking additions to CFLAGS" 1>&6
 
-echo "${as_me:-configure}:13738: testing checking additions to CFLAGS ..." 1>&5
+echo "${as_me:-configure}:14852: testing checking additions to CFLAGS ..." 1>&5
 
 cf_check_cflags="$CFLAGS"
 cf_check_cppflags="$CPPFLAGS"
@@ -13820,7 +14934,7 @@ done
 if test -n "$cf_new_cflags" ; then
        test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
 
-echo "${as_me:-configure}:13823: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
+echo "${as_me:-configure}:14937: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
 
        test -n "$CFLAGS" && CFLAGS="$CFLAGS "
        CFLAGS="${CFLAGS}$cf_new_cflags"
@@ -13830,7 +14944,7 @@ fi
 if test -n "$cf_new_cppflags" ; then
        test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
 
-echo "${as_me:-configure}:13833: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
+echo "${as_me:-configure}:14947: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
 
        test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
        CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
@@ -13840,7 +14954,7 @@ 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}:13843: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
+echo "${as_me:-configure}:14957: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
 
        test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
        EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
@@ -13849,7 +14963,7 @@ fi
 
 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
 cat >conftest.$ac_ext <<_ACEOF
-#line 13852 "configure"
+#line 14966 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 int
@@ -13861,16 +14975,16 @@ printf("Hello world");
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:13864: \"$ac_link\"") >&5
+if { (eval echo "$as_me:14978: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:13867: \$? = $ac_status" >&5
+  echo "$as_me:14981: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:13870: \"$ac_try\"") >&5
+  { (eval echo "$as_me:14984: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:13873: \$? = $ac_status" >&5
+  echo "$as_me:14987: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   :
 else
@@ -13878,12 +14992,12 @@ else
 cat conftest.$ac_ext >&5
 test -n "$verbose" && echo "   test-compile failed.  Undoing change to \$CFLAGS" 1>&6
 
-echo "${as_me:-configure}:13881: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
+echo "${as_me:-configure}:14995: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
 
         if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
                 test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
 
-echo "${as_me:-configure}:13886: testing but keeping change to \$CPPFLAGS ..." 1>&5
+echo "${as_me:-configure}:15000: testing but keeping change to \$CPPFLAGS ..." 1>&5
 
         fi
         CFLAGS="$cf_check_flags"
@@ -13891,7 +15005,7 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
 
-echo "$as_me:13894: checking for XOpenDisplay in -lX11" >&5
+echo "$as_me:15008: checking for XOpenDisplay in -lX11" >&5
 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -13899,7 +15013,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 13902 "configure"
+#line 15016 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -13918,16 +15032,16 @@ XOpenDisplay ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:13921: \"$ac_link\"") >&5
+if { (eval echo "$as_me:15035: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:13924: \$? = $ac_status" >&5
+  echo "$as_me:15038: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:13927: \"$ac_try\"") >&5
+  { (eval echo "$as_me:15041: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:13930: \$? = $ac_status" >&5
+  echo "$as_me:15044: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_X11_XOpenDisplay=yes
 else
@@ -13938,7 +15052,7 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:13941: result: $ac_cv_lib_X11_XOpenDisplay" >&5
+echo "$as_me:15055: result: $ac_cv_lib_X11_XOpenDisplay" >&5
 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
 
@@ -13960,7 +15074,7 @@ LIBS="$cf_add_libs"
 
 fi
 
-echo "$as_me:13963: checking for XCurses library" >&5
+echo "$as_me:15077: checking for XCurses library" >&5
 echo $ECHO_N "checking for XCurses library... $ECHO_C" >&6
 if test "${cf_cv_lib_XCurses+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -13983,7 +15097,7 @@ done
 LIBS="$cf_add_libs"
 
 cat >conftest.$ac_ext <<_ACEOF
-#line 13986 "configure"
+#line 15100 "configure"
 #include "confdefs.h"
 
 #include <xcurses.h>
@@ -13998,16 +15112,16 @@ XCursesExit();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:14001: \"$ac_link\"") >&5
+if { (eval echo "$as_me:15115: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:14004: \$? = $ac_status" >&5
+  echo "$as_me:15118: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:14007: \"$ac_try\"") >&5
+  { (eval echo "$as_me:15121: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:14010: \$? = $ac_status" >&5
+  echo "$as_me:15124: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_lib_XCurses=yes
 else
@@ -14018,7 +15132,7 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 
 fi
-echo "$as_me:14021: result: $cf_cv_lib_XCurses" >&5
+echo "$as_me:15135: result: $cf_cv_lib_XCurses" >&5
 echo "${ECHO_T}$cf_cv_lib_XCurses" >&6
 
 fi
@@ -14033,23 +15147,23 @@ cat >>confdefs.h <<\EOF
 #define XCURSES 1
 EOF
 
-       echo "$as_me:14036: checking for xcurses.h" >&5
+       echo "$as_me:15150: checking for xcurses.h" >&5
 echo $ECHO_N "checking for xcurses.h... $ECHO_C" >&6
 if test "${ac_cv_header_xcurses_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 14042 "configure"
+#line 15156 "configure"
 #include "confdefs.h"
 #include <xcurses.h>
 _ACEOF
-if { (eval echo "$as_me:14046: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:15160: \"$ac_cpp conftest.$ac_ext\"") >&5
   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
   ac_status=$?
   egrep -v '^ *\+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:14052: \$? = $ac_status" >&5
+  echo "$as_me:15166: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
@@ -14068,7 +15182,7 @@ else
 fi
 rm -f conftest.err conftest.$ac_ext
 fi
-echo "$as_me:14071: result: $ac_cv_header_xcurses_h" >&5
+echo "$as_me:15185: result: $ac_cv_header_xcurses_h" >&5
 echo "${ECHO_T}$ac_cv_header_xcurses_h" >&6
 if test $ac_cv_header_xcurses_h = yes; then
 
@@ -14079,14 +15193,14 @@ EOF
 fi
 
 else
-       { { echo "$as_me:14082: error: Cannot link with XCurses" >&5
+       { { echo "$as_me:15196: error: Cannot link with XCurses" >&5
 echo "$as_me: error: Cannot link with XCurses" >&2;}
    { (exit 1); exit 1; }; }
 fi
 
        ;;
 (*)
-       { { echo "$as_me:14089: error: unexpected screen-value: $cf_cv_screen" >&5
+       { { echo "$as_me:15203: error: unexpected screen-value: $cf_cv_screen" >&5
 echo "$as_me: error: unexpected screen-value: $cf_cv_screen" >&2;}
    { (exit 1); exit 1; }; }
        ;;
@@ -14094,7 +15208,7 @@ esac
 
 : ${cf_nculib_root:=$cf_cv_screen}
 as_ac_Lib=`echo "ac_cv_lib_$cf_nculib_root''__nc_init_pthreads" | $as_tr_sh`
-echo "$as_me:14097: checking for _nc_init_pthreads in -l$cf_nculib_root" >&5
+echo "$as_me:15211: checking for _nc_init_pthreads in -l$cf_nculib_root" >&5
 echo $ECHO_N "checking for _nc_init_pthreads in -l$cf_nculib_root... $ECHO_C" >&6
 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -14102,7 +15216,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-l$cf_nculib_root  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 14105 "configure"
+#line 15219 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -14121,16 +15235,16 @@ _nc_init_pthreads ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:14124: \"$ac_link\"") >&5
+if { (eval echo "$as_me:15238: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:14127: \$? = $ac_status" >&5
+  echo "$as_me:15241: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:14130: \"$ac_try\"") >&5
+  { (eval echo "$as_me:15244: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:14133: \$? = $ac_status" >&5
+  echo "$as_me:15247: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   eval "$as_ac_Lib=yes"
 else
@@ -14141,7 +15255,7 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:14144: result: `eval echo '${'$as_ac_Lib'}'`" >&5
+echo "$as_me:15258: result: `eval echo '${'$as_ac_Lib'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
   cf_cv_ncurses_pthreads=yes
@@ -14176,18 +15290,103 @@ case $cf_cv_screen in
        ;;
 esac
 
-cf_curses_headers=
+echo "$as_me:15293: checking for X11 rgb file" >&5
+echo $ECHO_N "checking for X11 rgb file... $ECHO_C" >&6
 
-case $cf_cv_screen in
-(pdcurses)
-       cf_default_panel=no
-       cf_default_form=no
-       cf_default_menu=no
-       cf_default_tinfo=no
+# Check whether --with-x11-rgb or --without-x11-rgb was given.
+if test "${with_x11_rgb+set}" = set; then
+  withval="$with_x11_rgb"
+  RGB_PATH=$withval
+else
+  RGB_PATH=auto
+fi;
+
+if test "x$RGB_PATH" = xauto
+then
+       RGB_PATH='${exec_prefix}/lib/X11/rgb.txt'
+       for cf_path in \
+               /opt/local/share/X11/rgb.txt \
+               /opt/X11/share/X11/rgb.txt \
+               /usr/share/X11/rgb.txt \
+               /usr/X11/share/X11/rgb.txt \
+               /usr/X11/lib/X11/rgb.txt \
+               /usr/lib/X11/rgb.txt \
+               /etc/X11/rgb.txt \
+               /usr/pkg/lib/X11/rgb.txt \
+               /usr/X11R7/lib/X11/rgb.txt \
+               /usr/X11R6/lib/X11/rgb.txt \
+               /usr/X11R5/lib/X11/rgb.txt \
+               /usr/X11R4/lib/X11/rgb.txt \
+               /usr/local/lib/X11/rgb.txt \
+               /usr/local/share/X11/rgb.txt \
+               /usr/lib64/X11/rgb.txt
+       do
+               if test -f "$cf_path" ; then
+                       RGB_PATH="$cf_path"
+                       break
+               fi
+       done
+else
+       cf_path=$RGB_PATH
+
+if test "x$prefix" != xNONE; then
+       cf_path_syntax="$prefix"
+else
+       cf_path_syntax="$ac_default_prefix"
+fi
+
+case ".$cf_path" in
+(.\$\(*\)*|.\'*\'*)
        ;;
-(xcurses|bsdcurses)
-       cf_default_panel=no
-       cf_default_form=no
+(..|./*|.\\*)
+       ;;
+(.[a-zA-Z]:[\\/]*) # OS/2 EMX
+       ;;
+(.\${*prefix}*|.\${*dir}*)
+       eval cf_path="$cf_path"
+       case ".$cf_path" in
+       (.NONE/*)
+               cf_path=`echo $cf_path | sed -e s%NONE%$cf_path_syntax%`
+               ;;
+       esac
+       ;;
+(.no|.NONE/*)
+       cf_path=`echo $cf_path | sed -e s%NONE%$cf_path_syntax%`
+       ;;
+(*)
+       { { echo "$as_me:15357: error: expected a pathname, not \"$cf_path\"" >&5
+echo "$as_me: error: expected a pathname, not \"$cf_path\"" >&2;}
+   { (exit 1); exit 1; }; }
+       ;;
+esac
+
+fi
+
+echo "$as_me:15365: result: $RGB_PATH" >&5
+echo "${ECHO_T}$RGB_PATH" >&6
+
+cat >>confdefs.h <<EOF
+#define RGB_PATH "$cf_path"
+EOF
+
+no_x11_rgb=
+if test "$RGB_PATH" = no
+then
+       no_x11_rgb="#"
+fi
+
+cf_curses_headers=
+
+case $cf_cv_screen in
+(pdcurses)
+       cf_default_panel=no
+       cf_default_form=no
+       cf_default_menu=no
+       cf_default_tinfo=no
+       ;;
+(xcurses|bsdcurses)
+       cf_default_panel=no
+       cf_default_form=no
        cf_default_menu=no
        cf_default_tinfo=yes
        ;;
@@ -14204,7 +15403,7 @@ case $cf_cv_screen in
        ;;
 esac
 
-echo "$as_me:14207: checking if you want to check for panel functions" >&5
+echo "$as_me:15406: checking if you want to check for panel functions" >&5
 echo $ECHO_N "checking if you want to check for panel functions... $ECHO_C" >&6
 
 # Check whether --enable-panel or --disable-panel was given.
@@ -14221,13 +15420,224 @@ else
        cf_enable_panel=$cf_default_panel
 
 fi;
-echo "$as_me:14224: result: $cf_enable_panel" >&5
+echo "$as_me:15423: result: $cf_enable_panel" >&5
 echo "${ECHO_T}$cf_enable_panel" >&6
 if test $cf_enable_panel = yes
 then
 
-as_ac_Lib=`echo "ac_cv_lib_panel$cf_cv_libtype''_new_panel" | $as_tr_sh`
-echo "$as_me:14230: checking for new_panel in -lpanel$cf_cv_libtype" >&5
+cf_have_curses_lib=no
+
+: ${NCURSES_CONFIG_PKG:=none}
+if test "x${NCURSES_CONFIG_PKG}" = xnone; then
+       :
+elif test "x${PKG_CONFIG:=none}" != xnone; then
+       echo "$as_me:15434: checking pkg-config for panel$cf_cv_libtype" >&5
+echo $ECHO_N "checking pkg-config for panel$cf_cv_libtype... $ECHO_C" >&6
+       if "$PKG_CONFIG" --exists panel$cf_cv_libtype ; then
+               echo "$as_me:15437: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+
+               echo "$as_me:15440: checking if the panel$cf_cv_libtype package files work" >&5
+echo $ECHO_N "checking if the panel$cf_cv_libtype package files work... $ECHO_C" >&6
+
+               cf_save_CPPFLAGS="$CPPFLAGS"
+               cf_save_LIBS="$LIBS"
+
+cf_fix_cppflags=no
+cf_new_cflags=
+cf_new_cppflags=
+cf_new_extra_cppflags=
+
+for cf_add_cflags in `$PKG_CONFIG --cflags panel$cf_cv_libtype`
+do
+case $cf_fix_cppflags in
+(no)
+       case $cf_add_cflags in
+       (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
+               case $cf_add_cflags in
+               (-D*)
+                       cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
+
+                       test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
+                               && test -z "${cf_tst_cflags}" \
+                               && cf_fix_cppflags=yes
+
+                       if test $cf_fix_cppflags = yes ; then
+
+       test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+       cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
+                               continue
+                       elif test "${cf_tst_cflags}" = "\"'" ; then
+
+       test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+       cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
+                               continue
+                       fi
+                       ;;
+               esac
+               case "$CPPFLAGS" in
+               (*$cf_add_cflags)
+                       ;;
+               (*)
+                       case $cf_add_cflags in
+                       (-D*)
+                               cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
+
+CPPFLAGS=`echo "$CPPFLAGS" | \
+       sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
+               -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
+
+                               ;;
+                       esac
+
+       test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
+       cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
+
+                       ;;
+               esac
+               ;;
+       (*)
+
+       test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
+       cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
+
+               ;;
+       esac
+       ;;
+(yes)
+
+       test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+       cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
+       cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
+
+       test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
+               && test -z "${cf_tst_cflags}" \
+               && cf_fix_cppflags=no
+       ;;
+esac
+done
+
+if test -n "$cf_new_cflags" ; then
+
+       test -n "$CFLAGS" && CFLAGS="$CFLAGS "
+       CFLAGS="${CFLAGS}$cf_new_cflags"
+
+fi
+
+if test -n "$cf_new_cppflags" ; then
+
+       test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
+       CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
+
+fi
+
+if test -n "$cf_new_extra_cppflags" ; then
+
+       test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
+       EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
+
+fi
+
+cf_add_libs="`$PKG_CONFIG --libs panel$cf_cv_libtype`"
+# Filter out duplicates - this happens with badly-designed ".pc" files...
+for cf_add_1lib in $LIBS
+do
+       for cf_add_2lib in $cf_add_libs
+       do
+               if test "x$cf_add_1lib" = "x$cf_add_2lib"
+               then
+                       cf_add_1lib=
+                       break
+               fi
+       done
+       test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
+done
+LIBS="$cf_add_libs"
+
+               cat >conftest.$ac_ext <<_ACEOF
+#line 15561 "configure"
+#include "confdefs.h"
+#include <panel.h>
+int
+main (void)
+{
+(void) new_panel ( 0 );
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:15573: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:15576: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:15579: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:15582: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  if test "$cross_compiling" = yes; then
+  cf_have_curses_lib=maybe
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 15588 "configure"
+#include "confdefs.h"
+#include <panel.h>
+                               int main(void)
+                               { (void) new_panel ( 0 ); return 0; }
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:15595: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:15598: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (eval echo "$as_me:15600: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:15603: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_have_curses_lib=yes
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_have_curses_lib=no
+fi
+rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_have_curses_lib=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+               echo "$as_me:15620: result: $cf_have_curses_lib" >&5
+echo "${ECHO_T}$cf_have_curses_lib" >&6
+               test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
+               if test "$cf_have_curses_lib" != "yes"
+               then
+                       CPPFLAGS="$cf_save_CPPFLAGS"
+                       LIBS="$cf_save_LIBS"
+               else
+
+cf_upper=`echo "have_libpanel" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
+
+                       cat >>confdefs.h <<EOF
+#define $cf_upper 1
+EOF
+
+               fi
+       fi
+fi
+if test "$cf_have_curses_lib" = no; then
+       as_ac_Lib=`echo "ac_cv_lib_panel$cf_cv_libtype''_new_panel" | $as_tr_sh`
+echo "$as_me:15640: checking for new_panel in -lpanel$cf_cv_libtype" >&5
 echo $ECHO_N "checking for new_panel in -lpanel$cf_cv_libtype... $ECHO_C" >&6
 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -14235,7 +15645,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lpanel$cf_cv_libtype  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 14238 "configure"
+#line 15648 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -14254,16 +15664,16 @@ new_panel ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:14257: \"$ac_link\"") >&5
+if { (eval echo "$as_me:15667: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:14260: \$? = $ac_status" >&5
+  echo "$as_me:15670: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:14263: \"$ac_try\"") >&5
+  { (eval echo "$as_me:15673: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:14266: \$? = $ac_status" >&5
+  echo "$as_me:15676: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   eval "$as_ac_Lib=yes"
 else
@@ -14274,7 +15684,7 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:14277: result: `eval echo '${'$as_ac_Lib'}'`" >&5
+echo "$as_me:15687: result: `eval echo '${'$as_ac_Lib'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
 
 done
 LIBS="$cf_add_libs"
 
-cat >>confdefs.h <<EOF
+               cat >>confdefs.h <<EOF
 #define $cf_upper 1
 EOF
 
+fi
+
 fi
 
        cf_curses_headers="$cf_curses_headers panel.h"
 fi
 
-echo "$as_me:14308: checking if you want to check for menu functions" >&5
+echo "$as_me:15720: checking if you want to check for menu functions" >&5
 echo $ECHO_N "checking if you want to check for menu functions... $ECHO_C" >&6
 
 # Check whether --enable-menu or --disable-menu was given.
@@ -14322,7 +15734,7 @@ else
        cf_enable_menu=$cf_default_menu
 
 fi;
-echo "$as_me:14325: result: $cf_enable_menu" >&5
+echo "$as_me:15737: result: $cf_enable_menu" >&5
 echo "${ECHO_T}$cf_enable_menu" >&6
 if test $cf_enable_menu = yes
 then
@@ -14331,14 +15743,14 @@ then
                ;;
        (curses*)
 
-echo "$as_me:14334: checking for NetBSD menu.h" >&5
+echo "$as_me:15746: checking for NetBSD menu.h" >&5
 echo $ECHO_N "checking for NetBSD menu.h... $ECHO_C" >&6
 if test "${cf_cv_netbsd_menu_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
 cat >conftest.$ac_ext <<_ACEOF
-#line 14341 "configure"
+#line 15753 "configure"
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header:-curses.h}>
@@ -14356,16 +15768,16 @@ main (void)
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:14359: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:15771: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:14362: \$? = $ac_status" >&5
+  echo "$as_me:15774: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:14365: \"$ac_try\"") >&5
+  { (eval echo "$as_me:15777: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:14368: \$? = $ac_status" >&5
+  echo "$as_me:15780: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_netbsd_menu_h=yes
 
@@ -14377,7 +15789,7 @@ fi
 rm -f conftest.$ac_objext conftest.$ac_ext
 
 fi
-echo "$as_me:14380: result: $cf_cv_netbsd_menu_h" >&5
+echo "$as_me:15792: result: $cf_cv_netbsd_menu_h" >&5
 echo "${ECHO_T}$cf_cv_netbsd_menu_h" >&6
 
 test "$cf_cv_netbsd_menu_h" = yes &&
                ;;
        esac
 
-as_ac_Lib=`echo "ac_cv_lib_menu$cf_cv_libtype''_menu_driver" | $as_tr_sh`
-echo "$as_me:14392: checking for menu_driver in -lmenu$cf_cv_libtype" >&5
-echo $ECHO_N "checking for menu_driver in -lmenu$cf_cv_libtype... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Lib+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lmenu$cf_cv_libtype  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-#line 14400 "configure"
-#include "confdefs.h"
+cf_have_curses_lib=no
 
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char menu_driver ();
-int
-main (void)
-{
-menu_driver ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:14419: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:14422: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:14425: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:14428: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  eval "$as_ac_Lib=yes"
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-eval "$as_ac_Lib=no"
-fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+: ${NCURSES_CONFIG_PKG:=none}
+if test "x${NCURSES_CONFIG_PKG}" = xnone; then
+       :
+elif test "x${PKG_CONFIG:=none}" != xnone; then
+       echo "$as_me:15809: checking pkg-config for menu$cf_cv_libtype" >&5
+echo $ECHO_N "checking pkg-config for menu$cf_cv_libtype... $ECHO_C" >&6
+       if "$PKG_CONFIG" --exists menu$cf_cv_libtype ; then
+               echo "$as_me:15812: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+
+               echo "$as_me:15815: checking if the menu$cf_cv_libtype package files work" >&5
+echo $ECHO_N "checking if the menu$cf_cv_libtype package files work... $ECHO_C" >&6
+
+               cf_save_CPPFLAGS="$CPPFLAGS"
+               cf_save_LIBS="$LIBS"
+
+cf_fix_cppflags=no
+cf_new_cflags=
+cf_new_cppflags=
+cf_new_extra_cppflags=
+
+for cf_add_cflags in `$PKG_CONFIG --cflags menu$cf_cv_libtype`
+do
+case $cf_fix_cppflags in
+(no)
+       case $cf_add_cflags in
+       (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
+               case $cf_add_cflags in
+               (-D*)
+                       cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
+
+                       test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
+                               && test -z "${cf_tst_cflags}" \
+                               && cf_fix_cppflags=yes
+
+                       if test $cf_fix_cppflags = yes ; then
+
+       test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+       cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
+                               continue
+                       elif test "${cf_tst_cflags}" = "\"'" ; then
+
+       test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+       cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
+                               continue
+                       fi
+                       ;;
+               esac
+               case "$CPPFLAGS" in
+               (*$cf_add_cflags)
+                       ;;
+               (*)
+                       case $cf_add_cflags in
+                       (-D*)
+                               cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
+
+CPPFLAGS=`echo "$CPPFLAGS" | \
+       sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
+               -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
+
+                               ;;
+                       esac
+
+       test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
+       cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
+
+                       ;;
+               esac
+               ;;
+       (*)
+
+       test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
+       cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
+
+               ;;
+       esac
+       ;;
+(yes)
+
+       test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+       cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
+       cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
+
+       test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
+               && test -z "${cf_tst_cflags}" \
+               && cf_fix_cppflags=no
+       ;;
+esac
+done
+
+if test -n "$cf_new_cflags" ; then
+
+       test -n "$CFLAGS" && CFLAGS="$CFLAGS "
+       CFLAGS="${CFLAGS}$cf_new_cflags"
+
+fi
+
+if test -n "$cf_new_cppflags" ; then
+
+       test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
+       CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
+
+fi
+
+if test -n "$cf_new_extra_cppflags" ; then
+
+       test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
+       EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
+
+fi
+
+cf_add_libs="`$PKG_CONFIG --libs menu$cf_cv_libtype`"
+# Filter out duplicates - this happens with badly-designed ".pc" files...
+for cf_add_1lib in $LIBS
+do
+       for cf_add_2lib in $cf_add_libs
+       do
+               if test "x$cf_add_1lib" = "x$cf_add_2lib"
+               then
+                       cf_add_1lib=
+                       break
+               fi
+       done
+       test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
+done
+LIBS="$cf_add_libs"
+
+               cat >conftest.$ac_ext <<_ACEOF
+#line 15936 "configure"
+#include "confdefs.h"
+#include <menu.h>
+int
+main (void)
+{
+(void) menu_driver ( 0,0 );
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:15948: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:15951: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:15954: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:15957: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  if test "$cross_compiling" = yes; then
+  cf_have_curses_lib=maybe
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 15963 "configure"
+#include "confdefs.h"
+#include <menu.h>
+                               int main(void)
+                               { (void) menu_driver ( 0,0 ); return 0; }
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:15970: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:15973: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (eval echo "$as_me:15975: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:15978: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_have_curses_lib=yes
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_have_curses_lib=no
+fi
+rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_have_curses_lib=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+               echo "$as_me:15995: result: $cf_have_curses_lib" >&5
+echo "${ECHO_T}$cf_have_curses_lib" >&6
+               test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
+               if test "$cf_have_curses_lib" != "yes"
+               then
+                       CPPFLAGS="$cf_save_CPPFLAGS"
+                       LIBS="$cf_save_LIBS"
+               else
+
+cf_upper=`echo "have_libmenu" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
+
+                       cat >>confdefs.h <<EOF
+#define $cf_upper 1
+EOF
+
+               fi
+       fi
+fi
+if test "$cf_have_curses_lib" = no; then
+       as_ac_Lib=`echo "ac_cv_lib_menu$cf_cv_libtype''_menu_driver" | $as_tr_sh`
+echo "$as_me:16015: checking for menu_driver in -lmenu$cf_cv_libtype" >&5
+echo $ECHO_N "checking for menu_driver in -lmenu$cf_cv_libtype... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Lib+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lmenu$cf_cv_libtype  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line 16023 "configure"
+#include "confdefs.h"
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char menu_driver ();
+int
+main (void)
+{
+menu_driver ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:16042: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:16045: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:16048: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:16051: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$as_ac_Lib=yes"
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+eval "$as_ac_Lib=no"
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:14439: result: `eval echo '${'$as_ac_Lib'}'`" >&5
+echo "$as_me:16062: result: `eval echo '${'$as_ac_Lib'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
 
 done
 LIBS="$cf_add_libs"
 
-cat >>confdefs.h <<EOF
+               cat >>confdefs.h <<EOF
 #define $cf_upper 1
 EOF
 
+fi
+
 fi
 
        cf_curses_headers="$cf_curses_headers menu.h"
 fi
 
-echo "$as_me:14470: checking if you want to check for form functions" >&5
+echo "$as_me:16095: checking if you want to check for form functions" >&5
 echo $ECHO_N "checking if you want to check for form functions... $ECHO_C" >&6
 
 # Check whether --enable-form or --disable-form was given.
@@ -14484,7 +16109,7 @@ else
        cf_enable_form=$cf_default_form
 
 fi;
-echo "$as_me:14487: result: $cf_enable_form" >&5
+echo "$as_me:16112: result: $cf_enable_form" >&5
 echo "${ECHO_T}$cf_enable_form" >&6
 if test $cf_enable_form = yes
 then
@@ -14493,14 +16118,14 @@ then
                ;;
        (curses*)
 
-echo "$as_me:14496: checking for NetBSD form.h" >&5
+echo "$as_me:16121: checking for NetBSD form.h" >&5
 echo $ECHO_N "checking for NetBSD form.h... $ECHO_C" >&6
 if test "${cf_cv_netbsd_form_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
 cat >conftest.$ac_ext <<_ACEOF
-#line 14503 "configure"
+#line 16128 "configure"
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header:-curses.h}>
@@ -14519,16 +16144,16 @@ main (void)
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:14522: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:16147: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:14525: \$? = $ac_status" >&5
+  echo "$as_me:16150: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:14528: \"$ac_try\"") >&5
+  { (eval echo "$as_me:16153: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:14531: \$? = $ac_status" >&5
+  echo "$as_me:16156: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_netbsd_form_h=yes
 
@@ -14540,7 +16165,7 @@ fi
 rm -f conftest.$ac_objext conftest.$ac_ext
 
 fi
-echo "$as_me:14543: result: $cf_cv_netbsd_form_h" >&5
+echo "$as_me:16168: result: $cf_cv_netbsd_form_h" >&5
 echo "${ECHO_T}$cf_cv_netbsd_form_h" >&6
 
 test "$cf_cv_netbsd_form_h" = yes &&
                ;;
        esac
 
-as_ac_Lib=`echo "ac_cv_lib_form$cf_cv_libtype''_form_driver" | $as_tr_sh`
-echo "$as_me:14555: checking for form_driver in -lform$cf_cv_libtype" >&5
-echo $ECHO_N "checking for form_driver in -lform$cf_cv_libtype... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Lib+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lform$cf_cv_libtype  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-#line 14563 "configure"
-#include "confdefs.h"
+cf_have_curses_lib=no
 
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char form_driver ();
-int
-main (void)
-{
-form_driver ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:14582: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:14585: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:14588: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:14591: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  eval "$as_ac_Lib=yes"
-else
-  echo "$as_me: failed program was:" >&5
+: ${NCURSES_CONFIG_PKG:=none}
+if test "x${NCURSES_CONFIG_PKG}" = xnone; then
+       :
+elif test "x${PKG_CONFIG:=none}" != xnone; then
+       echo "$as_me:16185: checking pkg-config for form$cf_cv_libtype" >&5
+echo $ECHO_N "checking pkg-config for form$cf_cv_libtype... $ECHO_C" >&6
+       if "$PKG_CONFIG" --exists form$cf_cv_libtype ; then
+               echo "$as_me:16188: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+
+               echo "$as_me:16191: checking if the form$cf_cv_libtype package files work" >&5
+echo $ECHO_N "checking if the form$cf_cv_libtype package files work... $ECHO_C" >&6
+
+               cf_save_CPPFLAGS="$CPPFLAGS"
+               cf_save_LIBS="$LIBS"
+
+cf_fix_cppflags=no
+cf_new_cflags=
+cf_new_cppflags=
+cf_new_extra_cppflags=
+
+for cf_add_cflags in `$PKG_CONFIG --cflags form$cf_cv_libtype`
+do
+case $cf_fix_cppflags in
+(no)
+       case $cf_add_cflags in
+       (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
+               case $cf_add_cflags in
+               (-D*)
+                       cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
+
+                       test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
+                               && test -z "${cf_tst_cflags}" \
+                               && cf_fix_cppflags=yes
+
+                       if test $cf_fix_cppflags = yes ; then
+
+       test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+       cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
+                               continue
+                       elif test "${cf_tst_cflags}" = "\"'" ; then
+
+       test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+       cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
+                               continue
+                       fi
+                       ;;
+               esac
+               case "$CPPFLAGS" in
+               (*$cf_add_cflags)
+                       ;;
+               (*)
+                       case $cf_add_cflags in
+                       (-D*)
+                               cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
+
+CPPFLAGS=`echo "$CPPFLAGS" | \
+       sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
+               -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
+
+                               ;;
+                       esac
+
+       test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
+       cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
+
+                       ;;
+               esac
+               ;;
+       (*)
+
+       test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
+       cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
+
+               ;;
+       esac
+       ;;
+(yes)
+
+       test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+       cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
+       cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
+
+       test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
+               && test -z "${cf_tst_cflags}" \
+               && cf_fix_cppflags=no
+       ;;
+esac
+done
+
+if test -n "$cf_new_cflags" ; then
+
+       test -n "$CFLAGS" && CFLAGS="$CFLAGS "
+       CFLAGS="${CFLAGS}$cf_new_cflags"
+
+fi
+
+if test -n "$cf_new_cppflags" ; then
+
+       test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
+       CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
+
+fi
+
+if test -n "$cf_new_extra_cppflags" ; then
+
+       test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
+       EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
+
+fi
+
+cf_add_libs="`$PKG_CONFIG --libs form$cf_cv_libtype`"
+# Filter out duplicates - this happens with badly-designed ".pc" files...
+for cf_add_1lib in $LIBS
+do
+       for cf_add_2lib in $cf_add_libs
+       do
+               if test "x$cf_add_1lib" = "x$cf_add_2lib"
+               then
+                       cf_add_1lib=
+                       break
+               fi
+       done
+       test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
+done
+LIBS="$cf_add_libs"
+
+               cat >conftest.$ac_ext <<_ACEOF
+#line 16312 "configure"
+#include "confdefs.h"
+#include <form.h>
+int
+main (void)
+{
+(void) form_driver ( 0,0 );
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:16324: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:16327: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:16330: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:16333: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  if test "$cross_compiling" = yes; then
+  cf_have_curses_lib=maybe
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 16339 "configure"
+#include "confdefs.h"
+#include <form.h>
+                               int main(void)
+                               { (void) form_driver ( 0,0 ); return 0; }
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:16346: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:16349: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (eval echo "$as_me:16351: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:16354: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_have_curses_lib=yes
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_have_curses_lib=no
+fi
+rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_have_curses_lib=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+               echo "$as_me:16371: result: $cf_have_curses_lib" >&5
+echo "${ECHO_T}$cf_have_curses_lib" >&6
+               test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
+               if test "$cf_have_curses_lib" != "yes"
+               then
+                       CPPFLAGS="$cf_save_CPPFLAGS"
+                       LIBS="$cf_save_LIBS"
+               else
+
+cf_upper=`echo "have_libform" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
+
+                       cat >>confdefs.h <<EOF
+#define $cf_upper 1
+EOF
+
+               fi
+       fi
+fi
+if test "$cf_have_curses_lib" = no; then
+       as_ac_Lib=`echo "ac_cv_lib_form$cf_cv_libtype''_form_driver" | $as_tr_sh`
+echo "$as_me:16391: checking for form_driver in -lform$cf_cv_libtype" >&5
+echo $ECHO_N "checking for form_driver in -lform$cf_cv_libtype... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Lib+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lform$cf_cv_libtype  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line 16399 "configure"
+#include "confdefs.h"
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char form_driver ();
+int
+main (void)
+{
+form_driver ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:16418: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:16421: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:16424: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:16427: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$as_ac_Lib=yes"
+else
+  echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
 eval "$as_ac_Lib=no"
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:14602: result: `eval echo '${'$as_ac_Lib'}'`" >&5
+echo "$as_me:16438: result: `eval echo '${'$as_ac_Lib'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
 
 done
 LIBS="$cf_add_libs"
 
-cat >>confdefs.h <<EOF
+               cat >>confdefs.h <<EOF
 #define $cf_upper 1
 EOF
 
+fi
+
 fi
 
        cf_curses_headers="$cf_curses_headers form.h"
 for ac_header in $cf_curses_headers
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-echo "$as_me:14638: checking for $ac_header" >&5
+echo "$as_me:16476: checking for $ac_header" >&5
 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
 if eval "test \"\${$as_ac_Header+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 14644 "configure"
+#line 16482 "configure"
 #include "confdefs.h"
 #include <$ac_header>
 _ACEOF
-if { (eval echo "$as_me:14648: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:16486: \"$ac_cpp conftest.$ac_ext\"") >&5
   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
   ac_status=$?
   egrep -v '^ *\+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:14654: \$? = $ac_status" >&5
+  echo "$as_me:16492: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
@@ -14670,7 +16508,7 @@ else
 fi
 rm -f conftest.err conftest.$ac_ext
 fi
-echo "$as_me:14673: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "$as_me:16511: result: `eval echo '${'$as_ac_Header'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
 if test `eval echo '${'$as_ac_Header'}'` = yes; then
   cat >>confdefs.h <<EOF
@@ -14680,13 +16518,13 @@ EOF
 fi
 done
 
-echo "$as_me:14683: checking for ANSI C header files" >&5
+echo "$as_me:16521: checking for ANSI C header files" >&5
 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
 if test "${ac_cv_header_stdc+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 14689 "configure"
+#line 16527 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -14694,13 +16532,13 @@ else
 #include <float.h>
 
 _ACEOF
-if { (eval echo "$as_me:14697: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:16535: \"$ac_cpp conftest.$ac_ext\"") >&5
   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
   ac_status=$?
   egrep -v '^ *\+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:14703: \$? = $ac_status" >&5
+  echo "$as_me:16541: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
@@ -14722,7 +16560,7 @@ rm -f conftest.err conftest.$ac_ext
 if test $ac_cv_header_stdc = yes; then
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
   cat >conftest.$ac_ext <<_ACEOF
-#line 14725 "configure"
+#line 16563 "configure"
 #include "confdefs.h"
 #include <string.h>
 
@@ -14740,7 +16578,7 @@ fi
 if test $ac_cv_header_stdc = yes; then
   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
   cat >conftest.$ac_ext <<_ACEOF
-#line 14743 "configure"
+#line 16581 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 
@@ -14761,7 +16599,7 @@ if test $ac_cv_header_stdc = yes; then
   :
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 14764 "configure"
+#line 16602 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 #if ((' ' & 0x0FF) == 0x020)
@@ -14787,15 +16625,15 @@ main (void)
 }
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:14790: \"$ac_link\"") >&5
+if { (eval echo "$as_me:16628: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:14793: \$? = $ac_status" >&5
+  echo "$as_me:16631: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:14795: \"$ac_try\"") >&5
+  { (eval echo "$as_me:16633: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:14798: \$? = $ac_status" >&5
+  echo "$as_me:16636: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   :
 else
@@ -14808,7 +16646,7 @@ rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 fi
 fi
-echo "$as_me:14811: result: $ac_cv_header_stdc" >&5
+echo "$as_me:16649: result: $ac_cv_header_stdc" >&5
 echo "${ECHO_T}$ac_cv_header_stdc" >&6
 if test $ac_cv_header_stdc = yes; then
 
@@ -14818,13 +16656,13 @@ EOF
 
 fi
 
-echo "$as_me:14821: checking whether time.h and sys/time.h may both be included" >&5
+echo "$as_me:16659: checking whether time.h and sys/time.h may both be included" >&5
 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
 if test "${ac_cv_header_time+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 14827 "configure"
+#line 16665 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/time.h>
@@ -14840,16 +16678,16 @@ return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:14843: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:16681: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:14846: \$? = $ac_status" >&5
+  echo "$as_me:16684: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:14849: \"$ac_try\"") >&5
+  { (eval echo "$as_me:16687: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:14852: \$? = $ac_status" >&5
+  echo "$as_me:16690: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_header_time=yes
 else
@@ -14859,7 +16697,7 @@ ac_cv_header_time=no
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:14862: result: $ac_cv_header_time" >&5
+echo "$as_me:16700: result: $ac_cv_header_time" >&5
 echo "${ECHO_T}$ac_cv_header_time" >&6
 if test $ac_cv_header_time = yes; then
 
@@ -14883,23 +16721,23 @@ unistd.h \
 
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-echo "$as_me:14886: checking for $ac_header" >&5
+echo "$as_me:16724: checking for $ac_header" >&5
 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
 if eval "test \"\${$as_ac_Header+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 14892 "configure"
+#line 16730 "configure"
 #include "confdefs.h"
 #include <$ac_header>
 _ACEOF
-if { (eval echo "$as_me:14896: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:16734: \"$ac_cpp conftest.$ac_ext\"") >&5
   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
   ac_status=$?
   egrep -v '^ *\+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:14902: \$? = $ac_status" >&5
+  echo "$as_me:16740: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
@@ -14918,7 +16756,7 @@ else
 fi
 rm -f conftest.err conftest.$ac_ext
 fi
-echo "$as_me:14921: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "$as_me:16759: result: `eval echo '${'$as_ac_Header'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
 if test `eval echo '${'$as_ac_Header'}'` = yes; then
   cat >>confdefs.h <<EOF
@@ -14931,23 +16769,23 @@ done
 for ac_header in unistd.h getopt.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-echo "$as_me:14934: checking for $ac_header" >&5
+echo "$as_me:16772: checking for $ac_header" >&5
 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
 if eval "test \"\${$as_ac_Header+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 14940 "configure"
+#line 16778 "configure"
 #include "confdefs.h"
 #include <$ac_header>
 _ACEOF
-if { (eval echo "$as_me:14944: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:16782: \"$ac_cpp conftest.$ac_ext\"") >&5
   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
   ac_status=$?
   egrep -v '^ *\+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:14950: \$? = $ac_status" >&5
+  echo "$as_me:16788: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
@@ -14966,7 +16804,7 @@ else
 fi
 rm -f conftest.err conftest.$ac_ext
 fi
-echo "$as_me:14969: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "$as_me:16807: result: `eval echo '${'$as_ac_Header'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
 if test `eval echo '${'$as_ac_Header'}'` = yes; then
   cat >>confdefs.h <<EOF
@@ -14976,7 +16814,7 @@ EOF
 fi
 done
 
-echo "$as_me:14979: checking for header declaring getopt variables" >&5
+echo "$as_me:16817: checking for header declaring getopt variables" >&5
 echo $ECHO_N "checking for header declaring getopt variables... $ECHO_C" >&6
 if test "${cf_cv_getopt_header+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -14986,7 +16824,7 @@ cf_cv_getopt_header=none
 for cf_header in stdio.h stdlib.h unistd.h getopt.h
 do
 cat >conftest.$ac_ext <<_ACEOF
-#line 14989 "configure"
+#line 16827 "configure"
 #include "confdefs.h"
 
 #include <$cf_header>
@@ -14999,16 +16837,16 @@ int x = optind; char *y = optarg
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:15002: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:16840: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:15005: \$? = $ac_status" >&5
+  echo "$as_me:16843: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:15008: \"$ac_try\"") >&5
+  { (eval echo "$as_me:16846: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:15011: \$? = $ac_status" >&5
+  echo "$as_me:16849: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_getopt_header=$cf_header
  break
@@ -15020,7 +16858,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext
 done
 
 fi
-echo "$as_me:15023: result: $cf_cv_getopt_header" >&5
+echo "$as_me:16861: result: $cf_cv_getopt_header" >&5
 echo "${ECHO_T}$cf_cv_getopt_header" >&6
 if test $cf_cv_getopt_header != none ; then
 
@@ -15045,13 +16883,13 @@ tsearch \
 
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:15048: checking for $ac_func" >&5
+echo "$as_me:16886: checking for $ac_func" >&5
 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
 if eval "test \"\${$as_ac_var+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 15054 "configure"
+#line 16892 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func (); below.  */
@@ -15082,16 +16920,16 @@ f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:15085: \"$ac_link\"") >&5
+if { (eval echo "$as_me:16923: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:15088: \$? = $ac_status" >&5
+  echo "$as_me:16926: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:15091: \"$ac_try\"") >&5
+  { (eval echo "$as_me:16929: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:15094: \$? = $ac_status" >&5
+  echo "$as_me:16932: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   eval "$as_ac_var=yes"
 else
@@ -15101,7 +16939,7 @@ eval "$as_ac_var=no"
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:15104: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "$as_me:16942: result: `eval echo '${'$as_ac_var'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<EOF
@@ -15111,8 +16949,56 @@ EOF
 fi
 done
 
+# use a compile-check to work with ncurses*-config and subdirectory includes
+echo "$as_me:16953: checking if we can use termcap.h" >&5
+echo $ECHO_N "checking if we can use termcap.h... $ECHO_C" >&6
+if test "${cf_cv_have_termcap_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+       cat >conftest.$ac_ext <<_ACEOF
+#line 16960 "configure"
+#include "confdefs.h"
+
+#include <curses.h>
+#include <termcap.h>
+
+int
+main (void)
+{
+return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:16975: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:16978: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:16981: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:16984: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_cv_have_termcap_h=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_have_termcap_h=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:16994: result: $cf_cv_have_termcap_h" >&5
+echo "${ECHO_T}$cf_cv_have_termcap_h" >&6
+test "x$cf_cv_have_termcap_h" = xyes && cat >>confdefs.h <<\EOF
+#define HAVE_TERMCAP_H 1
+EOF
+
 if test "x$ac_cv_func_getopt" = xno; then
-       { { echo "$as_me:15115: error: getopt is required for building programs" >&5
+       { { echo "$as_me:17001: error: getopt is required for building programs" >&5
 echo "$as_me: error: getopt is required for building programs" >&2;}
    { (exit 1); exit 1; }; }
 fi
@@ -15131,13 +17017,13 @@ wcstombs \
 
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:15134: checking for $ac_func" >&5
+echo "$as_me:17020: checking for $ac_func" >&5
 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
 if eval "test \"\${$as_ac_var+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 15140 "configure"
+#line 17026 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func (); below.  */
@@ -15168,16 +17054,16 @@ f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:15171: \"$ac_link\"") >&5
+if { (eval echo "$as_me:17057: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:15174: \$? = $ac_status" >&5
+  echo "$as_me:17060: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:15177: \"$ac_try\"") >&5
+  { (eval echo "$as_me:17063: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:15180: \$? = $ac_status" >&5
+  echo "$as_me:17066: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   eval "$as_ac_var=yes"
 else
@@ -15187,7 +17073,7 @@ eval "$as_ac_var=no"
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:15190: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "$as_me:17076: result: `eval echo '${'$as_ac_var'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<EOF
@@ -15199,7 +17085,7 @@ done
 
 fi
 
-echo "$as_me:15202: checking definition to turn on extended curses functions" >&5
+echo "$as_me:17088: checking definition to turn on extended curses functions" >&5
 echo $ECHO_N "checking definition to turn on extended curses functions... $ECHO_C" >&6
 if test "${cf_cv_need_xopen_extension+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -15207,7 +17093,7 @@ else
 
 cf_cv_need_xopen_extension=unknown
 cat >conftest.$ac_ext <<_ACEOF
-#line 15210 "configure"
+#line 17096 "configure"
 #include "confdefs.h"
 
 #include <stdlib.h>
@@ -15233,16 +17119,16 @@ main (void)
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:15236: \"$ac_link\"") >&5
+if { (eval echo "$as_me:17122: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:15239: \$? = $ac_status" >&5
+  echo "$as_me:17125: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:15242: \"$ac_try\"") >&5
+  { (eval echo "$as_me:17128: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:15245: \$? = $ac_status" >&5
+  echo "$as_me:17131: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_need_xopen_extension=none
 else
@@ -15252,7 +17138,7 @@ cat conftest.$ac_ext >&5
        for cf_try_xopen_extension in _XOPEN_SOURCE_EXTENDED NCURSES_WIDECHAR
        do
                cat >conftest.$ac_ext <<_ACEOF
-#line 15255 "configure"
+#line 17141 "configure"
 #include "confdefs.h"
 
 #define $cf_try_xopen_extension 1
@@ -15274,16 +17160,16 @@ main (void)
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:15277: \"$ac_link\"") >&5
+if { (eval echo "$as_me:17163: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:15280: \$? = $ac_status" >&5
+  echo "$as_me:17166: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:15283: \"$ac_try\"") >&5
+  { (eval echo "$as_me:17169: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:15286: \$? = $ac_status" >&5
+  echo "$as_me:17172: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_need_xopen_extension=$cf_try_xopen_extension; break
 else
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 
 fi
-echo "$as_me:15300: result: $cf_cv_need_xopen_extension" >&5
+echo "$as_me:17186: result: $cf_cv_need_xopen_extension" >&5
 echo "${ECHO_T}$cf_cv_need_xopen_extension" >&6
 
 case $cf_cv_need_xopen_extension in
 (*_*)
-       CPPFLAGS="$CPPFLAGS -D$cf_cv_need_xopen_extension"
+
+       test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
+       CPPFLAGS="${CPPFLAGS}-D$cf_cv_need_xopen_extension"
+
        ;;
 esac
 
-echo "$as_me:15309: checking for term.h" >&5
+echo "$as_me:17198: checking for term.h" >&5
 echo $ECHO_N "checking for term.h... $ECHO_C" >&6
 if test "${cf_cv_term_header+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -15327,7 +17216,7 @@ esac
 for cf_header in $cf_header_list
 do
        cat >conftest.$ac_ext <<_ACEOF
-#line 15330 "configure"
+#line 17219 "configure"
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header:-curses.h}>
@@ -15341,16 +17230,16 @@ WINDOW *x
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:15344: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:17233: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:15347: \$? = $ac_status" >&5
+  echo "$as_me:17236: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:15350: \"$ac_try\"") >&5
+  { (eval echo "$as_me:17239: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:15353: \$? = $ac_status" >&5
+  echo "$as_me:17242: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_term_header=$cf_header
         break
@@ -15369,7 +17258,7 @@ case $cf_cv_term_header in
        for cf_header in ncurses/term.h ncursesw/term.h
        do
                cat >conftest.$ac_ext <<_ACEOF
-#line 15372 "configure"
+#line 17261 "configure"
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header:-curses.h}>
@@ -15387,16 +17276,16 @@ WINDOW *x
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:15390: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:17279: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:15393: \$? = $ac_status" >&5
+  echo "$as_me:17282: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:15396: \"$ac_try\"") >&5
+  { (eval echo "$as_me:17285: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:15399: \$? = $ac_status" >&5
+  echo "$as_me:17288: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_term_header=$cf_header
                         break
@@ -15411,7 +17300,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext
 esac
 
 fi
-echo "$as_me:15414: result: $cf_cv_term_header" >&5
+echo "$as_me:17303: result: $cf_cv_term_header" >&5
 echo "${ECHO_T}$cf_cv_term_header" >&6
 
 case $cf_cv_term_header in
@@ -15438,7 +17327,7 @@ EOF
        ;;
 esac
 
-echo "$as_me:15441: checking for unctrl.h" >&5
+echo "$as_me:17330: checking for unctrl.h" >&5
 echo $ECHO_N "checking for unctrl.h... $ECHO_C" >&6
 if test "${cf_cv_unctrl_header+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -15459,7 +17348,7 @@ esac
 for cf_header in $cf_header_list
 do
        cat >conftest.$ac_ext <<_ACEOF
-#line 15462 "configure"
+#line 17351 "configure"
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header:-curses.h}>
@@ -15473,16 +17362,16 @@ WINDOW *x
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:15476: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:17365: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:15479: \$? = $ac_status" >&5
+  echo "$as_me:17368: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:15482: \"$ac_try\"") >&5
+  { (eval echo "$as_me:17371: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:15485: \$? = $ac_status" >&5
+  echo "$as_me:17374: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_unctrl_header=$cf_header
         break
@@ -15495,12 +17384,12 @@ rm -f conftest.$ac_objext conftest.$ac_ext
 done
 
 fi
-echo "$as_me:15498: result: $cf_cv_unctrl_header" >&5
+echo "$as_me:17387: result: $cf_cv_unctrl_header" >&5
 echo "${ECHO_T}$cf_cv_unctrl_header" >&6
 
 case $cf_cv_unctrl_header in
 (no)
-       { echo "$as_me:15503: WARNING: unctrl.h header not found" >&5
+       { echo "$as_me:17392: WARNING: unctrl.h header not found" >&5
 echo "$as_me: WARNING: unctrl.h header not found" >&2;}
        ;;
 esac
@@ -15554,6 +17443,7 @@ mvwvline \
 napms \
 newpad \
 putwin \
+reset_color_pairs \
 resize_term \
 resizeterm \
 restartterm \
 
 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
 
-       echo "$as_me:15591: checking for ${cf_func}" >&5
+       echo "$as_me:17481: checking for ${cf_func}" >&5
 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
 
-echo "${as_me:-configure}:15594: testing ${cf_func} ..." 1>&5
+echo "${as_me:-configure}:17484: testing ${cf_func} ..." 1>&5
 
        if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -15600,7 +17490,7 @@ else
                eval cf_result='$ac_cv_func_'$cf_func
                if test ".$cf_result" != ".no"; then
                        cat >conftest.$ac_ext <<_ACEOF
-#line 15603 "configure"
+#line 17493 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_XCURSES
@@ -15623,9 +17513,9 @@ main (void)
 
 #ifndef ${cf_func}
 long foo = (long)(&${cf_func});
-fprintf(stderr, "testing linkage of $cf_func:%p\n", foo);
-if (foo + 1234 > 5678)
-       ${cf_cv_main_return:-return}(foo);
+fprintf(stderr, "testing linkage of $cf_func:%p\n", (void *)foo);
+if (foo + 1234L > 5678L)
+       ${cf_cv_main_return:-return}(foo != 0);
 #endif
 
   ;
@@ -15633,16 +17523,16 @@ if (foo + 1234 > 5678)
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:15636: \"$ac_link\"") >&5
+if { (eval echo "$as_me:17526: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:15639: \$? = $ac_status" >&5
+  echo "$as_me:17529: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:15642: \"$ac_try\"") >&5
+  { (eval echo "$as_me:17532: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:15645: \$? = $ac_status" >&5
+  echo "$as_me:17535: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_result=yes
 else
@@ -15658,7 +17548,7 @@ fi
 
        # use the computed/retrieved cache-value:
        eval 'cf_result=$cf_cv_func_'$cf_func
-       echo "$as_me:15661: result: $cf_result" >&5
+       echo "$as_me:17551: result: $cf_result" >&5
 echo "${ECHO_T}$cf_result" >&6
        if test $cf_result != no; then
                cat >>confdefs.h <<EOF
 
 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
 
-       echo "$as_me:15676: checking for ${cf_func}" >&5
+       echo "$as_me:17566: checking for ${cf_func}" >&5
 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
 
-echo "${as_me:-configure}:15679: testing ${cf_func} ..." 1>&5
+echo "${as_me:-configure}:17569: testing ${cf_func} ..." 1>&5
 
        if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -15685,7 +17575,7 @@ else
                eval cf_result='$ac_cv_func_'$cf_func
                if test ".$cf_result" != ".no"; then
                        cat >conftest.$ac_ext <<_ACEOF
-#line 15688 "configure"
+#line 17578 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_XCURSES
@@ -15708,9 +17598,9 @@ main (void)
 
 #ifndef ${cf_func}
 long foo = (long)(&${cf_func});
-fprintf(stderr, "testing linkage of $cf_func:%p\n", foo);
-if (foo + 1234 > 5678)
-       ${cf_cv_main_return:-return}(foo);
+fprintf(stderr, "testing linkage of $cf_func:%p\n", (void *)foo);
+if (foo + 1234L > 5678L)
+       ${cf_cv_main_return:-return}(foo != 0);
 #endif
 
   ;
@@ -15718,16 +17608,16 @@ if (foo + 1234 > 5678)
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:15721: \"$ac_link\"") >&5
+if { (eval echo "$as_me:17611: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:15724: \$? = $ac_status" >&5
+  echo "$as_me:17614: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:15727: \"$ac_try\"") >&5
+  { (eval echo "$as_me:17617: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:15730: \$? = $ac_status" >&5
+  echo "$as_me:17620: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_result=yes
 else
@@ -15743,7 +17633,7 @@ fi
 
        # use the computed/retrieved cache-value:
        eval 'cf_result=$cf_cv_func_'$cf_func
-       echo "$as_me:15746: result: $cf_result" >&5
+       echo "$as_me:17636: result: $cf_result" >&5
 echo "${ECHO_T}$cf_result" >&6
        if test $cf_result != no; then
                cat >>confdefs.h <<EOF
@@ -15767,7 +17657,7 @@ then
                                cf_return="return value"
                        fi
                        cat >conftest.$ac_ext <<_ACEOF
-#line 15770 "configure"
+#line 17660 "configure"
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header:-curses.h}>
@@ -15787,21 +17677,21 @@ main (void)
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:15790: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:17680: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:15793: \$? = $ac_status" >&5
+  echo "$as_me:17683: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:15796: \"$ac_try\"") >&5
+  { (eval echo "$as_me:17686: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:15799: \$? = $ac_status" >&5
+  echo "$as_me:17689: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
                test -n "$verbose" && echo "    prototype $cf_ret func($cf_arg value)" 1>&6
 
-echo "${as_me:-configure}:15804: testing prototype $cf_ret func($cf_arg value) ..." 1>&5
+echo "${as_me:-configure}:17694: testing prototype $cf_ret func($cf_arg value) ..." 1>&5
 
                cat >>confdefs.h <<EOF
 #define TPUTS_ARG               $cf_arg
@@ -15821,14 +17711,14 @@ rm -f conftest.$ac_objext conftest.$ac_ext
        done
 fi
 
-echo "$as_me:15824: checking for ncurses extended functions" >&5
+echo "$as_me:17714: checking for ncurses extended functions" >&5
 echo $ECHO_N "checking for ncurses extended functions... $ECHO_C" >&6
 if test "${cf_cv_ncurses_ext_funcs+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
 cat >conftest.$ac_ext <<_ACEOF
-#line 15831 "configure"
+#line 17721 "configure"
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header:-curses.h}>
@@ -15843,16 +17733,16 @@ int x = NCURSES_EXT_FUNCS
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:15846: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:17736: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:15849: \$? = $ac_status" >&5
+  echo "$as_me:17739: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:15852: \"$ac_try\"") >&5
+  { (eval echo "$as_me:17742: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:15855: \$? = $ac_status" >&5
+  echo "$as_me:17745: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_ncurses_ext_funcs=defined
 else
@@ -15860,7 +17750,7 @@ else
 cat conftest.$ac_ext >&5
 
 cat >conftest.$ac_ext <<_ACEOF
-#line 15863 "configure"
+#line 17753 "configure"
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header:-curses.h}>
@@ -15885,16 +17775,16 @@ main (void)
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:15888: \"$ac_link\"") >&5
+if { (eval echo "$as_me:17778: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:15891: \$? = $ac_status" >&5
+  echo "$as_me:17781: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:15894: \"$ac_try\"") >&5
+  { (eval echo "$as_me:17784: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:15897: \$? = $ac_status" >&5
+  echo "$as_me:17787: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_ncurses_ext_funcs=yes
 else
@@ -15908,7 +17798,7 @@ fi
 rm -f conftest.$ac_objext conftest.$ac_ext
 
 fi
-echo "$as_me:15911: result: $cf_cv_ncurses_ext_funcs" >&5
+echo "$as_me:17801: result: $cf_cv_ncurses_ext_funcs" >&5
 echo "${ECHO_T}$cf_cv_ncurses_ext_funcs" >&6
 test "$cf_cv_ncurses_ext_funcs" = yes &&
 cat >>confdefs.h <<\EOF
@@ -15922,11 +17812,11 @@ then
        if test -n "$cf_cv_ncurses_version" && test "x$cf_cv_ncurses_version" != xno
        then
                cf_define_xpg5=no
-               echo "$as_me:15925: checking if _XPG5 should be defined to enable wide-characters" >&5
+               echo "$as_me:17815: checking if _XPG5 should be defined to enable wide-characters" >&5
 echo $ECHO_N "checking if _XPG5 should be defined to enable wide-characters... $ECHO_C" >&6
 
                cat >conftest.$ac_ext <<_ACEOF
-#line 15929 "configure"
+#line 17819 "configure"
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header:-curses.h}>
@@ -15939,16 +17829,16 @@ int x = _XPG5
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:15942: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:17832: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:15945: \$? = $ac_status" >&5
+  echo "$as_me:17835: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:15948: \"$ac_try\"") >&5
+  { (eval echo "$as_me:17838: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:15951: \$? = $ac_status" >&5
+  echo "$as_me:17841: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   :
 else
@@ -15957,7 +17847,7 @@ cat conftest.$ac_ext >&5
 cf_save_cppflags="$CPPFLAGS"
                         CPPFLAGS="$CPPFLAGS -D_XPG5"
                         cat >conftest.$ac_ext <<_ACEOF
-#line 15960 "configure"
+#line 17850 "configure"
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header:-curses.h}>
@@ -15970,16 +17860,16 @@ int x = _XPG5
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:15973: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:17863: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:15976: \$? = $ac_status" >&5
+  echo "$as_me:17866: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:15979: \"$ac_try\"") >&5
+  { (eval echo "$as_me:17869: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:15982: \$? = $ac_status" >&5
+  echo "$as_me:17872: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_define_xpg5=yes
 else
@@ -15990,7 +17880,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext
                         CPPFLAGS="$cf_save_cppflags"
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
-               echo "$as_me:15993: result: $cf_define_xpg5" >&5
+               echo "$as_me:17883: result: $cf_define_xpg5" >&5
 echo "${ECHO_T}$cf_define_xpg5" >&6
 
                if test "$cf_define_xpg5" = yes
@@ -15999,14 +17889,14 @@ echo "${ECHO_T}$cf_define_xpg5" >&6
                fi
        fi
 
-       echo "$as_me:16002: checking for wide-character functions" >&5
+       echo "$as_me:17892: checking for wide-character functions" >&5
 echo $ECHO_N "checking for wide-character functions... $ECHO_C" >&6
 if test "${cf_cv_widechar_funcs+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
        cat >conftest.$ac_ext <<_ACEOF
-#line 16009 "configure"
+#line 17899 "configure"
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header:-curses.h}>
@@ -16023,16 +17913,16 @@ main (void)
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:16026: \"$ac_link\"") >&5
+if { (eval echo "$as_me:17916: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:16029: \$? = $ac_status" >&5
+  echo "$as_me:17919: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:16032: \"$ac_try\"") >&5
+  { (eval echo "$as_me:17922: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:16035: \$? = $ac_status" >&5
+  echo "$as_me:17925: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_widechar_funcs=yes
 else
@@ -16043,7 +17933,7 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 
 fi
-echo "$as_me:16046: result: $cf_cv_widechar_funcs" >&5
+echo "$as_me:17936: result: $cf_cv_widechar_funcs" >&5
 echo "${ECHO_T}$cf_cv_widechar_funcs" >&6
        if test "$cf_cv_widechar_funcs" != no ; then
 
@@ -16064,14 +17954,14 @@ EOF
 
 fi
 
-echo "$as_me:16067: checking if $cf_cv_screen library uses pthreads" >&5
+echo "$as_me:17957: checking if $cf_cv_screen library uses pthreads" >&5
 echo $ECHO_N "checking if $cf_cv_screen library uses pthreads... $ECHO_C" >&6
 if test "${cf_cv_use_pthreads+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
 cat >conftest.$ac_ext <<_ACEOF
-#line 16074 "configure"
+#line 17964 "configure"
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header:-curses.h}>
@@ -16089,16 +17979,16 @@ main (void)
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:16092: \"$ac_link\"") >&5
+if { (eval echo "$as_me:17982: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:16095: \$? = $ac_status" >&5
+  echo "$as_me:17985: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:16098: \"$ac_try\"") >&5
+  { (eval echo "$as_me:17988: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:16101: \$? = $ac_status" >&5
+  echo "$as_me:17991: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_use_pthreads=yes
 else
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 
 fi
-echo "$as_me:16112: result: $cf_cv_use_pthreads" >&5
+echo "$as_me:18002: result: $cf_cv_use_pthreads" >&5
 echo "${ECHO_T}$cf_cv_use_pthreads" >&6
 test $cf_cv_use_pthreads = yes && cat >>confdefs.h <<\EOF
 #define USE_PTHREADS 1
 EOF
 
-echo "$as_me:16118: checking if sys/time.h works with sys/select.h" >&5
+echo "$as_me:18008: checking if sys/time.h works with sys/select.h" >&5
 echo $ECHO_N "checking if sys/time.h works with sys/select.h... $ECHO_C" >&6
 if test "${cf_cv_sys_time_select+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
 cat >conftest.$ac_ext <<_ACEOF
-#line 16125 "configure"
+#line 18015 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -16142,16 +18032,16 @@ main (void)
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:16145: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:18035: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:16148: \$? = $ac_status" >&5
+  echo "$as_me:18038: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:16151: \"$ac_try\"") >&5
+  { (eval echo "$as_me:18041: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:16154: \$? = $ac_status" >&5
+  echo "$as_me:18044: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_sys_time_select=yes
 else
@@ -16163,7 +18053,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext
 
 fi
 
-echo "$as_me:16166: result: $cf_cv_sys_time_select" >&5
+echo "$as_me:18056: result: $cf_cv_sys_time_select" >&5
 echo "${ECHO_T}$cf_cv_sys_time_select" >&6
 test "$cf_cv_sys_time_select" = yes &&
 cat >>confdefs.h <<\EOF
@@ -16172,7 +18062,7 @@ EOF
 
 # special check for test/ditto.c
 
-echo "$as_me:16175: checking for openpty in -lutil" >&5
+echo "$as_me:18065: checking for openpty in -lutil" >&5
 echo $ECHO_N "checking for openpty in -lutil... $ECHO_C" >&6
 if test "${ac_cv_lib_util_openpty+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -16180,7 +18070,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lutil  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 16183 "configure"
+#line 18073 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -16199,16 +18089,16 @@ openpty ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:16202: \"$ac_link\"") >&5
+if { (eval echo "$as_me:18092: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:16205: \$? = $ac_status" >&5
+  echo "$as_me:18095: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:16208: \"$ac_try\"") >&5
+  { (eval echo "$as_me:18098: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:16211: \$? = $ac_status" >&5
+  echo "$as_me:18101: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_util_openpty=yes
 else
@@ -16219,7 +18109,7 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:16222: result: $ac_cv_lib_util_openpty" >&5
+echo "$as_me:18112: result: $ac_cv_lib_util_openpty" >&5
 echo "${ECHO_T}$ac_cv_lib_util_openpty" >&6
 if test $ac_cv_lib_util_openpty = yes; then
   cf_cv_lib_util=yes
@@ -16227,7 +18117,7 @@ else
   cf_cv_lib_util=no
 fi
 
-echo "$as_me:16230: checking for openpty header" >&5
+echo "$as_me:18120: checking for openpty header" >&5
 echo $ECHO_N "checking for openpty header... $ECHO_C" >&6
 if test "${cf_cv_func_openpty+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -16254,7 +18144,7 @@ LIBS="$cf_add_libs"
        for cf_header in pty.h libutil.h util.h
        do
        cat >conftest.$ac_ext <<_ACEOF
-#line 16257 "configure"
+#line 18147 "configure"
 #include "confdefs.h"
 
 #include <$cf_header>
@@ -16271,16 +18161,16 @@ main (void)
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:16274: \"$ac_link\"") >&5
+if { (eval echo "$as_me:18164: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:16277: \$? = $ac_status" >&5
+  echo "$as_me:18167: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:16280: \"$ac_try\"") >&5
+  { (eval echo "$as_me:18170: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:16283: \$? = $ac_status" >&5
+  echo "$as_me:18173: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
                cf_cv_func_openpty=$cf_header
@@ -16298,7 +18188,7 @@ rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
        LIBS="$cf_save_LIBS"
 
 fi
-echo "$as_me:16301: result: $cf_cv_func_openpty" >&5
+echo "$as_me:18191: result: $cf_cv_func_openpty" >&5
 echo "${ECHO_T}$cf_cv_func_openpty" >&6
 
 if test "$cf_cv_func_openpty" != no ; then
@@ -16332,7 +18222,7 @@ TEST_LIBS="$cf_add_libs"
        fi
 fi
 
-echo "$as_me:16335: checking for function curses_version" >&5
+echo "$as_me:18225: checking for function curses_version" >&5
 echo $ECHO_N "checking for function curses_version... $ECHO_C" >&6
 if test "${cf_cv_func_curses_version+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -16342,7 +18232,7 @@ if test "$cross_compiling" = yes; then
   cf_cv_func_curses_version=unknown
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 16345 "configure"
+#line 18235 "configure"
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header:-curses.h}>
@@ -16355,15 +18245,15 @@ int main(void)
 
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:16358: \"$ac_link\"") >&5
+if { (eval echo "$as_me:18248: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:16361: \$? = $ac_status" >&5
+  echo "$as_me:18251: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:16363: \"$ac_try\"") >&5
+  { (eval echo "$as_me:18253: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:16366: \$? = $ac_status" >&5
+  echo "$as_me:18256: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_func_curses_version=yes
 
@@ -16378,14 +18268,14 @@ rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 rm -f core
 fi
-echo "$as_me:16381: result: $cf_cv_func_curses_version" >&5
+echo "$as_me:18271: result: $cf_cv_func_curses_version" >&5
 echo "${ECHO_T}$cf_cv_func_curses_version" >&6
 test "$cf_cv_func_curses_version" = yes &&
 cat >>confdefs.h <<\EOF
 #define HAVE_CURSES_VERSION 1
 EOF
 
-echo "$as_me:16388: checking for alternate character set array" >&5
+echo "$as_me:18278: checking for alternate character set array" >&5
 echo $ECHO_N "checking for alternate character set array... $ECHO_C" >&6
 if test "${cf_cv_curses_acs_map+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -16395,7 +18285,7 @@ cf_cv_curses_acs_map=unknown
 for name in acs_map _acs_map __acs_map ${NCURSES_WRAP_PREFIX}acs_map
 do
 cat >conftest.$ac_ext <<_ACEOF
-#line 16398 "configure"
+#line 18288 "configure"
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header:-curses.h}>
@@ -16411,16 +18301,16 @@ $name['k'] = ACS_PLUS
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:16414: \"$ac_link\"") >&5
+if { (eval echo "$as_me:18304: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:16417: \$? = $ac_status" >&5
+  echo "$as_me:18307: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:16420: \"$ac_try\"") >&5
+  { (eval echo "$as_me:18310: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:16423: \$? = $ac_status" >&5
+  echo "$as_me:18313: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_curses_acs_map=$name; break
 else
@@ -16431,7 +18321,7 @@ rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 done
 
 fi
-echo "$as_me:16434: result: $cf_cv_curses_acs_map" >&5
+echo "$as_me:18324: result: $cf_cv_curses_acs_map" >&5
 echo "${ECHO_T}$cf_cv_curses_acs_map" >&6
 
 test "$cf_cv_curses_acs_map" != unknown &&
@@ -16441,7 +18331,7 @@ EOF
 
 if test "$cf_enable_widec" = yes; then
 
-echo "$as_me:16444: checking for wide alternate character set array" >&5
+echo "$as_me:18334: checking for wide alternate character set array" >&5
 echo $ECHO_N "checking for wide alternate character set array... $ECHO_C" >&6
 if test "${cf_cv_curses_wacs_map+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -16451,7 +18341,7 @@ else
        for name in wacs_map _wacs_map __wacs_map _nc_wacs _wacs_char
        do
        cat >conftest.$ac_ext <<_ACEOF
-#line 16454 "configure"
+#line 18344 "configure"
 #include "confdefs.h"
 
 #ifndef _XOPEN_SOURCE_EXTENDED
@@ -16467,16 +18357,16 @@ void *foo = &($name['k'])
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:16470: \"$ac_link\"") >&5
+if { (eval echo "$as_me:18360: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:16473: \$? = $ac_status" >&5
+  echo "$as_me:18363: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:16476: \"$ac_try\"") >&5
+  { (eval echo "$as_me:18366: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:16479: \$? = $ac_status" >&5
+  echo "$as_me:18369: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_curses_wacs_map=$name
         break
@@ -16487,7 +18377,7 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
        done
 fi
-echo "$as_me:16490: result: $cf_cv_curses_wacs_map" >&5
+echo "$as_me:18380: result: $cf_cv_curses_wacs_map" >&5
 echo "${ECHO_T}$cf_cv_curses_wacs_map" >&6
 
 test "$cf_cv_curses_wacs_map" != unknown &&
@@ -16495,7 +18385,7 @@ cat >>confdefs.h <<EOF
 #define CURSES_WACS_ARRAY $cf_cv_curses_wacs_map
 EOF
 
-echo "$as_me:16498: checking for wide alternate character constants" >&5
+echo "$as_me:18388: checking for wide alternate character constants" >&5
 echo $ECHO_N "checking for wide alternate character constants... $ECHO_C" >&6
 if test "${cf_cv_curses_wacs_symbols+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -16505,7 +18395,7 @@ cf_cv_curses_wacs_symbols=no
 if test "$cf_cv_curses_wacs_map" != unknown
 then
        cat >conftest.$ac_ext <<_ACEOF
-#line 16508 "configure"
+#line 18398 "configure"
 #include "confdefs.h"
 
 #ifndef _XOPEN_SOURCE_EXTENDED
@@ -16522,16 +18412,16 @@ cchar_t *foo = WACS_PLUS;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:16525: \"$ac_link\"") >&5
+if { (eval echo "$as_me:18415: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:16528: \$? = $ac_status" >&5
+  echo "$as_me:18418: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:16531: \"$ac_try\"") >&5
+  { (eval echo "$as_me:18421: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:16534: \$? = $ac_status" >&5
+  echo "$as_me:18424: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_curses_wacs_symbols=yes
 else
@@ -16541,7 +18431,7 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 else
        cat >conftest.$ac_ext <<_ACEOF
-#line 16544 "configure"
+#line 18434 "configure"
 #include "confdefs.h"
 
 #ifndef _XOPEN_SOURCE_EXTENDED
@@ -16557,16 +18447,16 @@ cchar_t *foo = WACS_PLUS
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:16560: \"$ac_link\"") >&5
+if { (eval echo "$as_me:18450: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:16563: \$? = $ac_status" >&5
+  echo "$as_me:18453: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:16566: \"$ac_try\"") >&5
+  { (eval echo "$as_me:18456: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:16569: \$? = $ac_status" >&5
+  echo "$as_me:18459: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_curses_wacs_symbols=yes
 else
@@ -16577,7 +18467,7 @@ rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
 
 fi
-echo "$as_me:16580: result: $cf_cv_curses_wacs_symbols" >&5
+echo "$as_me:18470: result: $cf_cv_curses_wacs_symbols" >&5
 echo "${ECHO_T}$cf_cv_curses_wacs_symbols" >&6
 
 test "$cf_cv_curses_wacs_symbols" != no &&
@@ -16587,10 +18477,10 @@ EOF
 
 fi
 
-echo "$as_me:16590: checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}" >&5
+echo "$as_me:18480: checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}" >&5
 echo $ECHO_N "checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
-#line 16593 "configure"
+#line 18483 "configure"
 #include "confdefs.h"
 
 #ifndef _XOPEN_SOURCE_EXTENDED
@@ -16608,16 +18498,16 @@ attr_t foo
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:16611: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:18501: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:16614: \$? = $ac_status" >&5
+  echo "$as_me:18504: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:16617: \"$ac_try\"") >&5
+  { (eval echo "$as_me:18507: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:16620: \$? = $ac_status" >&5
+  echo "$as_me:18510: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_result=yes
 else
@@ -16626,7 +18516,7 @@ cat conftest.$ac_ext >&5
 cf_result=no
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:16629: result: $cf_result" >&5
+echo "$as_me:18519: result: $cf_result" >&5
 echo "${ECHO_T}$cf_result" >&6
 if test $cf_result = yes ; then
 
 if test "$cf_enable_widec" = yes; then
 
 # This is needed on Tru64 5.0 to declare mbstate_t
-echo "$as_me:16650: checking if we must include wchar.h to declare mbstate_t" >&5
+echo "$as_me:18540: checking if we must include wchar.h to declare mbstate_t" >&5
 echo $ECHO_N "checking if we must include wchar.h to declare mbstate_t... $ECHO_C" >&6
 if test "${cf_cv_mbstate_t+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
 cat >conftest.$ac_ext <<_ACEOF
-#line 16657 "configure"
+#line 18547 "configure"
 #include "confdefs.h"
 
 #include <stdlib.h>
@@ -16672,23 +18562,23 @@ mbstate_t state
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:16675: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:18565: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:16678: \$? = $ac_status" >&5
+  echo "$as_me:18568: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:16681: \"$ac_try\"") >&5
+  { (eval echo "$as_me:18571: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:16684: \$? = $ac_status" >&5
+  echo "$as_me:18574: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_mbstate_t=no
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
 cat >conftest.$ac_ext <<_ACEOF
-#line 16691 "configure"
+#line 18581 "configure"
 #include "confdefs.h"
 
 #include <stdlib.h>
@@ -16707,16 +18597,16 @@ mbstate_t value
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:16710: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:18600: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:16713: \$? = $ac_status" >&5
+  echo "$as_me:18603: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:16716: \"$ac_try\"") >&5
+  { (eval echo "$as_me:18606: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:16719: \$? = $ac_status" >&5
+  echo "$as_me:18609: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_mbstate_t=yes
 else
@@ -16728,7 +18618,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:16731: result: $cf_cv_mbstate_t" >&5
+echo "$as_me:18621: result: $cf_cv_mbstate_t" >&5
 echo "${ECHO_T}$cf_cv_mbstate_t" >&6
 
 if test "$cf_cv_mbstate_t" = yes ; then
@@ -16751,14 +18641,14 @@ if test "$cf_cv_mbstate_t" != unknown ; then
 fi
 
 # This is needed on Tru64 5.0 to declare wchar_t
-echo "$as_me:16754: checking if we must include wchar.h to declare wchar_t" >&5
+echo "$as_me:18644: checking if we must include wchar.h to declare wchar_t" >&5
 echo $ECHO_N "checking if we must include wchar.h to declare wchar_t... $ECHO_C" >&6
 if test "${cf_cv_wchar_t+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
 cat >conftest.$ac_ext <<_ACEOF
-#line 16761 "configure"
+#line 18651 "configure"
 #include "confdefs.h"
 
 #include <stdlib.h>
@@ -16776,23 +18666,23 @@ wchar_t state
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:16779: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:18669: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:16782: \$? = $ac_status" >&5
+  echo "$as_me:18672: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:16785: \"$ac_try\"") >&5
+  { (eval echo "$as_me:18675: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:16788: \$? = $ac_status" >&5
+  echo "$as_me:18678: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_wchar_t=no
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
 cat >conftest.$ac_ext <<_ACEOF
-#line 16795 "configure"
+#line 18685 "configure"
 #include "confdefs.h"
 
 #include <stdlib.h>
@@ -16811,16 +18701,16 @@ wchar_t value
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:16814: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:18704: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:16817: \$? = $ac_status" >&5
+  echo "$as_me:18707: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:16820: \"$ac_try\"") >&5
+  { (eval echo "$as_me:18710: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:16823: \$? = $ac_status" >&5
+  echo "$as_me:18713: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_wchar_t=yes
 else
@@ -16832,7 +18722,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:16835: result: $cf_cv_wchar_t" >&5
+echo "$as_me:18725: result: $cf_cv_wchar_t" >&5
 echo "${ECHO_T}$cf_cv_wchar_t" >&6
 
 if test "$cf_cv_wchar_t" = yes ; then
@@ -16855,14 +18745,14 @@ if test "$cf_cv_wchar_t" != unknown ; then
 fi
 
 # This is needed on Tru64 5.0 to declare wint_t
-echo "$as_me:16858: checking if we must include wchar.h to declare wint_t" >&5
+echo "$as_me:18748: checking if we must include wchar.h to declare wint_t" >&5
 echo $ECHO_N "checking if we must include wchar.h to declare wint_t... $ECHO_C" >&6
 if test "${cf_cv_wint_t+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
 cat >conftest.$ac_ext <<_ACEOF
-#line 16865 "configure"
+#line 18755 "configure"
 #include "confdefs.h"
 
 #include <stdlib.h>
@@ -16880,944 +18770,178 @@ wint_t state
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:16883: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:18773: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:16886: \$? = $ac_status" >&5
+  echo "$as_me:18776: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:16889: \"$ac_try\"") >&5
+  { (eval echo "$as_me:18779: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:16892: \$? = $ac_status" >&5
+  echo "$as_me:18782: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_wint_t=no
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
 cat >conftest.$ac_ext <<_ACEOF
-#line 16899 "configure"
-#include "confdefs.h"
-
-#include <stdlib.h>
-#include <stdarg.h>
-#include <stdio.h>
-#include <wchar.h>
-#ifdef HAVE_LIBUTF8_H
-#include <libutf8.h>
-#endif
-int
-main (void)
-{
-wint_t value
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:16918: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:16921: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:16924: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:16927: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  cf_cv_wint_t=yes
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-cf_cv_wint_t=unknown
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:16939: result: $cf_cv_wint_t" >&5
-echo "${ECHO_T}$cf_cv_wint_t" >&6
-
-if test "$cf_cv_wint_t" = yes ; then
-
-cat >>confdefs.h <<\EOF
-#define NEED_WCHAR_H 1
-EOF
-
-       NEED_WCHAR_H=1
-fi
-
-# if we do not find wint_t in either place, use substitution to provide a fallback.
-if test "$cf_cv_wint_t" = unknown ; then
-       NCURSES_WINT_T=1
-fi
-
-# if we find wint_t in either place, use substitution to provide a fallback.
-if test "$cf_cv_wint_t" != unknown ; then
-       NCURSES_OK_WINT_T=1
-fi
-
-       if test "$NCURSES_OK_MBSTATE_T" = 0 ; then
-
-echo "$as_me:16963: checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}" >&5
-echo $ECHO_N "checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-#line 16966 "configure"
-#include "confdefs.h"
-
-#ifndef _XOPEN_SOURCE_EXTENDED
-#define _XOPEN_SOURCE_EXTENDED
-#endif
-#include <${cf_cv_ncurses_header:-curses.h}>
-int
-main (void)
-{
-
-mbstate_t foo
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:16984: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:16987: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:16990: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:16993: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  cf_result=yes
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-cf_result=no
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:17002: result: $cf_result" >&5
-echo "${ECHO_T}$cf_result" >&6
-if test $cf_result = yes ; then
-
-cf_result=`echo "have_type_mbstate_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
-
-cat >>confdefs.h <<EOF
-#define $cf_result 1
-EOF
-
-else
-
-cat >>confdefs.h <<EOF
-#define mbstate_t long
-EOF
-
-fi
-
-       fi
-
-       if test "$NCURSES_OK_WCHAR_T" = 0 ; then
-
-echo "$as_me:17024: checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}" >&5
-echo $ECHO_N "checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-#line 17027 "configure"
-#include "confdefs.h"
-
-#ifndef _XOPEN_SOURCE_EXTENDED
-#define _XOPEN_SOURCE_EXTENDED
-#endif
-#include <${cf_cv_ncurses_header:-curses.h}>
-int
-main (void)
-{
-
-wchar_t foo
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:17045: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:17048: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:17051: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:17054: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  cf_result=yes
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-cf_result=no
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:17063: result: $cf_result" >&5
-echo "${ECHO_T}$cf_result" >&6
-if test $cf_result = yes ; then
-
-cf_result=`echo "have_type_wchar_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
-
-cat >>confdefs.h <<EOF
-#define $cf_result 1
-EOF
-
-else
-
-cat >>confdefs.h <<EOF
-#define wchar_t long
-EOF
-
-fi
-
-       fi
-
-       if test "$NCURSES_OK_WINT_T" = 0 ; then
-
-echo "$as_me:17085: checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}" >&5
-echo $ECHO_N "checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-#line 17088 "configure"
-#include "confdefs.h"
-
-#ifndef _XOPEN_SOURCE_EXTENDED
-#define _XOPEN_SOURCE_EXTENDED
-#endif
-#include <${cf_cv_ncurses_header:-curses.h}>
-int
-main (void)
-{
-
-wint_t foo
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:17106: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:17109: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:17112: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:17115: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  cf_result=yes
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-cf_result=no
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:17124: result: $cf_result" >&5
-echo "${ECHO_T}$cf_result" >&6
-if test $cf_result = yes ; then
-
-cf_result=`echo "have_type_wint_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
-
-cat >>confdefs.h <<EOF
-#define $cf_result 1
-EOF
-
-else
-
-cat >>confdefs.h <<EOF
-#define wint_t long
-EOF
-
-fi
-
-       fi
-fi
-
-for cf_data in curscr
-do
-echo "$as_me:17147: checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
-echo $ECHO_N "checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
-
-cat >conftest.$ac_ext <<_ACEOF
-#line 17151 "configure"
+#line 18789 "configure"
 #include "confdefs.h"
 
-#ifdef HAVE_XCURSES
-#include <xcurses.h>
-char * XCursesProgramName = "test";
-#else
-#include <${cf_cv_ncurses_header:-curses.h}>
-#if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
-#include <ncursesw/term.h>
-#elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
-#include <ncurses/term.h>
-#elif defined(HAVE_TERM_H)
-#include <term.h>
-#endif
-#endif
-
-int
-main (void)
-{
-
-void *foo = &($cf_data)
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:17179: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:17182: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:17185: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:17188: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  cf_result=yes
-
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-cf_result=no
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:17198: result: $cf_result" >&5
-echo "${ECHO_T}$cf_result" >&6
-
-if test $cf_result = yes ; then
-
-cf_result=`echo "have_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
-
-       cat >>confdefs.h <<EOF
-#define $cf_result 1
-EOF
-
-else
-       echo "$as_me:17210: checking for data $cf_data in library" >&5
-echo $ECHO_N "checking for data $cf_data in library... $ECHO_C" >&6
-       # BSD linkers insist on making weak linkage, but resolve at runtime.
-       if test "$cross_compiling" = yes; then
-
-       # cross-compiling
-       cat >conftest.$ac_ext <<_ACEOF
-#line 17217 "configure"
-#include "confdefs.h"
-
-#ifdef HAVE_XCURSES
-#include <xcurses.h>
-char * XCursesProgramName = "test";
-#else
-#include <${cf_cv_ncurses_header:-curses.h}>
-#if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
-#include <ncursesw/term.h>
-#elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
-#include <ncurses/term.h>
-#elif defined(HAVE_TERM_H)
-#include <term.h>
-#endif
-#endif
-
-extern char $cf_data;
-int
-main (void)
-{
-
-       do {
-               void *foo = &($cf_data);
-               fprintf(stderr, "testing linkage of $cf_data:%p\n", foo);
-               ${cf_cv_main_return:-return}(foo == 0);
-       } while (0)
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:17250: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:17253: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:17256: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:17259: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  cf_result=yes
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-cf_result=no
-fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-
-else
-  cat >conftest.$ac_ext <<_ACEOF
-#line 17271 "configure"
-#include "confdefs.h"
-
-#ifdef HAVE_XCURSES
-#include <xcurses.h>
-char * XCursesProgramName = "test";
-#else
-#include <${cf_cv_ncurses_header:-curses.h}>
-#if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
-#include <ncursesw/term.h>
-#elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
-#include <ncurses/term.h>
-#elif defined(HAVE_TERM_H)
-#include <term.h>
-#endif
-#endif
-
-extern char $cf_data;
-int main(void)
-{
-       void *foo = &($cf_data);
-       fprintf(stderr, "testing linkage of $cf_data:%p\n", foo);
-       ${cf_cv_main_return:-return}(foo == 0);
-}
-_ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:17297: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:17300: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:17302: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:17305: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  cf_result=yes
-
-else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-cf_result=no
-fi
-rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-       echo "$as_me:17317: result: $cf_result" >&5
-echo "${ECHO_T}$cf_result" >&6
-       if test $cf_result = yes ; then
-
-cf_result=`echo "decl_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
-
-               cat >>confdefs.h <<EOF
-#define $cf_result 1
-EOF
-
-               # do not exit loop here, since we prefer system's declarations
-       fi
-fi
-done
-
-for cf_data in ospeed
-do
-echo "$as_me:17334: checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
-echo $ECHO_N "checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
-
-cat >conftest.$ac_ext <<_ACEOF
-#line 17338 "configure"
-#include "confdefs.h"
-
-#ifdef HAVE_XCURSES
-#include <xcurses.h>
-char * XCursesProgramName = "test";
-#else
-#include <${cf_cv_ncurses_header:-curses.h}>
-#if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
-#include <ncursesw/term.h>
-#elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
-#include <ncurses/term.h>
-#elif defined(HAVE_TERM_H)
-#include <term.h>
-#endif
-#endif
-
-int
-main (void)
-{
-
-void *foo = &($cf_data)
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:17366: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:17369: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:17372: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:17375: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  cf_result=yes
-
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-cf_result=no
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:17385: result: $cf_result" >&5
-echo "${ECHO_T}$cf_result" >&6
-
-if test $cf_result = yes ; then
-
-cf_result=`echo "have_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
-
-       cat >>confdefs.h <<EOF
-#define $cf_result 1
-EOF
-
-else
-       echo "$as_me:17397: checking for data $cf_data in library" >&5
-echo $ECHO_N "checking for data $cf_data in library... $ECHO_C" >&6
-       # BSD linkers insist on making weak linkage, but resolve at runtime.
-       if test "$cross_compiling" = yes; then
-
-       # cross-compiling
-       cat >conftest.$ac_ext <<_ACEOF
-#line 17404 "configure"
-#include "confdefs.h"
-
-#ifdef HAVE_XCURSES
-#include <xcurses.h>
-char * XCursesProgramName = "test";
-#else
-#include <${cf_cv_ncurses_header:-curses.h}>
-#if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
-#include <ncursesw/term.h>
-#elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
-#include <ncurses/term.h>
-#elif defined(HAVE_TERM_H)
-#include <term.h>
-#endif
-#endif
-
-extern char $cf_data;
-int
-main (void)
-{
-
-       do {
-               void *foo = &($cf_data);
-               fprintf(stderr, "testing linkage of $cf_data:%p\n", foo);
-               ${cf_cv_main_return:-return}(foo == 0);
-       } while (0)
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:17437: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:17440: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:17443: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:17446: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  cf_result=yes
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-cf_result=no
-fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-
-else
-  cat >conftest.$ac_ext <<_ACEOF
-#line 17458 "configure"
-#include "confdefs.h"
-
-#ifdef HAVE_XCURSES
-#include <xcurses.h>
-char * XCursesProgramName = "test";
-#else
-#include <${cf_cv_ncurses_header:-curses.h}>
-#if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
-#include <ncursesw/term.h>
-#elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
-#include <ncurses/term.h>
-#elif defined(HAVE_TERM_H)
-#include <term.h>
-#endif
-#endif
-
-extern char $cf_data;
-int main(void)
-{
-       void *foo = &($cf_data);
-       fprintf(stderr, "testing linkage of $cf_data:%p\n", foo);
-       ${cf_cv_main_return:-return}(foo == 0);
-}
-_ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:17484: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:17487: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:17489: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:17492: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  cf_result=yes
-
-else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-cf_result=no
-fi
-rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-       echo "$as_me:17504: result: $cf_result" >&5
-echo "${ECHO_T}$cf_result" >&6
-       if test $cf_result = yes ; then
-
-cf_result=`echo "decl_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
-
-               cat >>confdefs.h <<EOF
-#define $cf_result 1
-EOF
-
-               # do not exit loop here, since we prefer system's declarations
-       fi
-fi
-done
-
-for cf_data in boolnames
-do
-echo "$as_me:17521: checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
-echo $ECHO_N "checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
-
-cat >conftest.$ac_ext <<_ACEOF
-#line 17525 "configure"
-#include "confdefs.h"
-
-#ifdef HAVE_XCURSES
-#include <xcurses.h>
-char * XCursesProgramName = "test";
-#else
-#include <${cf_cv_ncurses_header:-curses.h}>
-#if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
-#include <ncursesw/term.h>
-#elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
-#include <ncurses/term.h>
-#elif defined(HAVE_TERM_H)
-#include <term.h>
-#endif
-#endif
-
-int
-main (void)
-{
-
-void *foo = &($cf_data)
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:17553: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:17556: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:17559: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:17562: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  cf_result=yes
-
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-cf_result=no
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:17572: result: $cf_result" >&5
-echo "${ECHO_T}$cf_result" >&6
-
-if test $cf_result = yes ; then
-
-cf_result=`echo "have_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
-
-       cat >>confdefs.h <<EOF
-#define $cf_result 1
-EOF
-
-else
-       echo "$as_me:17584: checking for data $cf_data in library" >&5
-echo $ECHO_N "checking for data $cf_data in library... $ECHO_C" >&6
-       # BSD linkers insist on making weak linkage, but resolve at runtime.
-       if test "$cross_compiling" = yes; then
-
-       # cross-compiling
-       cat >conftest.$ac_ext <<_ACEOF
-#line 17591 "configure"
-#include "confdefs.h"
-
-#ifdef HAVE_XCURSES
-#include <xcurses.h>
-char * XCursesProgramName = "test";
-#else
-#include <${cf_cv_ncurses_header:-curses.h}>
-#if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
-#include <ncursesw/term.h>
-#elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
-#include <ncurses/term.h>
-#elif defined(HAVE_TERM_H)
-#include <term.h>
-#endif
-#endif
-
-extern char $cf_data;
-int
-main (void)
-{
-
-       do {
-               void *foo = &($cf_data);
-               fprintf(stderr, "testing linkage of $cf_data:%p\n", foo);
-               ${cf_cv_main_return:-return}(foo == 0);
-       } while (0)
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:17624: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:17627: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:17630: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:17633: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  cf_result=yes
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-cf_result=no
-fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-
-else
-  cat >conftest.$ac_ext <<_ACEOF
-#line 17645 "configure"
-#include "confdefs.h"
-
-#ifdef HAVE_XCURSES
-#include <xcurses.h>
-char * XCursesProgramName = "test";
-#else
-#include <${cf_cv_ncurses_header:-curses.h}>
-#if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
-#include <ncursesw/term.h>
-#elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
-#include <ncurses/term.h>
-#elif defined(HAVE_TERM_H)
-#include <term.h>
-#endif
-#endif
-
-extern char $cf_data;
-int main(void)
+#include <stdlib.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <wchar.h>
+#ifdef HAVE_LIBUTF8_H
+#include <libutf8.h>
+#endif
+int
+main (void)
 {
-       void *foo = &($cf_data);
-       fprintf(stderr, "testing linkage of $cf_data:%p\n", foo);
-       ${cf_cv_main_return:-return}(foo == 0);
+wint_t value
+  ;
+  return 0;
 }
 _ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:17671: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:18808: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:17674: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:17676: \"$ac_try\"") >&5
+  echo "$as_me:18811: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:18814: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:17679: \$? = $ac_status" >&5
+  echo "$as_me:18817: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  cf_result=yes
-
+  cf_cv_wint_t=yes
 else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
+  echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
-cf_result=no
+cf_cv_wint_t=unknown
 fi
-rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.$ac_objext conftest.$ac_ext
 fi
-       echo "$as_me:17691: result: $cf_result" >&5
-echo "${ECHO_T}$cf_result" >&6
-       if test $cf_result = yes ; then
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:18829: result: $cf_cv_wint_t" >&5
+echo "${ECHO_T}$cf_cv_wint_t" >&6
 
-cf_result=`echo "decl_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
+if test "$cf_cv_wint_t" = yes ; then
 
-               cat >>confdefs.h <<EOF
-#define $cf_result 1
+cat >>confdefs.h <<\EOF
+#define NEED_WCHAR_H 1
 EOF
 
-               # do not exit loop here, since we prefer system's declarations
-       fi
+       NEED_WCHAR_H=1
 fi
-done
 
-for cf_data in boolfnames
-do
-echo "$as_me:17708: checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
-echo $ECHO_N "checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
+# if we do not find wint_t in either place, use substitution to provide a fallback.
+if test "$cf_cv_wint_t" = unknown ; then
+       NCURSES_WINT_T=1
+fi
+
+# if we find wint_t in either place, use substitution to provide a fallback.
+if test "$cf_cv_wint_t" != unknown ; then
+       NCURSES_OK_WINT_T=1
+fi
+
+       if test "$NCURSES_OK_MBSTATE_T" = 0 ; then
 
+echo "$as_me:18853: checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}" >&5
+echo $ECHO_N "checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
-#line 17712 "configure"
+#line 18856 "configure"
 #include "confdefs.h"
 
-#ifdef HAVE_XCURSES
-#include <xcurses.h>
-char * XCursesProgramName = "test";
-#else
-#include <${cf_cv_ncurses_header:-curses.h}>
-#if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
-#include <ncursesw/term.h>
-#elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
-#include <ncurses/term.h>
-#elif defined(HAVE_TERM_H)
-#include <term.h>
-#endif
+#ifndef _XOPEN_SOURCE_EXTENDED
+#define _XOPEN_SOURCE_EXTENDED
 #endif
-
+#include <${cf_cv_ncurses_header:-curses.h}>
 int
 main (void)
 {
 
-void *foo = &($cf_data)
+mbstate_t foo
 
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:17740: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:18874: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:17743: \$? = $ac_status" >&5
+  echo "$as_me:18877: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:17746: \"$ac_try\"") >&5
+  { (eval echo "$as_me:18880: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:17749: \$? = $ac_status" >&5
+  echo "$as_me:18883: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_result=yes
-
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
 cf_result=no
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:17759: result: $cf_result" >&5
+echo "$as_me:18892: result: $cf_result" >&5
 echo "${ECHO_T}$cf_result" >&6
-
 if test $cf_result = yes ; then
 
-cf_result=`echo "have_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
+cf_result=`echo "have_type_mbstate_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
 
-       cat >>confdefs.h <<EOF
+cat >>confdefs.h <<EOF
 #define $cf_result 1
 EOF
 
 else
-       echo "$as_me:17771: checking for data $cf_data in library" >&5
-echo $ECHO_N "checking for data $cf_data in library... $ECHO_C" >&6
-       # BSD linkers insist on making weak linkage, but resolve at runtime.
-       if test "$cross_compiling" = yes; then
 
-       # cross-compiling
-       cat >conftest.$ac_ext <<_ACEOF
-#line 17778 "configure"
+cat >>confdefs.h <<EOF
+#define mbstate_t long
+EOF
+
+fi
+
+       fi
+
+       if test "$NCURSES_OK_WCHAR_T" = 0 ; then
+
+echo "$as_me:18914: checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}" >&5
+echo $ECHO_N "checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line 18917 "configure"
 #include "confdefs.h"
 
-#ifdef HAVE_XCURSES
-#include <xcurses.h>
-char * XCursesProgramName = "test";
-#else
-#include <${cf_cv_ncurses_header:-curses.h}>
-#if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
-#include <ncursesw/term.h>
-#elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
-#include <ncurses/term.h>
-#elif defined(HAVE_TERM_H)
-#include <term.h>
-#endif
+#ifndef _XOPEN_SOURCE_EXTENDED
+#define _XOPEN_SOURCE_EXTENDED
 #endif
-
-extern char $cf_data;
+#include <${cf_cv_ncurses_header:-curses.h}>
 int
 main (void)
 {
 
-       do {
-               void *foo = &($cf_data);
-               fprintf(stderr, "testing linkage of $cf_data:%p\n", foo);
-               ${cf_cv_main_return:-return}(foo == 0);
-       } while (0)
+wchar_t foo
 
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:17811: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:18935: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:17814: \$? = $ac_status" >&5
+  echo "$as_me:18938: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:17817: \"$ac_try\"") >&5
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:18941: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:17820: \$? = $ac_status" >&5
+  echo "$as_me:18944: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_result=yes
 else
@@ -17825,78 +18949,101 @@ else
 cat conftest.$ac_ext >&5
 cf_result=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:18953: result: $cf_result" >&5
+echo "${ECHO_T}$cf_result" >&6
+if test $cf_result = yes ; then
+
+cf_result=`echo "have_type_wchar_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
+
+cat >>confdefs.h <<EOF
+#define $cf_result 1
+EOF
 
 else
-  cat >conftest.$ac_ext <<_ACEOF
-#line 17832 "configure"
+
+cat >>confdefs.h <<EOF
+#define wchar_t long
+EOF
+
+fi
+
+       fi
+
+       if test "$NCURSES_OK_WINT_T" = 0 ; then
+
+echo "$as_me:18975: checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}" >&5
+echo $ECHO_N "checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line 18978 "configure"
 #include "confdefs.h"
 
-#ifdef HAVE_XCURSES
-#include <xcurses.h>
-char * XCursesProgramName = "test";
-#else
-#include <${cf_cv_ncurses_header:-curses.h}>
-#if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
-#include <ncursesw/term.h>
-#elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
-#include <ncurses/term.h>
-#elif defined(HAVE_TERM_H)
-#include <term.h>
-#endif
+#ifndef _XOPEN_SOURCE_EXTENDED
+#define _XOPEN_SOURCE_EXTENDED
 #endif
-
-extern char $cf_data;
-int main(void)
+#include <${cf_cv_ncurses_header:-curses.h}>
+int
+main (void)
 {
-       void *foo = &($cf_data);
-       fprintf(stderr, "testing linkage of $cf_data:%p\n", foo);
-       ${cf_cv_main_return:-return}(foo == 0);
+
+wint_t foo
+
+  ;
+  return 0;
 }
 _ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:17858: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:18996: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:17861: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:17863: \"$ac_try\"") >&5
+  echo "$as_me:18999: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:19002: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:17866: \$? = $ac_status" >&5
+  echo "$as_me:19005: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_result=yes
-
 else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
+  echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
 cf_result=no
 fi
-rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-       echo "$as_me:17878: result: $cf_result" >&5
+rm -f conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:19014: result: $cf_result" >&5
 echo "${ECHO_T}$cf_result" >&6
-       if test $cf_result = yes ; then
+if test $cf_result = yes ; then
 
-cf_result=`echo "decl_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
+cf_result=`echo "have_type_wint_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
 
-               cat >>confdefs.h <<EOF
+cat >>confdefs.h <<EOF
 #define $cf_result 1
 EOF
 
-               # do not exit loop here, since we prefer system's declarations
+else
+
+cat >>confdefs.h <<EOF
+#define wint_t long
+EOF
+
+fi
+
        fi
 fi
-done
 
-for cf_data in ttytype
+for cf_data in \
+curscr \
+ospeed \
+boolnames \
+boolfnames \
+ttytype
 do
-echo "$as_me:17895: checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
+echo "$as_me:19042: checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
 echo $ECHO_N "checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
 
 cat >conftest.$ac_ext <<_ACEOF
-#line 17899 "configure"
+#line 19046 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_XCURSES
@@ -17924,16 +19071,16 @@ void *foo = &($cf_data)
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:17927: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:19074: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:17930: \$? = $ac_status" >&5
+  echo "$as_me:19077: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:17933: \"$ac_try\"") >&5
+  { (eval echo "$as_me:19080: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:17936: \$? = $ac_status" >&5
+  echo "$as_me:19083: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_result=yes
 
@@ -17943,7 +19090,7 @@ cat conftest.$ac_ext >&5
 cf_result=no
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:17946: result: $cf_result" >&5
+echo "$as_me:19093: result: $cf_result" >&5
 echo "${ECHO_T}$cf_result" >&6
 
 if test $cf_result = yes ; then
@@ -17955,14 +19102,14 @@ cf_result=`echo "have_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./
 EOF
 
 else
-       echo "$as_me:17958: checking for data $cf_data in library" >&5
+       echo "$as_me:19105: checking for data $cf_data in library" >&5
 echo $ECHO_N "checking for data $cf_data in library... $ECHO_C" >&6
        # BSD linkers insist on making weak linkage, but resolve at runtime.
        if test "$cross_compiling" = yes; then
 
        # cross-compiling
        cat >conftest.$ac_ext <<_ACEOF
-#line 17965 "configure"
+#line 19112 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_XCURSES
@@ -17986,7 +19133,7 @@ main (void)
 
        do {
                void *foo = &($cf_data);
-               fprintf(stderr, "testing linkage of $cf_data:%p\n", foo);
+               fprintf(stderr, "testing linkage of $cf_data:%p\n", (void *)foo);
                ${cf_cv_main_return:-return}(foo == 0);
        } while (0)
 
@@ -17995,16 +19142,16 @@ main (void)
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:17998: \"$ac_link\"") >&5
+if { (eval echo "$as_me:19145: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:18001: \$? = $ac_status" >&5
+  echo "$as_me:19148: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:18004: \"$ac_try\"") >&5
+  { (eval echo "$as_me:19151: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:18007: \$? = $ac_status" >&5
+  echo "$as_me:19154: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_result=yes
 else
@@ -18016,7 +19163,7 @@ rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 18019 "configure"
+#line 19166 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_XCURSES
@@ -18037,20 +19184,20 @@ extern char $cf_data;
 int main(void)
 {
        void *foo = &($cf_data);
-       fprintf(stderr, "testing linkage of $cf_data:%p\n", foo);
+       fprintf(stderr, "testing linkage of $cf_data:%p\n", (void *)foo);
        ${cf_cv_main_return:-return}(foo == 0);
 }
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:18045: \"$ac_link\"") >&5
+if { (eval echo "$as_me:19192: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:18048: \$? = $ac_status" >&5
+  echo "$as_me:19195: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:18050: \"$ac_try\"") >&5
+  { (eval echo "$as_me:19197: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:18053: \$? = $ac_status" >&5
+  echo "$as_me:19200: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_result=yes
 
@@ -18062,7 +19209,7 @@ cf_result=no
 fi
 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
-       echo "$as_me:18065: result: $cf_result" >&5
+       echo "$as_me:19212: result: $cf_result" >&5
 echo "${ECHO_T}$cf_result" >&6
        if test $cf_result = yes ; then
 
@@ -18079,7 +19226,7 @@ done
 
 if ( test "$GCC" = yes || test "$GXX" = yes )
 then
-echo "$as_me:18082: checking if you want to turn on gcc warnings" >&5
+echo "$as_me:19229: checking if you want to turn on gcc warnings" >&5
 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
 
 # Check whether --enable-warnings or --disable-warnings was given.
@@ -18096,7 +19243,7 @@ else
        with_warnings=no
 
 fi;
-echo "$as_me:18099: result: $with_warnings" >&5
+echo "$as_me:19246: result: $with_warnings" >&5
 echo "${ECHO_T}$with_warnings" >&6
 if test "$with_warnings" = "yes"
 then
@@ -18119,10 +19266,10 @@ cat > conftest.i <<EOF
 EOF
 if test "$GCC" = yes
 then
-       { echo "$as_me:18122: checking for $CC __attribute__ directives..." >&5
+       { echo "$as_me:19269: checking for $CC __attribute__ directives..." >&5
 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
 cat > conftest.$ac_ext <<EOF
-#line 18125 "${as_me:-configure}"
+#line 19272 "${as_me:-configure}"
 #include "confdefs.h"
 #include "conftest.h"
 #include "conftest.i"
@@ -18171,12 +19318,12 @@ EOF
                        ;;
                esac
 
-               if { (eval echo "$as_me:18174: \"$ac_compile\"") >&5
+               if { (eval echo "$as_me:19321: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:18177: \$? = $ac_status" >&5
+  echo "$as_me:19324: \$? = $ac_status" >&5
   (exit $ac_status); }; then
-                       test -n "$verbose" && echo "$as_me:18179: result: ... $cf_attribute" >&5
+                       test -n "$verbose" && echo "$as_me:19326: result: ... $cf_attribute" >&5
 echo "${ECHO_T}... $cf_attribute" >&6
                        cat conftest.h >>confdefs.h
                        case $cf_attribute in
@@ -18240,12 +19387,12 @@ INTEL_COMPILER=no
 if test "$GCC" = yes ; then
        case $host_os in
        (linux*|gnu*)
-               echo "$as_me:18243: checking if this is really Intel C compiler" >&5
+               echo "$as_me:19390: checking if this is really Intel C compiler" >&5
 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
                cf_save_CFLAGS="$CFLAGS"
                CFLAGS="$CFLAGS -no-gcc"
                cat >conftest.$ac_ext <<_ACEOF
-#line 18248 "configure"
+#line 19395 "configure"
 #include "confdefs.h"
 
 int
@@ -18262,16 +19409,16 @@ make an error
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:18265: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:19412: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:18268: \$? = $ac_status" >&5
+  echo "$as_me:19415: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:18271: \"$ac_try\"") >&5
+  { (eval echo "$as_me:19418: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:18274: \$? = $ac_status" >&5
+  echo "$as_me:19421: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   INTEL_COMPILER=yes
 cf_save_CFLAGS="$cf_save_CFLAGS -we147"
@@ -18282,7 +19429,7 @@ cat conftest.$ac_ext >&5
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
                CFLAGS="$cf_save_CFLAGS"
-               echo "$as_me:18285: result: $INTEL_COMPILER" >&5
+               echo "$as_me:19432: result: $INTEL_COMPILER" >&5
 echo "${ECHO_T}$INTEL_COMPILER" >&6
                ;;
        esac
 CLANG_COMPILER=no
 
 if test "$GCC" = yes ; then
-       echo "$as_me:18294: checking if this is really Clang C compiler" >&5
+       echo "$as_me:19441: checking if this is really Clang C compiler" >&5
 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
        cf_save_CFLAGS="$CFLAGS"
        CFLAGS="$CFLAGS -Qunused-arguments"
        cat >conftest.$ac_ext <<_ACEOF
-#line 18299 "configure"
+#line 19446 "configure"
 #include "confdefs.h"
 
 int
@@ -18313,16 +19460,16 @@ make an error
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:18316: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:19463: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:18319: \$? = $ac_status" >&5
+  echo "$as_me:19466: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:18322: \"$ac_try\"") >&5
+  { (eval echo "$as_me:19469: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:18325: \$? = $ac_status" >&5
+  echo "$as_me:19472: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   CLANG_COMPILER=yes
 cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments"
@@ -18333,12 +19480,12 @@ cat conftest.$ac_ext >&5
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
        CFLAGS="$cf_save_CFLAGS"
-       echo "$as_me:18336: result: $CLANG_COMPILER" >&5
+       echo "$as_me:19483: result: $CLANG_COMPILER" >&5
 echo "${ECHO_T}$CLANG_COMPILER" >&6
 fi
 
 cat > conftest.$ac_ext <<EOF
-#line 18341 "${as_me:-configure}"
+#line 19488 "${as_me:-configure}"
 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
 EOF
 
@@ -18355,7 +19502,7 @@ then
 # remark #981: operands are evaluated in unspecified order
 # warning #279: controlling expression is constant
 
-       { echo "$as_me:18358: checking for $CC warning options..." >&5
+       { echo "$as_me:19505: checking for $CC warning options..." >&5
 echo "$as_me: checking for $CC warning options..." >&6;}
        cf_save_CFLAGS="$CFLAGS"
        EXTRA_CFLAGS="-Wall"
@@ -18371,12 +19518,12 @@ echo "$as_me: checking for $CC warning options..." >&6;}
                wd981
        do
                CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
-               if { (eval echo "$as_me:18374: \"$ac_compile\"") >&5
+               if { (eval echo "$as_me:19521: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:18377: \$? = $ac_status" >&5
+  echo "$as_me:19524: \$? = $ac_status" >&5
   (exit $ac_status); }; then
-                       test -n "$verbose" && echo "$as_me:18379: result: ... -$cf_opt" >&5
+                       test -n "$verbose" && echo "$as_me:19526: result: ... -$cf_opt" >&5
 echo "${ECHO_T}... -$cf_opt" >&6
                        EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
                fi
@@ -18385,7 +19532,7 @@ echo "${ECHO_T}... -$cf_opt" >&6
 
 elif test "$GCC" = yes
 then
-       { echo "$as_me:18388: checking for $CC warning options..." >&5
+       { echo "$as_me:19535: checking for $CC warning options..." >&5
 echo "$as_me: checking for $CC warning options..." >&6;}
        cf_save_CFLAGS="$CFLAGS"
        EXTRA_CFLAGS=
@@ -18406,26 +19553,29 @@ echo "$as_me: checking for $CC warning options..." >&6;}
                Wpointer-arith \
                Wshadow \
                Wstrict-prototypes \
-               Wundef $cf_gcc_warnings $cf_warn_CONST
+               Wundef $cf_gcc_warnings $cf_warn_CONST Wno-unknown-pragmas
        do
                CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
-               if { (eval echo "$as_me:18412: \"$ac_compile\"") >&5
+               if { (eval echo "$as_me:19559: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:18415: \$? = $ac_status" >&5
+  echo "$as_me:19562: \$? = $ac_status" >&5
   (exit $ac_status); }; then
-                       test -n "$verbose" && echo "$as_me:18417: result: ... -$cf_opt" >&5
+                       test -n "$verbose" && echo "$as_me:19564: result: ... -$cf_opt" >&5
 echo "${ECHO_T}... -$cf_opt" >&6
                        case $cf_opt in
                        (Wcast-qual)
-                               CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES"
+
+       test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
+       CPPFLAGS="${CPPFLAGS}-DXTSTRINGDEFINES"
+
                                ;;
                        (Winline)
                                case $GCC_VERSION in
                                ([34].*)
                                        test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
 
-echo "${as_me:-configure}:18428: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
+echo "${as_me:-configure}:19578: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
 
                                        continue;;
                                esac
@@ -18435,7 +19585,7 @@ echo "${as_me:-configure}:18428: testing feature is broken in gcc $GCC_VERSION .
                                ([12].*)
                                        test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
 
-echo "${as_me:-configure}:18438: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
+echo "${as_me:-configure}:19588: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
 
                                        continue;;
                                esac
@@ -18451,7 +19601,7 @@ rm -rf conftest*
 fi
 fi
 
-echo "$as_me:18454: checking if you want to use dmalloc for testing" >&5
+echo "$as_me:19604: checking if you want to use dmalloc for testing" >&5
 echo $ECHO_N "checking if you want to use dmalloc for testing... $ECHO_C" >&6
 
 # Check whether --with-dmalloc or --without-dmalloc was given.
@@ -18468,7 +19618,7 @@ EOF
 else
   with_dmalloc=
 fi;
-echo "$as_me:18471: result: ${with_dmalloc:-no}" >&5
+echo "$as_me:19621: result: ${with_dmalloc:-no}" >&5
 echo "${ECHO_T}${with_dmalloc:-no}" >&6
 
 case .$with_cflags in
 esac
 
 if test "$with_dmalloc" = yes ; then
-       echo "$as_me:18585: checking for dmalloc.h" >&5
+       echo "$as_me:19735: checking for dmalloc.h" >&5
 echo $ECHO_N "checking for dmalloc.h... $ECHO_C" >&6
 if test "${ac_cv_header_dmalloc_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 18591 "configure"
+#line 19741 "configure"
 #include "confdefs.h"
 #include <dmalloc.h>
 _ACEOF
-if { (eval echo "$as_me:18595: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:19745: \"$ac_cpp conftest.$ac_ext\"") >&5
   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
   ac_status=$?
   egrep -v '^ *\+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:18601: \$? = $ac_status" >&5
+  echo "$as_me:19751: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
@@ -18617,11 +19767,11 @@ else
 fi
 rm -f conftest.err conftest.$ac_ext
 fi
-echo "$as_me:18620: result: $ac_cv_header_dmalloc_h" >&5
+echo "$as_me:19770: result: $ac_cv_header_dmalloc_h" >&5
 echo "${ECHO_T}$ac_cv_header_dmalloc_h" >&6
 if test $ac_cv_header_dmalloc_h = yes; then
 
-echo "$as_me:18624: checking for dmalloc_debug in -ldmalloc" >&5
+echo "$as_me:19774: checking for dmalloc_debug in -ldmalloc" >&5
 echo $ECHO_N "checking for dmalloc_debug in -ldmalloc... $ECHO_C" >&6
 if test "${ac_cv_lib_dmalloc_dmalloc_debug+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -18629,7 +19779,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-ldmalloc  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 18632 "configure"
+#line 19782 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -18648,16 +19798,16 @@ dmalloc_debug ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:18651: \"$ac_link\"") >&5
+if { (eval echo "$as_me:19801: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:18654: \$? = $ac_status" >&5
+  echo "$as_me:19804: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:18657: \"$ac_try\"") >&5
+  { (eval echo "$as_me:19807: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:18660: \$? = $ac_status" >&5
+  echo "$as_me:19810: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_dmalloc_dmalloc_debug=yes
 else
@@ -18668,7 +19818,7 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:18671: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5
+echo "$as_me:19821: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5
 echo "${ECHO_T}$ac_cv_lib_dmalloc_dmalloc_debug" >&6
 if test $ac_cv_lib_dmalloc_dmalloc_debug = yes; then
   cat >>confdefs.h <<EOF
@@ -18683,7 +19833,7 @@ fi
 
 fi
 
-echo "$as_me:18686: checking if you want to use dbmalloc for testing" >&5
+echo "$as_me:19836: checking if you want to use dbmalloc for testing" >&5
 echo $ECHO_N "checking if you want to use dbmalloc for testing... $ECHO_C" >&6
 
 # Check whether --with-dbmalloc or --without-dbmalloc was given.
@@ -18700,7 +19850,7 @@ EOF
 else
   with_dbmalloc=
 fi;
-echo "$as_me:18703: result: ${with_dbmalloc:-no}" >&5
+echo "$as_me:19853: result: ${with_dbmalloc:-no}" >&5
 echo "${ECHO_T}${with_dbmalloc:-no}" >&6
 
 case .$with_cflags in
 esac
 
 if test "$with_dbmalloc" = yes ; then
-       echo "$as_me:18817: checking for dbmalloc.h" >&5
+       echo "$as_me:19967: checking for dbmalloc.h" >&5
 echo $ECHO_N "checking for dbmalloc.h... $ECHO_C" >&6
 if test "${ac_cv_header_dbmalloc_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 18823 "configure"
+#line 19973 "configure"
 #include "confdefs.h"
 #include <dbmalloc.h>
 _ACEOF
-if { (eval echo "$as_me:18827: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:19977: \"$ac_cpp conftest.$ac_ext\"") >&5
   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
   ac_status=$?
   egrep -v '^ *\+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:18833: \$? = $ac_status" >&5
+  echo "$as_me:19983: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
@@ -18849,11 +19999,11 @@ else
 fi
 rm -f conftest.err conftest.$ac_ext
 fi
-echo "$as_me:18852: result: $ac_cv_header_dbmalloc_h" >&5
+echo "$as_me:20002: result: $ac_cv_header_dbmalloc_h" >&5
 echo "${ECHO_T}$ac_cv_header_dbmalloc_h" >&6
 if test $ac_cv_header_dbmalloc_h = yes; then
 
-echo "$as_me:18856: checking for debug_malloc in -ldbmalloc" >&5
+echo "$as_me:20006: checking for debug_malloc in -ldbmalloc" >&5
 echo $ECHO_N "checking for debug_malloc in -ldbmalloc... $ECHO_C" >&6
 if test "${ac_cv_lib_dbmalloc_debug_malloc+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -18861,7 +20011,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-ldbmalloc  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 18864 "configure"
+#line 20014 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -18880,16 +20030,16 @@ debug_malloc ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:18883: \"$ac_link\"") >&5
+if { (eval echo "$as_me:20033: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:18886: \$? = $ac_status" >&5
+  echo "$as_me:20036: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:18889: \"$ac_try\"") >&5
+  { (eval echo "$as_me:20039: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:18892: \$? = $ac_status" >&5
+  echo "$as_me:20042: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_dbmalloc_debug_malloc=yes
 else
@@ -18900,7 +20050,7 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:18903: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5
+echo "$as_me:20053: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5
 echo "${ECHO_T}$ac_cv_lib_dbmalloc_debug_malloc" >&6
 if test $ac_cv_lib_dbmalloc_debug_malloc = yes; then
   cat >>confdefs.h <<EOF
@@ -18915,7 +20065,7 @@ fi
 
 fi
 
-echo "$as_me:18918: checking if you want to use valgrind for testing" >&5
+echo "$as_me:20068: checking if you want to use valgrind for testing" >&5
 echo $ECHO_N "checking if you want to use valgrind for testing... $ECHO_C" >&6
 
 # Check whether --with-valgrind or --without-valgrind was given.
@@ -18932,7 +20082,7 @@ EOF
 else
   with_valgrind=
 fi;
-echo "$as_me:18935: result: ${with_valgrind:-no}" >&5
+echo "$as_me:20085: result: ${with_valgrind:-no}" >&5
 echo "${ECHO_T}${with_valgrind:-no}" >&6
 
 case .$with_cflags in
@@ -19045,7 +20195,7 @@ fi
        ;;
 esac
 
-echo "$as_me:19048: checking if you want to perform memory-leak testing" >&5
+echo "$as_me:20198: checking if you want to perform memory-leak testing" >&5
 echo $ECHO_N "checking if you want to perform memory-leak testing... $ECHO_C" >&6
 
 # Check whether --enable-leaks or --disable-leaks was given.
@@ -19055,7 +20205,7 @@ if test "${enable_leaks+set}" = set; then
 else
   : ${with_no_leaks:=no}
 fi;
-echo "$as_me:19058: result: $with_no_leaks" >&5
+echo "$as_me:20208: result: $with_no_leaks" >&5
 echo "${ECHO_T}$with_no_leaks" >&6
 
 if test "$with_no_leaks" = yes ; then
@@ -19071,45 +20221,47 @@ EOF
 fi
 
 LD_RPATH_OPT=
-echo "$as_me:19074: checking for an rpath option" >&5
+if test "x$cf_cv_enable_rpath" != xno
+then
+       echo "$as_me:20226: checking for an rpath option" >&5
 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
-case $cf_cv_system_name in
-(irix*)
-       if test "$GCC" = yes; then
+       case $cf_cv_system_name in
+       (irix*)
+               if test "$GCC" = yes; then
+                       LD_RPATH_OPT="-Wl,-rpath,"
+               else
+                       LD_RPATH_OPT="-rpath "
+               fi
+               ;;
+       (linux*|gnu*|k*bsd*-gnu|freebsd*)
                LD_RPATH_OPT="-Wl,-rpath,"
-       else
+               ;;
+       (openbsd[2-9].*|mirbsd*)
+               LD_RPATH_OPT="-Wl,-rpath,"
+               ;;
+       (dragonfly*)
                LD_RPATH_OPT="-rpath "
-       fi
-       ;;
-(linux*|gnu*|k*bsd*-gnu|freebsd*)
-       LD_RPATH_OPT="-Wl,-rpath,"
-       ;;
-(openbsd[2-9].*|mirbsd*)
-       LD_RPATH_OPT="-Wl,-rpath,"
-       ;;
-(dragonfly*)
-       LD_RPATH_OPT="-rpath "
-       ;;
-(netbsd*)
-       LD_RPATH_OPT="-Wl,-rpath,"
-       ;;
-(osf*|mls+*)
-       LD_RPATH_OPT="-rpath "
-       ;;
-(solaris2*)
-       LD_RPATH_OPT="-R"
-       ;;
-(*)
-       ;;
-esac
-echo "$as_me:19105: result: $LD_RPATH_OPT" >&5
+               ;;
+       (netbsd*)
+               LD_RPATH_OPT="-Wl,-rpath,"
+               ;;
+       (osf*|mls+*)
+               LD_RPATH_OPT="-rpath "
+               ;;
+       (solaris2*)
+               LD_RPATH_OPT="-R"
+               ;;
+       (*)
+               ;;
+       esac
+       echo "$as_me:20257: result: $LD_RPATH_OPT" >&5
 echo "${ECHO_T}$LD_RPATH_OPT" >&6
 
-case "x$LD_RPATH_OPT" in
-(x-R*)
-       echo "$as_me:19110: checking if we need a space after rpath option" >&5
+       case "x$LD_RPATH_OPT" in
+       (x-R*)
+               echo "$as_me:20262: checking if we need a space after rpath option" >&5
 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
-       cf_save_LIBS="$LIBS"
+               cf_save_LIBS="$LIBS"
 
 cf_add_libs="${LD_RPATH_OPT}$libdir"
 # Filter out duplicates - this happens with badly-designed ".pc" files...
@@ -19127,8 +20279,8 @@ do
 done
 LIBS="$cf_add_libs"
 
-       cat >conftest.$ac_ext <<_ACEOF
-#line 19131 "configure"
+               cat >conftest.$ac_ext <<_ACEOF
+#line 20283 "configure"
 #include "confdefs.h"
 
 int
@@ -19140,16 +20292,16 @@ main (void)
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:19143: \"$ac_link\"") >&5
+if { (eval echo "$as_me:20295: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:19146: \$? = $ac_status" >&5
+  echo "$as_me:20298: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:19149: \"$ac_try\"") >&5
+  { (eval echo "$as_me:20301: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:19152: \$? = $ac_status" >&5
+  echo "$as_me:20304: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_rpath_space=no
 else
@@ -19158,14 +20310,15 @@ cat conftest.$ac_ext >&5
 cf_rpath_space=yes
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-       LIBS="$cf_save_LIBS"
-       echo "$as_me:19162: result: $cf_rpath_space" >&5
+               LIBS="$cf_save_LIBS"
+               echo "$as_me:20314: result: $cf_rpath_space" >&5
 echo "${ECHO_T}$cf_rpath_space" >&6
-       test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
-       ;;
-esac
+               test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
+               ;;
+       esac
+fi
 
-echo "$as_me:19168: checking if rpath-hack should be disabled" >&5
+echo "$as_me:20321: checking if rpath-hack should be disabled" >&5
 echo $ECHO_N "checking if rpath-hack should be disabled... $ECHO_C" >&6
 
 # Check whether --enable-rpath-hack or --disable-rpath-hack was given.
@@ -19182,21 +20335,21 @@ else
        cf_disable_rpath_hack=no
 
 fi;
-echo "$as_me:19185: result: $cf_disable_rpath_hack" >&5
+echo "$as_me:20338: result: $cf_disable_rpath_hack" >&5
 echo "${ECHO_T}$cf_disable_rpath_hack" >&6
 if test "$cf_disable_rpath_hack" = no ; then
 
-echo "$as_me:19189: checking for updated LDFLAGS" >&5
+echo "$as_me:20342: checking for updated LDFLAGS" >&5
 echo $ECHO_N "checking for updated LDFLAGS... $ECHO_C" >&6
 if test -n "$LD_RPATH_OPT" ; then
-       echo "$as_me:19192: result: maybe" >&5
+       echo "$as_me:20345: result: maybe" >&5
 echo "${ECHO_T}maybe" >&6
 
        for ac_prog in ldd
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-echo "$as_me:19199: checking for $ac_word" >&5
+echo "$as_me:20352: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_prog_cf_ldd_prog+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -19211,7 +20364,7 @@ for ac_dir in $ac_dummy; do
   test -z "$ac_dir" && ac_dir=.
   $as_executable_p "$ac_dir/$ac_word" || continue
 ac_cv_prog_cf_ldd_prog="$ac_prog"
-echo "$as_me:19214: found $ac_dir/$ac_word" >&5
+echo "$as_me:20367: found $ac_dir/$ac_word" >&5
 break
 done
 
 fi
 cf_ldd_prog=$ac_cv_prog_cf_ldd_prog
 if test -n "$cf_ldd_prog"; then
-  echo "$as_me:19222: result: $cf_ldd_prog" >&5
+  echo "$as_me:20375: result: $cf_ldd_prog" >&5
 echo "${ECHO_T}$cf_ldd_prog" >&6
 else
-  echo "$as_me:19225: result: no" >&5
+  echo "$as_me:20378: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -19236,7 +20389,7 @@ test -n "$cf_ldd_prog" || cf_ldd_prog="no"
                cf_rpath_oops=
 
 cat >conftest.$ac_ext <<_ACEOF
-#line 19239 "configure"
+#line 20392 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 int
@@ -19248,16 +20401,16 @@ printf("Hello");
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:19251: \"$ac_link\"") >&5
+if { (eval echo "$as_me:20404: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:19254: \$? = $ac_status" >&5
+  echo "$as_me:20407: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:19257: \"$ac_try\"") >&5
+  { (eval echo "$as_me:20410: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:19260: \$? = $ac_status" >&5
+  echo "$as_me:20413: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_rpath_oops=`$cf_ldd_prog conftest$ac_exeext | fgrep ' not found' | sed -e 's% =>.*$%%' |sort | uniq`
                 cf_rpath_list=`$cf_ldd_prog conftest$ac_exeext | fgrep / | sed -e 's%^.*[      ]/%/%' -e 's%/[^/][^/]*$%%' |sort | uniq`
@@ -19285,7 +20438,7 @@ rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
                                        then
                                                test -n "$verbose" && echo "    ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src" 1>&6
 
-echo "${as_me:-configure}:19288: testing ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src ..." 1>&5
+echo "${as_me:-configure}:20441: testing ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src ..." 1>&5
 
                                                LDFLAGS="$LDFLAGS -L$cf_rpath_dir/lib"
                                                break
@@ -19297,11 +20450,11 @@ echo "${as_me:-configure}:19288: testing ...adding -L$cf_rpath_dir/lib to LDFLAG
 
        test -n "$verbose" && echo "    ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
 
-echo "${as_me:-configure}:19300: testing ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
+echo "${as_me:-configure}:20453: testing ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
 
 test -n "$verbose" && echo "   ...checking LDFLAGS $LDFLAGS" 1>&6
 
-echo "${as_me:-configure}:19304: testing ...checking LDFLAGS $LDFLAGS ..." 1>&5
+echo "${as_me:-configure}:20457: testing ...checking LDFLAGS $LDFLAGS ..." 1>&5
 
 cf_rpath_dst=
 for cf_rpath_src in $LDFLAGS
@@ -19338,7 +20491,7 @@ do
                        then
                                test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
 
-echo "${as_me:-configure}:19341: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
+echo "${as_me:-configure}:20494: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
 
                                EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
                        fi
@@ -19351,11 +20504,11 @@ LDFLAGS=$cf_rpath_dst
 
 test -n "$verbose" && echo "   ...checked LDFLAGS $LDFLAGS" 1>&6
 
-echo "${as_me:-configure}:19354: testing ...checked LDFLAGS $LDFLAGS ..." 1>&5
+echo "${as_me:-configure}:20507: testing ...checked LDFLAGS $LDFLAGS ..." 1>&5
 
 test -n "$verbose" && echo "   ...checking LIBS $LIBS" 1>&6
 
-echo "${as_me:-configure}:19358: testing ...checking LIBS $LIBS ..." 1>&5
+echo "${as_me:-configure}:20511: testing ...checking LIBS $LIBS ..." 1>&5
 
 cf_rpath_dst=
 for cf_rpath_src in $LIBS
@@ -19392,7 +20545,7 @@ do
                        then
                                test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
 
-echo "${as_me:-configure}:19395: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
+echo "${as_me:-configure}:20548: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
 
                                EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
                        fi
@@ -19405,14 +20558,14 @@ LIBS=$cf_rpath_dst
 
 test -n "$verbose" && echo "   ...checked LIBS $LIBS" 1>&6
 
-echo "${as_me:-configure}:19408: testing ...checked LIBS $LIBS ..." 1>&5
+echo "${as_me:-configure}:20561: testing ...checked LIBS $LIBS ..." 1>&5
 
        test -n "$verbose" && echo "    ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
 
-echo "${as_me:-configure}:19412: testing ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
+echo "${as_me:-configure}:20565: testing ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
 
 else
-       echo "$as_me:19415: result: no" >&5
+       echo "$as_me:20568: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -19502,7 +20655,7 @@ DEFS=-DHAVE_CONFIG_H
 : ${CONFIG_STATUS=./config.status}
 ac_clean_files_save=$ac_clean_files
 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
-{ echo "$as_me:19505: creating $CONFIG_STATUS" >&5
+{ echo "$as_me:20658: creating $CONFIG_STATUS" >&5
 echo "$as_me: creating $CONFIG_STATUS" >&6;}
 cat >$CONFIG_STATUS <<_ACEOF
 #! $SHELL
@@ -19678,7 +20831,7 @@ cat >>$CONFIG_STATUS <<\EOF
     echo "$ac_cs_version"; exit 0 ;;
   --he | --h)
     # Conflict between --help and --header
-    { { echo "$as_me:19681: error: ambiguous option: $1
+    { { echo "$as_me:20834: error: ambiguous option: $1
 Try \`$0 --help' for more information." >&5
 echo "$as_me: error: ambiguous option: $1
 Try \`$0 --help' for more information." >&2;}
@@ -19697,7 +20850,7 @@ Try \`$0 --help' for more information." >&2;}
     ac_need_defaults=false;;
 
   # This is an error.
-  -*) { { echo "$as_me:19700: error: unrecognized option: $1
+  -*) { { echo "$as_me:20853: error: unrecognized option: $1
 Try \`$0 --help' for more information." >&5
 echo "$as_me: error: unrecognized option: $1
 Try \`$0 --help' for more information." >&2;}
@@ -19747,7 +20900,7 @@ do
   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
   "ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS ncurses_cfg.h:ncurses_tst.hin" ;;
-  *) { { echo "$as_me:19750: error: invalid argument: $ac_config_target" >&5
+  *) { { echo "$as_me:20903: error: invalid argument: $ac_config_target" >&5
 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
    { (exit 1); exit 1; }; };;
   esac
@@ -19852,6 +21005,8 @@ s,@AWK@,$AWK,;t t
 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
+s,@INSTALL_OPT_S@,$INSTALL_OPT_S,;t t
+s,@INSTALL_OPT_O@,$INSTALL_OPT_O,;t t
 s,@LINT@,$LINT,;t t
 s,@LINT_OPTS@,$LINT_OPTS,;t t
 s,@CTAGS@,$CTAGS,;t t
@@ -19903,6 +21058,8 @@ s,@X_LIBS@,$X_LIBS,;t t
 s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t
 s,@XCURSES_CONFIG@,$XCURSES_CONFIG,;t t
 s,@ac_ct_XCURSES_CONFIG@,$ac_ct_XCURSES_CONFIG,;t t
+s,@RGB_PATH@,$RGB_PATH,;t t
+s,@no_x11_rgb@,$no_x11_rgb,;t t
 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
 s,@cf_ldd_prog@,$cf_ldd_prog,;t t
 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
@@ -20038,7 +21195,7 @@ done; }
   esac
 
   if test x"$ac_file" != x-; then
-    { echo "$as_me:20041: creating $ac_file" >&5
+    { echo "$as_me:21198: creating $ac_file" >&5
 echo "$as_me: creating $ac_file" >&6;}
     rm -f "$ac_file"
   fi
@@ -20056,7 +21213,7 @@ echo "$as_me: creating $ac_file" >&6;}
       -) echo $tmp/stdin ;;
       [\\/$]*)
          # Absolute (can't be DOS-style, as IFS=:)
-         test -f "$f" || { { echo "$as_me:20059: error: cannot find input file: $f" >&5
+         test -f "$f" || { { echo "$as_me:21216: error: cannot find input file: $f" >&5
 echo "$as_me: error: cannot find input file: $f" >&2;}
    { (exit 1); exit 1; }; }
          echo $f;;
@@ -20069,7 +21226,7 @@ echo "$as_me: error: cannot find input file: $f" >&2;}
            echo $srcdir/$f
          else
            # /dev/null tree
-           { { echo "$as_me:20072: error: cannot find input file: $f" >&5
+           { { echo "$as_me:21229: error: cannot find input file: $f" >&5
 echo "$as_me: error: cannot find input file: $f" >&2;}
    { (exit 1); exit 1; }; }
          fi;;
@@ -20085,7 +21242,7 @@ cat >>$CONFIG_STATUS <<\EOF
       if test -n "$ac_seen"; then
         ac_used=`grep '@datarootdir@' $ac_item`
         if test -z "$ac_used"; then
-          { echo "$as_me:20088: WARNING: datarootdir was used implicitly but not set:
+          { echo "$as_me:21245: WARNING: datarootdir was used implicitly but not set:
 $ac_seen" >&5
 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
 $ac_seen" >&2;}
@@ -20094,7 +21251,7 @@ $ac_seen" >&2;}
       fi
       ac_seen=`grep '${datarootdir}' $ac_item`
       if test -n "$ac_seen"; then
-        { echo "$as_me:20097: WARNING: datarootdir was used explicitly but not set:
+        { echo "$as_me:21254: WARNING: datarootdir was used explicitly but not set:
 $ac_seen" >&5
 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
 $ac_seen" >&2;}
@@ -20131,7 +21288,7 @@ s,@INSTALL@,$ac_INSTALL,;t t
             ac_init=`egrep '[  ]*'$ac_name'[   ]*=' $ac_file`
             if test -z "$ac_init"; then
               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
-              { echo "$as_me:20134: WARNING: Variable $ac_name is used but was not set:
+              { echo "$as_me:21291: WARNING: Variable $ac_name is used but was not set:
 $ac_seen" >&5
 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
 $ac_seen" >&2;}
@@ -20142,7 +21299,7 @@ $ac_seen" >&2;}
     egrep -n '@[A-Z_][A-Z_0-9]+@' $ac_file >>$tmp/out
     if test -s $tmp/out; then
       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
-      { echo "$as_me:20145: WARNING: Some variables may not be substituted:
+      { echo "$as_me:21302: WARNING: Some variables may not be substituted:
 $ac_seen" >&5
 echo "$as_me: WARNING: Some variables may not be substituted:
 $ac_seen" >&2;}
@@ -20191,7 +21348,7 @@ for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
   * )   ac_file_in=$ac_file.in ;;
   esac
 
-  test x"$ac_file" != x- && { echo "$as_me:20194: creating $ac_file" >&5
+  test x"$ac_file" != x- && { echo "$as_me:21351: creating $ac_file" >&5
 echo "$as_me: creating $ac_file" >&6;}
 
   # First look for the input files in the build tree, otherwise in the
@@ -20202,7 +21359,7 @@ echo "$as_me: creating $ac_file" >&6;}
       -) echo $tmp/stdin ;;
       [\\/$]*)
          # Absolute (can't be DOS-style, as IFS=:)
-         test -f "$f" || { { echo "$as_me:20205: error: cannot find input file: $f" >&5
+         test -f "$f" || { { echo "$as_me:21362: error: cannot find input file: $f" >&5
 echo "$as_me: error: cannot find input file: $f" >&2;}
    { (exit 1); exit 1; }; }
          echo $f;;
@@ -20215,7 +21372,7 @@ echo "$as_me: error: cannot find input file: $f" >&2;}
            echo $srcdir/$f
          else
            # /dev/null tree
-           { { echo "$as_me:20218: error: cannot find input file: $f" >&5
+           { { echo "$as_me:21375: error: cannot find input file: $f" >&5
 echo "$as_me: error: cannot find input file: $f" >&2;}
    { (exit 1); exit 1; }; }
          fi;;
@@ -20273,7 +21430,7 @@ cat >>$CONFIG_STATUS <<\EOF
   rm -f $tmp/in
   if test x"$ac_file" != x-; then
     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
-      { echo "$as_me:20276: $ac_file is unchanged" >&5
+      { echo "$as_me:21433: $ac_file is unchanged" >&5
 echo "$as_me: $ac_file is unchanged" >&6;}
     else
       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \