]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - test/configure
ncurses 6.1 - patch 20200104
[ncurses.git] / test / configure
index 5ac552a0c1488963da81a1ab298c6151e4266f1f..7fee5389da5948cd5cd714cb63ee35177d6fd717 100755 (executable)
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by Autoconf 2.52.20190828.
+# Generated by Autoconf 2.52.20190901.
 #
 # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
 # Free Software Foundation, Inc.
@@ -765,7 +765,7 @@ This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
 It was created by $as_me, which was
-generated by GNU Autoconf 2.52.20190828.  Invocation command line was
+generated by GNU Autoconf 2.52.20190901.  Invocation command line was
 
   $ $0 $@
 
@@ -1856,7 +1856,109 @@ echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
 echo "${ECHO_T}$GCC_VERSION" >&6
 fi
 
-echo "$as_me:1859: checking for $CC option to accept ANSI C" >&5
+INTEL_COMPILER=no
+
+if test "$GCC" = yes ; then
+       case $host_os in
+       (linux*|gnu*)
+               echo "$as_me:1864: 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 1869 "configure"
+#include "confdefs.h"
+
+int
+main (void)
+{
+
+#ifdef __INTEL_COMPILER
+#else
+make an error
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:1886: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:1889: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:1892: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:1895: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  INTEL_COMPILER=yes
+cf_save_CFLAGS="$cf_save_CFLAGS -we147"
+
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+               CFLAGS="$cf_save_CFLAGS"
+               echo "$as_me:1906: result: $INTEL_COMPILER" >&5
+echo "${ECHO_T}$INTEL_COMPILER" >&6
+               ;;
+       esac
+fi
+
+CLANG_COMPILER=no
+
+if test "$GCC" = yes ; then
+       echo "$as_me:1915: 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 1920 "configure"
+#include "confdefs.h"
+
+int
+main (void)
+{
+
+#ifdef __clang__
+#else
+make an error
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:1937: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:1940: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:1943: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:1946: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  CLANG_COMPILER=yes
+cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments"
+
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+       CFLAGS="$cf_save_CFLAGS"
+       echo "$as_me:1957: result: $CLANG_COMPILER" >&5
+echo "${ECHO_T}$CLANG_COMPILER" >&6
+fi
+
+echo "$as_me:1961: 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
@@ -1864,7 +1966,7 @@ else
   ac_cv_prog_cc_stdc=no
 ac_save_CC=$CC
 cat >conftest.$ac_ext <<_ACEOF
-#line 1867 "configure"
+#line 1969 "configure"
 #include "confdefs.h"
 #include <stdarg.h>
 #include <stdio.h>
@@ -1913,16 +2015,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:1916: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:2018: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:1919: \$? = $ac_status" >&5
+  echo "$as_me:2021: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:1922: \"$ac_try\"") >&5
+  { (eval echo "$as_me:2024: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:1925: \$? = $ac_status" >&5
+  echo "$as_me:2027: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_prog_cc_stdc=$ac_arg
 break
@@ -1939,10 +2041,10 @@ fi
 
 case "x$ac_cv_prog_cc_stdc" in
   x|xno)
-    echo "$as_me:1942: result: none needed" >&5
+    echo "$as_me:2044: result: none needed" >&5
 echo "${ECHO_T}none needed" >&6 ;;
   *)
-    echo "$as_me:1945: result: $ac_cv_prog_cc_stdc" >&5
+    echo "$as_me:2047: result: $ac_cv_prog_cc_stdc" >&5
 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
     CC="$CC $ac_cv_prog_cc_stdc" ;;
 esac
@@ -1950,13 +2052,13 @@ esac
 # This should have been defined by AC_PROG_CC
 : ${CC:=cc}
 
-echo "$as_me:1953: checking \$CFLAGS variable" >&5
+echo "$as_me:2055: checking \$CFLAGS variable" >&5
 echo $ECHO_N "checking \$CFLAGS variable... $ECHO_C" >&6
 case "x$CFLAGS" in
 (*-[IUD]*)
-       echo "$as_me:1957: result: broken" >&5
+       echo "$as_me:2059: result: broken" >&5
 echo "${ECHO_T}broken" >&6
-       { echo "$as_me:1959: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&5
+       { echo "$as_me:2061: 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=
@@ -2064,18 +2166,18 @@ fi
        done
        ;;
 (*)
-       echo "$as_me:2067: result: ok" >&5
+       echo "$as_me:2169: result: ok" >&5
 echo "${ECHO_T}ok" >&6
        ;;
 esac
 
-echo "$as_me:2072: checking \$CC variable" >&5
+echo "$as_me:2174: checking \$CC variable" >&5
 echo $ECHO_N "checking \$CC variable... $ECHO_C" >&6
 case "$CC" in
 (*[\ \ ]-*)
-       echo "$as_me:2076: result: broken" >&5
+       echo "$as_me:2178: result: broken" >&5
 echo "${ECHO_T}broken" >&6
-       { echo "$as_me:2078: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&5
+       { echo "$as_me:2180: 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/[ ]*[ ]-[^ ].*//'`
@@ -2192,24 +2294,24 @@ fi
        done
        test -n "$verbose" && echo "    resulting CC: '$CC'" 1>&6
 
-echo "${as_me:-configure}:2195: testing resulting CC: '$CC' ..." 1>&5
+echo "${as_me:-configure}:2297: testing resulting CC: '$CC' ..." 1>&5
 
        test -n "$verbose" && echo "    resulting CFLAGS: '$CFLAGS'" 1>&6
 
-echo "${as_me:-configure}:2199: testing resulting CFLAGS: '$CFLAGS' ..." 1>&5
+echo "${as_me:-configure}:2301: testing resulting CFLAGS: '$CFLAGS' ..." 1>&5
 
        test -n "$verbose" && echo "    resulting CPPFLAGS: '$CPPFLAGS'" 1>&6
 
-echo "${as_me:-configure}:2203: testing resulting CPPFLAGS: '$CPPFLAGS' ..." 1>&5
+echo "${as_me:-configure}:2305: testing resulting CPPFLAGS: '$CPPFLAGS' ..." 1>&5
 
        ;;
 (*)
-       echo "$as_me:2207: result: ok" >&5
+       echo "$as_me:2309: result: ok" >&5
 echo "${ECHO_T}ok" >&6
        ;;
 esac
 
-echo "$as_me:2212: checking for inline" >&5
+echo "$as_me:2314: 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
@@ -2217,7 +2319,7 @@ else
   ac_cv_c_inline=no
 for ac_kw in inline __inline__ __inline; do
   cat >conftest.$ac_ext <<_ACEOF
-#line 2220 "configure"
+#line 2322 "configure"
 #include "confdefs.h"
 #ifndef __cplusplus
 static $ac_kw int static_foo () {return 0; }
@@ -2226,16 +2328,16 @@ $ac_kw int foo () {return 0; }
 
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:2229: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:2331: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:2232: \$? = $ac_status" >&5
+  echo "$as_me:2334: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:2235: \"$ac_try\"") >&5
+  { (eval echo "$as_me:2337: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:2238: \$? = $ac_status" >&5
+  echo "$as_me:2340: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_c_inline=$ac_kw; break
 else
@@ -2246,7 +2348,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext
 done
 
 fi
-echo "$as_me:2249: result: $ac_cv_c_inline" >&5
+echo "$as_me:2351: result: $ac_cv_c_inline" >&5
 echo "${ECHO_T}$ac_cv_c_inline" >&6
 case $ac_cv_c_inline in
   inline | yes) ;;
@@ -2267,7 +2369,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:2270: checking how to run the C preprocessor" >&5
+echo "$as_me:2372: 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
@@ -2288,18 +2390,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 2291 "configure"
+#line 2393 "configure"
 #include "confdefs.h"
 #include <assert.h>
                      Syntax error
 _ACEOF
-if { (eval echo "$as_me:2296: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:2398: \"$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:2302: \$? = $ac_status" >&5
+  echo "$as_me:2404: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
@@ -2322,17 +2424,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 2325 "configure"
+#line 2427 "configure"
 #include "confdefs.h"
 #include <ac_nonexistent.h>
 _ACEOF
-if { (eval echo "$as_me:2329: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:2431: \"$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:2335: \$? = $ac_status" >&5
+  echo "$as_me:2437: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
@@ -2369,7 +2471,7 @@ fi
 else
   ac_cv_prog_CPP=$CPP
 fi
-echo "$as_me:2372: result: $CPP" >&5
+echo "$as_me:2474: result: $CPP" >&5
 echo "${ECHO_T}$CPP" >&6
 ac_preproc_ok=false
 for ac_c_preproc_warn_flag in '' yes
@@ -2379,18 +2481,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 2382 "configure"
+#line 2484 "configure"
 #include "confdefs.h"
 #include <assert.h>
                      Syntax error
 _ACEOF
-if { (eval echo "$as_me:2387: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:2489: \"$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:2393: \$? = $ac_status" >&5
+  echo "$as_me:2495: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
@@ -2413,17 +2515,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 2416 "configure"
+#line 2518 "configure"
 #include "confdefs.h"
 #include <ac_nonexistent.h>
 _ACEOF
-if { (eval echo "$as_me:2420: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:2522: \"$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:2426: \$? = $ac_status" >&5
+  echo "$as_me:2528: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
@@ -2451,7 +2553,7 @@ rm -f conftest.err conftest.$ac_ext
 if $ac_preproc_ok; then
   :
 else
-  { { echo "$as_me:2454: error: C preprocessor \"$CPP\" fails sanity check" >&5
+  { { echo "$as_me:2556: error: C preprocessor \"$CPP\" fails sanity check" >&5
 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
    { (exit 1); exit 1; }; }
 fi
@@ -2467,7 +2569,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:2470: checking for $ac_word" >&5
+echo "$as_me:2572: 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
@@ -2482,7 +2584,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:2485: found $ac_dir/$ac_word" >&5
+echo "$as_me:2587: found $ac_dir/$ac_word" >&5
 break
 done
 
@@ -2490,10 +2592,10 @@ fi
 fi
 AWK=$ac_cv_prog_AWK
 if test -n "$AWK"; then
-  echo "$as_me:2493: result: $AWK" >&5
+  echo "$as_me:2595: result: $AWK" >&5
 echo "${ECHO_T}$AWK" >&6
 else
-  echo "$as_me:2496: result: no" >&5
+  echo "$as_me:2598: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -2512,7 +2614,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:2515: checking for a BSD compatible install" >&5
+echo "$as_me:2617: 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
@@ -2561,7 +2663,7 @@ fi
     INSTALL=$ac_install_sh
   fi
 fi
-echo "$as_me:2564: result: $INSTALL" >&5
+echo "$as_me:2666: result: $INSTALL" >&5
 echo "${ECHO_T}$INSTALL" >&6
 
 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
@@ -2582,7 +2684,7 @@ case $INSTALL in
        ;;
 esac
 
-echo "$as_me:2585: checking if you want to install stripped executables" >&5
+echo "$as_me:2687: 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.
@@ -2599,7 +2701,7 @@ else
        with_stripping=yes
 
 fi;
-echo "$as_me:2602: result: $with_stripping" >&5
+echo "$as_me:2704: result: $with_stripping" >&5
 echo "${ECHO_T}$with_stripping" >&6
 
 if test "$with_stripping" = yes
@@ -2610,7 +2712,7 @@ else
 fi
 
 : ${INSTALL:=install}
-echo "$as_me:2613: checking if install accepts -p option" >&5
+echo "$as_me:2715: 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
@@ -2641,10 +2743,10 @@ else
        rm -rf conftest*
 
 fi
-echo "$as_me:2644: result: $cf_cv_install_p" >&5
+echo "$as_me:2746: result: $cf_cv_install_p" >&5
 echo "${ECHO_T}$cf_cv_install_p" >&6
 
-echo "$as_me:2647: checking if install needs to be told about ownership" >&5
+echo "$as_me:2749: 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)
@@ -2655,7 +2757,7 @@ case `$ac_config_guess` in
        ;;
 esac
 
-echo "$as_me:2658: result: $with_install_o" >&5
+echo "$as_me:2760: result: $with_install_o" >&5
 echo "${ECHO_T}$with_install_o" >&6
 if test "x$with_install_o" = xyes
 then
@@ -2668,7 +2770,7 @@ 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:2671: checking for $ac_word" >&5
+echo "$as_me:2773: 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
@@ -2683,7 +2785,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:2686: found $ac_dir/$ac_word" >&5
+echo "$as_me:2788: found $ac_dir/$ac_word" >&5
 break
 done
 
@@ -2691,17 +2793,23 @@ fi
 fi
 LINT=$ac_cv_prog_LINT
 if test -n "$LINT"; then
-  echo "$as_me:2694: result: $LINT" >&5
+  echo "$as_me:2796: result: $LINT" >&5
 echo "${ECHO_T}$LINT" >&6
 else
-  echo "$as_me:2697: result: no" >&5
+  echo "$as_me:2799: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
   test -n "$LINT" && break
 done
 
-echo "$as_me:2704: checking if filesystem supports mixed-case filenames" >&5
+case "x$LINT" in
+(xcppcheck|x*/cppcheck)
+       test -z "$LINT_OPTS" && LINT_OPTS="--enable=all"
+       ;;
+esac
+
+echo "$as_me:2812: 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
@@ -2728,7 +2836,7 @@ else
 fi
 
 fi
-echo "$as_me:2731: result: $cf_cv_mixedcase" >&5
+echo "$as_me:2839: result: $cf_cv_mixedcase" >&5
 echo "${ECHO_T}$cf_cv_mixedcase" >&6
 test "$cf_cv_mixedcase" = yes &&
 cat >>confdefs.h <<\EOF
@@ -2739,7 +2847,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:2742: checking for $ac_word" >&5
+echo "$as_me:2850: 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
@@ -2754,7 +2862,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:2757: found $ac_dir/$ac_word" >&5
+echo "$as_me:2865: found $ac_dir/$ac_word" >&5
 break
 done
 
@@ -2762,10 +2870,10 @@ fi
 fi
 CTAGS=$ac_cv_prog_CTAGS
 if test -n "$CTAGS"; then
-  echo "$as_me:2765: result: $CTAGS" >&5
+  echo "$as_me:2873: result: $CTAGS" >&5
 echo "${ECHO_T}$CTAGS" >&6
 else
-  echo "$as_me:2768: result: no" >&5
+  echo "$as_me:2876: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -2776,7 +2884,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:2779: checking for $ac_word" >&5
+echo "$as_me:2887: 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
@@ -2791,7 +2899,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:2794: found $ac_dir/$ac_word" >&5
+echo "$as_me:2902: found $ac_dir/$ac_word" >&5
 break
 done
 
@@ -2799,10 +2907,10 @@ fi
 fi
 ETAGS=$ac_cv_prog_ETAGS
 if test -n "$ETAGS"; then
-  echo "$as_me:2802: result: $ETAGS" >&5
+  echo "$as_me:2910: result: $ETAGS" >&5
 echo "${ECHO_T}$ETAGS" >&6
 else
-  echo "$as_me:2805: result: no" >&5
+  echo "$as_me:2913: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -2811,7 +2919,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:2814: checking for $ac_word" >&5
+echo "$as_me:2922: 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
@@ -2826,7 +2934,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:2829: found $ac_dir/$ac_word" >&5
+echo "$as_me:2937: found $ac_dir/$ac_word" >&5
 break
 done
 
@@ -2835,17 +2943,17 @@ fi
 fi
 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
 if test -n "$MAKE_LOWER_TAGS"; then
-  echo "$as_me:2838: result: $MAKE_LOWER_TAGS" >&5
+  echo "$as_me:2946: result: $MAKE_LOWER_TAGS" >&5
 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
 else
-  echo "$as_me:2841: result: no" >&5
+  echo "$as_me:2949: 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:2848: checking for $ac_word" >&5
+echo "$as_me:2956: 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
@@ -2860,7 +2968,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:2863: found $ac_dir/$ac_word" >&5
+echo "$as_me:2971: found $ac_dir/$ac_word" >&5
 break
 done
 
@@ -2869,10 +2977,10 @@ fi
 fi
 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
 if test -n "$MAKE_UPPER_TAGS"; then
-  echo "$as_me:2872: result: $MAKE_UPPER_TAGS" >&5
+  echo "$as_me:2980: result: $MAKE_UPPER_TAGS" >&5
 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
 else
-  echo "$as_me:2875: result: no" >&5
+  echo "$as_me:2983: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -2892,14 +3000,14 @@ else
        MAKE_LOWER_TAGS="#"
 fi
 
-echo "$as_me:2895: checking if -lm needed for math functions" >&5
+echo "$as_me:3003: 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 2902 "configure"
+#line 3010 "configure"
 #include "confdefs.h"
 
        #include <stdio.h>
@@ -2915,16 +3023,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:2918: \"$ac_link\"") >&5
+if { (eval echo "$as_me:3026: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:2921: \$? = $ac_status" >&5
+  echo "$as_me:3029: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:2924: \"$ac_try\"") >&5
+  { (eval echo "$as_me:3032: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:2927: \$? = $ac_status" >&5
+  echo "$as_me:3035: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_need_libm=no
 else
@@ -2934,7 +3042,7 @@ cf_cv_need_libm=yes
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:2937: result: $cf_cv_need_libm" >&5
+echo "$as_me:3045: result: $cf_cv_need_libm" >&5
 echo "${ECHO_T}$cf_cv_need_libm" >&6
 if test "$cf_cv_need_libm" = yes
 then
@@ -2993,10 +3101,10 @@ cat > conftest.i <<EOF
 EOF
 if test "$GCC" = yes
 then
-       { echo "$as_me:2996: checking for $CC __attribute__ directives..." >&5
+       { echo "$as_me:3104: checking for $CC __attribute__ directives..." >&5
 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
 cat > conftest.$ac_ext <<EOF
-#line 2999 "${as_me:-configure}"
+#line 3107 "${as_me:-configure}"
 #include "confdefs.h"
 #include "conftest.h"
 #include "conftest.i"
@@ -3045,12 +3153,12 @@ EOF
                        ;;
                esac
 
-               if { (eval echo "$as_me:3048: \"$ac_compile\"") >&5
+               if { (eval echo "$as_me:3156: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:3051: \$? = $ac_status" >&5
+  echo "$as_me:3159: \$? = $ac_status" >&5
   (exit $ac_status); }; then
-                       test -n "$verbose" && echo "$as_me:3053: result: ... $cf_attribute" >&5
+                       test -n "$verbose" && echo "$as_me:3161: result: ... $cf_attribute" >&5
 echo "${ECHO_T}... $cf_attribute" >&6
                        cat conftest.h >>confdefs.h
                        case $cf_attribute in
@@ -3109,7 +3217,7 @@ fi
 rm -rf conftest*
 fi
 
-echo "$as_me:3112: checking if you want to work around bogus compiler/loader warnings" >&5
+echo "$as_me:3220: 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.
@@ -3119,7 +3227,7 @@ if test "${enable_string_hacks+set}" = set; then
 else
   with_string_hacks=no
 fi;
-echo "$as_me:3122: result: $with_string_hacks" >&5
+echo "$as_me:3230: result: $with_string_hacks" >&5
 echo "${ECHO_T}$with_string_hacks" >&6
 
 if test "x$with_string_hacks" = "xyes"; then
@@ -3128,15 +3236,15 @@ cat >>confdefs.h <<\EOF
 #define USE_STRING_HACKS 1
 EOF
 
-       { echo "$as_me:3131: WARNING: enabling string-hacks to work around bogus compiler/loader warnings" >&5
+       { echo "$as_me:3239: 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:3133: checking for strlcat" >&5
+       echo "$as_me:3241: 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 3139 "configure"
+#line 3247 "configure"
 #include "confdefs.h"
 #define strlcat autoconf_temporary
 #include <limits.h>    /* least-intrusive standard header which defines gcc2 __stub macros */
@@ -3167,16 +3275,16 @@ main (void)
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:3170: \"$ac_link\"") >&5
+if { (eval echo "$as_me:3278: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:3173: \$? = $ac_status" >&5
+  echo "$as_me:3281: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:3176: \"$ac_try\"") >&5
+  { (eval echo "$as_me:3284: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:3179: \$? = $ac_status" >&5
+  echo "$as_me:3287: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_func_strlcat=yes
 else
@@ -3186,7 +3294,7 @@ ac_cv_func_strlcat=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:3189: result: $ac_cv_func_strlcat" >&5
+echo "$as_me:3297: result: $ac_cv_func_strlcat" >&5
 echo "${ECHO_T}$ac_cv_func_strlcat" >&6
 if test $ac_cv_func_strlcat = yes; then
 
@@ -3196,7 +3304,7 @@ EOF
 
 else
 
-               echo "$as_me:3199: checking for strlcat in -lbsd" >&5
+               echo "$as_me:3307: 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
@@ -3204,7 +3312,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lbsd  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 3207 "configure"
+#line 3315 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -3223,16 +3331,16 @@ strlcat ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:3226: \"$ac_link\"") >&5
+if { (eval echo "$as_me:3334: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:3229: \$? = $ac_status" >&5
+  echo "$as_me:3337: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:3232: \"$ac_try\"") >&5
+  { (eval echo "$as_me:3340: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:3235: \$? = $ac_status" >&5
+  echo "$as_me:3343: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_bsd_strlcat=yes
 else
@@ -3243,46 +3351,46 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:3246: result: $ac_cv_lib_bsd_strlcat" >&5
+echo "$as_me:3354: 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
 
-cf_add_libs="-lbsd"
-# 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_libs="$LIBS"
+# reverse order
+cf_add_0lib=
+for cf_add_1lib in -lbsd; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
+# filter duplicates
+for cf_add_1lib in $cf_add_0lib; 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"
+       test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
 done
 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:3269: checking for $ac_header" >&5
+echo "$as_me:3377: 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 3275 "configure"
+#line 3383 "configure"
 #include "confdefs.h"
 #include <$ac_header>
 _ACEOF
-if { (eval echo "$as_me:3279: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:3387: \"$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:3285: \$? = $ac_status" >&5
+  echo "$as_me:3393: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
@@ -3301,7 +3409,7 @@ else
 fi
 rm -f conftest.err conftest.$ac_ext
 fi
-echo "$as_me:3304: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "$as_me:3412: 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
@@ -3322,13 +3430,13 @@ fi
 for ac_func in strlcpy snprintf
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:3325: checking for $ac_func" >&5
+echo "$as_me:3433: 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 3331 "configure"
+#line 3439 "configure"
 #include "confdefs.h"
 #define $ac_func autoconf_temporary
 #include <limits.h>    /* least-intrusive standard header which defines gcc2 __stub macros */
@@ -3359,16 +3467,16 @@ main (void)
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:3362: \"$ac_link\"") >&5
+if { (eval echo "$as_me:3470: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:3365: \$? = $ac_status" >&5
+  echo "$as_me:3473: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:3368: \"$ac_try\"") >&5
+  { (eval echo "$as_me:3476: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:3371: \$? = $ac_status" >&5
+  echo "$as_me:3479: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   eval "$as_ac_var=yes"
 else
@@ -3378,7 +3486,7 @@ eval "$as_ac_var=no"
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:3381: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "$as_me:3489: 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
@@ -3390,14 +3498,14 @@ done
 
 fi
 
-echo "$as_me:3393: checking if the POSIX test-macros are already defined" >&5
+echo "$as_me:3501: checking if the POSIX test-macros are already defined" >&5
 echo $ECHO_N "checking if the POSIX test-macros are already defined... $ECHO_C" >&6
 if test "${cf_cv_posix_visible+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
 cat >conftest.$ac_ext <<_ACEOF
-#line 3400 "configure"
+#line 3508 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 int
@@ -3416,16 +3524,16 @@ main (void)
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:3419: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:3527: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:3422: \$? = $ac_status" >&5
+  echo "$as_me:3530: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:3425: \"$ac_try\"") >&5
+  { (eval echo "$as_me:3533: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:3428: \$? = $ac_status" >&5
+  echo "$as_me:3536: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_posix_visible=no
 else
@@ -3436,7 +3544,7 @@ fi
 rm -f conftest.$ac_objext conftest.$ac_ext
 
 fi
-echo "$as_me:3439: result: $cf_cv_posix_visible" >&5
+echo "$as_me:3547: result: $cf_cv_posix_visible" >&5
 echo "${ECHO_T}$cf_cv_posix_visible" >&6
 
 if test "$cf_cv_posix_visible" = no; then
@@ -3481,14 +3589,14 @@ case $host_os in
 
 cf_gnu_xopen_source=$cf_XOPEN_SOURCE
 
-echo "$as_me:3484: checking if this is the GNU C library" >&5
+echo "$as_me:3592: 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 3491 "configure"
+#line 3599 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 int
@@ -3507,16 +3615,16 @@ main (void)
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:3510: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:3618: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:3513: \$? = $ac_status" >&5
+  echo "$as_me:3621: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:3516: \"$ac_try\"") >&5
+  { (eval echo "$as_me:3624: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:3519: \$? = $ac_status" >&5
+  echo "$as_me:3627: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_gnu_library=yes
 else
@@ -3527,7 +3635,7 @@ fi
 rm -f conftest.$ac_objext conftest.$ac_ext
 
 fi
-echo "$as_me:3530: result: $cf_cv_gnu_library" >&5
+echo "$as_me:3638: result: $cf_cv_gnu_library" >&5
 echo "${ECHO_T}$cf_cv_gnu_library" >&6
 
 if test x$cf_cv_gnu_library = xyes; then
@@ -3535,7 +3643,7 @@ if test x$cf_cv_gnu_library = xyes; then
        # With glibc 2.19 (13 years after this check was begun), _DEFAULT_SOURCE
        # was changed to help a little.  newlib incorporated the change about 4
        # years later.
-       echo "$as_me:3538: checking if _DEFAULT_SOURCE can be used as a basis" >&5
+       echo "$as_me:3646: 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
@@ -3547,7 +3655,7 @@ else
        CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
 
                cat >conftest.$ac_ext <<_ACEOF
-#line 3550 "configure"
+#line 3658 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 int
@@ -3566,16 +3674,16 @@ main (void)
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:3569: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:3677: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:3572: \$? = $ac_status" >&5
+  echo "$as_me:3680: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:3575: \"$ac_try\"") >&5
+  { (eval echo "$as_me:3683: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:3578: \$? = $ac_status" >&5
+  echo "$as_me:3686: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_gnu_library_219=yes
 else
@@ -3587,12 +3695,12 @@ rm -f conftest.$ac_objext conftest.$ac_ext
                CPPFLAGS="$cf_save"
 
 fi
-echo "$as_me:3590: result: $cf_cv_gnu_library_219" >&5
+echo "$as_me:3698: result: $cf_cv_gnu_library_219" >&5
 echo "${ECHO_T}$cf_cv_gnu_library_219" >&6
 
        if test "x$cf_cv_gnu_library_219" = xyes; then
                cf_save="$CPPFLAGS"
-               echo "$as_me:3595: checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE" >&5
+               echo "$as_me:3703: 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
@@ -3697,7 +3805,7 @@ if test -n "$cf_new_extra_cppflags" ; then
 fi
 
                        cat >conftest.$ac_ext <<_ACEOF
-#line 3700 "configure"
+#line 3808 "configure"
 #include "confdefs.h"
 
                                #include <limits.h>
@@ -3717,16 +3825,16 @@ main (void)
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:3720: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:3828: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:3723: \$? = $ac_status" >&5
+  echo "$as_me:3831: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:3726: \"$ac_try\"") >&5
+  { (eval echo "$as_me:3834: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:3729: \$? = $ac_status" >&5
+  echo "$as_me:3837: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_gnu_dftsrc_219=yes
 else
@@ -3737,7 +3845,7 @@ fi
 rm -f conftest.$ac_objext conftest.$ac_ext
 
 fi
-echo "$as_me:3740: result: $cf_cv_gnu_dftsrc_219" >&5
+echo "$as_me:3848: 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
@@ -3746,14 +3854,14 @@ echo "${ECHO_T}$cf_cv_gnu_dftsrc_219" >&6
 
        if test "x$cf_cv_gnu_dftsrc_219" != xyes; then
 
-               echo "$as_me:3749: checking if we must define _GNU_SOURCE" >&5
+               echo "$as_me:3857: 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 3756 "configure"
+#line 3864 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 int
@@ -3768,16 +3876,16 @@ main (void)
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:3771: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:3879: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:3774: \$? = $ac_status" >&5
+  echo "$as_me:3882: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:3777: \"$ac_try\"") >&5
+  { (eval echo "$as_me:3885: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:3780: \$? = $ac_status" >&5
+  echo "$as_me:3888: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_gnu_source=no
 else
@@ -3884,7 +3992,7 @@ if test -n "$cf_new_extra_cppflags" ; then
 fi
 
                         cat >conftest.$ac_ext <<_ACEOF
-#line 3887 "configure"
+#line 3995 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 int
@@ -3899,16 +4007,16 @@ main (void)
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:3902: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:4010: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:3905: \$? = $ac_status" >&5
+  echo "$as_me:4013: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:3908: \"$ac_try\"") >&5
+  { (eval echo "$as_me:4016: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:3911: \$? = $ac_status" >&5
+  echo "$as_me:4019: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_gnu_source=no
 else
@@ -3923,12 +4031,12 @@ fi
 rm -f conftest.$ac_objext conftest.$ac_ext
 
 fi
-echo "$as_me:3926: result: $cf_cv_gnu_source" >&5
+echo "$as_me:4034: 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:3931: checking if we should also define _DEFAULT_SOURCE" >&5
+               echo "$as_me:4039: 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
@@ -3938,7 +4046,7 @@ else
        CPPFLAGS="${CPPFLAGS}-D_GNU_SOURCE"
 
                        cat >conftest.$ac_ext <<_ACEOF
-#line 3941 "configure"
+#line 4049 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 int
@@ -3953,16 +4061,16 @@ main (void)
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:3956: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:4064: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:3959: \$? = $ac_status" >&5
+  echo "$as_me:4067: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:3962: \"$ac_try\"") >&5
+  { (eval echo "$as_me:4070: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:3965: \$? = $ac_status" >&5
+  echo "$as_me:4073: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_default_source=no
 else
@@ -3973,7 +4081,7 @@ fi
 rm -f conftest.$ac_objext conftest.$ac_ext
 
 fi
-echo "$as_me:3976: result: $cf_cv_default_source" >&5
+echo "$as_me:4084: result: $cf_cv_default_source" >&5
 echo "${ECHO_T}$cf_cv_default_source" >&6
                        if test "$cf_cv_default_source" = yes
                        then
@@ -4010,16 +4118,16 @@ 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:4013: checking if we should define _POSIX_C_SOURCE" >&5
+echo "$as_me:4121: 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}:4019: testing if the symbol is already defined go no further ..." 1>&5
+echo "${as_me:-configure}:4127: testing if the symbol is already defined go no further ..." 1>&5
 
        cat >conftest.$ac_ext <<_ACEOF
-#line 4022 "configure"
+#line 4130 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 int
@@ -4034,16 +4142,16 @@ make an error
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:4037: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:4145: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:4040: \$? = $ac_status" >&5
+  echo "$as_me:4148: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:4043: \"$ac_try\"") >&5
+  { (eval echo "$as_me:4151: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:4046: \$? = $ac_status" >&5
+  echo "$as_me:4154: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_posix_c_source=no
 else
@@ -4064,7 +4172,7 @@ cf_want_posix_source=no
         esac
         if test "$cf_want_posix_source" = yes ; then
                cat >conftest.$ac_ext <<_ACEOF
-#line 4067 "configure"
+#line 4175 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 int
@@ -4079,16 +4187,16 @@ make an error
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:4082: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:4190: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:4085: \$? = $ac_status" >&5
+  echo "$as_me:4193: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:4088: \"$ac_try\"") >&5
+  { (eval echo "$as_me:4196: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:4091: \$? = $ac_status" >&5
+  echo "$as_me:4199: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   :
 else
@@ -4099,7 +4207,7 @@ fi
 rm -f conftest.$ac_objext conftest.$ac_ext
         fi
 
-echo "${as_me:-configure}:4102: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
+echo "${as_me:-configure}:4210: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
 
         CFLAGS="$cf_trim_CFLAGS"
         CPPFLAGS="$cf_trim_CPPFLAGS"
@@ -4107,10 +4215,10 @@ echo "${as_me:-configure}:4102: testing ifdef from value $cf_POSIX_C_SOURCE ..."
        test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
        CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
 
-echo "${as_me:-configure}:4110: testing if the second compile does not leave our definition intact error ..." 1>&5
+echo "${as_me:-configure}:4218: testing if the second compile does not leave our definition intact error ..." 1>&5
 
         cat >conftest.$ac_ext <<_ACEOF
-#line 4113 "configure"
+#line 4221 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 int
@@ -4125,16 +4233,16 @@ make an error
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:4128: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:4236: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:4131: \$? = $ac_status" >&5
+  echo "$as_me:4239: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:4134: \"$ac_try\"") >&5
+  { (eval echo "$as_me:4242: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:4137: \$? = $ac_status" >&5
+  echo "$as_me:4245: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   :
 else
@@ -4150,7 +4258,7 @@ fi
 rm -f conftest.$ac_objext conftest.$ac_ext
 
 fi
-echo "$as_me:4153: result: $cf_cv_posix_c_source" >&5
+echo "$as_me:4261: 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
@@ -4290,14 +4398,14 @@ fi # cf_cv_posix_visible
        ;;
 (*)
 
-echo "$as_me:4293: checking if we should define _XOPEN_SOURCE" >&5
+echo "$as_me:4401: 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 4300 "configure"
+#line 4408 "configure"
 #include "confdefs.h"
 
 #include <stdlib.h>
@@ -4316,16 +4424,16 @@ make an error
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:4319: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:4427: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:4322: \$? = $ac_status" >&5
+  echo "$as_me:4430: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:4325: \"$ac_try\"") >&5
+  { (eval echo "$as_me:4433: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:4328: \$? = $ac_status" >&5
+  echo "$as_me:4436: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_xopen_source=no
 else
@@ -4337,7 +4445,7 @@ cf_save="$CPPFLAGS"
        CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
 
         cat >conftest.$ac_ext <<_ACEOF
-#line 4340 "configure"
+#line 4448 "configure"
 #include "confdefs.h"
 
 #include <stdlib.h>
@@ -4356,16 +4464,16 @@ make an error
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:4359: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:4467: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:4362: \$? = $ac_status" >&5
+  echo "$as_me:4470: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:4365: \"$ac_try\"") >&5
+  { (eval echo "$as_me:4473: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:4368: \$? = $ac_status" >&5
+  echo "$as_me:4476: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_xopen_source=no
 else
@@ -4380,7 +4488,7 @@ fi
 rm -f conftest.$ac_objext conftest.$ac_ext
 
 fi
-echo "$as_me:4383: result: $cf_cv_xopen_source" >&5
+echo "$as_me:4491: result: $cf_cv_xopen_source" >&5
 echo "${ECHO_T}$cf_cv_xopen_source" >&6
 
 if test "$cf_cv_xopen_source" != no ; then
@@ -4510,16 +4618,16 @@ 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:4513: checking if we should define _POSIX_C_SOURCE" >&5
+echo "$as_me:4621: 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}:4519: testing if the symbol is already defined go no further ..." 1>&5
+echo "${as_me:-configure}:4627: testing if the symbol is already defined go no further ..." 1>&5
 
        cat >conftest.$ac_ext <<_ACEOF
-#line 4522 "configure"
+#line 4630 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 int
@@ -4534,16 +4642,16 @@ make an error
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:4537: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:4645: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:4540: \$? = $ac_status" >&5
+  echo "$as_me:4648: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:4543: \"$ac_try\"") >&5
+  { (eval echo "$as_me:4651: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:4546: \$? = $ac_status" >&5
+  echo "$as_me:4654: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_posix_c_source=no
 else
@@ -4564,7 +4672,7 @@ cf_want_posix_source=no
         esac
         if test "$cf_want_posix_source" = yes ; then
                cat >conftest.$ac_ext <<_ACEOF
-#line 4567 "configure"
+#line 4675 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 int
@@ -4579,16 +4687,16 @@ make an error
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:4582: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:4690: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:4585: \$? = $ac_status" >&5
+  echo "$as_me:4693: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:4588: \"$ac_try\"") >&5
+  { (eval echo "$as_me:4696: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:4591: \$? = $ac_status" >&5
+  echo "$as_me:4699: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   :
 else
@@ -4599,7 +4707,7 @@ fi
 rm -f conftest.$ac_objext conftest.$ac_ext
         fi
 
-echo "${as_me:-configure}:4602: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
+echo "${as_me:-configure}:4710: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
 
         CFLAGS="$cf_trim_CFLAGS"
         CPPFLAGS="$cf_trim_CPPFLAGS"
@@ -4607,10 +4715,10 @@ echo "${as_me:-configure}:4602: testing ifdef from value $cf_POSIX_C_SOURCE ..."
        test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
        CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
 
-echo "${as_me:-configure}:4610: testing if the second compile does not leave our definition intact error ..." 1>&5
+echo "${as_me:-configure}:4718: testing if the second compile does not leave our definition intact error ..." 1>&5
 
         cat >conftest.$ac_ext <<_ACEOF
-#line 4613 "configure"
+#line 4721 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 int
@@ -4625,16 +4733,16 @@ make an error
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:4628: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:4736: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:4631: \$? = $ac_status" >&5
+  echo "$as_me:4739: \$? = $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:4742: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:4637: \$? = $ac_status" >&5
+  echo "$as_me:4745: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   :
 else
@@ -4650,7 +4758,7 @@ fi
 rm -f conftest.$ac_objext conftest.$ac_ext
 
 fi
-echo "$as_me:4653: result: $cf_cv_posix_c_source" >&5
+echo "$as_me:4761: 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
@@ -4844,7 +4952,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}:4847: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
+echo "${as_me:-configure}:4955: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
 
        test -n "$CFLAGS" && CFLAGS="$CFLAGS "
        CFLAGS="${CFLAGS}$cf_new_cflags"
@@ -4854,7 +4962,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}:4857: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
+echo "${as_me:-configure}:4965: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
 
        test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
        CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
@@ -4864,7 +4972,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}:4867: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
+echo "${as_me:-configure}:4975: 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"
@@ -4874,10 +4982,10 @@ fi
 fi
 
 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
-       echo "$as_me:4877: checking if _XOPEN_SOURCE really is set" >&5
+       echo "$as_me:4985: 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 4880 "configure"
+#line 4988 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 int
@@ -4892,16 +5000,16 @@ make an error
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:4895: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:5003: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:4898: \$? = $ac_status" >&5
+  echo "$as_me:5006: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:4901: \"$ac_try\"") >&5
+  { (eval echo "$as_me:5009: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:4904: \$? = $ac_status" >&5
+  echo "$as_me:5012: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_XOPEN_SOURCE_set=yes
 else
@@ -4910,12 +5018,12 @@ cat conftest.$ac_ext >&5
 cf_XOPEN_SOURCE_set=no
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
-       echo "$as_me:4913: result: $cf_XOPEN_SOURCE_set" >&5
+       echo "$as_me:5021: 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 4918 "configure"
+#line 5026 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 int
@@ -4930,16 +5038,16 @@ make an error
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:4933: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:5041: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:4936: \$? = $ac_status" >&5
+  echo "$as_me:5044: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:4939: \"$ac_try\"") >&5
+  { (eval echo "$as_me:5047: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:4942: \$? = $ac_status" >&5
+  echo "$as_me:5050: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_XOPEN_SOURCE_set_ok=yes
 else
@@ -4950,19 +5058,19 @@ fi
 rm -f conftest.$ac_objext conftest.$ac_ext
                if test $cf_XOPEN_SOURCE_set_ok = no
                then
-                       { echo "$as_me:4953: WARNING: _XOPEN_SOURCE is lower than requested" >&5
+                       { echo "$as_me:5061: WARNING: _XOPEN_SOURCE is lower than requested" >&5
 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
                fi
        else
 
-echo "$as_me:4958: checking if we should define _XOPEN_SOURCE" >&5
+echo "$as_me:5066: 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 4965 "configure"
+#line 5073 "configure"
 #include "confdefs.h"
 
 #include <stdlib.h>
@@ -4981,16 +5089,16 @@ make an error
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:4984: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:5092: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:4987: \$? = $ac_status" >&5
+  echo "$as_me:5095: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:4990: \"$ac_try\"") >&5
+  { (eval echo "$as_me:5098: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:4993: \$? = $ac_status" >&5
+  echo "$as_me:5101: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_xopen_source=no
 else
@@ -5002,7 +5110,7 @@ cf_save="$CPPFLAGS"
        CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
 
         cat >conftest.$ac_ext <<_ACEOF
-#line 5005 "configure"
+#line 5113 "configure"
 #include "confdefs.h"
 
 #include <stdlib.h>
@@ -5021,16 +5129,16 @@ make an error
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:5024: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:5132: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:5027: \$? = $ac_status" >&5
+  echo "$as_me:5135: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:5030: \"$ac_try\"") >&5
+  { (eval echo "$as_me:5138: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:5033: \$? = $ac_status" >&5
+  echo "$as_me:5141: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_xopen_source=no
 else
@@ -5045,7 +5153,7 @@ fi
 rm -f conftest.$ac_objext conftest.$ac_ext
 
 fi
-echo "$as_me:5048: result: $cf_cv_xopen_source" >&5
+echo "$as_me:5156: result: $cf_cv_xopen_source" >&5
 echo "${ECHO_T}$cf_cv_xopen_source" >&6
 
 if test "$cf_cv_xopen_source" != no ; then
@@ -5164,7 +5272,7 @@ fi
 fi
 fi # cf_cv_posix_visible
 
-echo "$as_me:5167: checking for signal global datatype" >&5
+echo "$as_me:5275: 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
@@ -5176,7 +5284,7 @@ else
                "int"
        do
        cat >conftest.$ac_ext <<_ACEOF
-#line 5179 "configure"
+#line 5287 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -5199,16 +5307,16 @@ signal(SIGINT, handler);
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:5202: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:5310: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:5205: \$? = $ac_status" >&5
+  echo "$as_me:5313: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:5208: \"$ac_try\"") >&5
+  { (eval echo "$as_me:5316: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:5211: \$? = $ac_status" >&5
+  echo "$as_me:5319: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_sig_atomic_t=$cf_type
 else
@@ -5222,7 +5330,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext
 
 fi
 
-echo "$as_me:5225: result: $cf_cv_sig_atomic_t" >&5
+echo "$as_me:5333: 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
@@ -5231,14 +5339,14 @@ EOF
 
 # Work around breakage on OS X
 
-echo "$as_me:5234: checking if SIGWINCH is defined" >&5
+echo "$as_me:5342: 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 5241 "configure"
+#line 5349 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -5253,23 +5361,23 @@ int x = SIGWINCH
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:5256: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:5364: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:5259: \$? = $ac_status" >&5
+  echo "$as_me:5367: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:5262: \"$ac_try\"") >&5
+  { (eval echo "$as_me:5370: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:5265: \$? = $ac_status" >&5
+  echo "$as_me:5373: \$? = $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 5272 "configure"
+#line 5380 "configure"
 #include "confdefs.h"
 
 #undef _XOPEN_SOURCE
@@ -5287,16 +5395,16 @@ int x = SIGWINCH
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:5290: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:5398: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:5293: \$? = $ac_status" >&5
+  echo "$as_me:5401: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:5296: \"$ac_try\"") >&5
+  { (eval echo "$as_me:5404: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:5299: \$? = $ac_status" >&5
+  echo "$as_me:5407: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_define_sigwinch=maybe
 else
@@ -5310,11 +5418,11 @@ fi
 rm -f conftest.$ac_objext conftest.$ac_ext
 
 fi
-echo "$as_me:5313: result: $cf_cv_define_sigwinch" >&5
+echo "$as_me:5421: 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:5317: checking for actual SIGWINCH definition" >&5
+echo "$as_me:5425: 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
@@ -5325,7 +5433,7 @@ cf_sigwinch=32
 while test $cf_sigwinch != 1
 do
        cat >conftest.$ac_ext <<_ACEOF
-#line 5328 "configure"
+#line 5436 "configure"
 #include "confdefs.h"
 
 #undef _XOPEN_SOURCE
@@ -5347,16 +5455,16 @@ int x = SIGWINCH
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:5350: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:5458: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:5353: \$? = $ac_status" >&5
+  echo "$as_me:5461: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:5356: \"$ac_try\"") >&5
+  { (eval echo "$as_me:5464: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:5359: \$? = $ac_status" >&5
+  echo "$as_me:5467: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_fixup_sigwinch=$cf_sigwinch
         break
@@ -5370,7 +5478,7 @@ cf_sigwinch=`expr $cf_sigwinch - 1`
 done
 
 fi
-echo "$as_me:5373: result: $cf_cv_fixup_sigwinch" >&5
+echo "$as_me:5481: result: $cf_cv_fixup_sigwinch" >&5
 echo "${ECHO_T}$cf_cv_fixup_sigwinch" >&6
 
        if test "$cf_cv_fixup_sigwinch" != unknown ; then
@@ -5380,13 +5488,13 @@ fi
 
 # Checks for CODESET support.
 
-echo "$as_me:5383: checking for nl_langinfo and CODESET" >&5
+echo "$as_me:5491: 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 5389 "configure"
+#line 5497 "configure"
 #include "confdefs.h"
 #include <langinfo.h>
 int
@@ -5398,16 +5506,16 @@ char* cs = nl_langinfo(CODESET);
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:5401: \"$ac_link\"") >&5
+if { (eval echo "$as_me:5509: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:5404: \$? = $ac_status" >&5
+  echo "$as_me:5512: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:5407: \"$ac_try\"") >&5
+  { (eval echo "$as_me:5515: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:5410: \$? = $ac_status" >&5
+  echo "$as_me:5518: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   am_cv_langinfo_codeset=yes
 else
@@ -5418,7 +5526,7 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 
 fi
-echo "$as_me:5421: result: $am_cv_langinfo_codeset" >&5
+echo "$as_me:5529: result: $am_cv_langinfo_codeset" >&5
 echo "${ECHO_T}$am_cv_langinfo_codeset" >&6
        if test $am_cv_langinfo_codeset = yes; then
 
@@ -5428,7 +5536,7 @@ EOF
 
        fi
 
-echo "$as_me:5431: checking if you want to use pkg-config" >&5
+echo "$as_me:5539: 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.
@@ -5438,7 +5546,7 @@ if test "${with_pkg_config+set}" = set; then
 else
   cf_pkg_config=yes
 fi;
-echo "$as_me:5441: result: $cf_pkg_config" >&5
+echo "$as_me:5549: result: $cf_pkg_config" >&5
 echo "${ECHO_T}$cf_pkg_config" >&6
 
 case $cf_pkg_config in
@@ -5450,7 +5558,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:5453: checking for $ac_word" >&5
+echo "$as_me:5561: 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
@@ -5467,7 +5575,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:5470: found $ac_dir/$ac_word" >&5
+   echo "$as_me:5578: found $ac_dir/$ac_word" >&5
    break
 fi
 done
@@ -5478,10 +5586,10 @@ fi
 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
 
 if test -n "$PKG_CONFIG"; then
-  echo "$as_me:5481: result: $PKG_CONFIG" >&5
+  echo "$as_me:5589: result: $PKG_CONFIG" >&5
 echo "${ECHO_T}$PKG_CONFIG" >&6
 else
-  echo "$as_me:5484: result: no" >&5
+  echo "$as_me:5592: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -5490,7 +5598,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:5493: checking for $ac_word" >&5
+echo "$as_me:5601: 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
@@ -5507,7 +5615,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:5510: found $ac_dir/$ac_word" >&5
+   echo "$as_me:5618: found $ac_dir/$ac_word" >&5
    break
 fi
 done
@@ -5519,10 +5627,10 @@ fi
 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
 
 if test -n "$ac_pt_PKG_CONFIG"; then
-  echo "$as_me:5522: result: $ac_pt_PKG_CONFIG" >&5
+  echo "$as_me:5630: result: $ac_pt_PKG_CONFIG" >&5
 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
 else
-  echo "$as_me:5525: result: no" >&5
+  echo "$as_me:5633: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -5565,18 +5673,18 @@ case ".$PKG_CONFIG" in
        PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
        ;;
 (*)
-       { { echo "$as_me:5568: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
+       { { echo "$as_me:5676: 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:5575: WARNING: pkg-config is not installed" >&5
+       { echo "$as_me:5683: WARNING: pkg-config is not installed" >&5
 echo "$as_me: WARNING: pkg-config is not installed" >&2;}
 fi
 
-echo "$as_me:5579: checking if you want to see long compiling messages" >&5
+echo "$as_me:5687: 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.
@@ -5610,10 +5718,10 @@ else
        ECHO_CC=''
 
 fi;
-echo "$as_me:5613: result: $enableval" >&5
+echo "$as_me:5721: result: $enableval" >&5
 echo "${ECHO_T}$enableval" >&6
 
-echo "$as_me:5616: checking for ncurses wrap-prefix" >&5
+echo "$as_me:5724: 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.
@@ -5623,10 +5731,10 @@ if test "${with_ncurses_wrap_prefix+set}" = set; then
 else
   NCURSES_WRAP_PREFIX=_nc_
 fi;
-echo "$as_me:5626: result: $NCURSES_WRAP_PREFIX" >&5
+echo "$as_me:5734: result: $NCURSES_WRAP_PREFIX" >&5
 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
 
-echo "$as_me:5629: checking if you want to check for wide-character functions" >&5
+echo "$as_me:5737: 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.
@@ -5643,10 +5751,10 @@ else
        cf_enable_widec=yes
 
 fi;
-echo "$as_me:5646: result: $cf_enable_widec" >&5
+echo "$as_me:5754: result: $cf_enable_widec" >&5
 echo "${ECHO_T}$cf_enable_widec" >&6
 
-echo "$as_me:5649: checking for specific curses-directory" >&5
+echo "$as_me:5757: 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.
@@ -5656,7 +5764,7 @@ if test "${with_curses_dir+set}" = set; then
 else
   cf_cv_curses_dir=no
 fi;
-echo "$as_me:5659: result: $cf_cv_curses_dir" >&5
+echo "$as_me:5767: 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" )
@@ -5687,7 +5795,7 @@ case ".$withval" in
        withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
        ;;
 (*)
-       { { echo "$as_me:5690: error: expected a pathname, not \"$withval\"" >&5
+       { { echo "$as_me:5798: error: expected a pathname, not \"$withval\"" >&5
 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
    { (exit 1); exit 1; }; }
        ;;
@@ -5723,7 +5831,7 @@ if test -n "$cf_cv_curses_dir/include" ; then
        CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
 
                          cat >conftest.$ac_ext <<_ACEOF
-#line 5726 "configure"
+#line 5834 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 int
@@ -5735,16 +5843,16 @@ printf("Hello")
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:5738: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:5846: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:5741: \$? = $ac_status" >&5
+  echo "$as_me:5849: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:5744: \"$ac_try\"") >&5
+  { (eval echo "$as_me:5852: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:5747: \$? = $ac_status" >&5
+  echo "$as_me:5855: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   :
 else
@@ -5761,7 +5869,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}:5764: testing adding $cf_add_incdir to include-path ..." 1>&5
+echo "${as_me:-configure}:5872: testing adding $cf_add_incdir to include-path ..." 1>&5
 
                  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
 
@@ -5797,7 +5905,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}:5800: testing adding $cf_add_libdir to library-path ..." 1>&5
+echo "${as_me:-configure}:5908: testing adding $cf_add_libdir to library-path ..." 1>&5
 
                                LDFLAGS="-L$cf_add_libdir $LDFLAGS"
                        fi
@@ -5810,7 +5918,7 @@ fi
 
 cf_cv_screen=curses
 
-echo "$as_me:5813: checking for specified curses library type" >&5
+echo "$as_me:5921: 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.
@@ -5854,13 +5962,13 @@ fi;
 fi;
 fi;
 
-echo "$as_me:5857: result: $cf_cv_screen" >&5
+echo "$as_me:5965: result: $cf_cv_screen" >&5
 echo "${ECHO_T}$cf_cv_screen" >&6
 
 case $cf_cv_screen in
 (curses|curses_*)
 
-echo "$as_me:5863: checking for extra include directories" >&5
+echo "$as_me:5971: 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
@@ -5886,7 +5994,7 @@ case $host_os in
 esac
 
 fi
-echo "$as_me:5889: result: $cf_cv_curses_incdir" >&5
+echo "$as_me:5997: result: $cf_cv_curses_incdir" >&5
 echo "${ECHO_T}$cf_cv_curses_incdir" >&6
 if test "$cf_cv_curses_incdir" != no
 then
@@ -5896,7 +6004,7 @@ then
 
 fi
 
-echo "$as_me:5899: checking if we have identified curses headers" >&5
+echo "$as_me:6007: 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
@@ -5908,7 +6016,7 @@ for cf_header in \
        curses.h  ncurses/ncurses.h ncurses/curses.h
 do
 cat >conftest.$ac_ext <<_ACEOF
-#line 5911 "configure"
+#line 6019 "configure"
 #include "confdefs.h"
 #include <${cf_header}>
 int
@@ -5920,16 +6028,16 @@ initscr(); tgoto("?", 0,0)
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:5923: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:6031: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:5926: \$? = $ac_status" >&5
+  echo "$as_me:6034: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:5929: \"$ac_try\"") >&5
+  { (eval echo "$as_me:6037: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:5932: \$? = $ac_status" >&5
+  echo "$as_me:6040: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_ncurses_header=$cf_header; break
 else
@@ -5940,11 +6048,11 @@ rm -f conftest.$ac_objext conftest.$ac_ext
 done
 
 fi
-echo "$as_me:5943: result: $cf_cv_ncurses_header" >&5
+echo "$as_me:6051: 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:5947: error: No curses header-files found" >&5
+       { { echo "$as_me:6055: error: No curses header-files found" >&5
 echo "$as_me: error: No curses header-files found" >&2;}
    { (exit 1); exit 1; }; }
 fi
@@ -5954,23 +6062,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:5957: checking for $ac_header" >&5
+echo "$as_me:6065: 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 5963 "configure"
+#line 6071 "configure"
 #include "confdefs.h"
 #include <$ac_header>
 _ACEOF
-if { (eval echo "$as_me:5967: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:6075: \"$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:5973: \$? = $ac_status" >&5
+  echo "$as_me:6081: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
@@ -5989,7 +6097,7 @@ else
 fi
 rm -f conftest.err conftest.$ac_ext
 fi
-echo "$as_me:5992: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "$as_me:6100: 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
@@ -5999,7 +6107,7 @@ EOF
 fi
 done
 
-echo "$as_me:6002: checking for terminfo header" >&5
+echo "$as_me:6110: 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
@@ -6017,7 +6125,7 @@ esac
 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
 do
 cat >conftest.$ac_ext <<_ACEOF
-#line 6020 "configure"
+#line 6128 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 #include <${cf_cv_ncurses_header:-curses.h}>
@@ -6032,16 +6140,16 @@ int x = auto_left_margin
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:6035: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:6143: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:6038: \$? = $ac_status" >&5
+  echo "$as_me:6146: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:6041: \"$ac_try\"") >&5
+  { (eval echo "$as_me:6149: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:6044: \$? = $ac_status" >&5
+  echo "$as_me:6152: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
        cf_cv_term_header="$cf_test"
@@ -6057,7 +6165,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext
 done
 
 fi
-echo "$as_me:6060: result: $cf_cv_term_header" >&5
+echo "$as_me:6168: result: $cf_cv_term_header" >&5
 echo "${ECHO_T}$cf_cv_term_header" >&6
 
 # Set definitions to allow ifdef'ing to accommodate subdirectories
@@ -6089,7 +6197,7 @@ EOF
        ;;
 esac
 
-echo "$as_me:6092: checking for ncurses version" >&5
+echo "$as_me:6200: 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
@@ -6115,10 +6223,10 @@ Autoconf "old"
 #endif
 EOF
        cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
-       { (eval echo "$as_me:6118: \"$cf_try\"") >&5
+       { (eval echo "$as_me:6226: \"$cf_try\"") >&5
   (eval $cf_try) 2>&5
   ac_status=$?
-  echo "$as_me:6121: \$? = $ac_status" >&5
+  echo "$as_me:6229: \$? = $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%".*%%'`
@@ -6128,7 +6236,7 @@ EOF
 
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 6131 "configure"
+#line 6239 "configure"
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header:-curses.h}>
@@ -6153,15 +6261,15 @@ int main(void)
 }
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:6156: \"$ac_link\"") >&5
+if { (eval echo "$as_me:6264: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:6159: \$? = $ac_status" >&5
+  echo "$as_me:6267: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:6161: \"$ac_try\"") >&5
+  { (eval echo "$as_me:6269: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:6164: \$? = $ac_status" >&5
+  echo "$as_me:6272: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
        cf_cv_ncurses_version=`cat $cf_tempfile`
@@ -6175,17 +6283,17 @@ fi
        rm -f $cf_tempfile
 
 fi
-echo "$as_me:6178: result: $cf_cv_ncurses_version" >&5
+echo "$as_me:6286: 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:6185: checking if we have identified curses libraries" >&5
+echo "$as_me:6293: 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 6188 "configure"
+#line 6296 "configure"
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header:-curses.h}>
 int
@@ -6197,16 +6305,16 @@ initscr(); tgoto("?", 0,0)
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:6200: \"$ac_link\"") >&5
+if { (eval echo "$as_me:6308: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:6203: \$? = $ac_status" >&5
+  echo "$as_me:6311: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:6206: \"$ac_try\"") >&5
+  { (eval echo "$as_me:6314: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:6209: \$? = $ac_status" >&5
+  echo "$as_me:6317: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_result=yes
 else
@@ -6215,13 +6323,13 @@ cat conftest.$ac_ext >&5
 cf_result=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-echo "$as_me:6218: result: $cf_result" >&5
+echo "$as_me:6326: result: $cf_result" >&5
 echo "${ECHO_T}$cf_result" >&6
 
 if test "$cf_result" = no ; then
 case $host_os in
 (freebsd*)
-       echo "$as_me:6224: checking for tgoto in -lmytinfo" >&5
+       echo "$as_me:6332: 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
@@ -6229,7 +6337,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lmytinfo  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 6232 "configure"
+#line 6340 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -6248,16 +6356,16 @@ tgoto ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:6251: \"$ac_link\"") >&5
+if { (eval echo "$as_me:6359: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:6254: \$? = $ac_status" >&5
+  echo "$as_me:6362: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:6257: \"$ac_try\"") >&5
+  { (eval echo "$as_me:6365: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:6260: \$? = $ac_status" >&5
+  echo "$as_me:6368: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_mytinfo_tgoto=yes
 else
@@ -6268,23 +6376,23 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:6271: result: $ac_cv_lib_mytinfo_tgoto" >&5
+echo "$as_me:6379: 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_add_libs="-lmytinfo"
-# 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_libs="$LIBS"
+# reverse order
+cf_add_0lib=
+for cf_add_1lib in -lmytinfo; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
+# filter duplicates
+for cf_add_1lib in $cf_add_0lib; 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"
+       test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
 done
 LIBS="$cf_add_libs"
 
@@ -6298,7 +6406,7 @@ fi
        # term.h) for cur_colr
        if test "x$cf_cv_screen" = "xcurses_colr"
        then
-               echo "$as_me:6301: checking for initscr in -lcur_colr" >&5
+               echo "$as_me:6409: 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
@@ -6306,7 +6414,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lcur_colr  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 6309 "configure"
+#line 6417 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -6325,16 +6433,16 @@ initscr ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:6328: \"$ac_link\"") >&5
+if { (eval echo "$as_me:6436: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:6331: \$? = $ac_status" >&5
+  echo "$as_me:6439: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:6334: \"$ac_try\"") >&5
+  { (eval echo "$as_me:6442: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:6337: \$? = $ac_status" >&5
+  echo "$as_me:6445: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_cur_colr_initscr=yes
 else
@@ -6345,23 +6453,23 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:6348: result: $ac_cv_lib_cur_colr_initscr" >&5
+echo "$as_me:6456: 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
 
-cf_add_libs="-lcur_colr"
-# 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_libs="$LIBS"
+# reverse order
+cf_add_0lib=
+for cf_add_1lib in -lcur_colr; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
+# filter duplicates
+for cf_add_1lib in $cf_add_0lib; 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"
+       test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
 done
 LIBS="$cf_add_libs"
 
@@ -6369,7 +6477,7 @@ LIBS="$cf_add_libs"
 
 else
 
-               echo "$as_me:6372: checking for initscr in -lHcurses" >&5
+               echo "$as_me:6480: 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
@@ -6377,7 +6485,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lHcurses  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 6380 "configure"
+#line 6488 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -6396,16 +6504,16 @@ initscr ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:6399: \"$ac_link\"") >&5
+if { (eval echo "$as_me:6507: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:6402: \$? = $ac_status" >&5
+  echo "$as_me:6510: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:6405: \"$ac_try\"") >&5
+  { (eval echo "$as_me:6513: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:6408: \$? = $ac_status" >&5
+  echo "$as_me:6516: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_Hcurses_initscr=yes
 else
@@ -6416,25 +6524,25 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:6419: result: $ac_cv_lib_Hcurses_initscr" >&5
+echo "$as_me:6527: result: $ac_cv_lib_Hcurses_initscr" >&5
 echo "${ECHO_T}$ac_cv_lib_Hcurses_initscr" >&6
 if test $ac_cv_lib_Hcurses_initscr = yes; then
 
                        # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
 
-cf_add_libs="-lHcurses"
-# 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_libs="$LIBS"
+# reverse order
+cf_add_0lib=
+for cf_add_1lib in -lHcurses; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
+# filter duplicates
+for cf_add_1lib in $cf_add_0lib; 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"
+       test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
 done
 LIBS="$cf_add_libs"
 
@@ -6474,7 +6582,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}:6477: testing adding $cf_add_libdir to library-path ..." 1>&5
+echo "${as_me:-configure}:6585: testing adding $cf_add_libdir to library-path ..." 1>&5
 
                                LDFLAGS="-L$cf_add_libdir $LDFLAGS"
                        fi
@@ -6503,7 +6611,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}:6506: testing adding $cf_add_libdir to library-path ..." 1>&5
+echo "${as_me:-configure}:6614: testing adding $cf_add_libdir to library-path ..." 1>&5
 
                                LDFLAGS="-L$cf_add_libdir $LDFLAGS"
                        fi
@@ -6534,7 +6642,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}:6537: testing adding $cf_add_libdir to library-path ..." 1>&5
+echo "${as_me:-configure}:6645: testing adding $cf_add_libdir to library-path ..." 1>&5
 
                                LDFLAGS="-L$cf_add_libdir $LDFLAGS"
                        fi
@@ -6569,7 +6677,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}:6572: testing adding $cf_add_libdir to library-path ..." 1>&5
+echo "${as_me:-configure}:6680: testing adding $cf_add_libdir to library-path ..." 1>&5
 
                                LDFLAGS="-L$cf_add_libdir $LDFLAGS"
                        fi
@@ -6577,19 +6685,19 @@ echo "${as_me:-configure}:6572: testing adding $cf_add_libdir to library-path ..
        done
 fi
 
-cf_add_libs="-lcurses -ltermcap"
-# 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_libs="$LIBS"
+# reverse order
+cf_add_0lib=
+for cf_add_1lib in -lcurses -ltermcap; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
+# filter duplicates
+for cf_add_1lib in $cf_add_0lib; 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"
+       test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
 done
 LIBS="$cf_add_libs"
 
@@ -6613,13 +6721,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:6616: checking for tgoto" >&5
+               echo "$as_me:6724: 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 6622 "configure"
+#line 6730 "configure"
 #include "confdefs.h"
 #define tgoto autoconf_temporary
 #include <limits.h>    /* least-intrusive standard header which defines gcc2 __stub macros */
@@ -6650,16 +6758,16 @@ main (void)
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:6653: \"$ac_link\"") >&5
+if { (eval echo "$as_me:6761: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:6656: \$? = $ac_status" >&5
+  echo "$as_me:6764: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:6659: \"$ac_try\"") >&5
+  { (eval echo "$as_me:6767: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:6662: \$? = $ac_status" >&5
+  echo "$as_me:6770: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_func_tgoto=yes
 else
@@ -6669,7 +6777,7 @@ ac_cv_func_tgoto=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:6672: result: $ac_cv_func_tgoto" >&5
+echo "$as_me:6780: 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
@@ -6678,7 +6786,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:6681: checking for tgoto in -l$cf_term_lib" >&5
+echo "$as_me:6789: 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
@@ -6686,7 +6794,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-l$cf_term_lib  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 6689 "configure"
+#line 6797 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -6705,16 +6813,16 @@ tgoto ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:6708: \"$ac_link\"") >&5
+if { (eval echo "$as_me:6816: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:6711: \$? = $ac_status" >&5
+  echo "$as_me:6819: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:6714: \"$ac_try\"") >&5
+  { (eval echo "$as_me:6822: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:6717: \$? = $ac_status" >&5
+  echo "$as_me:6825: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   eval "$as_ac_Lib=yes"
 else
@@ -6725,7 +6833,7 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:6728: result: `eval echo '${'$as_ac_Lib'}'`" >&5
+echo "$as_me:6836: 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
 
@@ -6748,10 +6856,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:6751: checking if we can link with $cf_curs_lib library" >&5
+                               echo "$as_me:6859: 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 6754 "configure"
+#line 6862 "configure"
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header:-curses.h}>
 int
@@ -6763,16 +6871,16 @@ initscr()
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:6766: \"$ac_link\"") >&5
+if { (eval echo "$as_me:6874: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:6769: \$? = $ac_status" >&5
+  echo "$as_me:6877: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:6772: \"$ac_try\"") >&5
+  { (eval echo "$as_me:6880: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:6775: \$? = $ac_status" >&5
+  echo "$as_me:6883: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_result=yes
 else
@@ -6781,16 +6889,16 @@ cat conftest.$ac_ext >&5
 cf_result=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-                               echo "$as_me:6784: result: $cf_result" >&5
+                               echo "$as_me:6892: 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:6790: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
+                               echo "$as_me:6898: 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 6793 "configure"
+#line 6901 "configure"
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header:-curses.h}>
 int
@@ -6802,16 +6910,16 @@ initscr(); tgoto((char *)0, 0, 0);
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:6805: \"$ac_link\"") >&5
+if { (eval echo "$as_me:6913: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:6808: \$? = $ac_status" >&5
+  echo "$as_me:6916: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:6811: \"$ac_try\"") >&5
+  { (eval echo "$as_me:6919: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:6814: \$? = $ac_status" >&5
+  echo "$as_me:6922: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_result=no
 else
@@ -6820,7 +6928,7 @@ cat conftest.$ac_ext >&5
 
                                        LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
                                        cat >conftest.$ac_ext <<_ACEOF
-#line 6823 "configure"
+#line 6931 "configure"
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header:-curses.h}>
 int
@@ -6832,16 +6940,16 @@ initscr()
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:6835: \"$ac_link\"") >&5
+if { (eval echo "$as_me:6943: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:6838: \$? = $ac_status" >&5
+  echo "$as_me:6946: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:6841: \"$ac_try\"") >&5
+  { (eval echo "$as_me:6949: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:6844: \$? = $ac_status" >&5
+  echo "$as_me:6952: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_result=yes
 else
@@ -6853,13 +6961,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:6856: result: $cf_result" >&5
+                               echo "$as_me:6964: 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:6862: error: no curses library found" >&5
+       test $cf_curs_lib = unknown && { { echo "$as_me:6970: error: no curses library found" >&5
 echo "$as_me: error: no curses library found" >&2;}
    { (exit 1); exit 1; }; }
 fi
@@ -6868,7 +6976,7 @@ fi
        ;;
 (ncursesw*)
 
-echo "$as_me:6871: checking for multibyte character support" >&5
+echo "$as_me:6979: 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
@@ -6876,7 +6984,7 @@ else
 
        cf_save_LIBS="$LIBS"
        cat >conftest.$ac_ext <<_ACEOF
-#line 6879 "configure"
+#line 6987 "configure"
 #include "confdefs.h"
 
 #include <stdlib.h>
@@ -6889,16 +6997,16 @@ putwc(0,0);
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:6892: \"$ac_link\"") >&5
+if { (eval echo "$as_me:7000: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:6895: \$? = $ac_status" >&5
+  echo "$as_me:7003: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:6898: \"$ac_try\"") >&5
+  { (eval echo "$as_me:7006: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:6901: \$? = $ac_status" >&5
+  echo "$as_me:7009: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_utf8_lib=yes
 else
@@ -6910,12 +7018,12 @@ cat conftest.$ac_ext >&5
 cf_cv_header_path_utf8=
 cf_cv_library_path_utf8=
 
-echo "${as_me:-configure}:6913: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
+echo "${as_me:-configure}:7021: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
 
 cf_save_LIBS="$LIBS"
 
 cat >conftest.$ac_ext <<_ACEOF
-#line 6918 "configure"
+#line 7026 "configure"
 #include "confdefs.h"
 
 #include <libutf8.h>
@@ -6928,16 +7036,16 @@ putwc(0,0);
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:6931: \"$ac_link\"") >&5
+if { (eval echo "$as_me:7039: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:6934: \$? = $ac_status" >&5
+  echo "$as_me:7042: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:6937: \"$ac_try\"") >&5
+  { (eval echo "$as_me:7045: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:6940: \$? = $ac_status" >&5
+  echo "$as_me:7048: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
        cf_cv_find_linkage_utf8=yes
@@ -6951,7 +7059,7 @@ cat conftest.$ac_ext >&5
 LIBS="-lutf8  $cf_save_LIBS"
 
 cat >conftest.$ac_ext <<_ACEOF
-#line 6954 "configure"
+#line 7062 "configure"
 #include "confdefs.h"
 
 #include <libutf8.h>
@@ -6964,16 +7072,16 @@ putwc(0,0);
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:6967: \"$ac_link\"") >&5
+if { (eval echo "$as_me:7075: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:6970: \$? = $ac_status" >&5
+  echo "$as_me:7078: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:6973: \"$ac_try\"") >&5
+  { (eval echo "$as_me:7081: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:6976: \$? = $ac_status" >&5
+  echo "$as_me:7084: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
        cf_cv_find_linkage_utf8=yes
@@ -6990,9 +7098,9 @@ cat conftest.$ac_ext >&5
 
        test -n "$verbose" && echo "    find linkage for utf8 library" 1>&6
 
-echo "${as_me:-configure}:6993: testing find linkage for utf8 library ..." 1>&5
+echo "${as_me:-configure}:7101: testing find linkage for utf8 library ..." 1>&5
 
-echo "${as_me:-configure}:6995: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
+echo "${as_me:-configure}:7103: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
 
        cf_save_CPPFLAGS="$CPPFLAGS"
        cf_test_CPPFLAGS="$CPPFLAGS"
@@ -7083,7 +7191,7 @@ 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}:7086: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
+echo "${as_me:-configure}:7194: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
 
                        CPPFLAGS="$cf_save_CPPFLAGS"
 
@@ -7091,7 +7199,7 @@ echo "${as_me:-configure}:7086: testing ... testing $cf_cv_header_path_utf8 ..."
        CPPFLAGS="${CPPFLAGS}-I$cf_cv_header_path_utf8"
 
                        cat >conftest.$ac_ext <<_ACEOF
-#line 7094 "configure"
+#line 7202 "configure"
 #include "confdefs.h"
 
 #include <libutf8.h>
@@ -7104,21 +7212,21 @@ putwc(0,0);
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:7107: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:7215: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:7110: \$? = $ac_status" >&5
+  echo "$as_me:7218: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:7113: \"$ac_try\"") >&5
+  { (eval echo "$as_me:7221: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:7116: \$? = $ac_status" >&5
+  echo "$as_me:7224: \$? = $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}:7121: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
+echo "${as_me:-configure}:7229: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
 
                                cf_cv_find_linkage_utf8=maybe
                                cf_test_CPPFLAGS="$CPPFLAGS"
@@ -7136,7 +7244,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext
 
        if test "$cf_cv_find_linkage_utf8" = maybe ; then
 
-echo "${as_me:-configure}:7139: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
+echo "${as_me:-configure}:7247: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
 
                cf_save_LIBS="$LIBS"
                cf_save_LDFLAGS="$LDFLAGS"
@@ -7211,13 +7319,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}:7214: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
+echo "${as_me:-configure}:7322: 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 7220 "configure"
+#line 7328 "configure"
 #include "confdefs.h"
 
 #include <libutf8.h>
@@ -7230,21 +7338,21 @@ putwc(0,0);
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:7233: \"$ac_link\"") >&5
+if { (eval echo "$as_me:7341: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:7236: \$? = $ac_status" >&5
+  echo "$as_me:7344: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:7239: \"$ac_try\"") >&5
+  { (eval echo "$as_me:7347: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:7242: \$? = $ac_status" >&5
+  echo "$as_me:7350: \$? = $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}:7247: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
+echo "${as_me:-configure}:7355: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
 
                                        cf_cv_find_linkage_utf8=yes
                                        cf_cv_library_file_utf8="-lutf8"
@@ -7286,7 +7394,7 @@ fi
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:7289: result: $cf_cv_utf8_lib" >&5
+echo "$as_me:7397: 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
@@ -7324,7 +7432,7 @@ if test -n "$cf_cv_header_path_utf8" ; then
        CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
 
                          cat >conftest.$ac_ext <<_ACEOF
-#line 7327 "configure"
+#line 7435 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 int
@@ -7336,16 +7444,16 @@ printf("Hello")
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:7339: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:7447: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:7342: \$? = $ac_status" >&5
+  echo "$as_me:7450: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:7345: \"$ac_try\"") >&5
+  { (eval echo "$as_me:7453: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:7348: \$? = $ac_status" >&5
+  echo "$as_me:7456: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   :
 else
@@ -7362,7 +7470,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}:7365: testing adding $cf_add_incdir to include-path ..." 1>&5
+echo "${as_me:-configure}:7473: testing adding $cf_add_incdir to include-path ..." 1>&5
 
                  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
 
@@ -7398,7 +7506,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}:7401: testing adding $cf_add_libdir to library-path ..." 1>&5
+echo "${as_me:-configure}:7509: testing adding $cf_add_libdir to library-path ..." 1>&5
 
                                LDFLAGS="-L$cf_add_libdir $LDFLAGS"
                        fi
@@ -7406,19 +7514,19 @@ echo "${as_me:-configure}:7401: testing adding $cf_add_libdir to library-path ..
        done
 fi
 
-cf_add_libs="$cf_cv_library_file_utf8"
-# 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_libs="$LIBS"
+# reverse order
+cf_add_0lib=
+for cf_add_1lib in $cf_cv_library_file_utf8; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
+# filter duplicates
+for cf_add_1lib in $cf_add_0lib; 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"
+       test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
 done
 LIBS="$cf_add_libs"
 
@@ -7428,13 +7536,13 @@ cf_ncuconfig_root=$cf_cv_screen
 cf_have_ncuconfig=no
 
 if test "x${PKG_CONFIG:=none}" != xnone; then
-       echo "$as_me:7431: checking pkg-config for $cf_ncuconfig_root" >&5
+       echo "$as_me:7539: 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:7434: result: yes" >&5
+               echo "$as_me:7542: result: yes" >&5
 echo "${ECHO_T}yes" >&6
 
-               echo "$as_me:7437: checking if the $cf_ncuconfig_root package files work" >&5
+               echo "$as_me:7545: 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
 
@@ -7539,24 +7647,24 @@ if test -n "$cf_new_extra_cppflags" ; then
 
 fi
 
-cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
-# 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_libs="$LIBS"
+# reverse order
+cf_add_0lib=
+for cf_add_1lib in `$PKG_CONFIG --libs $cf_ncuconfig_root`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
+# filter duplicates
+for cf_add_1lib in $cf_add_0lib; 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"
+       test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
 done
 LIBS="$cf_add_libs"
 
                cat >conftest.$ac_ext <<_ACEOF
-#line 7559 "configure"
+#line 7667 "configure"
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header:-curses.h}>
 int
@@ -7568,37 +7676,37 @@ initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:7571: \"$ac_link\"") >&5
+if { (eval echo "$as_me:7679: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:7574: \$? = $ac_status" >&5
+  echo "$as_me:7682: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:7577: \"$ac_try\"") >&5
+  { (eval echo "$as_me:7685: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:7580: \$? = $ac_status" >&5
+  echo "$as_me:7688: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   if test "$cross_compiling" = yes; then
   cf_have_ncuconfig=maybe
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 7586 "configure"
+#line 7694 "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:7593: \"$ac_link\"") >&5
+if { (eval echo "$as_me:7701: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:7596: \$? = $ac_status" >&5
+  echo "$as_me:7704: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:7598: \"$ac_try\"") >&5
+  { (eval echo "$as_me:7706: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:7601: \$? = $ac_status" >&5
+  echo "$as_me:7709: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_have_ncuconfig=yes
 else
@@ -7615,7 +7723,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:7618: result: $cf_have_ncuconfig" >&5
+               echo "$as_me:7726: 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"
@@ -7631,7 +7739,7 @@ EOF
 
                        NCURSES_CONFIG_PKG=$cf_ncuconfig_root
 
-echo "$as_me:7634: checking for terminfo header" >&5
+echo "$as_me:7742: 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
@@ -7649,7 +7757,7 @@ esac
 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
 do
 cat >conftest.$ac_ext <<_ACEOF
-#line 7652 "configure"
+#line 7760 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 #include <${cf_cv_ncurses_header:-curses.h}>
@@ -7664,16 +7772,16 @@ int x = auto_left_margin
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:7667: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:7775: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:7670: \$? = $ac_status" >&5
+  echo "$as_me:7778: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:7673: \"$ac_try\"") >&5
+  { (eval echo "$as_me:7781: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:7676: \$? = $ac_status" >&5
+  echo "$as_me:7784: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
        cf_cv_term_header="$cf_test"
@@ -7689,7 +7797,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext
 done
 
 fi
-echo "$as_me:7692: result: $cf_cv_term_header" >&5
+echo "$as_me:7800: result: $cf_cv_term_header" >&5
 echo "${ECHO_T}$cf_cv_term_header" >&6
 
 # Set definitions to allow ifdef'ing to accommodate subdirectories
@@ -7724,7 +7832,7 @@ esac
                fi
 
        else
-               echo "$as_me:7727: result: no" >&5
+               echo "$as_me:7835: result: no" >&5
 echo "${ECHO_T}no" >&6
                NCURSES_CONFIG_PKG=none
        fi
@@ -7740,7 +7848,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:7743: checking for $ac_word" >&5
+echo "$as_me:7851: 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
@@ -7755,7 +7863,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:7758: found $ac_dir/$ac_word" >&5
+echo "$as_me:7866: found $ac_dir/$ac_word" >&5
 break
 done
 
@@ -7763,10 +7871,10 @@ fi
 fi
 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
 if test -n "$NCURSES_CONFIG"; then
-  echo "$as_me:7766: result: $NCURSES_CONFIG" >&5
+  echo "$as_me:7874: result: $NCURSES_CONFIG" >&5
 echo "${ECHO_T}$NCURSES_CONFIG" >&6
 else
-  echo "$as_me:7769: result: no" >&5
+  echo "$as_me:7877: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -7779,7 +7887,7 @@ if test -z "$NCURSES_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:7782: checking for $ac_word" >&5
+echo "$as_me:7890: 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
@@ -7794,7 +7902,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:7797: found $ac_dir/$ac_word" >&5
+echo "$as_me:7905: found $ac_dir/$ac_word" >&5
 break
 done
 
@@ -7802,10 +7910,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:7805: result: $ac_ct_NCURSES_CONFIG" >&5
+  echo "$as_me:7913: result: $ac_ct_NCURSES_CONFIG" >&5
 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
 else
-  echo "$as_me:7808: result: no" >&5
+  echo "$as_me:7916: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -7916,25 +8024,25 @@ if test -n "$cf_new_extra_cppflags" ; then
 
 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_libs="$LIBS"
+# reverse order
+cf_add_0lib=
+for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
+# filter duplicates
+for cf_add_1lib in $cf_add_0lib; 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"
+       test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
 done
 LIBS="$cf_add_libs"
 
                # even with config script, some packages use no-override for curses.h
 
-echo "$as_me:7937: checking if we have identified curses headers" >&5
+echo "$as_me:8045: 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
@@ -7946,7 +8054,7 @@ for cf_header in \
        curses.h $cf_cv_screen/curses.h
 do
 cat >conftest.$ac_ext <<_ACEOF
-#line 7949 "configure"
+#line 8057 "configure"
 #include "confdefs.h"
 #include <${cf_header}>
 int
@@ -7958,16 +8066,16 @@ initscr(); tgoto("?", 0,0)
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:7961: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:8069: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:7964: \$? = $ac_status" >&5
+  echo "$as_me:8072: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:7967: \"$ac_try\"") >&5
+  { (eval echo "$as_me:8075: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:7970: \$? = $ac_status" >&5
+  echo "$as_me:8078: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_ncurses_header=$cf_header; break
 else
@@ -7978,11 +8086,11 @@ rm -f conftest.$ac_objext conftest.$ac_ext
 done
 
 fi
-echo "$as_me:7981: result: $cf_cv_ncurses_header" >&5
+echo "$as_me:8089: 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:7985: error: No curses header-files found" >&5
+       { { echo "$as_me:8093: error: No curses header-files found" >&5
 echo "$as_me: error: No curses header-files found" >&2;}
    { (exit 1); exit 1; }; }
 fi
@@ -7992,23 +8100,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:7995: checking for $ac_header" >&5
+echo "$as_me:8103: 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 8001 "configure"
+#line 8109 "configure"
 #include "confdefs.h"
 #include <$ac_header>
 _ACEOF
-if { (eval echo "$as_me:8005: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:8113: \"$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:8011: \$? = $ac_status" >&5
+  echo "$as_me:8119: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
@@ -8027,7 +8135,7 @@ else
 fi
 rm -f conftest.err conftest.$ac_ext
 fi
-echo "$as_me:8030: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "$as_me:8138: 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
@@ -8083,7 +8191,7 @@ if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
        CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
 
                          cat >conftest.$ac_ext <<_ACEOF
-#line 8086 "configure"
+#line 8194 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 int
@@ -8095,16 +8203,16 @@ printf("Hello")
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:8098: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:8206: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:8101: \$? = $ac_status" >&5
+  echo "$as_me:8209: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:8104: \"$ac_try\"") >&5
+  { (eval echo "$as_me:8212: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:8107: \$? = $ac_status" >&5
+  echo "$as_me:8215: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   :
 else
@@ -8121,7 +8229,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}:8124: testing adding $cf_add_incdir to include-path ..." 1>&5
+echo "${as_me:-configure}:8232: testing adding $cf_add_incdir to include-path ..." 1>&5
 
                  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
 
@@ -8140,7 +8248,7 @@ fi
 
 }
 
-echo "$as_me:8143: checking for $cf_ncuhdr_root header in include-path" >&5
+echo "$as_me:8251: 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
@@ -8152,7 +8260,7 @@ else
        do
 
        cat >conftest.$ac_ext <<_ACEOF
-#line 8155 "configure"
+#line 8263 "configure"
 #include "confdefs.h"
 
 #include <$cf_header>
@@ -8176,16 +8284,16 @@ printf("old\n");
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:8179: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:8287: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:8182: \$? = $ac_status" >&5
+  echo "$as_me:8290: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:8185: \"$ac_try\"") >&5
+  { (eval echo "$as_me:8293: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:8188: \$? = $ac_status" >&5
+  echo "$as_me:8296: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_ncurses_h=$cf_header
 
@@ -8200,14 +8308,14 @@ rm -f conftest.$ac_objext conftest.$ac_ext
        done
 
 fi
-echo "$as_me:8203: result: $cf_cv_ncurses_h" >&5
+echo "$as_me:8311: 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:8210: checking for $cf_ncuhdr_root include-path" >&5
+echo "$as_me:8318: 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
@@ -8328,7 +8436,7 @@ if test -n "$cf_incdir" ; then
        CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
 
                          cat >conftest.$ac_ext <<_ACEOF
-#line 8331 "configure"
+#line 8439 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 int
@@ -8340,16 +8448,16 @@ printf("Hello")
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:8343: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:8451: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:8346: \$? = $ac_status" >&5
+  echo "$as_me:8454: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:8349: \"$ac_try\"") >&5
+  { (eval echo "$as_me:8457: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:8352: \$? = $ac_status" >&5
+  echo "$as_me:8460: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   :
 else
@@ -8366,7 +8474,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}:8369: testing adding $cf_add_incdir to include-path ..." 1>&5
+echo "${as_me:-configure}:8477: testing adding $cf_add_incdir to include-path ..." 1>&5
 
                  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
 
@@ -8389,7 +8497,7 @@ fi
                do
 
        cat >conftest.$ac_ext <<_ACEOF
-#line 8392 "configure"
+#line 8500 "configure"
 #include "confdefs.h"
 
 #include <$cf_header>
@@ -8413,16 +8521,16 @@ printf("old\n");
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:8416: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:8524: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:8419: \$? = $ac_status" >&5
+  echo "$as_me:8527: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:8422: \"$ac_try\"") >&5
+  { (eval echo "$as_me:8530: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:8425: \$? = $ac_status" >&5
+  echo "$as_me:8533: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_ncurses_h2=$cf_header
 
@@ -8443,12 +8551,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:8446: error: not found" >&5
+       test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:8554: error: not found" >&5
 echo "$as_me: error: not found" >&2;}
    { (exit 1); exit 1; }; }
 
 fi
-echo "$as_me:8451: result: $cf_cv_ncurses_h2" >&5
+echo "$as_me:8559: 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%/[^/]*$%%'`
@@ -8484,7 +8592,7 @@ if test -n "$cf_1st_incdir" ; then
        CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
 
                          cat >conftest.$ac_ext <<_ACEOF
-#line 8487 "configure"
+#line 8595 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 int
@@ -8496,16 +8604,16 @@ printf("Hello")
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:8499: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:8607: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:8502: \$? = $ac_status" >&5
+  echo "$as_me:8610: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:8505: \"$ac_try\"") >&5
+  { (eval echo "$as_me:8613: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:8508: \$? = $ac_status" >&5
+  echo "$as_me:8616: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   :
 else
@@ -8522,7 +8630,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}:8525: testing adding $cf_add_incdir to include-path ..." 1>&5
+echo "${as_me:-configure}:8633: testing adding $cf_add_incdir to include-path ..." 1>&5
 
                  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
 
@@ -8570,7 +8678,7 @@ EOF
        ;;
 esac
 
-echo "$as_me:8573: checking for terminfo header" >&5
+echo "$as_me:8681: 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
@@ -8588,7 +8696,7 @@ esac
 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
 do
 cat >conftest.$ac_ext <<_ACEOF
-#line 8591 "configure"
+#line 8699 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 #include <${cf_cv_ncurses_header:-curses.h}>
@@ -8603,16 +8711,16 @@ int x = auto_left_margin
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:8606: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:8714: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:8609: \$? = $ac_status" >&5
+  echo "$as_me:8717: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:8612: \"$ac_try\"") >&5
+  { (eval echo "$as_me:8720: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:8615: \$? = $ac_status" >&5
+  echo "$as_me:8723: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
        cf_cv_term_header="$cf_test"
@@ -8628,7 +8736,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext
 done
 
 fi
-echo "$as_me:8631: result: $cf_cv_term_header" >&5
+echo "$as_me:8739: result: $cf_cv_term_header" >&5
 echo "${ECHO_T}$cf_cv_term_header" >&6
 
 # Set definitions to allow ifdef'ing to accommodate subdirectories
@@ -8666,7 +8774,7 @@ cat >>confdefs.h <<\EOF
 #define NCURSES 1
 EOF
 
-echo "$as_me:8669: checking for ncurses version" >&5
+echo "$as_me:8777: 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
@@ -8692,10 +8800,10 @@ Autoconf "old"
 #endif
 EOF
        cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
-       { (eval echo "$as_me:8695: \"$cf_try\"") >&5
+       { (eval echo "$as_me:8803: \"$cf_try\"") >&5
   (eval $cf_try) 2>&5
   ac_status=$?
-  echo "$as_me:8698: \$? = $ac_status" >&5
+  echo "$as_me:8806: \$? = $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%".*%%'`
@@ -8705,7 +8813,7 @@ EOF
 
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 8708 "configure"
+#line 8816 "configure"
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header:-curses.h}>
@@ -8730,15 +8838,15 @@ int main(void)
 }
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:8733: \"$ac_link\"") >&5
+if { (eval echo "$as_me:8841: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:8736: \$? = $ac_status" >&5
+  echo "$as_me:8844: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:8738: \"$ac_try\"") >&5
+  { (eval echo "$as_me:8846: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:8741: \$? = $ac_status" >&5
+  echo "$as_me:8849: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
        cf_cv_ncurses_version=`cat $cf_tempfile`
@@ -8752,7 +8860,7 @@ fi
        rm -f $cf_tempfile
 
 fi
-echo "$as_me:8755: result: $cf_cv_ncurses_version" >&5
+echo "$as_me:8863: result: $cf_cv_ncurses_version" >&5
 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
 test "$cf_cv_ncurses_version" = no ||
 cat >>confdefs.h <<\EOF
@@ -8765,7 +8873,7 @@ cf_nculib_root=$cf_cv_screen
        # to link gpm.
 cf_ncurses_LIBS=""
 cf_ncurses_SAVE="$LIBS"
-echo "$as_me:8768: checking for Gpm_Open in -lgpm" >&5
+echo "$as_me:8876: 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
@@ -8773,7 +8881,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lgpm  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 8776 "configure"
+#line 8884 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -8792,16 +8900,16 @@ Gpm_Open ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:8795: \"$ac_link\"") >&5
+if { (eval echo "$as_me:8903: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:8798: \$? = $ac_status" >&5
+  echo "$as_me:8906: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:8801: \"$ac_try\"") >&5
+  { (eval echo "$as_me:8909: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:8804: \$? = $ac_status" >&5
+  echo "$as_me:8912: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_gpm_Gpm_Open=yes
 else
@@ -8812,10 +8920,10 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:8815: result: $ac_cv_lib_gpm_Gpm_Open" >&5
+echo "$as_me:8923: 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:8818: checking for initscr in -lgpm" >&5
+  echo "$as_me:8926: 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
@@ -8823,7 +8931,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lgpm  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 8826 "configure"
+#line 8934 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -8842,16 +8950,16 @@ initscr ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:8845: \"$ac_link\"") >&5
+if { (eval echo "$as_me:8953: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:8848: \$? = $ac_status" >&5
+  echo "$as_me:8956: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:8851: \"$ac_try\"") >&5
+  { (eval echo "$as_me:8959: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:8854: \$? = $ac_status" >&5
+  echo "$as_me:8962: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_gpm_initscr=yes
 else
@@ -8862,7 +8970,7 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:8865: result: $ac_cv_lib_gpm_initscr" >&5
+echo "$as_me:8973: 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"
@@ -8877,7 +8985,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:8880: checking for tgoto in -lmytinfo" >&5
+               echo "$as_me:8988: 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
@@ -8885,7 +8993,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lmytinfo  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 8888 "configure"
+#line 8996 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -8904,16 +9012,16 @@ tgoto ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:8907: \"$ac_link\"") >&5
+if { (eval echo "$as_me:9015: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:8910: \$? = $ac_status" >&5
+  echo "$as_me:9018: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:8913: \"$ac_try\"") >&5
+  { (eval echo "$as_me:9021: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:8916: \$? = $ac_status" >&5
+  echo "$as_me:9024: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_mytinfo_tgoto=yes
 else
@@ -8924,7 +9032,7 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:8927: result: $ac_cv_lib_mytinfo_tgoto" >&5
+echo "$as_me:9035: 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"
@@ -8934,38 +9042,38 @@ fi
        ;;
 esac
 
-cf_add_libs="$cf_ncurses_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_libs="$LIBS"
+# reverse order
+cf_add_0lib=
+for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
+# filter duplicates
+for cf_add_1lib in $cf_add_0lib; 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"
+       test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
 done
 LIBS="$cf_add_libs"
 
 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
 then
 
-cf_add_libs="-l$cf_nculib_root"
-# 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_libs="$LIBS"
+# reverse order
+cf_add_0lib=
+for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
+# filter duplicates
+for cf_add_1lib in $cf_add_0lib; 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"
+       test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
 done
 LIBS="$cf_add_libs"
 
@@ -8973,13 +9081,13 @@ else
 
        eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
        cf_libdir=""
-       echo "$as_me:8976: checking for initscr" >&5
+       echo "$as_me:9084: 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 8982 "configure"
+#line 9090 "configure"
 #include "confdefs.h"
 #define initscr autoconf_temporary
 #include <limits.h>    /* least-intrusive standard header which defines gcc2 __stub macros */
@@ -9010,16 +9118,16 @@ main (void)
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:9013: \"$ac_link\"") >&5
+if { (eval echo "$as_me:9121: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:9016: \$? = $ac_status" >&5
+  echo "$as_me:9124: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:9019: \"$ac_try\"") >&5
+  { (eval echo "$as_me:9127: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:9022: \$? = $ac_status" >&5
+  echo "$as_me:9130: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_func_initscr=yes
 else
@@ -9029,18 +9137,18 @@ ac_cv_func_initscr=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:9032: result: $ac_cv_func_initscr" >&5
+echo "$as_me:9140: 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:9039: checking for initscr in -l$cf_nculib_root" >&5
+               echo "$as_me:9147: 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 9043 "configure"
+#line 9151 "configure"
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header:-curses.h}>
 int
@@ -9052,25 +9160,25 @@ initscr()
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:9055: \"$ac_link\"") >&5
+if { (eval echo "$as_me:9163: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:9058: \$? = $ac_status" >&5
+  echo "$as_me:9166: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:9061: \"$ac_try\"") >&5
+  { (eval echo "$as_me:9169: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:9064: \$? = $ac_status" >&5
+  echo "$as_me:9172: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  echo "$as_me:9066: result: yes" >&5
+  echo "$as_me:9174: 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:9073: result: no" >&5
+echo "$as_me:9181: result: no" >&5
 echo "${ECHO_T}no" >&6
 
 cf_search=
@@ -9138,11 +9246,11 @@ cf_search="$cf_library_path_list $cf_search"
 
                        for cf_libdir in $cf_search
                        do
-                               echo "$as_me:9141: checking for -l$cf_nculib_root in $cf_libdir" >&5
+                               echo "$as_me:9249: 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 9145 "configure"
+#line 9253 "configure"
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header:-curses.h}>
 int
@@ -9154,25 +9262,25 @@ initscr()
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:9157: \"$ac_link\"") >&5
+if { (eval echo "$as_me:9265: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:9160: \$? = $ac_status" >&5
+  echo "$as_me:9268: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:9163: \"$ac_try\"") >&5
+  { (eval echo "$as_me:9271: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:9166: \$? = $ac_status" >&5
+  echo "$as_me:9274: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  echo "$as_me:9168: result: yes" >&5
+  echo "$as_me:9276: 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:9175: result: no" >&5
+echo "$as_me:9283: result: no" >&5
 echo "${ECHO_T}no" >&6
                                         LIBS="$cf_save_LIBS"
 fi
@@ -9187,7 +9295,7 @@ fi
 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
 
 if test $cf_found_library = no ; then
-       { { echo "$as_me:9190: error: Cannot link $cf_nculib_root library" >&5
+       { { echo "$as_me:9298: error: Cannot link $cf_nculib_root library" >&5
 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
    { (exit 1); exit 1; }; }
 fi
@@ -9195,7 +9303,7 @@ fi
 fi
 
 if test -n "$cf_ncurses_LIBS" ; then
-       echo "$as_me:9198: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
+       echo "$as_me:9306: 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
@@ -9205,7 +9313,7 @@ echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS..
                fi
        done
        cat >conftest.$ac_ext <<_ACEOF
-#line 9208 "configure"
+#line 9316 "configure"
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header:-curses.h}>
 int
@@ -9217,23 +9325,23 @@ initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:9220: \"$ac_link\"") >&5
+if { (eval echo "$as_me:9328: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:9223: \$? = $ac_status" >&5
+  echo "$as_me:9331: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:9226: \"$ac_try\"") >&5
+  { (eval echo "$as_me:9334: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:9229: \$? = $ac_status" >&5
+  echo "$as_me:9337: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  echo "$as_me:9231: result: yes" >&5
+  echo "$as_me:9339: result: yes" >&5
 echo "${ECHO_T}yes" >&6
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
-echo "$as_me:9236: result: no" >&5
+echo "$as_me:9344: result: no" >&5
 echo "${ECHO_T}no" >&6
                 LIBS="$cf_ncurses_SAVE"
 fi
@@ -9258,13 +9366,13 @@ cf_ncuconfig_root=$cf_cv_screen
 cf_have_ncuconfig=no
 
 if test "x${PKG_CONFIG:=none}" != xnone; then
-       echo "$as_me:9261: checking pkg-config for $cf_ncuconfig_root" >&5
+       echo "$as_me:9369: 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:9264: result: yes" >&5
+               echo "$as_me:9372: result: yes" >&5
 echo "${ECHO_T}yes" >&6
 
-               echo "$as_me:9267: checking if the $cf_ncuconfig_root package files work" >&5
+               echo "$as_me:9375: 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
 
@@ -9369,24 +9477,24 @@ if test -n "$cf_new_extra_cppflags" ; then
 
 fi
 
-cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
-# 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_libs="$LIBS"
+# reverse order
+cf_add_0lib=
+for cf_add_1lib in `$PKG_CONFIG --libs $cf_ncuconfig_root`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
+# filter duplicates
+for cf_add_1lib in $cf_add_0lib; 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"
+       test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
 done
 LIBS="$cf_add_libs"
 
                cat >conftest.$ac_ext <<_ACEOF
-#line 9389 "configure"
+#line 9497 "configure"
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header:-curses.h}>
 int
@@ -9398,37 +9506,37 @@ initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:9401: \"$ac_link\"") >&5
+if { (eval echo "$as_me:9509: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:9404: \$? = $ac_status" >&5
+  echo "$as_me:9512: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:9407: \"$ac_try\"") >&5
+  { (eval echo "$as_me:9515: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:9410: \$? = $ac_status" >&5
+  echo "$as_me:9518: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   if test "$cross_compiling" = yes; then
   cf_have_ncuconfig=maybe
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 9416 "configure"
+#line 9524 "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:9423: \"$ac_link\"") >&5
+if { (eval echo "$as_me:9531: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:9426: \$? = $ac_status" >&5
+  echo "$as_me:9534: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:9428: \"$ac_try\"") >&5
+  { (eval echo "$as_me:9536: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:9431: \$? = $ac_status" >&5
+  echo "$as_me:9539: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_have_ncuconfig=yes
 else
@@ -9445,7 +9553,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:9448: result: $cf_have_ncuconfig" >&5
+               echo "$as_me:9556: 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"
@@ -9461,7 +9569,7 @@ EOF
 
                        NCURSES_CONFIG_PKG=$cf_ncuconfig_root
 
-echo "$as_me:9464: checking for terminfo header" >&5
+echo "$as_me:9572: 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
@@ -9479,7 +9587,7 @@ esac
 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
 do
 cat >conftest.$ac_ext <<_ACEOF
-#line 9482 "configure"
+#line 9590 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 #include <${cf_cv_ncurses_header:-curses.h}>
@@ -9494,16 +9602,16 @@ int x = auto_left_margin
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:9497: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:9605: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:9500: \$? = $ac_status" >&5
+  echo "$as_me:9608: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:9503: \"$ac_try\"") >&5
+  { (eval echo "$as_me:9611: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:9506: \$? = $ac_status" >&5
+  echo "$as_me:9614: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
        cf_cv_term_header="$cf_test"
@@ -9519,7 +9627,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext
 done
 
 fi
-echo "$as_me:9522: result: $cf_cv_term_header" >&5
+echo "$as_me:9630: result: $cf_cv_term_header" >&5
 echo "${ECHO_T}$cf_cv_term_header" >&6
 
 # Set definitions to allow ifdef'ing to accommodate subdirectories
@@ -9554,7 +9662,7 @@ esac
                fi
 
        else
-               echo "$as_me:9557: result: no" >&5
+               echo "$as_me:9665: result: no" >&5
 echo "${ECHO_T}no" >&6
                NCURSES_CONFIG_PKG=none
        fi
@@ -9570,7 +9678,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:9573: checking for $ac_word" >&5
+echo "$as_me:9681: 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
@@ -9585,7 +9693,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:9588: found $ac_dir/$ac_word" >&5
+echo "$as_me:9696: found $ac_dir/$ac_word" >&5
 break
 done
 
@@ -9593,10 +9701,10 @@ fi
 fi
 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
 if test -n "$NCURSES_CONFIG"; then
-  echo "$as_me:9596: result: $NCURSES_CONFIG" >&5
+  echo "$as_me:9704: result: $NCURSES_CONFIG" >&5
 echo "${ECHO_T}$NCURSES_CONFIG" >&6
 else
-  echo "$as_me:9599: result: no" >&5
+  echo "$as_me:9707: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -9609,7 +9717,7 @@ if test -z "$NCURSES_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:9612: checking for $ac_word" >&5
+echo "$as_me:9720: 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
@@ -9624,7 +9732,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:9627: found $ac_dir/$ac_word" >&5
+echo "$as_me:9735: found $ac_dir/$ac_word" >&5
 break
 done
 
@@ -9632,10 +9740,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:9635: result: $ac_ct_NCURSES_CONFIG" >&5
+  echo "$as_me:9743: result: $ac_ct_NCURSES_CONFIG" >&5
 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
 else
-  echo "$as_me:9638: result: no" >&5
+  echo "$as_me:9746: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -9746,25 +9854,25 @@ if test -n "$cf_new_extra_cppflags" ; then
 
 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_libs="$LIBS"
+# reverse order
+cf_add_0lib=
+for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
+# filter duplicates
+for cf_add_1lib in $cf_add_0lib; 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"
+       test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
 done
 LIBS="$cf_add_libs"
 
                # even with config script, some packages use no-override for curses.h
 
-echo "$as_me:9767: checking if we have identified curses headers" >&5
+echo "$as_me:9875: 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
@@ -9776,7 +9884,7 @@ for cf_header in \
        curses.h $cf_cv_screen/curses.h
 do
 cat >conftest.$ac_ext <<_ACEOF
-#line 9779 "configure"
+#line 9887 "configure"
 #include "confdefs.h"
 #include <${cf_header}>
 int
@@ -9788,16 +9896,16 @@ initscr(); tgoto("?", 0,0)
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:9791: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:9899: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:9794: \$? = $ac_status" >&5
+  echo "$as_me:9902: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:9797: \"$ac_try\"") >&5
+  { (eval echo "$as_me:9905: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:9800: \$? = $ac_status" >&5
+  echo "$as_me:9908: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_ncurses_header=$cf_header; break
 else
@@ -9808,11 +9916,11 @@ rm -f conftest.$ac_objext conftest.$ac_ext
 done
 
 fi
-echo "$as_me:9811: result: $cf_cv_ncurses_header" >&5
+echo "$as_me:9919: 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:9815: error: No curses header-files found" >&5
+       { { echo "$as_me:9923: error: No curses header-files found" >&5
 echo "$as_me: error: No curses header-files found" >&2;}
    { (exit 1); exit 1; }; }
 fi
@@ -9822,23 +9930,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:9825: checking for $ac_header" >&5
+echo "$as_me:9933: 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 9831 "configure"
+#line 9939 "configure"
 #include "confdefs.h"
 #include <$ac_header>
 _ACEOF
-if { (eval echo "$as_me:9835: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:9943: \"$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:9841: \$? = $ac_status" >&5
+  echo "$as_me:9949: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
@@ -9857,7 +9965,7 @@ else
 fi
 rm -f conftest.err conftest.$ac_ext
 fi
-echo "$as_me:9860: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "$as_me:9968: 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
@@ -9913,7 +10021,7 @@ if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
        CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
 
                          cat >conftest.$ac_ext <<_ACEOF
-#line 9916 "configure"
+#line 10024 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 int
@@ -9925,16 +10033,16 @@ printf("Hello")
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:9928: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:10036: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:9931: \$? = $ac_status" >&5
+  echo "$as_me:10039: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:9934: \"$ac_try\"") >&5
+  { (eval echo "$as_me:10042: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:9937: \$? = $ac_status" >&5
+  echo "$as_me:10045: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   :
 else
@@ -9951,7 +10059,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}:9954: testing adding $cf_add_incdir to include-path ..." 1>&5
+echo "${as_me:-configure}:10062: testing adding $cf_add_incdir to include-path ..." 1>&5
 
                  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
 
@@ -9970,7 +10078,7 @@ fi
 
 }
 
-echo "$as_me:9973: checking for $cf_ncuhdr_root header in include-path" >&5
+echo "$as_me:10081: 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
@@ -9982,7 +10090,7 @@ else
        do
 
        cat >conftest.$ac_ext <<_ACEOF
-#line 9985 "configure"
+#line 10093 "configure"
 #include "confdefs.h"
 
 #include <$cf_header>
@@ -10006,16 +10114,16 @@ printf("old\n");
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:10009: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:10117: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:10012: \$? = $ac_status" >&5
+  echo "$as_me:10120: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:10015: \"$ac_try\"") >&5
+  { (eval echo "$as_me:10123: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:10018: \$? = $ac_status" >&5
+  echo "$as_me:10126: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_ncurses_h=$cf_header
 
@@ -10030,14 +10138,14 @@ rm -f conftest.$ac_objext conftest.$ac_ext
        done
 
 fi
-echo "$as_me:10033: result: $cf_cv_ncurses_h" >&5
+echo "$as_me:10141: 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:10040: checking for $cf_ncuhdr_root include-path" >&5
+echo "$as_me:10148: 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
@@ -10158,7 +10266,7 @@ if test -n "$cf_incdir" ; then
        CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
 
                          cat >conftest.$ac_ext <<_ACEOF
-#line 10161 "configure"
+#line 10269 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 int
@@ -10170,16 +10278,16 @@ printf("Hello")
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:10173: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:10281: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:10176: \$? = $ac_status" >&5
+  echo "$as_me:10284: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:10179: \"$ac_try\"") >&5
+  { (eval echo "$as_me:10287: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:10182: \$? = $ac_status" >&5
+  echo "$as_me:10290: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   :
 else
@@ -10196,7 +10304,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}:10199: testing adding $cf_add_incdir to include-path ..." 1>&5
+echo "${as_me:-configure}:10307: testing adding $cf_add_incdir to include-path ..." 1>&5
 
                  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
 
@@ -10219,7 +10327,7 @@ fi
                do
 
        cat >conftest.$ac_ext <<_ACEOF
-#line 10222 "configure"
+#line 10330 "configure"
 #include "confdefs.h"
 
 #include <$cf_header>
@@ -10243,16 +10351,16 @@ printf("old\n");
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:10246: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:10354: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:10249: \$? = $ac_status" >&5
+  echo "$as_me:10357: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:10252: \"$ac_try\"") >&5
+  { (eval echo "$as_me:10360: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:10255: \$? = $ac_status" >&5
+  echo "$as_me:10363: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_ncurses_h2=$cf_header
 
@@ -10273,12 +10381,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:10276: error: not found" >&5
+       test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:10384: error: not found" >&5
 echo "$as_me: error: not found" >&2;}
    { (exit 1); exit 1; }; }
 
 fi
-echo "$as_me:10281: result: $cf_cv_ncurses_h2" >&5
+echo "$as_me:10389: 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%/[^/]*$%%'`
@@ -10314,7 +10422,7 @@ if test -n "$cf_1st_incdir" ; then
        CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
 
                          cat >conftest.$ac_ext <<_ACEOF
-#line 10317 "configure"
+#line 10425 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 int
@@ -10326,16 +10434,16 @@ printf("Hello")
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:10329: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:10437: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:10332: \$? = $ac_status" >&5
+  echo "$as_me:10440: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:10335: \"$ac_try\"") >&5
+  { (eval echo "$as_me:10443: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:10338: \$? = $ac_status" >&5
+  echo "$as_me:10446: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   :
 else
@@ -10352,7 +10460,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}:10355: testing adding $cf_add_incdir to include-path ..." 1>&5
+echo "${as_me:-configure}:10463: testing adding $cf_add_incdir to include-path ..." 1>&5
 
                  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
 
@@ -10400,7 +10508,7 @@ EOF
        ;;
 esac
 
-echo "$as_me:10403: checking for terminfo header" >&5
+echo "$as_me:10511: 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
@@ -10418,7 +10526,7 @@ esac
 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
 do
 cat >conftest.$ac_ext <<_ACEOF
-#line 10421 "configure"
+#line 10529 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 #include <${cf_cv_ncurses_header:-curses.h}>
@@ -10433,16 +10541,16 @@ int x = auto_left_margin
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:10436: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:10544: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:10439: \$? = $ac_status" >&5
+  echo "$as_me:10547: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:10442: \"$ac_try\"") >&5
+  { (eval echo "$as_me:10550: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:10445: \$? = $ac_status" >&5
+  echo "$as_me:10553: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
        cf_cv_term_header="$cf_test"
@@ -10458,7 +10566,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext
 done
 
 fi
-echo "$as_me:10461: result: $cf_cv_term_header" >&5
+echo "$as_me:10569: result: $cf_cv_term_header" >&5
 echo "${ECHO_T}$cf_cv_term_header" >&6
 
 # Set definitions to allow ifdef'ing to accommodate subdirectories
@@ -10496,7 +10604,7 @@ cat >>confdefs.h <<\EOF
 #define NCURSES 1
 EOF
 
-echo "$as_me:10499: checking for ncurses version" >&5
+echo "$as_me:10607: 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
@@ -10522,10 +10630,10 @@ Autoconf "old"
 #endif
 EOF
        cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
-       { (eval echo "$as_me:10525: \"$cf_try\"") >&5
+       { (eval echo "$as_me:10633: \"$cf_try\"") >&5
   (eval $cf_try) 2>&5
   ac_status=$?
-  echo "$as_me:10528: \$? = $ac_status" >&5
+  echo "$as_me:10636: \$? = $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%".*%%'`
@@ -10535,7 +10643,7 @@ EOF
 
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 10538 "configure"
+#line 10646 "configure"
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header:-curses.h}>
@@ -10560,15 +10668,15 @@ int main(void)
 }
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:10563: \"$ac_link\"") >&5
+if { (eval echo "$as_me:10671: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:10566: \$? = $ac_status" >&5
+  echo "$as_me:10674: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:10568: \"$ac_try\"") >&5
+  { (eval echo "$as_me:10676: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:10571: \$? = $ac_status" >&5
+  echo "$as_me:10679: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
        cf_cv_ncurses_version=`cat $cf_tempfile`
@@ -10582,7 +10690,7 @@ fi
        rm -f $cf_tempfile
 
 fi
-echo "$as_me:10585: result: $cf_cv_ncurses_version" >&5
+echo "$as_me:10693: result: $cf_cv_ncurses_version" >&5
 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
 test "$cf_cv_ncurses_version" = no ||
 cat >>confdefs.h <<\EOF
@@ -10595,7 +10703,7 @@ cf_nculib_root=$cf_cv_screen
        # to link gpm.
 cf_ncurses_LIBS=""
 cf_ncurses_SAVE="$LIBS"
-echo "$as_me:10598: checking for Gpm_Open in -lgpm" >&5
+echo "$as_me:10706: 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
@@ -10603,7 +10711,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lgpm  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 10606 "configure"
+#line 10714 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -10622,16 +10730,16 @@ Gpm_Open ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:10625: \"$ac_link\"") >&5
+if { (eval echo "$as_me:10733: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:10628: \$? = $ac_status" >&5
+  echo "$as_me:10736: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:10631: \"$ac_try\"") >&5
+  { (eval echo "$as_me:10739: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:10634: \$? = $ac_status" >&5
+  echo "$as_me:10742: \$? = $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:10645: result: $ac_cv_lib_gpm_Gpm_Open" >&5
+echo "$as_me:10753: 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:10648: checking for initscr in -lgpm" >&5
+  echo "$as_me:10756: 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
@@ -10653,7 +10761,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lgpm  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 10656 "configure"
+#line 10764 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -10672,16 +10780,16 @@ initscr ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:10675: \"$ac_link\"") >&5
+if { (eval echo "$as_me:10783: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:10678: \$? = $ac_status" >&5
+  echo "$as_me:10786: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:10681: \"$ac_try\"") >&5
+  { (eval echo "$as_me:10789: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:10684: \$? = $ac_status" >&5
+  echo "$as_me:10792: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_gpm_initscr=yes
 else
@@ -10692,7 +10800,7 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:10695: result: $ac_cv_lib_gpm_initscr" >&5
+echo "$as_me:10803: 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"
@@ -10707,7 +10815,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:10710: checking for tgoto in -lmytinfo" >&5
+               echo "$as_me:10818: 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
@@ -10715,7 +10823,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lmytinfo  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 10718 "configure"
+#line 10826 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -10734,16 +10842,16 @@ tgoto ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:10737: \"$ac_link\"") >&5
+if { (eval echo "$as_me:10845: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:10740: \$? = $ac_status" >&5
+  echo "$as_me:10848: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:10743: \"$ac_try\"") >&5
+  { (eval echo "$as_me:10851: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:10746: \$? = $ac_status" >&5
+  echo "$as_me:10854: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_mytinfo_tgoto=yes
 else
@@ -10754,7 +10862,7 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:10757: result: $ac_cv_lib_mytinfo_tgoto" >&5
+echo "$as_me:10865: 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"
        ;;
 esac
 
-cf_add_libs="$cf_ncurses_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_libs="$LIBS"
+# reverse order
+cf_add_0lib=
+for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
+# filter duplicates
+for cf_add_1lib in $cf_add_0lib; 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"
+       test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
 done
 LIBS="$cf_add_libs"
 
 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
 then
 
-cf_add_libs="-l$cf_nculib_root"
-# 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_libs="$LIBS"
+# reverse order
+cf_add_0lib=
+for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
+# filter duplicates
+for cf_add_1lib in $cf_add_0lib; 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"
+       test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
 done
 LIBS="$cf_add_libs"
 
@@ -10803,13 +10911,13 @@ else
 
        eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
        cf_libdir=""
-       echo "$as_me:10806: checking for initscr" >&5
+       echo "$as_me:10914: 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 10812 "configure"
+#line 10920 "configure"
 #include "confdefs.h"
 #define initscr autoconf_temporary
 #include <limits.h>    /* least-intrusive standard header which defines gcc2 __stub macros */
@@ -10840,16 +10948,16 @@ main (void)
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:10843: \"$ac_link\"") >&5
+if { (eval echo "$as_me:10951: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:10846: \$? = $ac_status" >&5
+  echo "$as_me:10954: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:10849: \"$ac_try\"") >&5
+  { (eval echo "$as_me:10957: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:10852: \$? = $ac_status" >&5
+  echo "$as_me:10960: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_func_initscr=yes
 else
@@ -10859,18 +10967,18 @@ ac_cv_func_initscr=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:10862: result: $ac_cv_func_initscr" >&5
+echo "$as_me:10970: 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:10869: checking for initscr in -l$cf_nculib_root" >&5
+               echo "$as_me:10977: 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 10873 "configure"
+#line 10981 "configure"
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header:-curses.h}>
 int
@@ -10882,25 +10990,25 @@ initscr()
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:10885: \"$ac_link\"") >&5
+if { (eval echo "$as_me:10993: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:10888: \$? = $ac_status" >&5
+  echo "$as_me:10996: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:10891: \"$ac_try\"") >&5
+  { (eval echo "$as_me:10999: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:10894: \$? = $ac_status" >&5
+  echo "$as_me:11002: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  echo "$as_me:10896: result: yes" >&5
+  echo "$as_me:11004: 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:10903: result: no" >&5
+echo "$as_me:11011: result: no" >&5
 echo "${ECHO_T}no" >&6
 
 cf_search=
@@ -10968,11 +11076,11 @@ cf_search="$cf_library_path_list $cf_search"
 
                        for cf_libdir in $cf_search
                        do
-                               echo "$as_me:10971: checking for -l$cf_nculib_root in $cf_libdir" >&5
+                               echo "$as_me:11079: 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 10975 "configure"
+#line 11083 "configure"
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header:-curses.h}>
 int
@@ -10984,25 +11092,25 @@ initscr()
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:10987: \"$ac_link\"") >&5
+if { (eval echo "$as_me:11095: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:10990: \$? = $ac_status" >&5
+  echo "$as_me:11098: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:10993: \"$ac_try\"") >&5
+  { (eval echo "$as_me:11101: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:10996: \$? = $ac_status" >&5
+  echo "$as_me:11104: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  echo "$as_me:10998: result: yes" >&5
+  echo "$as_me:11106: 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:11005: result: no" >&5
+echo "$as_me:11113: result: no" >&5
 echo "${ECHO_T}no" >&6
                                         LIBS="$cf_save_LIBS"
 fi
@@ -11017,7 +11125,7 @@ fi
 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
 
 if test $cf_found_library = no ; then
-       { { echo "$as_me:11020: error: Cannot link $cf_nculib_root library" >&5
+       { { echo "$as_me:11128: error: Cannot link $cf_nculib_root library" >&5
 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
    { (exit 1); exit 1; }; }
 fi
@@ -11025,7 +11133,7 @@ fi
 fi
 
 if test -n "$cf_ncurses_LIBS" ; then
-       echo "$as_me:11028: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
+       echo "$as_me:11136: 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
@@ -11035,7 +11143,7 @@ echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS..
                fi
        done
        cat >conftest.$ac_ext <<_ACEOF
-#line 11038 "configure"
+#line 11146 "configure"
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header:-curses.h}>
 int
@@ -11047,23 +11155,23 @@ initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:11050: \"$ac_link\"") >&5
+if { (eval echo "$as_me:11158: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:11053: \$? = $ac_status" >&5
+  echo "$as_me:11161: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:11056: \"$ac_try\"") >&5
+  { (eval echo "$as_me:11164: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:11059: \$? = $ac_status" >&5
+  echo "$as_me:11167: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  echo "$as_me:11061: result: yes" >&5
+  echo "$as_me:11169: result: yes" >&5
 echo "${ECHO_T}yes" >&6
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
-echo "$as_me:11066: result: no" >&5
+echo "$as_me:11174: result: no" >&5
 echo "${ECHO_T}no" >&6
                 LIBS="$cf_ncurses_SAVE"
 fi
@@ -11083,7 +11191,7 @@ fi
 
        ;;
 (pdcurses)
-       echo "$as_me:11086: checking for X" >&5
+       echo "$as_me:11194: checking for X" >&5
 echo $ECHO_N "checking for X... $ECHO_C" >&6
 
 # Check whether --with-x or --without-x was given.
@@ -11184,17 +11292,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 11187 "configure"
+#line 11295 "configure"
 #include "confdefs.h"
 #include <X11/Intrinsic.h>
 _ACEOF
-if { (eval echo "$as_me:11191: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:11299: \"$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:11197: \$? = $ac_status" >&5
+  echo "$as_me:11305: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
@@ -11227,7 +11335,7 @@ if test "$ac_x_libraries" = no; then
   ac_save_LIBS=$LIBS
   LIBS="-lXt $LIBS"
   cat >conftest.$ac_ext <<_ACEOF
-#line 11230 "configure"
+#line 11338 "configure"
 #include "confdefs.h"
 #include <X11/Intrinsic.h>
 int
@@ -11239,16 +11347,16 @@ XtMalloc (0)
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:11242: \"$ac_link\"") >&5
+if { (eval echo "$as_me:11350: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:11245: \$? = $ac_status" >&5
+  echo "$as_me:11353: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:11248: \"$ac_try\"") >&5
+  { (eval echo "$as_me:11356: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:11251: \$? = $ac_status" >&5
+  echo "$as_me:11359: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   LIBS=$ac_save_LIBS
 # We can link X programs with no special library path.
@@ -11286,7 +11394,7 @@ fi
 fi # $with_x != no
 
 if test "$have_x" != yes; then
-  echo "$as_me:11289: result: $have_x" >&5
+  echo "$as_me:11397: result: $have_x" >&5
 echo "${ECHO_T}$have_x" >&6
   no_x=yes
 else
@@ -11296,7 +11404,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:11299: result: libraries $x_libraries, headers $x_includes" >&5
+  echo "$as_me:11407: result: libraries $x_libraries, headers $x_includes" >&5
 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
 fi
 
@@ -11320,11 +11428,11 @@ else
     # others require no space.  Words are not sufficient . . . .
     case `(uname -sr) 2>/dev/null` in
     "SunOS 5"*)
-      echo "$as_me:11323: checking whether -R must be followed by a space" >&5
+      echo "$as_me:11431: 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 11327 "configure"
+#line 11435 "configure"
 #include "confdefs.h"
 
 int
@@ -11336,16 +11444,16 @@ main (void)
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:11339: \"$ac_link\"") >&5
+if { (eval echo "$as_me:11447: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:11342: \$? = $ac_status" >&5
+  echo "$as_me:11450: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:11345: \"$ac_try\"") >&5
+  { (eval echo "$as_me:11453: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:11348: \$? = $ac_status" >&5
+  echo "$as_me:11456: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_R_nospace=yes
 else
@@ -11355,13 +11463,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:11358: result: no" >&5
+       echo "$as_me:11466: 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 11364 "configure"
+#line 11472 "configure"
 #include "confdefs.h"
 
 int
@@ -11373,16 +11481,16 @@ main (void)
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:11376: \"$ac_link\"") >&5
+if { (eval echo "$as_me:11484: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:11379: \$? = $ac_status" >&5
+  echo "$as_me:11487: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:11382: \"$ac_try\"") >&5
+  { (eval echo "$as_me:11490: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:11385: \$? = $ac_status" >&5
+  echo "$as_me:11493: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_R_space=yes
 else
@@ -11392,11 +11500,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:11395: result: yes" >&5
+         echo "$as_me:11503: result: yes" >&5
 echo "${ECHO_T}yes" >&6
          X_LIBS="$X_LIBS -R $x_libraries"
        else
-         echo "$as_me:11399: result: neither works" >&5
+         echo "$as_me:11507: result: neither works" >&5
 echo "${ECHO_T}neither works" >&6
        fi
       fi
@@ -11416,7 +11524,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 11419 "configure"
+#line 11527 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -11435,22 +11543,22 @@ XOpenDisplay ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:11438: \"$ac_link\"") >&5
+if { (eval echo "$as_me:11546: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:11441: \$? = $ac_status" >&5
+  echo "$as_me:11549: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:11444: \"$ac_try\"") >&5
+  { (eval echo "$as_me:11552: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:11447: \$? = $ac_status" >&5
+  echo "$as_me:11555: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   :
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
-echo "$as_me:11453: checking for dnet_ntoa in -ldnet" >&5
+echo "$as_me:11561: 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
@@ -11458,7 +11566,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-ldnet  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 11461 "configure"
+#line 11569 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -11477,16 +11585,16 @@ dnet_ntoa ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:11480: \"$ac_link\"") >&5
+if { (eval echo "$as_me:11588: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:11483: \$? = $ac_status" >&5
+  echo "$as_me:11591: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:11486: \"$ac_try\"") >&5
+  { (eval echo "$as_me:11594: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:11489: \$? = $ac_status" >&5
+  echo "$as_me:11597: \$? = $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:11500: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
+echo "$as_me:11608: 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:11507: checking for dnet_ntoa in -ldnet_stub" >&5
+      echo "$as_me:11615: 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
@@ -11512,7 +11620,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-ldnet_stub  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 11515 "configure"
+#line 11623 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -11531,16 +11639,16 @@ dnet_ntoa ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:11534: \"$ac_link\"") >&5
+if { (eval echo "$as_me:11642: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:11537: \$? = $ac_status" >&5
+  echo "$as_me:11645: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:11540: \"$ac_try\"") >&5
+  { (eval echo "$as_me:11648: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:11543: \$? = $ac_status" >&5
+  echo "$as_me:11651: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_dnet_stub_dnet_ntoa=yes
 else
@@ -11551,7 +11659,7 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:11554: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
+echo "$as_me:11662: 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"
@@ -11570,13 +11678,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:11573: checking for gethostbyname" >&5
+    echo "$as_me:11681: 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 11579 "configure"
+#line 11687 "configure"
 #include "confdefs.h"
 #define gethostbyname autoconf_temporary
 #include <limits.h>    /* least-intrusive standard header which defines gcc2 __stub macros */
@@ -11607,16 +11715,16 @@ main (void)
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:11610: \"$ac_link\"") >&5
+if { (eval echo "$as_me:11718: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:11613: \$? = $ac_status" >&5
+  echo "$as_me:11721: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:11616: \"$ac_try\"") >&5
+  { (eval echo "$as_me:11724: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:11619: \$? = $ac_status" >&5
+  echo "$as_me:11727: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_func_gethostbyname=yes
 else
@@ -11626,11 +11734,11 @@ ac_cv_func_gethostbyname=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:11629: result: $ac_cv_func_gethostbyname" >&5
+echo "$as_me:11737: 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:11633: checking for gethostbyname in -lnsl" >&5
+      echo "$as_me:11741: 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
@@ -11638,7 +11746,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lnsl  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 11641 "configure"
+#line 11749 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -11657,16 +11765,16 @@ gethostbyname ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:11660: \"$ac_link\"") >&5
+if { (eval echo "$as_me:11768: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:11663: \$? = $ac_status" >&5
+  echo "$as_me:11771: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:11666: \"$ac_try\"") >&5
+  { (eval echo "$as_me:11774: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:11669: \$? = $ac_status" >&5
+  echo "$as_me:11777: \$? = $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:11680: result: $ac_cv_lib_nsl_gethostbyname" >&5
+echo "$as_me:11788: 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:11687: checking for gethostbyname in -lbsd" >&5
+        echo "$as_me:11795: 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
@@ -11692,7 +11800,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lbsd  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 11695 "configure"
+#line 11803 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -11711,16 +11819,16 @@ gethostbyname ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:11714: \"$ac_link\"") >&5
+if { (eval echo "$as_me:11822: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:11717: \$? = $ac_status" >&5
+  echo "$as_me:11825: \$? = $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:11828: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:11723: \$? = $ac_status" >&5
+  echo "$as_me:11831: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_bsd_gethostbyname=yes
 else
@@ -11731,7 +11839,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_bsd_gethostbyname" >&5
+echo "$as_me:11842: 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:11750: checking for connect" >&5
+    echo "$as_me:11858: 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 11756 "configure"
+#line 11864 "configure"
 #include "confdefs.h"
 #define connect autoconf_temporary
 #include <limits.h>    /* least-intrusive standard header which defines gcc2 __stub macros */
@@ -11784,16 +11892,16 @@ main (void)
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:11787: \"$ac_link\"") >&5
+if { (eval echo "$as_me:11895: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:11790: \$? = $ac_status" >&5
+  echo "$as_me:11898: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:11793: \"$ac_try\"") >&5
+  { (eval echo "$as_me:11901: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:11796: \$? = $ac_status" >&5
+  echo "$as_me:11904: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_func_connect=yes
 else
@@ -11803,11 +11911,11 @@ ac_cv_func_connect=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:11806: result: $ac_cv_func_connect" >&5
+echo "$as_me:11914: 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:11810: checking for connect in -lsocket" >&5
+      echo "$as_me:11918: 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
@@ -11815,7 +11923,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 11818 "configure"
+#line 11926 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -11834,16 +11942,16 @@ connect ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:11837: \"$ac_link\"") >&5
+if { (eval echo "$as_me:11945: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:11840: \$? = $ac_status" >&5
+  echo "$as_me:11948: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:11843: \"$ac_try\"") >&5
+  { (eval echo "$as_me:11951: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:11846: \$? = $ac_status" >&5
+  echo "$as_me:11954: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_socket_connect=yes
 else
@@ -11854,7 +11962,7 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:11857: result: $ac_cv_lib_socket_connect" >&5
+echo "$as_me:11965: 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:11866: checking for remove" >&5
+    echo "$as_me:11974: 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 11872 "configure"
+#line 11980 "configure"
 #include "confdefs.h"
 #define remove autoconf_temporary
 #include <limits.h>    /* least-intrusive standard header which defines gcc2 __stub macros */
@@ -11900,16 +12008,16 @@ main (void)
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:11903: \"$ac_link\"") >&5
+if { (eval echo "$as_me:12011: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:11906: \$? = $ac_status" >&5
+  echo "$as_me:12014: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:11909: \"$ac_try\"") >&5
+  { (eval echo "$as_me:12017: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:11912: \$? = $ac_status" >&5
+  echo "$as_me:12020: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_func_remove=yes
 else
@@ -11919,11 +12027,11 @@ ac_cv_func_remove=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:11922: result: $ac_cv_func_remove" >&5
+echo "$as_me:12030: 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:11926: checking for remove in -lposix" >&5
+      echo "$as_me:12034: 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
@@ -11931,7 +12039,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lposix  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 11934 "configure"
+#line 12042 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -11950,16 +12058,16 @@ remove ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:11953: \"$ac_link\"") >&5
+if { (eval echo "$as_me:12061: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:11956: \$? = $ac_status" >&5
+  echo "$as_me:12064: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:11959: \"$ac_try\"") >&5
+  { (eval echo "$as_me:12067: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:11962: \$? = $ac_status" >&5
+  echo "$as_me:12070: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_posix_remove=yes
 else
@@ -11970,7 +12078,7 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:11973: result: $ac_cv_lib_posix_remove" >&5
+echo "$as_me:12081: 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:11982: checking for shmat" >&5
+    echo "$as_me:12090: 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 11988 "configure"
+#line 12096 "configure"
 #include "confdefs.h"
 #define shmat autoconf_temporary
 #include <limits.h>    /* least-intrusive standard header which defines gcc2 __stub macros */
@@ -12016,16 +12124,16 @@ main (void)
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:12019: \"$ac_link\"") >&5
+if { (eval echo "$as_me:12127: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:12022: \$? = $ac_status" >&5
+  echo "$as_me:12130: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:12025: \"$ac_try\"") >&5
+  { (eval echo "$as_me:12133: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:12028: \$? = $ac_status" >&5
+  echo "$as_me:12136: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_func_shmat=yes
 else
@@ -12035,11 +12143,11 @@ ac_cv_func_shmat=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:12038: result: $ac_cv_func_shmat" >&5
+echo "$as_me:12146: 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:12042: checking for shmat in -lipc" >&5
+      echo "$as_me:12150: 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
@@ -12047,7 +12155,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lipc  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 12050 "configure"
+#line 12158 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -12066,16 +12174,16 @@ shmat ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:12069: \"$ac_link\"") >&5
+if { (eval echo "$as_me:12177: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:12072: \$? = $ac_status" >&5
+  echo "$as_me:12180: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:12075: \"$ac_try\"") >&5
+  { (eval echo "$as_me:12183: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:12078: \$? = $ac_status" >&5
+  echo "$as_me:12186: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_ipc_shmat=yes
 else
@@ -12086,7 +12194,7 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:12089: result: $ac_cv_lib_ipc_shmat" >&5
+echo "$as_me:12197: 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"
@@ -12104,7 +12212,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:12107: checking for IceConnectionNumber in -lICE" >&5
+  echo "$as_me:12215: 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
@@ -12112,7 +12220,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 12115 "configure"
+#line 12223 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -12131,16 +12239,16 @@ IceConnectionNumber ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:12134: \"$ac_link\"") >&5
+if { (eval echo "$as_me:12242: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:12137: \$? = $ac_status" >&5
+  echo "$as_me:12245: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:12140: \"$ac_try\"") >&5
+  { (eval echo "$as_me:12248: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:12143: \$? = $ac_status" >&5
+  echo "$as_me:12251: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_ICE_IceConnectionNumber=yes
 else
@@ -12151,7 +12259,7 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:12154: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
+echo "$as_me:12262: 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"
@@ -12163,7 +12271,7 @@ fi
 
 cf_x_athena=${cf_x_athena:-Xaw}
 
-echo "$as_me:12166: checking if you want to link with Xaw 3d library" >&5
+echo "$as_me:12274: 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=
 
@@ -12174,14 +12282,14 @@ if test "${with_Xaw3d+set}" = set; then
 fi;
 if test "$withval" = yes ; then
        cf_x_athena=Xaw3d
-       echo "$as_me:12177: result: yes" >&5
+       echo "$as_me:12285: result: yes" >&5
 echo "${ECHO_T}yes" >&6
 else
-       echo "$as_me:12180: result: no" >&5
+       echo "$as_me:12288: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
-echo "$as_me:12184: checking if you want to link with Xaw 3d xft library" >&5
+echo "$as_me:12292: 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=
 
@@ -12192,14 +12300,14 @@ if test "${with_Xaw3dxft+set}" = set; then
 fi;
 if test "$withval" = yes ; then
        cf_x_athena=Xaw3dxft
-       echo "$as_me:12195: result: yes" >&5
+       echo "$as_me:12303: result: yes" >&5
 echo "${ECHO_T}yes" >&6
 else
-       echo "$as_me:12198: result: no" >&5
+       echo "$as_me:12306: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
-echo "$as_me:12202: checking if you want to link with neXT Athena library" >&5
+echo "$as_me:12310: 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=
 
@@ -12210,14 +12318,14 @@ if test "${with_neXtaw+set}" = set; then
 fi;
 if test "$withval" = yes ; then
        cf_x_athena=neXtaw
-       echo "$as_me:12213: result: yes" >&5
+       echo "$as_me:12321: result: yes" >&5
 echo "${ECHO_T}yes" >&6
 else
-       echo "$as_me:12216: result: no" >&5
+       echo "$as_me:12324: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
-echo "$as_me:12220: checking if you want to link with Athena-Plus library" >&5
+echo "$as_me:12328: 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=
 
@@ -12228,10 +12336,10 @@ if test "${with_XawPlus+set}" = set; then
 fi;
 if test "$withval" = yes ; then
        cf_x_athena=XawPlus
-       echo "$as_me:12231: result: yes" >&5
+       echo "$as_me:12339: result: yes" >&5
 echo "${ECHO_T}yes" >&6
 else
-       echo "$as_me:12234: result: no" >&5
+       echo "$as_me:12342: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -12251,17 +12359,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}:12254: testing found package $cf_athena_pkg ..." 1>&5
+echo "${as_me:-configure}:12362: 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}:12260: testing package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs ..." 1>&5
+echo "${as_me:-configure}:12368: 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}:12264: testing package $cf_athena_pkg LIBS: $cf_pkgconfig_libs ..." 1>&5
+echo "${as_me:-configure}:12372: testing package $cf_athena_pkg LIBS: $cf_pkgconfig_libs ..." 1>&5
 
 cf_fix_cppflags=no
 cf_new_cflags=
@@ -12361,19 +12469,19 @@ if test -n "$cf_new_extra_cppflags" ; then
 
 fi
 
-cf_add_libs="$cf_pkgconfig_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_libs="$LIBS"
+# reverse order
+cf_add_0lib=
+for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
+# filter duplicates
+for cf_add_1lib in $cf_add_0lib; 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"
+       test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
 done
 LIBS="$cf_add_libs"
 
@@ -12392,20 +12500,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}:12395: testing ..trimmed $LIBS ..." 1>&5
+echo "${as_me:-configure}:12503: testing ..trimmed $LIBS ..." 1>&5
 
                        ;;
                esac
        done
 
-echo "$as_me:12401: checking for usable $cf_x_athena/Xmu package" >&5
+echo "$as_me:12509: 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 12408 "configure"
+#line 12516 "configure"
 #include "confdefs.h"
 
 #include <X11/Xmu/CharSet.h>
@@ -12421,16 +12529,16 @@ int check = XmuCompareISOLatin1("big", "small")
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:12424: \"$ac_link\"") >&5
+if { (eval echo "$as_me:12532: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:12427: \$? = $ac_status" >&5
+  echo "$as_me:12535: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:12430: \"$ac_try\"") >&5
+  { (eval echo "$as_me:12538: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:12433: \$? = $ac_status" >&5
+  echo "$as_me:12541: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_xaw_compat=yes
 else
@@ -12440,7 +12548,7 @@ cf_cv_xaw_compat=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:12443: result: $cf_cv_xaw_compat" >&5
+echo "$as_me:12551: result: $cf_cv_xaw_compat" >&5
 echo "${ECHO_T}$cf_cv_xaw_compat" >&6
 
                        if test "$cf_cv_xaw_compat" = no
@@ -12452,7 +12560,7 @@ echo "${ECHO_T}$cf_cv_xaw_compat" >&6
                                (*)
                                        test -n "$verbose" && echo "    work around broken package" 1>&6
 
-echo "${as_me:-configure}:12455: testing work around broken package ..." 1>&5
+echo "${as_me:-configure}:12563: testing work around broken package ..." 1>&5
 
                                        cf_save_xmu="$LIBS"
                                        cf_first_lib=`echo "$cf_save_xmu" | sed -e 's/^  *//' -e 's/ .*//'`
@@ -12460,17 +12568,17 @@ echo "${as_me:-configure}:12455: 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}:12463: testing found package xmu ..." 1>&5
+echo "${as_me:-configure}:12571: 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}:12469: testing package xmu CFLAGS: $cf_pkgconfig_incs ..." 1>&5
+echo "${as_me:-configure}:12577: 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}:12473: testing package xmu LIBS: $cf_pkgconfig_libs ..." 1>&5
+echo "${as_me:-configure}:12581: testing package xmu LIBS: $cf_pkgconfig_libs ..." 1>&5
 
 cf_fix_cppflags=no
 cf_new_cflags=
@@ -12570,19 +12678,19 @@ if test -n "$cf_new_extra_cppflags" ; then
 
 fi
 
-cf_add_libs="$cf_pkgconfig_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_libs="$LIBS"
+# reverse order
+cf_add_0lib=
+for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
+# filter duplicates
+for cf_add_1lib in $cf_add_0lib; 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"
+       test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
 done
 LIBS="$cf_add_libs"
 
@@ -12590,12 +12698,12 @@ LIBS="$cf_add_libs"
 
 test -n "$verbose" && echo "   ...before $LIBS" 1>&6
 
-echo "${as_me:-configure}:12593: testing ...before $LIBS ..." 1>&5
+echo "${as_me:-configure}:12701: 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}:12598: testing ...after  $LIBS ..." 1>&5
+echo "${as_me:-configure}:12706: testing ...after  $LIBS ..." 1>&5
 
 else
        cf_pkgconfig_incs=
@@ -12603,12 +12711,12 @@ else
 
 test -n "$verbose" && echo "   ...before $LIBS" 1>&6
 
-echo "${as_me:-configure}:12606: testing ...before $LIBS ..." 1>&5
+echo "${as_me:-configure}:12714: 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}:12611: testing ...after  $LIBS ..." 1>&5
+echo "${as_me:-configure}:12719: testing ...after  $LIBS ..." 1>&5
 
 fi
 
@@ -12619,7 +12727,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}:12622: testing ..trimmed $LIBS ..." 1>&5
+echo "${as_me:-configure}:12730: testing ..trimmed $LIBS ..." 1>&5
 
                        ;;
                esac
@@ -12644,17 +12752,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}:12647: testing found package Xext ..." 1>&5
+echo "${as_me:-configure}:12755: 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}:12653: testing package Xext CFLAGS: $cf_pkgconfig_incs ..." 1>&5
+echo "${as_me:-configure}:12761: 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}:12657: testing package Xext LIBS: $cf_pkgconfig_libs ..." 1>&5
+echo "${as_me:-configure}:12765: testing package Xext LIBS: $cf_pkgconfig_libs ..." 1>&5
 
 cf_fix_cppflags=no
 cf_new_cflags=
@@ -12754,19 +12862,19 @@ if test -n "$cf_new_extra_cppflags" ; then
 
 fi
 
-cf_add_libs="$cf_pkgconfig_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_libs="$LIBS"
+# reverse order
+cf_add_0lib=
+for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
+# filter duplicates
+for cf_add_1lib in $cf_add_0lib; 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"
+       test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
 done
 LIBS="$cf_add_libs"
 
@@ -12775,7 +12883,7 @@ else
        cf_pkgconfig_incs=
        cf_pkgconfig_libs=
 
-       echo "$as_me:12778: checking for XextCreateExtension in -lXext" >&5
+       echo "$as_me:12886: 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
@@ -12783,7 +12891,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lXext  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 12786 "configure"
+#line 12894 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -12802,16 +12910,16 @@ XextCreateExtension ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:12805: \"$ac_link\"") >&5
+if { (eval echo "$as_me:12913: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:12808: \$? = $ac_status" >&5
+  echo "$as_me:12916: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:12811: \"$ac_try\"") >&5
+  { (eval echo "$as_me:12919: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:12814: \$? = $ac_status" >&5
+  echo "$as_me:12922: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_Xext_XextCreateExtension=yes
 else
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:12825: result: $ac_cv_lib_Xext_XextCreateExtension" >&5
+echo "$as_me:12933: 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
 
-cf_add_libs="-lXext"
-# 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_libs="$LIBS"
+# reverse order
+cf_add_0lib=
+for cf_add_1lib in -lXext; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
+# filter duplicates
+for cf_add_1lib in $cf_add_0lib; 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"
+       test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
 done
 LIBS="$cf_add_libs"
 
@@ -12846,7 +12954,7 @@ fi
 
 fi
 
-# OSX is schizoid about who owns /usr/X11 (old) versus /opt/X11 (new), and (and
+# OSX is schizoid about who owns /usr/X11 (old) versus /opt/X11 (new) (and
 # in some cases has installed dummy files in the former, other cases replaced
 # it with a link to the new location).  This complicates the configure script.
 # Check for that pitfall, and recover using pkg-config
@@ -12858,17 +12966,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}:12861: testing found package x11 ..." 1>&5
+echo "${as_me:-configure}:12969: 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}:12867: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
+echo "${as_me:-configure}:12975: 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}:12871: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
+echo "${as_me:-configure}:12979: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
 
 cf_fix_cppflags=no
 cf_new_cflags=
@@ -12968,19 +13076,19 @@ if test -n "$cf_new_extra_cppflags" ; then
 
 fi
 
-cf_add_libs="$cf_pkgconfig_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_libs="$LIBS"
+# reverse order
+cf_add_0lib=
+for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
+# filter duplicates
+for cf_add_1lib in $cf_add_0lib; 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"
+       test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
 done
 LIBS="$cf_add_libs"
 
@@ -12988,24 +13096,24 @@ LIBS="$cf_add_libs"
 else
        cf_pkgconfig_incs=
        cf_pkgconfig_libs=
-       { echo "$as_me:12991: WARNING: unable to find X11 library" >&5
+       { echo "$as_me:13099: 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}:12998: testing found package ice ..." 1>&5
+echo "${as_me:-configure}:13106: 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}:13004: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
+echo "${as_me:-configure}:13112: 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}:13008: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
+echo "${as_me:-configure}:13116: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
 
 cf_fix_cppflags=no
 cf_new_cflags=
@@ -13105,19 +13213,19 @@ if test -n "$cf_new_extra_cppflags" ; then
 
 fi
 
-cf_add_libs="$cf_pkgconfig_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_libs="$LIBS"
+# reverse order
+cf_add_0lib=
+for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
+# filter duplicates
+for cf_add_1lib in $cf_add_0lib; 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"
+       test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
 done
 LIBS="$cf_add_libs"
 
@@ -13125,24 +13233,24 @@ LIBS="$cf_add_libs"
 else
        cf_pkgconfig_incs=
        cf_pkgconfig_libs=
-       { echo "$as_me:13128: WARNING: unable to find ICE library" >&5
+       { echo "$as_me:13236: 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}:13135: testing found package sm ..." 1>&5
+echo "${as_me:-configure}:13243: 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}:13141: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
+echo "${as_me:-configure}:13249: 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}:13145: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
+echo "${as_me:-configure}:13253: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
 
 cf_fix_cppflags=no
 cf_new_cflags=
@@ -13242,19 +13350,19 @@ if test -n "$cf_new_extra_cppflags" ; then
 
 fi
 
-cf_add_libs="$cf_pkgconfig_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_libs="$LIBS"
+# reverse order
+cf_add_0lib=
+for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
+# filter duplicates
+for cf_add_1lib in $cf_add_0lib; 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"
+       test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
 done
 LIBS="$cf_add_libs"
 
@@ -13262,24 +13370,24 @@ LIBS="$cf_add_libs"
 else
        cf_pkgconfig_incs=
        cf_pkgconfig_libs=
-       { echo "$as_me:13265: WARNING: unable to find SM library" >&5
+       { echo "$as_me:13373: 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}:13272: testing found package xt ..." 1>&5
+echo "${as_me:-configure}:13380: 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}:13278: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
+echo "${as_me:-configure}:13386: 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}:13282: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
+echo "${as_me:-configure}:13390: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
 
 cf_fix_cppflags=no
 cf_new_cflags=
@@ -13379,19 +13487,19 @@ if test -n "$cf_new_extra_cppflags" ; then
 
 fi
 
-cf_add_libs="$cf_pkgconfig_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_libs="$LIBS"
+# reverse order
+cf_add_0lib=
+for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
+# filter duplicates
+for cf_add_1lib in $cf_add_0lib; 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"
+       test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
 done
 LIBS="$cf_add_libs"
 
@@ -13399,7 +13507,7 @@ LIBS="$cf_add_libs"
 else
        cf_pkgconfig_incs=
        cf_pkgconfig_libs=
-       { echo "$as_me:13402: WARNING: unable to find Xt library" >&5
+       { echo "$as_me:13510: WARNING: unable to find Xt library" >&5
 echo "$as_me: WARNING: unable to find Xt library" >&2;}
 fi
 
@@ -13410,17 +13518,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}:13413: testing found package xt ..." 1>&5
+echo "${as_me:-configure}:13521: 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}:13419: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
+echo "${as_me:-configure}:13527: 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}:13423: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
+echo "${as_me:-configure}:13531: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
 
 cf_fix_cppflags=no
 cf_new_cflags=
@@ -13520,19 +13628,19 @@ if test -n "$cf_new_extra_cppflags" ; then
 
 fi
 
-cf_add_libs="$cf_pkgconfig_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_libs="$LIBS"
+# reverse order
+cf_add_0lib=
+for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
+# filter duplicates
+for cf_add_1lib in $cf_add_0lib; 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"
+       test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
 done
 LIBS="$cf_add_libs"
 
@@ -13541,14 +13649,14 @@ LIBS="$cf_add_libs"
                ;;
        (*)
 # we have an "xt" package, but it may omit Xt's dependency on X11
-echo "$as_me:13544: checking for usable X dependency" >&5
+echo "$as_me:13652: 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 13551 "configure"
+#line 13659 "configure"
 #include "confdefs.h"
 
 #include <X11/Xlib.h>
@@ -13567,16 +13675,16 @@ main (void)
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:13570: \"$ac_link\"") >&5
+if { (eval echo "$as_me:13678: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:13573: \$? = $ac_status" >&5
+  echo "$as_me:13681: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:13576: \"$ac_try\"") >&5
+  { (eval echo "$as_me:13684: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:13579: \$? = $ac_status" >&5
+  echo "$as_me:13687: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_xt_x11_compat=yes
 else
@@ -13586,30 +13694,30 @@ cf_cv_xt_x11_compat=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:13589: result: $cf_cv_xt_x11_compat" >&5
+echo "$as_me:13697: 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}:13595: testing work around broken X11 dependency ..." 1>&5
+echo "${as_me:-configure}:13703: 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}:13602: testing found package x11 ..." 1>&5
+echo "${as_me:-configure}:13710: 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}:13608: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
+echo "${as_me:-configure}:13716: 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}:13612: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
+echo "${as_me:-configure}:13720: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
 
 cf_fix_cppflags=no
 cf_new_cflags=
@@ -13709,19 +13817,19 @@ if test -n "$cf_new_extra_cppflags" ; then
 
 fi
 
-cf_add_libs="$cf_pkgconfig_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_libs="$LIBS"
+# reverse order
+cf_add_0lib=
+for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
+# filter duplicates
+for cf_add_1lib in $cf_add_0lib; 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"
+       test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
 done
 LIBS="$cf_add_libs"
 
@@ -13732,12 +13840,12 @@ else
 
 test -n "$verbose" && echo "   ...before $LIBS" 1>&6
 
-echo "${as_me:-configure}:13735: testing ...before $LIBS ..." 1>&5
+echo "${as_me:-configure}:13843: 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}:13740: testing ...after  $LIBS ..." 1>&5
+echo "${as_me:-configure}:13848: testing ...after  $LIBS ..." 1>&5
 
 fi
 
                ;;
        esac
 
-echo "$as_me:13748: checking for usable X Toolkit package" >&5
+echo "$as_me:13856: 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 13755 "configure"
+#line 13863 "configure"
 #include "confdefs.h"
 
 #include <X11/Shell.h>
@@ -13767,16 +13875,16 @@ int num = IceConnectionNumber(0)
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:13770: \"$ac_link\"") >&5
+if { (eval echo "$as_me:13878: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:13773: \$? = $ac_status" >&5
+  echo "$as_me:13881: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:13776: \"$ac_try\"") >&5
+  { (eval echo "$as_me:13884: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:13779: \$? = $ac_status" >&5
+  echo "$as_me:13887: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_xt_ice_compat=yes
 else
@@ -13786,7 +13894,7 @@ cf_cv_xt_ice_compat=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:13789: result: $cf_cv_xt_ice_compat" >&5
+echo "$as_me:13897: result: $cf_cv_xt_ice_compat" >&5
 echo "${ECHO_T}$cf_cv_xt_ice_compat" >&6
 
        if test "$cf_cv_xt_ice_compat" = no
@@ -13800,22 +13908,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}:13803: testing work around broken ICE dependency ..." 1>&5
+echo "${as_me:-configure}:13911: 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}:13808: testing found package ice ..." 1>&5
+echo "${as_me:-configure}:13916: 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}:13814: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
+echo "${as_me:-configure}:13922: 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}:13818: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
+echo "${as_me:-configure}:13926: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
 
 cf_fix_cppflags=no
 cf_new_cflags=
@@ -13915,36 +14023,36 @@ if test -n "$cf_new_extra_cppflags" ; then
 
 fi
 
-cf_add_libs="$cf_pkgconfig_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_libs="$LIBS"
+# reverse order
+cf_add_0lib=
+for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
+# filter duplicates
+for cf_add_1lib in $cf_add_0lib; 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"
+       test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
 done
 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}:13937: testing found package sm ..." 1>&5
+echo "${as_me:-configure}:14045: 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}:13943: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
+echo "${as_me:-configure}:14051: 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}:13947: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
+echo "${as_me:-configure}:14055: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
 
 cf_fix_cppflags=no
 cf_new_cflags=
@@ -14044,19 +14152,19 @@ if test -n "$cf_new_extra_cppflags" ; then
 
 fi
 
-cf_add_libs="$cf_pkgconfig_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_libs="$LIBS"
+# reverse order
+cf_add_0lib=
+for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
+# filter duplicates
+for cf_add_1lib in $cf_add_0lib; 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"
+       test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
 done
 LIBS="$cf_add_libs"
 
@@ -14073,12 +14181,12 @@ else
 
 test -n "$verbose" && echo "   ...before $LIBS" 1>&6
 
-echo "${as_me:-configure}:14076: testing ...before $LIBS ..." 1>&5
+echo "${as_me:-configure}:14184: 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}:14081: testing ...after  $LIBS ..." 1>&5
+echo "${as_me:-configure}:14189: testing ...after  $LIBS ..." 1>&5
 
 fi
 
@@ -14098,7 +14206,7 @@ else
 
 test -n "$verbose" && echo "   checking additions to CFLAGS" 1>&6
 
-echo "${as_me:-configure}:14101: testing checking additions to CFLAGS ..." 1>&5
+echo "${as_me:-configure}:14209: testing checking additions to CFLAGS ..." 1>&5
 
 cf_check_cflags="$CFLAGS"
 cf_check_cppflags="$CPPFLAGS"
@@ -14183,7 +14291,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}:14186: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
+echo "${as_me:-configure}:14294: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
 
        test -n "$CFLAGS" && CFLAGS="$CFLAGS "
        CFLAGS="${CFLAGS}$cf_new_cflags"
@@ -14193,7 +14301,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}:14196: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
+echo "${as_me:-configure}:14304: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
 
        test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
        CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
@@ -14203,7 +14311,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}:14206: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
+echo "${as_me:-configure}:14314: 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"
@@ -14212,7 +14320,7 @@ fi
 
 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
 cat >conftest.$ac_ext <<_ACEOF
-#line 14215 "configure"
+#line 14323 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 int
@@ -14224,16 +14332,16 @@ printf("Hello world");
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:14227: \"$ac_link\"") >&5
+if { (eval echo "$as_me:14335: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:14230: \$? = $ac_status" >&5
+  echo "$as_me:14338: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:14233: \"$ac_try\"") >&5
+  { (eval echo "$as_me:14341: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:14236: \$? = $ac_status" >&5
+  echo "$as_me:14344: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   :
 else
@@ -14241,12 +14349,12 @@ else
 cat conftest.$ac_ext >&5
 test -n "$verbose" && echo "   test-compile failed.  Undoing change to \$CFLAGS" 1>&6
 
-echo "${as_me:-configure}:14244: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
+echo "${as_me:-configure}:14352: 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}:14249: testing but keeping change to \$CPPFLAGS ..." 1>&5
+echo "${as_me:-configure}:14357: 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:14257: checking for XOpenDisplay" >&5
+       echo "$as_me:14365: 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 14263 "configure"
+#line 14371 "configure"
 #include "confdefs.h"
 #define XOpenDisplay autoconf_temporary
 #include <limits.h>    /* least-intrusive standard header which defines gcc2 __stub macros */
@@ -14291,16 +14399,16 @@ main (void)
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:14294: \"$ac_link\"") >&5
+if { (eval echo "$as_me:14402: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:14297: \$? = $ac_status" >&5
+  echo "$as_me:14405: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:14300: \"$ac_try\"") >&5
+  { (eval echo "$as_me:14408: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:14303: \$? = $ac_status" >&5
+  echo "$as_me:14411: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_func_XOpenDisplay=yes
 else
@@ -14310,13 +14418,13 @@ ac_cv_func_XOpenDisplay=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:14313: result: $ac_cv_func_XOpenDisplay" >&5
+echo "$as_me:14421: 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:14319: checking for XOpenDisplay in -lX11" >&5
+       echo "$as_me:14427: 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
@@ -14324,7 +14432,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 14327 "configure"
+#line 14435 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -14343,16 +14451,16 @@ XOpenDisplay ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:14346: \"$ac_link\"") >&5
+if { (eval echo "$as_me:14454: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:14349: \$? = $ac_status" >&5
+  echo "$as_me:14457: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:14352: \"$ac_try\"") >&5
+  { (eval echo "$as_me:14460: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:14355: \$? = $ac_status" >&5
+  echo "$as_me:14463: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_X11_XOpenDisplay=yes
 else
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:14366: result: $ac_cv_lib_X11_XOpenDisplay" >&5
+echo "$as_me:14474: 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
 
-cf_add_libs="-lX11"
-# 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_libs="$LIBS"
+# reverse order
+cf_add_0lib=
+for cf_add_1lib in -lX11; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
+# filter duplicates
+for cf_add_1lib in $cf_add_0lib; 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"
+       test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
 done
 LIBS="$cf_add_libs"
 
 
 fi
 
-       echo "$as_me:14390: checking for XtAppInitialize" >&5
+       echo "$as_me:14498: 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 14396 "configure"
+#line 14504 "configure"
 #include "confdefs.h"
 #define XtAppInitialize autoconf_temporary
 #include <limits.h>    /* least-intrusive standard header which defines gcc2 __stub macros */
@@ -14424,16 +14532,16 @@ main (void)
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:14427: \"$ac_link\"") >&5
+if { (eval echo "$as_me:14535: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:14430: \$? = $ac_status" >&5
+  echo "$as_me:14538: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:14433: \"$ac_try\"") >&5
+  { (eval echo "$as_me:14541: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:14436: \$? = $ac_status" >&5
+  echo "$as_me:14544: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_func_XtAppInitialize=yes
 else
@@ -14443,13 +14551,13 @@ ac_cv_func_XtAppInitialize=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:14446: result: $ac_cv_func_XtAppInitialize" >&5
+echo "$as_me:14554: 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:14452: checking for XtAppInitialize in -lXt" >&5
+       echo "$as_me:14560: 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
@@ -14457,7 +14565,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 14460 "configure"
+#line 14568 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -14476,16 +14584,16 @@ XtAppInitialize ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:14479: \"$ac_link\"") >&5
+if { (eval echo "$as_me:14587: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:14482: \$? = $ac_status" >&5
+  echo "$as_me:14590: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:14485: \"$ac_try\"") >&5
+  { (eval echo "$as_me:14593: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:14488: \$? = $ac_status" >&5
+  echo "$as_me:14596: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_Xt_XtAppInitialize=yes
 else
@@ -14496,7 +14604,7 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:14499: result: $ac_cv_lib_Xt_XtAppInitialize" >&5
+echo "$as_me:14607: 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
 
@@ -14513,7 +14621,7 @@ fi
 fi
 
 if test $cf_have_X_LIBS = no ; then
-       { echo "$as_me:14516: WARNING: Unable to successfully link X Toolkit library (-lXt) with
+       { echo "$as_me:14624: 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
        test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
        CPPFLAGS="${CPPFLAGS}-I$cf_path/include"
 
-                       echo "$as_me:14542: checking for $cf_test in $cf_path" >&5
+                       echo "$as_me:14650: 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:14545: checking for $cf_test" >&5
+                       echo "$as_me:14653: checking for $cf_test" >&5
 echo $ECHO_N "checking for $cf_test... $ECHO_C" >&6
                fi
                cat >conftest.$ac_ext <<_ACEOF
-#line 14549 "configure"
+#line 14657 "configure"
 #include "confdefs.h"
 
 #include <X11/Intrinsic.h>
@@ -14560,16 +14668,16 @@ main (void)
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:14563: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:14671: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:14566: \$? = $ac_status" >&5
+  echo "$as_me:14674: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:14569: \"$ac_try\"") >&5
+  { (eval echo "$as_me:14677: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:14572: \$? = $ac_status" >&5
+  echo "$as_me:14680: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_result=yes
 else
@@ -14578,7 +14686,7 @@ cat conftest.$ac_ext >&5
 cf_result=no
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
-               echo "$as_me:14581: result: $cf_result" >&5
+               echo "$as_me:14689: result: $cf_result" >&5
 echo "${ECHO_T}$cf_result" >&6
                if test "$cf_result" = yes ; then
                        cf_x_athena_inc=$cf_path
@@ -14590,7 +14698,7 @@ echo "${ECHO_T}$cf_result" >&6
 done
 
 if test -z "$cf_x_athena_inc" ; then
-       { echo "$as_me:14593: WARNING: Unable to successfully find Athena header files with test program" >&5
+       { echo "$as_me:14701: 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
 
                        cf_test=XawSimpleMenuAddGlobalActions
                        if test $cf_path != default ; then
 
-cf_add_libs="-L$cf_path/lib $cf_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_libs="$LIBS"
+# reverse order
+cf_add_0lib=
+for cf_add_1lib in -L$cf_path/lib $cf_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
+# filter duplicates
+for cf_add_1lib in $cf_add_0lib; 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"
+       test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
 done
 LIBS="$cf_add_libs"
 
-                               echo "$as_me:14642: checking for $cf_libs in $cf_path" >&5
+                               echo "$as_me:14750: checking for $cf_libs in $cf_path" >&5
 echo $ECHO_N "checking for $cf_libs in $cf_path... $ECHO_C" >&6
                        else
 
-cf_add_libs="$cf_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_libs="$LIBS"
+# reverse order
+cf_add_0lib=
+for cf_add_1lib in $cf_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
+# filter duplicates
+for cf_add_1lib in $cf_add_0lib; 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"
+       test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
 done
 LIBS="$cf_add_libs"
 
-                               echo "$as_me:14662: checking for $cf_test in $cf_libs" >&5
+                               echo "$as_me:14770: 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 14666 "configure"
+#line 14774 "configure"
 #include "confdefs.h"
 
 #include <X11/Intrinsic.h>
@@ -14679,16 +14787,16 @@ $cf_test((XtAppContext) 0)
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:14682: \"$ac_link\"") >&5
+if { (eval echo "$as_me:14790: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:14685: \$? = $ac_status" >&5
+  echo "$as_me:14793: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:14688: \"$ac_try\"") >&5
+  { (eval echo "$as_me:14796: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:14691: \$? = $ac_status" >&5
+  echo "$as_me:14799: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_result=yes
 else
@@ -14697,7 +14805,7 @@ cat conftest.$ac_ext >&5
 cf_result=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-                       echo "$as_me:14700: result: $cf_result" >&5
+                       echo "$as_me:14808: result: $cf_result" >&5
 echo "${ECHO_T}$cf_result" >&6
                        if test "$cf_result" = yes ; then
                                cf_x_athena_lib="$cf_libs"
@@ -14711,7 +14819,7 @@ echo "${ECHO_T}$cf_result" >&6
 done
 
 if test -z "$cf_x_athena_lib" ; then
-       { { echo "$as_me:14714: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&5
+       { { echo "$as_me:14822: 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
@@ -14729,7 +14837,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:14732: checking for $ac_word" >&5
+echo "$as_me:14840: 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
@@ -14744,7 +14852,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:14747: found $ac_dir/$ac_word" >&5
+echo "$as_me:14855: 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:14755: result: $XCURSES_CONFIG" >&5
+  echo "$as_me:14863: result: $XCURSES_CONFIG" >&5
 echo "${ECHO_T}$XCURSES_CONFIG" >&6
 else
-  echo "$as_me:14758: result: no" >&5
+  echo "$as_me:14866: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -14768,7 +14876,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:14771: checking for $ac_word" >&5
+echo "$as_me:14879: 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
@@ -14783,7 +14891,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:14786: found $ac_dir/$ac_word" >&5
+echo "$as_me:14894: 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:14794: result: $ac_ct_XCURSES_CONFIG" >&5
+  echo "$as_me:14902: result: $ac_ct_XCURSES_CONFIG" >&5
 echo "${ECHO_T}$ac_ct_XCURSES_CONFIG" >&6
 else
-  echo "$as_me:14797: result: no" >&5
+  echo "$as_me:14905: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -14905,19 +15013,19 @@ if test -n "$cf_new_extra_cppflags" ; then
 
 fi
 
-cf_add_libs="`$XCURSES_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_libs="$LIBS"
+# reverse order
+cf_add_0lib=
+for cf_add_1lib in `$XCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
+# filter duplicates
+for cf_add_1lib in $cf_add_0lib; 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"
+       test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
 done
 LIBS="$cf_add_libs"
 
@@ -14929,7 +15037,7 @@ LDFLAGS="$LDFLAGS $X_LIBS"
 
 test -n "$verbose" && echo "   checking additions to CFLAGS" 1>&6
 
-echo "${as_me:-configure}:14932: testing checking additions to CFLAGS ..." 1>&5
+echo "${as_me:-configure}:15040: testing checking additions to CFLAGS ..." 1>&5
 
 cf_check_cflags="$CFLAGS"
 cf_check_cppflags="$CPPFLAGS"
@@ -15014,7 +15122,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}:15017: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
+echo "${as_me:-configure}:15125: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
 
        test -n "$CFLAGS" && CFLAGS="$CFLAGS "
        CFLAGS="${CFLAGS}$cf_new_cflags"
@@ -15024,7 +15132,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}:15027: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
+echo "${as_me:-configure}:15135: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
 
        test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
        CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
@@ -15034,7 +15142,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}:15037: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
+echo "${as_me:-configure}:15145: 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"
@@ -15043,7 +15151,7 @@ fi
 
 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
 cat >conftest.$ac_ext <<_ACEOF
-#line 15046 "configure"
+#line 15154 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 int
@@ -15055,16 +15163,16 @@ printf("Hello world");
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:15058: \"$ac_link\"") >&5
+if { (eval echo "$as_me:15166: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:15061: \$? = $ac_status" >&5
+  echo "$as_me:15169: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:15064: \"$ac_try\"") >&5
+  { (eval echo "$as_me:15172: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:15067: \$? = $ac_status" >&5
+  echo "$as_me:15175: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   :
 else
@@ -15072,12 +15180,12 @@ else
 cat conftest.$ac_ext >&5
 test -n "$verbose" && echo "   test-compile failed.  Undoing change to \$CFLAGS" 1>&6
 
-echo "${as_me:-configure}:15075: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
+echo "${as_me:-configure}:15183: 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}:15080: testing but keeping change to \$CPPFLAGS ..." 1>&5
+echo "${as_me:-configure}:15188: testing but keeping change to \$CPPFLAGS ..." 1>&5
 
         fi
         CFLAGS="$cf_check_flags"
@@ -15085,7 +15193,7 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
 
-echo "$as_me:15088: checking for XOpenDisplay in -lX11" >&5
+echo "$as_me:15196: 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
@@ -15093,7 +15201,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 15096 "configure"
+#line 15204 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -15112,16 +15220,16 @@ XOpenDisplay ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:15115: \"$ac_link\"") >&5
+if { (eval echo "$as_me:15223: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:15118: \$? = $ac_status" >&5
+  echo "$as_me:15226: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:15121: \"$ac_try\"") >&5
+  { (eval echo "$as_me:15229: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:15124: \$? = $ac_status" >&5
+  echo "$as_me:15232: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_X11_XOpenDisplay=yes
 else
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:15135: result: $ac_cv_lib_X11_XOpenDisplay" >&5
+echo "$as_me:15243: 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
 
-cf_add_libs="-lX11"
-# 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_libs="$LIBS"
+# reverse order
+cf_add_0lib=
+for cf_add_1lib in -lX11; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
+# filter duplicates
+for cf_add_1lib in $cf_add_0lib; 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"
+       test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
 done
 LIBS="$cf_add_libs"
 
 fi
 
-echo "$as_me:15157: checking for XCurses library" >&5
+echo "$as_me:15265: 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
 else
 
-cf_add_libs="-lXCurses"
-# 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_libs="$LIBS"
+# reverse order
+cf_add_0lib=
+for cf_add_1lib in -lXCurses; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
+# filter duplicates
+for cf_add_1lib in $cf_add_0lib; 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"
+       test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
 done
 LIBS="$cf_add_libs"
 
 cat >conftest.$ac_ext <<_ACEOF
-#line 15180 "configure"
+#line 15288 "configure"
 #include "confdefs.h"
 
 #include <xcurses.h>
@@ -15192,16 +15300,16 @@ XCursesExit();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:15195: \"$ac_link\"") >&5
+if { (eval echo "$as_me:15303: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:15198: \$? = $ac_status" >&5
+  echo "$as_me:15306: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:15201: \"$ac_try\"") >&5
+  { (eval echo "$as_me:15309: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:15204: \$? = $ac_status" >&5
+  echo "$as_me:15312: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_lib_XCurses=yes
 else
@@ -15212,7 +15320,7 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 
 fi
-echo "$as_me:15215: result: $cf_cv_lib_XCurses" >&5
+echo "$as_me:15323: result: $cf_cv_lib_XCurses" >&5
 echo "${ECHO_T}$cf_cv_lib_XCurses" >&6
 
 fi
@@ -15227,23 +15335,23 @@ cat >>confdefs.h <<\EOF
 #define XCURSES 1
 EOF
 
-       echo "$as_me:15230: checking for xcurses.h" >&5
+       echo "$as_me:15338: 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 15236 "configure"
+#line 15344 "configure"
 #include "confdefs.h"
 #include <xcurses.h>
 _ACEOF
-if { (eval echo "$as_me:15240: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:15348: \"$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:15246: \$? = $ac_status" >&5
+  echo "$as_me:15354: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
@@ -15262,7 +15370,7 @@ else
 fi
 rm -f conftest.err conftest.$ac_ext
 fi
-echo "$as_me:15265: result: $ac_cv_header_xcurses_h" >&5
+echo "$as_me:15373: 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
 
@@ -15273,14 +15381,14 @@ EOF
 fi
 
 else
-       { { echo "$as_me:15276: error: Cannot link with XCurses" >&5
+       { { echo "$as_me:15384: error: Cannot link with XCurses" >&5
 echo "$as_me: error: Cannot link with XCurses" >&2;}
    { (exit 1); exit 1; }; }
 fi
 
        ;;
 (*)
-       { { echo "$as_me:15283: error: unexpected screen-value: $cf_cv_screen" >&5
+       { { echo "$as_me:15391: error: unexpected screen-value: $cf_cv_screen" >&5
 echo "$as_me: error: unexpected screen-value: $cf_cv_screen" >&2;}
    { (exit 1); exit 1; }; }
        ;;
@@ -15288,7 +15396,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:15291: checking for _nc_init_pthreads in -l$cf_nculib_root" >&5
+echo "$as_me:15399: 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
@@ -15296,7 +15404,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-l$cf_nculib_root  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 15299 "configure"
+#line 15407 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -15315,16 +15423,16 @@ _nc_init_pthreads ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:15318: \"$ac_link\"") >&5
+if { (eval echo "$as_me:15426: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:15321: \$? = $ac_status" >&5
+  echo "$as_me:15429: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:15324: \"$ac_try\"") >&5
+  { (eval echo "$as_me:15432: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:15327: \$? = $ac_status" >&5
+  echo "$as_me:15435: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   eval "$as_ac_Lib=yes"
 else
@@ -15335,7 +15443,7 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:15338: result: `eval echo '${'$as_ac_Lib'}'`" >&5
+echo "$as_me:15446: 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
 if test "$cf_cv_ncurses_pthreads" = yes
 then
 
-cf_add_libs="-lpthread"
-# 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_libs="$LIBS"
+# reverse order
+cf_add_0lib=
+for cf_add_1lib in -lpthread; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
+# filter duplicates
+for cf_add_1lib in $cf_add_0lib; 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"
+       test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
 done
 LIBS="$cf_add_libs"
 
@@ -15370,7 +15478,7 @@ case $cf_cv_screen in
        ;;
 esac
 
-echo "$as_me:15373: checking for X11 rgb file" >&5
+echo "$as_me:15481: checking for X11 rgb file" >&5
 echo $ECHO_N "checking for X11 rgb file... $ECHO_C" >&6
 
 # Check whether --with-x11-rgb or --without-x11-rgb was given.
@@ -15434,7 +15542,7 @@ case ".$cf_path" in
        cf_path=`echo $cf_path | sed -e s%NONE%$cf_path_syntax%`
        ;;
 (*)
-       { { echo "$as_me:15437: error: expected a pathname, not \"$cf_path\"" >&5
+       { { echo "$as_me:15545: error: expected a pathname, not \"$cf_path\"" >&5
 echo "$as_me: error: expected a pathname, not \"$cf_path\"" >&2;}
    { (exit 1); exit 1; }; }
        ;;
@@ -15442,7 +15550,7 @@ esac
 
 fi
 
-echo "$as_me:15445: result: $RGB_PATH" >&5
+echo "$as_me:15553: result: $RGB_PATH" >&5
 echo "${ECHO_T}$RGB_PATH" >&6
 
 cat >>confdefs.h <<EOF
@@ -15483,7 +15591,7 @@ case $cf_cv_screen in
        ;;
 esac
 
-echo "$as_me:15486: checking if you want to check for panel functions" >&5
+echo "$as_me:15594: 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.
@@ -15500,7 +15608,7 @@ else
        cf_enable_panel=$cf_default_panel
 
 fi;
-echo "$as_me:15503: result: $cf_enable_panel" >&5
+echo "$as_me:15611: result: $cf_enable_panel" >&5
 echo "${ECHO_T}$cf_enable_panel" >&6
 if test $cf_enable_panel = yes
 then
@@ -15511,13 +15619,13 @@ cf_have_curses_lib=no
 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
        :
 elif test "x${PKG_CONFIG:=none}" != xnone; then
-       echo "$as_me:15514: checking pkg-config for panel$cf_cv_libtype" >&5
+       echo "$as_me:15622: 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:15517: result: yes" >&5
+               echo "$as_me:15625: result: yes" >&5
 echo "${ECHO_T}yes" >&6
 
-               echo "$as_me:15520: checking if the panel$cf_cv_libtype package files work" >&5
+               echo "$as_me:15628: 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"
@@ -15621,24 +15729,24 @@ if test -n "$cf_new_extra_cppflags" ; then
 
 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_libs="$LIBS"
+# reverse order
+cf_add_0lib=
+for cf_add_1lib in `$PKG_CONFIG --libs panel$cf_cv_libtype`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
+# filter duplicates
+for cf_add_1lib in $cf_add_0lib; 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"
+       test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
 done
 LIBS="$cf_add_libs"
 
                cat >conftest.$ac_ext <<_ACEOF
-#line 15641 "configure"
+#line 15749 "configure"
 #include "confdefs.h"
 #include <panel.h>
 int
@@ -15650,37 +15758,37 @@ main (void)
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:15653: \"$ac_link\"") >&5
+if { (eval echo "$as_me:15761: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:15656: \$? = $ac_status" >&5
+  echo "$as_me:15764: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:15659: \"$ac_try\"") >&5
+  { (eval echo "$as_me:15767: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:15662: \$? = $ac_status" >&5
+  echo "$as_me:15770: \$? = $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 15668 "configure"
+#line 15776 "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:15675: \"$ac_link\"") >&5
+if { (eval echo "$as_me:15783: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:15678: \$? = $ac_status" >&5
+  echo "$as_me:15786: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:15680: \"$ac_try\"") >&5
+  { (eval echo "$as_me:15788: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:15683: \$? = $ac_status" >&5
+  echo "$as_me:15791: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_have_curses_lib=yes
 else
@@ -15697,7 +15805,7 @@ 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:15700: result: $cf_have_curses_lib" >&5
+               echo "$as_me:15808: 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"
@@ -15717,7 +15825,7 @@ EOF
 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:15720: checking for new_panel in -lpanel$cf_cv_libtype" >&5
+echo "$as_me:15828: 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
@@ -15725,7 +15833,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lpanel$cf_cv_libtype  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 15728 "configure"
+#line 15836 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -15744,16 +15852,16 @@ new_panel ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:15747: \"$ac_link\"") >&5
+if { (eval echo "$as_me:15855: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:15750: \$? = $ac_status" >&5
+  echo "$as_me:15858: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:15753: \"$ac_try\"") >&5
+  { (eval echo "$as_me:15861: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:15756: \$? = $ac_status" >&5
+  echo "$as_me:15864: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   eval "$as_ac_Lib=yes"
 else
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:15767: result: `eval echo '${'$as_ac_Lib'}'`" >&5
+echo "$as_me:15875: 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_upper=`echo "have_libpanel" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
 
-cf_add_libs="-lpanel$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_libs="$LIBS"
+# reverse order
+cf_add_0lib=
+for cf_add_1lib in -lpanel$cf_cv_libtype; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
+# filter duplicates
+for cf_add_1lib in $cf_add_0lib; 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"
+       test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
 done
 LIBS="$cf_add_libs"
 
@@ -15797,7 +15905,7 @@ fi
        cf_curses_headers="$cf_curses_headers panel.h"
 fi
 
-echo "$as_me:15800: checking if you want to check for menu functions" >&5
+echo "$as_me:15908: 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.
@@ -15814,7 +15922,7 @@ else
        cf_enable_menu=$cf_default_menu
 
 fi;
-echo "$as_me:15817: result: $cf_enable_menu" >&5
+echo "$as_me:15925: result: $cf_enable_menu" >&5
 echo "${ECHO_T}$cf_enable_menu" >&6
 if test $cf_enable_menu = yes
 then
@@ -15823,14 +15931,14 @@ then
                ;;
        (curses*)
 
-echo "$as_me:15826: checking for NetBSD menu.h" >&5
+echo "$as_me:15934: 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 15833 "configure"
+#line 15941 "configure"
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header:-curses.h}>
@@ -15848,16 +15956,16 @@ main (void)
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:15851: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:15959: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:15854: \$? = $ac_status" >&5
+  echo "$as_me:15962: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:15857: \"$ac_try\"") >&5
+  { (eval echo "$as_me:15965: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:15860: \$? = $ac_status" >&5
+  echo "$as_me:15968: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_netbsd_menu_h=yes
 
@@ -15869,7 +15977,7 @@ fi
 rm -f conftest.$ac_objext conftest.$ac_ext
 
 fi
-echo "$as_me:15872: result: $cf_cv_netbsd_menu_h" >&5
+echo "$as_me:15980: result: $cf_cv_netbsd_menu_h" >&5
 echo "${ECHO_T}$cf_cv_netbsd_menu_h" >&6
 
 test "$cf_cv_netbsd_menu_h" = yes &&
@@ -15886,13 +15994,13 @@ cf_have_curses_lib=no
 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
        :
 elif test "x${PKG_CONFIG:=none}" != xnone; then
-       echo "$as_me:15889: checking pkg-config for menu$cf_cv_libtype" >&5
+       echo "$as_me:15997: 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:15892: result: yes" >&5
+               echo "$as_me:16000: result: yes" >&5
 echo "${ECHO_T}yes" >&6
 
-               echo "$as_me:15895: checking if the menu$cf_cv_libtype package files work" >&5
+               echo "$as_me:16003: 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"
@@ -15996,24 +16104,24 @@ if test -n "$cf_new_extra_cppflags" ; then
 
 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_libs="$LIBS"
+# reverse order
+cf_add_0lib=
+for cf_add_1lib in `$PKG_CONFIG --libs menu$cf_cv_libtype`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
+# filter duplicates
+for cf_add_1lib in $cf_add_0lib; 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"
+       test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
 done
 LIBS="$cf_add_libs"
 
                cat >conftest.$ac_ext <<_ACEOF
-#line 16016 "configure"
+#line 16124 "configure"
 #include "confdefs.h"
 #include <menu.h>
 int
@@ -16025,37 +16133,37 @@ main (void)
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:16028: \"$ac_link\"") >&5
+if { (eval echo "$as_me:16136: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:16031: \$? = $ac_status" >&5
+  echo "$as_me:16139: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:16034: \"$ac_try\"") >&5
+  { (eval echo "$as_me:16142: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:16037: \$? = $ac_status" >&5
+  echo "$as_me:16145: \$? = $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 16043 "configure"
+#line 16151 "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:16050: \"$ac_link\"") >&5
+if { (eval echo "$as_me:16158: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:16053: \$? = $ac_status" >&5
+  echo "$as_me:16161: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:16055: \"$ac_try\"") >&5
+  { (eval echo "$as_me:16163: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:16058: \$? = $ac_status" >&5
+  echo "$as_me:16166: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_have_curses_lib=yes
 else
@@ -16072,7 +16180,7 @@ 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:16075: result: $cf_have_curses_lib" >&5
+               echo "$as_me:16183: 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"
@@ -16092,7 +16200,7 @@ EOF
 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:16095: checking for menu_driver in -lmenu$cf_cv_libtype" >&5
+echo "$as_me:16203: 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
@@ -16100,7 +16208,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lmenu$cf_cv_libtype  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 16103 "configure"
+#line 16211 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -16119,16 +16227,16 @@ menu_driver ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:16122: \"$ac_link\"") >&5
+if { (eval echo "$as_me:16230: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:16125: \$? = $ac_status" >&5
+  echo "$as_me:16233: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:16128: \"$ac_try\"") >&5
+  { (eval echo "$as_me:16236: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:16131: \$? = $ac_status" >&5
+  echo "$as_me:16239: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   eval "$as_ac_Lib=yes"
 else
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:16142: result: `eval echo '${'$as_ac_Lib'}'`" >&5
+echo "$as_me:16250: 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_upper=`echo "have_libmenu" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
 
-cf_add_libs="-lmenu$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_libs="$LIBS"
+# reverse order
+cf_add_0lib=
+for cf_add_1lib in -lmenu$cf_cv_libtype; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
+# filter duplicates
+for cf_add_1lib in $cf_add_0lib; 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"
+       test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
 done
 LIBS="$cf_add_libs"
 
@@ -16172,7 +16280,7 @@ fi
        cf_curses_headers="$cf_curses_headers menu.h"
 fi
 
-echo "$as_me:16175: checking if you want to check for form functions" >&5
+echo "$as_me:16283: 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.
@@ -16189,7 +16297,7 @@ else
        cf_enable_form=$cf_default_form
 
 fi;
-echo "$as_me:16192: result: $cf_enable_form" >&5
+echo "$as_me:16300: result: $cf_enable_form" >&5
 echo "${ECHO_T}$cf_enable_form" >&6
 if test $cf_enable_form = yes
 then
@@ -16198,14 +16306,14 @@ then
                ;;
        (curses*)
 
-echo "$as_me:16201: checking for NetBSD form.h" >&5
+echo "$as_me:16309: 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 16208 "configure"
+#line 16316 "configure"
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header:-curses.h}>
@@ -16224,16 +16332,16 @@ main (void)
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:16227: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:16335: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:16230: \$? = $ac_status" >&5
+  echo "$as_me:16338: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:16233: \"$ac_try\"") >&5
+  { (eval echo "$as_me:16341: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:16236: \$? = $ac_status" >&5
+  echo "$as_me:16344: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_netbsd_form_h=yes
 
@@ -16245,7 +16353,7 @@ fi
 rm -f conftest.$ac_objext conftest.$ac_ext
 
 fi
-echo "$as_me:16248: result: $cf_cv_netbsd_form_h" >&5
+echo "$as_me:16356: result: $cf_cv_netbsd_form_h" >&5
 echo "${ECHO_T}$cf_cv_netbsd_form_h" >&6
 
 test "$cf_cv_netbsd_form_h" = yes &&
@@ -16262,13 +16370,13 @@ cf_have_curses_lib=no
 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
        :
 elif test "x${PKG_CONFIG:=none}" != xnone; then
-       echo "$as_me:16265: checking pkg-config for form$cf_cv_libtype" >&5
+       echo "$as_me:16373: 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:16268: result: yes" >&5
+               echo "$as_me:16376: result: yes" >&5
 echo "${ECHO_T}yes" >&6
 
-               echo "$as_me:16271: checking if the form$cf_cv_libtype package files work" >&5
+               echo "$as_me:16379: 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"
@@ -16372,24 +16480,24 @@ if test -n "$cf_new_extra_cppflags" ; then
 
 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_libs="$LIBS"
+# reverse order
+cf_add_0lib=
+for cf_add_1lib in `$PKG_CONFIG --libs form$cf_cv_libtype`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
+# filter duplicates
+for cf_add_1lib in $cf_add_0lib; 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"
+       test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
 done
 LIBS="$cf_add_libs"
 
                cat >conftest.$ac_ext <<_ACEOF
-#line 16392 "configure"
+#line 16500 "configure"
 #include "confdefs.h"
 #include <form.h>
 int
@@ -16401,37 +16509,37 @@ main (void)
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:16404: \"$ac_link\"") >&5
+if { (eval echo "$as_me:16512: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:16407: \$? = $ac_status" >&5
+  echo "$as_me:16515: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:16410: \"$ac_try\"") >&5
+  { (eval echo "$as_me:16518: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:16413: \$? = $ac_status" >&5
+  echo "$as_me:16521: \$? = $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 16419 "configure"
+#line 16527 "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:16426: \"$ac_link\"") >&5
+if { (eval echo "$as_me:16534: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:16429: \$? = $ac_status" >&5
+  echo "$as_me:16537: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:16431: \"$ac_try\"") >&5
+  { (eval echo "$as_me:16539: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:16434: \$? = $ac_status" >&5
+  echo "$as_me:16542: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_have_curses_lib=yes
 else
@@ -16448,7 +16556,7 @@ 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:16451: result: $cf_have_curses_lib" >&5
+               echo "$as_me:16559: 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"
@@ -16468,7 +16576,7 @@ EOF
 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:16471: checking for form_driver in -lform$cf_cv_libtype" >&5
+echo "$as_me:16579: 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
@@ -16476,7 +16584,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lform$cf_cv_libtype  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 16479 "configure"
+#line 16587 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -16495,16 +16603,16 @@ form_driver ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:16498: \"$ac_link\"") >&5
+if { (eval echo "$as_me:16606: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:16501: \$? = $ac_status" >&5
+  echo "$as_me:16609: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:16504: \"$ac_try\"") >&5
+  { (eval echo "$as_me:16612: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:16507: \$? = $ac_status" >&5
+  echo "$as_me:16615: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   eval "$as_ac_Lib=yes"
 else
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:16518: result: `eval echo '${'$as_ac_Lib'}'`" >&5
+echo "$as_me:16626: 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_upper=`echo "have_libform" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
 
-cf_add_libs="-lform$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_libs="$LIBS"
+# reverse order
+cf_add_0lib=
+for cf_add_1lib in -lform$cf_cv_libtype; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
+# filter duplicates
+for cf_add_1lib in $cf_add_0lib; 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"
+       test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
 done
 LIBS="$cf_add_libs"
 
 for ac_header in $cf_curses_headers
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-echo "$as_me:16556: checking for $ac_header" >&5
+echo "$as_me:16664: 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 16562 "configure"
+#line 16670 "configure"
 #include "confdefs.h"
 #include <$ac_header>
 _ACEOF
-if { (eval echo "$as_me:16566: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:16674: \"$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:16572: \$? = $ac_status" >&5
+  echo "$as_me:16680: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
@@ -16588,7 +16696,7 @@ else
 fi
 rm -f conftest.err conftest.$ac_ext
 fi
-echo "$as_me:16591: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "$as_me:16699: 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
@@ -16598,13 +16706,13 @@ EOF
 fi
 done
 
-echo "$as_me:16601: checking for ANSI C header files" >&5
+echo "$as_me:16709: 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 16607 "configure"
+#line 16715 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -16612,13 +16720,13 @@ else
 #include <float.h>
 
 _ACEOF
-if { (eval echo "$as_me:16615: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:16723: \"$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:16621: \$? = $ac_status" >&5
+  echo "$as_me:16729: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
@@ -16640,7 +16748,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 16643 "configure"
+#line 16751 "configure"
 #include "confdefs.h"
 #include <string.h>
 
@@ -16658,7 +16766,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 16661 "configure"
+#line 16769 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 
@@ -16679,7 +16787,7 @@ if test $ac_cv_header_stdc = yes; then
   :
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 16682 "configure"
+#line 16790 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 #if ((' ' & 0x0FF) == 0x020)
@@ -16705,15 +16813,15 @@ main (void)
 }
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:16708: \"$ac_link\"") >&5
+if { (eval echo "$as_me:16816: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:16711: \$? = $ac_status" >&5
+  echo "$as_me:16819: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:16713: \"$ac_try\"") >&5
+  { (eval echo "$as_me:16821: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:16716: \$? = $ac_status" >&5
+  echo "$as_me:16824: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   :
 else
@@ -16726,7 +16834,7 @@ rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 fi
 fi
-echo "$as_me:16729: result: $ac_cv_header_stdc" >&5
+echo "$as_me:16837: result: $ac_cv_header_stdc" >&5
 echo "${ECHO_T}$ac_cv_header_stdc" >&6
 if test $ac_cv_header_stdc = yes; then
 
@@ -16736,13 +16844,13 @@ EOF
 
 fi
 
-echo "$as_me:16739: checking whether time.h and sys/time.h may both be included" >&5
+echo "$as_me:16847: 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 16745 "configure"
+#line 16853 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/time.h>
@@ -16758,16 +16866,16 @@ return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:16761: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:16869: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:16764: \$? = $ac_status" >&5
+  echo "$as_me:16872: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:16767: \"$ac_try\"") >&5
+  { (eval echo "$as_me:16875: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:16770: \$? = $ac_status" >&5
+  echo "$as_me:16878: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_header_time=yes
 else
@@ -16777,7 +16885,7 @@ ac_cv_header_time=no
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:16780: result: $ac_cv_header_time" >&5
+echo "$as_me:16888: result: $ac_cv_header_time" >&5
 echo "${ECHO_T}$ac_cv_header_time" >&6
 if test $ac_cv_header_time = yes; then
 
@@ -16801,23 +16909,23 @@ unistd.h \
 
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-echo "$as_me:16804: checking for $ac_header" >&5
+echo "$as_me:16912: 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 16810 "configure"
+#line 16918 "configure"
 #include "confdefs.h"
 #include <$ac_header>
 _ACEOF
-if { (eval echo "$as_me:16814: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:16922: \"$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:16820: \$? = $ac_status" >&5
+  echo "$as_me:16928: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
@@ -16836,7 +16944,7 @@ else
 fi
 rm -f conftest.err conftest.$ac_ext
 fi
-echo "$as_me:16839: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "$as_me:16947: 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
@@ -16849,23 +16957,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:16852: checking for $ac_header" >&5
+echo "$as_me:16960: 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 16858 "configure"
+#line 16966 "configure"
 #include "confdefs.h"
 #include <$ac_header>
 _ACEOF
-if { (eval echo "$as_me:16862: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:16970: \"$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:16868: \$? = $ac_status" >&5
+  echo "$as_me:16976: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
@@ -16884,7 +16992,7 @@ else
 fi
 rm -f conftest.err conftest.$ac_ext
 fi
-echo "$as_me:16887: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "$as_me:16995: 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
@@ -16894,7 +17002,7 @@ EOF
 fi
 done
 
-echo "$as_me:16897: checking for header declaring getopt variables" >&5
+echo "$as_me:17005: 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
@@ -16904,7 +17012,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 16907 "configure"
+#line 17015 "configure"
 #include "confdefs.h"
 
 #include <$cf_header>
@@ -16917,16 +17025,16 @@ int x = optind; char *y = optarg
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:16920: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:17028: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:16923: \$? = $ac_status" >&5
+  echo "$as_me:17031: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:16926: \"$ac_try\"") >&5
+  { (eval echo "$as_me:17034: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:16929: \$? = $ac_status" >&5
+  echo "$as_me:17037: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_getopt_header=$cf_header
  break
@@ -16938,7 +17046,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext
 done
 
 fi
-echo "$as_me:16941: result: $cf_cv_getopt_header" >&5
+echo "$as_me:17049: result: $cf_cv_getopt_header" >&5
 echo "${ECHO_T}$cf_cv_getopt_header" >&6
 if test $cf_cv_getopt_header != none ; then
 
@@ -16963,13 +17071,13 @@ tsearch \
 
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:16966: checking for $ac_func" >&5
+echo "$as_me:17074: 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 16972 "configure"
+#line 17080 "configure"
 #include "confdefs.h"
 #define $ac_func autoconf_temporary
 #include <limits.h>    /* least-intrusive standard header which defines gcc2 __stub macros */
@@ -17000,16 +17108,16 @@ main (void)
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:17003: \"$ac_link\"") >&5
+if { (eval echo "$as_me:17111: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:17006: \$? = $ac_status" >&5
+  echo "$as_me:17114: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:17009: \"$ac_try\"") >&5
+  { (eval echo "$as_me:17117: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:17012: \$? = $ac_status" >&5
+  echo "$as_me:17120: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   eval "$as_ac_var=yes"
 else
@@ -17019,7 +17127,7 @@ eval "$as_ac_var=no"
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:17022: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "$as_me:17130: 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
 done
 
 # use a compile-check to work with ncurses*-config and subdirectory includes
-echo "$as_me:17033: checking if we can use termcap.h" >&5
+echo "$as_me:17141: 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 17040 "configure"
+#line 17148 "configure"
 #include "confdefs.h"
 
 #include <curses.h>
@@ -17058,16 +17166,16 @@ return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:17061: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:17169: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:17064: \$? = $ac_status" >&5
+  echo "$as_me:17172: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:17067: \"$ac_try\"") >&5
+  { (eval echo "$as_me:17175: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:17070: \$? = $ac_status" >&5
+  echo "$as_me:17178: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_have_termcap_h=yes
 else
@@ -17077,23 +17185,24 @@ cf_cv_have_termcap_h=no
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:17080: result: $cf_cv_have_termcap_h" >&5
+echo "$as_me:17188: result: $cf_cv_have_termcap_h" >&5
 echo "${ECHO_T}$cf_cv_have_termcap_h" >&6
 if test "x$cf_cv_have_termcap_h" = xyes
 then
-       cat >>confdefs.h <<\EOF
+
+cat >>confdefs.h <<\EOF
 #define HAVE_TERMCAP_H 1
 EOF
 
 else
-echo "$as_me:17089: checking if we can use ncurses/termcap.h" >&5
+echo "$as_me:17198: checking if we can use ncurses/termcap.h" >&5
 echo $ECHO_N "checking if we can use ncurses/termcap.h... $ECHO_C" >&6
 if test "${cf_cv_have_ncurses_termcap_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
        cat >conftest.$ac_ext <<_ACEOF
-#line 17096 "configure"
+#line 17205 "configure"
 #include "confdefs.h"
 
 #include <ncurses/curses.h>
@@ -17114,16 +17223,16 @@ return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:17117: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:17226: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:17120: \$? = $ac_status" >&5
+  echo "$as_me:17229: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:17123: \"$ac_try\"") >&5
+  { (eval echo "$as_me:17232: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:17126: \$? = $ac_status" >&5
+  echo "$as_me:17235: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_have_ncurses_termcap_h=yes
 else
@@ -17133,16 +17242,17 @@ cf_cv_have_ncurses_termcap_h=no
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:17136: result: $cf_cv_have_ncurses_termcap_h" >&5
+echo "$as_me:17245: result: $cf_cv_have_ncurses_termcap_h" >&5
 echo "${ECHO_T}$cf_cv_have_ncurses_termcap_h" >&6
-test "x$cf_cv_have_ncurses_termcap_h" = xyes && cat >>confdefs.h <<\EOF
+test "x$cf_cv_have_ncurses_termcap_h" = xyes &&
+cat >>confdefs.h <<\EOF
 #define HAVE_NCURSES_TERMCAP_H 1
 EOF
 
 fi
 
 if test "x$ac_cv_func_getopt" = xno; then
-       { { echo "$as_me:17145: error: getopt is required for building programs" >&5
+       { { echo "$as_me:17255: error: getopt is required for building programs" >&5
 echo "$as_me: error: getopt is required for building programs" >&2;}
    { (exit 1); exit 1; }; }
 fi
@@ -17161,13 +17271,13 @@ wcstombs \
 
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:17164: checking for $ac_func" >&5
+echo "$as_me:17274: 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 17170 "configure"
+#line 17280 "configure"
 #include "confdefs.h"
 #define $ac_func autoconf_temporary
 #include <limits.h>    /* least-intrusive standard header which defines gcc2 __stub macros */
@@ -17198,16 +17308,16 @@ main (void)
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:17201: \"$ac_link\"") >&5
+if { (eval echo "$as_me:17311: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:17204: \$? = $ac_status" >&5
+  echo "$as_me:17314: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:17207: \"$ac_try\"") >&5
+  { (eval echo "$as_me:17317: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:17210: \$? = $ac_status" >&5
+  echo "$as_me:17320: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   eval "$as_ac_var=yes"
 else
@@ -17217,7 +17327,7 @@ eval "$as_ac_var=no"
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:17220: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "$as_me:17330: 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
@@ -17229,7 +17339,7 @@ done
 
 fi
 
-echo "$as_me:17232: checking definition to turn on extended curses functions" >&5
+echo "$as_me:17342: 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
@@ -17237,7 +17347,7 @@ else
 
 cf_cv_need_xopen_extension=unknown
 cat >conftest.$ac_ext <<_ACEOF
-#line 17240 "configure"
+#line 17350 "configure"
 #include "confdefs.h"
 
 #include <stdlib.h>
@@ -17263,16 +17373,16 @@ main (void)
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:17266: \"$ac_link\"") >&5
+if { (eval echo "$as_me:17376: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:17269: \$? = $ac_status" >&5
+  echo "$as_me:17379: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:17272: \"$ac_try\"") >&5
+  { (eval echo "$as_me:17382: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:17275: \$? = $ac_status" >&5
+  echo "$as_me:17385: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_need_xopen_extension=none
 else
@@ -17282,7 +17392,7 @@ cat conftest.$ac_ext >&5
        for cf_try_xopen_extension in _XOPEN_SOURCE_EXTENDED NCURSES_WIDECHAR
        do
                cat >conftest.$ac_ext <<_ACEOF
-#line 17285 "configure"
+#line 17395 "configure"
 #include "confdefs.h"
 
 #define $cf_try_xopen_extension 1
@@ -17304,16 +17414,16 @@ main (void)
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:17307: \"$ac_link\"") >&5
+if { (eval echo "$as_me:17417: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:17310: \$? = $ac_status" >&5
+  echo "$as_me:17420: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:17313: \"$ac_try\"") >&5
+  { (eval echo "$as_me:17423: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:17316: \$? = $ac_status" >&5
+  echo "$as_me:17426: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_need_xopen_extension=$cf_try_xopen_extension; break
 else
@@ -17327,7 +17437,7 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 
 fi
-echo "$as_me:17330: result: $cf_cv_need_xopen_extension" >&5
+echo "$as_me:17440: result: $cf_cv_need_xopen_extension" >&5
 echo "${ECHO_T}$cf_cv_need_xopen_extension" >&6
 
 case $cf_cv_need_xopen_extension in
@@ -17339,7 +17449,7 @@ case $cf_cv_need_xopen_extension in
        ;;
 esac
 
-echo "$as_me:17342: checking for term.h" >&5
+echo "$as_me:17452: 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
@@ -17360,7 +17470,7 @@ esac
 for cf_header in $cf_header_list
 do
        cat >conftest.$ac_ext <<_ACEOF
-#line 17363 "configure"
+#line 17473 "configure"
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header:-curses.h}>
@@ -17374,16 +17484,16 @@ WINDOW *x
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:17377: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:17487: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:17380: \$? = $ac_status" >&5
+  echo "$as_me:17490: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:17383: \"$ac_try\"") >&5
+  { (eval echo "$as_me:17493: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:17386: \$? = $ac_status" >&5
+  echo "$as_me:17496: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_term_header=$cf_header
         break
@@ -17402,7 +17512,7 @@ case $cf_cv_term_header in
        for cf_header in ncurses/term.h ncursesw/term.h
        do
                cat >conftest.$ac_ext <<_ACEOF
-#line 17405 "configure"
+#line 17515 "configure"
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header:-curses.h}>
@@ -17420,16 +17530,16 @@ WINDOW *x
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:17423: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:17533: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:17426: \$? = $ac_status" >&5
+  echo "$as_me:17536: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:17429: \"$ac_try\"") >&5
+  { (eval echo "$as_me:17539: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:17432: \$? = $ac_status" >&5
+  echo "$as_me:17542: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_term_header=$cf_header
                         break
@@ -17444,7 +17554,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext
 esac
 
 fi
-echo "$as_me:17447: result: $cf_cv_term_header" >&5
+echo "$as_me:17557: result: $cf_cv_term_header" >&5
 echo "${ECHO_T}$cf_cv_term_header" >&6
 
 case $cf_cv_term_header in
@@ -17471,7 +17581,7 @@ EOF
        ;;
 esac
 
-echo "$as_me:17474: checking for unctrl.h" >&5
+echo "$as_me:17584: 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
@@ -17492,7 +17602,7 @@ esac
 for cf_header in $cf_header_list
 do
        cat >conftest.$ac_ext <<_ACEOF
-#line 17495 "configure"
+#line 17605 "configure"
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header:-curses.h}>
@@ -17506,16 +17616,16 @@ WINDOW *x
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:17509: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:17619: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:17512: \$? = $ac_status" >&5
+  echo "$as_me:17622: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:17515: \"$ac_try\"") >&5
+  { (eval echo "$as_me:17625: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:17518: \$? = $ac_status" >&5
+  echo "$as_me:17628: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_unctrl_header=$cf_header
         break
@@ -17528,12 +17638,12 @@ rm -f conftest.$ac_objext conftest.$ac_ext
 done
 
 fi
-echo "$as_me:17531: result: $cf_cv_unctrl_header" >&5
+echo "$as_me:17641: result: $cf_cv_unctrl_header" >&5
 echo "${ECHO_T}$cf_cv_unctrl_header" >&6
 
 case $cf_cv_unctrl_header in
 (no)
-       { echo "$as_me:17536: WARNING: unctrl.h header not found" >&5
+       { echo "$as_me:17646: WARNING: unctrl.h header not found" >&5
 echo "$as_me: WARNING: unctrl.h header not found" >&2;}
        ;;
 esac
 
 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
 
-       echo "$as_me:17625: checking for ${cf_func}" >&5
+       echo "$as_me:17735: checking for ${cf_func}" >&5
 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
 
-echo "${as_me:-configure}:17628: testing ${cf_func} ..." 1>&5
+echo "${as_me:-configure}:17738: testing ${cf_func} ..." 1>&5
 
        if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -17634,7 +17744,7 @@ else
                eval cf_result='$ac_cv_func_'$cf_func
                if test ".$cf_result" != ".no"; then
                        cat >conftest.$ac_ext <<_ACEOF
-#line 17637 "configure"
+#line 17747 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_XCURSES
@@ -17667,16 +17777,16 @@ if (foo + 1234L > 5678L)
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:17670: \"$ac_link\"") >&5
+if { (eval echo "$as_me:17780: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:17673: \$? = $ac_status" >&5
+  echo "$as_me:17783: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:17676: \"$ac_try\"") >&5
+  { (eval echo "$as_me:17786: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:17679: \$? = $ac_status" >&5
+  echo "$as_me:17789: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_result=yes
 else
@@ -17692,7 +17802,7 @@ fi
 
        # use the computed/retrieved cache-value:
        eval 'cf_result=$cf_cv_func_'$cf_func
-       echo "$as_me:17695: result: $cf_result" >&5
+       echo "$as_me:17805: 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:17710: checking for ${cf_func}" >&5
+       echo "$as_me:17820: checking for ${cf_func}" >&5
 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
 
-echo "${as_me:-configure}:17713: testing ${cf_func} ..." 1>&5
+echo "${as_me:-configure}:17823: testing ${cf_func} ..." 1>&5
 
        if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -17719,7 +17829,7 @@ else
                eval cf_result='$ac_cv_func_'$cf_func
                if test ".$cf_result" != ".no"; then
                        cat >conftest.$ac_ext <<_ACEOF
-#line 17722 "configure"
+#line 17832 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_XCURSES
@@ -17752,16 +17862,16 @@ if (foo + 1234L > 5678L)
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:17755: \"$ac_link\"") >&5
+if { (eval echo "$as_me:17865: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:17758: \$? = $ac_status" >&5
+  echo "$as_me:17868: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:17761: \"$ac_try\"") >&5
+  { (eval echo "$as_me:17871: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:17764: \$? = $ac_status" >&5
+  echo "$as_me:17874: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_result=yes
 else
@@ -17777,7 +17887,7 @@ fi
 
        # use the computed/retrieved cache-value:
        eval 'cf_result=$cf_cv_func_'$cf_func
-       echo "$as_me:17780: result: $cf_result" >&5
+       echo "$as_me:17890: result: $cf_result" >&5
 echo "${ECHO_T}$cf_result" >&6
        if test $cf_result != no; then
                cat >>confdefs.h <<EOF
@@ -17801,7 +17911,7 @@ then
                                cf_return="return value"
                        fi
                        cat >conftest.$ac_ext <<_ACEOF
-#line 17804 "configure"
+#line 17914 "configure"
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header:-curses.h}>
@@ -17821,21 +17931,21 @@ main (void)
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:17824: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:17934: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:17827: \$? = $ac_status" >&5
+  echo "$as_me:17937: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:17830: \"$ac_try\"") >&5
+  { (eval echo "$as_me:17940: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:17833: \$? = $ac_status" >&5
+  echo "$as_me:17943: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
                test -n "$verbose" && echo "    prototype $cf_ret func($cf_arg value)" 1>&6
 
-echo "${as_me:-configure}:17838: testing prototype $cf_ret func($cf_arg value) ..." 1>&5
+echo "${as_me:-configure}:17948: testing prototype $cf_ret func($cf_arg value) ..." 1>&5
 
                cat >>confdefs.h <<EOF
 #define TPUTS_ARG               $cf_arg
@@ -17855,14 +17965,14 @@ rm -f conftest.$ac_objext conftest.$ac_ext
        done
 fi
 
-echo "$as_me:17858: checking for ncurses extended functions" >&5
+echo "$as_me:17968: 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 17865 "configure"
+#line 17975 "configure"
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header:-curses.h}>
@@ -17877,16 +17987,16 @@ int x = NCURSES_EXT_FUNCS
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:17880: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:17990: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:17883: \$? = $ac_status" >&5
+  echo "$as_me:17993: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:17886: \"$ac_try\"") >&5
+  { (eval echo "$as_me:17996: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:17889: \$? = $ac_status" >&5
+  echo "$as_me:17999: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_ncurses_ext_funcs=defined
 else
@@ -17894,7 +18004,7 @@ else
 cat conftest.$ac_ext >&5
 
 cat >conftest.$ac_ext <<_ACEOF
-#line 17897 "configure"
+#line 18007 "configure"
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header:-curses.h}>
@@ -17919,16 +18029,16 @@ main (void)
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:17922: \"$ac_link\"") >&5
+if { (eval echo "$as_me:18032: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:17925: \$? = $ac_status" >&5
+  echo "$as_me:18035: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:17928: \"$ac_try\"") >&5
+  { (eval echo "$as_me:18038: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:17931: \$? = $ac_status" >&5
+  echo "$as_me:18041: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_ncurses_ext_funcs=yes
 else
@@ -17942,7 +18052,7 @@ fi
 rm -f conftest.$ac_objext conftest.$ac_ext
 
 fi
-echo "$as_me:17945: result: $cf_cv_ncurses_ext_funcs" >&5
+echo "$as_me:18055: 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
@@ -17956,11 +18066,11 @@ then
        if test -n "$cf_cv_ncurses_version" && test "x$cf_cv_ncurses_version" != xno
        then
                cf_define_xpg5=no
-               echo "$as_me:17959: checking if _XPG5 should be defined to enable wide-characters" >&5
+               echo "$as_me:18069: 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 17963 "configure"
+#line 18073 "configure"
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header:-curses.h}>
@@ -17973,16 +18083,16 @@ int x = _XPG5
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:17976: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:18086: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:17979: \$? = $ac_status" >&5
+  echo "$as_me:18089: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:17982: \"$ac_try\"") >&5
+  { (eval echo "$as_me:18092: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:17985: \$? = $ac_status" >&5
+  echo "$as_me:18095: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   :
 else
@@ -17991,7 +18101,7 @@ cat conftest.$ac_ext >&5
 cf_save_cppflags="$CPPFLAGS"
                         CPPFLAGS="$CPPFLAGS -D_XPG5"
                         cat >conftest.$ac_ext <<_ACEOF
-#line 17994 "configure"
+#line 18104 "configure"
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header:-curses.h}>
@@ -18004,16 +18114,16 @@ int x = _XPG5
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:18007: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:18117: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:18010: \$? = $ac_status" >&5
+  echo "$as_me:18120: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:18013: \"$ac_try\"") >&5
+  { (eval echo "$as_me:18123: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:18016: \$? = $ac_status" >&5
+  echo "$as_me:18126: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_define_xpg5=yes
 else
@@ -18024,7 +18134,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:18027: result: $cf_define_xpg5" >&5
+               echo "$as_me:18137: result: $cf_define_xpg5" >&5
 echo "${ECHO_T}$cf_define_xpg5" >&6
 
                if test "$cf_define_xpg5" = yes
@@ -18033,14 +18143,14 @@ echo "${ECHO_T}$cf_define_xpg5" >&6
                fi
        fi
 
-       echo "$as_me:18036: checking for wide-character functions" >&5
+       echo "$as_me:18146: 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 18043 "configure"
+#line 18153 "configure"
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header:-curses.h}>
@@ -18057,16 +18167,16 @@ main (void)
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:18060: \"$ac_link\"") >&5
+if { (eval echo "$as_me:18170: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:18063: \$? = $ac_status" >&5
+  echo "$as_me:18173: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:18066: \"$ac_try\"") >&5
+  { (eval echo "$as_me:18176: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:18069: \$? = $ac_status" >&5
+  echo "$as_me:18179: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_widechar_funcs=yes
 else
@@ -18077,7 +18187,7 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 
 fi
-echo "$as_me:18080: result: $cf_cv_widechar_funcs" >&5
+echo "$as_me:18190: result: $cf_cv_widechar_funcs" >&5
 echo "${ECHO_T}$cf_cv_widechar_funcs" >&6
        if test "$cf_cv_widechar_funcs" != no ; then
 
@@ -18098,14 +18208,14 @@ EOF
 
 fi
 
-echo "$as_me:18101: checking if $cf_cv_screen library uses pthreads" >&5
+echo "$as_me:18211: 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 18108 "configure"
+#line 18218 "configure"
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header:-curses.h}>
@@ -18123,16 +18233,16 @@ main (void)
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:18126: \"$ac_link\"") >&5
+if { (eval echo "$as_me:18236: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:18129: \$? = $ac_status" >&5
+  echo "$as_me:18239: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:18132: \"$ac_try\"") >&5
+  { (eval echo "$as_me:18242: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:18135: \$? = $ac_status" >&5
+  echo "$as_me:18245: \$? = $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:18146: result: $cf_cv_use_pthreads" >&5
+echo "$as_me:18256: result: $cf_cv_use_pthreads" >&5
 echo "${ECHO_T}$cf_cv_use_pthreads" >&6
-test $cf_cv_use_pthreads = yes && cat >>confdefs.h <<\EOF
+test $cf_cv_use_pthreads = yes &&
+cat >>confdefs.h <<\EOF
 #define USE_PTHREADS 1
 EOF
 
-echo "$as_me:18152: checking if sys/time.h works with sys/select.h" >&5
+echo "$as_me:18263: 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 18159 "configure"
+#line 18270 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -18176,16 +18287,16 @@ main (void)
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:18179: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:18290: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:18182: \$? = $ac_status" >&5
+  echo "$as_me:18293: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:18185: \"$ac_try\"") >&5
+  { (eval echo "$as_me:18296: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:18188: \$? = $ac_status" >&5
+  echo "$as_me:18299: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_sys_time_select=yes
 else
@@ -18197,7 +18308,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext
 
 fi
 
-echo "$as_me:18200: result: $cf_cv_sys_time_select" >&5
+echo "$as_me:18311: 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
@@ -18206,7 +18317,7 @@ EOF
 
 # special check for test/ditto.c
 
-echo "$as_me:18209: checking for openpty in -lutil" >&5
+echo "$as_me:18320: 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
@@ -18214,7 +18325,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lutil  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 18217 "configure"
+#line 18328 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -18233,16 +18344,16 @@ openpty ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:18236: \"$ac_link\"") >&5
+if { (eval echo "$as_me:18347: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:18239: \$? = $ac_status" >&5
+  echo "$as_me:18350: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:18242: \"$ac_try\"") >&5
+  { (eval echo "$as_me:18353: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:18245: \$? = $ac_status" >&5
+  echo "$as_me:18356: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_util_openpty=yes
 else
@@ -18253,7 +18364,7 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:18256: result: $ac_cv_lib_util_openpty" >&5
+echo "$as_me:18367: 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
@@ -18261,7 +18372,7 @@ else
   cf_cv_lib_util=no
 fi
 
-echo "$as_me:18264: checking for openpty header" >&5
+echo "$as_me:18375: 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
@@ -18269,26 +18380,26 @@ else
 
        cf_save_LIBS="$LIBS"
        test $cf_cv_lib_util = yes && {
-cf_add_libs="-lutil"
-# 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_libs="$LIBS"
+# reverse order
+cf_add_0lib=
+for cf_add_1lib in -lutil; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
+# filter duplicates
+for cf_add_1lib in $cf_add_0lib; 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"
+       test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
 done
 LIBS="$cf_add_libs"
  }
        for cf_header in pty.h libutil.h util.h
        do
        cat >conftest.$ac_ext <<_ACEOF
-#line 18291 "configure"
+#line 18402 "configure"
 #include "confdefs.h"
 
 #include <$cf_header>
@@ -18305,16 +18416,16 @@ main (void)
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:18308: \"$ac_link\"") >&5
+if { (eval echo "$as_me:18419: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:18311: \$? = $ac_status" >&5
+  echo "$as_me:18422: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:18314: \"$ac_try\"") >&5
+  { (eval echo "$as_me:18425: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:18317: \$? = $ac_status" >&5
+  echo "$as_me:18428: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
                cf_cv_func_openpty=$cf_header
@@ -18332,7 +18443,7 @@ rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
        LIBS="$cf_save_LIBS"
 
 fi
-echo "$as_me:18335: result: $cf_cv_func_openpty" >&5
+echo "$as_me:18446: result: $cf_cv_func_openpty" >&5
 echo "${ECHO_T}$cf_cv_func_openpty" >&6
 
 if test "$cf_cv_func_openpty" != no ; then
@@ -18347,26 +18458,26 @@ EOF
 
        if test "x$cf_cv_lib_util" = xyes ; then
 
-cf_add_libs="-lutil"
-# Filter out duplicates - this happens with badly-designed ".pc" files...
-for cf_add_1lib in $TEST_LIBS
-do
-       for cf_add_2lib in $cf_add_libs
-       do
-               if test "x$cf_add_1lib" = "x$cf_add_2lib"
-               then
+cf_add_libs="$TEST_LIBS"
+# reverse order
+cf_add_0lib=
+for cf_add_1lib in -lutil; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
+# filter duplicates
+for cf_add_1lib in $cf_add_0lib; 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"
+       test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
 done
 TEST_LIBS="$cf_add_libs"
 
        fi
 fi
 
-echo "$as_me:18369: checking for function curses_version" >&5
+echo "$as_me:18480: 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
@@ -18376,7 +18487,7 @@ if test "$cross_compiling" = yes; then
   cf_cv_func_curses_version=unknown
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 18379 "configure"
+#line 18490 "configure"
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header:-curses.h}>
@@ -18389,15 +18500,15 @@ int main(void)
 
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:18392: \"$ac_link\"") >&5
+if { (eval echo "$as_me:18503: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:18395: \$? = $ac_status" >&5
+  echo "$as_me:18506: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:18397: \"$ac_try\"") >&5
+  { (eval echo "$as_me:18508: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:18400: \$? = $ac_status" >&5
+  echo "$as_me:18511: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_func_curses_version=yes
 
@@ -18412,14 +18523,14 @@ rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 rm -f core
 fi
-echo "$as_me:18415: result: $cf_cv_func_curses_version" >&5
+echo "$as_me:18526: 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:18422: checking for alternate character set array" >&5
+echo "$as_me:18533: 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
@@ -18429,7 +18540,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 18432 "configure"
+#line 18543 "configure"
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header:-curses.h}>
@@ -18445,16 +18556,16 @@ $name['k'] = ACS_PLUS
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:18448: \"$ac_link\"") >&5
+if { (eval echo "$as_me:18559: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:18451: \$? = $ac_status" >&5
+  echo "$as_me:18562: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:18454: \"$ac_try\"") >&5
+  { (eval echo "$as_me:18565: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:18457: \$? = $ac_status" >&5
+  echo "$as_me:18568: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_curses_acs_map=$name; break
 else
@@ -18465,7 +18576,7 @@ rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 done
 
 fi
-echo "$as_me:18468: result: $cf_cv_curses_acs_map" >&5
+echo "$as_me:18579: result: $cf_cv_curses_acs_map" >&5
 echo "${ECHO_T}$cf_cv_curses_acs_map" >&6
 
 test "$cf_cv_curses_acs_map" != unknown &&
@@ -18475,7 +18586,7 @@ EOF
 
 if test "$cf_enable_widec" = yes; then
 
-echo "$as_me:18478: checking for wide alternate character set array" >&5
+echo "$as_me:18589: 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
@@ -18485,7 +18596,7 @@ else
        for name in wacs_map _wacs_map __wacs_map _nc_wacs _wacs_char
        do
        cat >conftest.$ac_ext <<_ACEOF
-#line 18488 "configure"
+#line 18599 "configure"
 #include "confdefs.h"
 
 #ifndef _XOPEN_SOURCE_EXTENDED
@@ -18501,16 +18612,16 @@ void *foo = &($name['k'])
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:18504: \"$ac_link\"") >&5
+if { (eval echo "$as_me:18615: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:18507: \$? = $ac_status" >&5
+  echo "$as_me:18618: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:18510: \"$ac_try\"") >&5
+  { (eval echo "$as_me:18621: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:18513: \$? = $ac_status" >&5
+  echo "$as_me:18624: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_curses_wacs_map=$name
         break
@@ -18521,7 +18632,7 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
        done
 fi
-echo "$as_me:18524: result: $cf_cv_curses_wacs_map" >&5
+echo "$as_me:18635: result: $cf_cv_curses_wacs_map" >&5
 echo "${ECHO_T}$cf_cv_curses_wacs_map" >&6
 
 test "$cf_cv_curses_wacs_map" != unknown &&
@@ -18529,7 +18640,7 @@ cat >>confdefs.h <<EOF
 #define CURSES_WACS_ARRAY $cf_cv_curses_wacs_map
 EOF
 
-echo "$as_me:18532: checking for wide alternate character constants" >&5
+echo "$as_me:18643: 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
@@ -18539,7 +18650,7 @@ cf_cv_curses_wacs_symbols=no
 if test "$cf_cv_curses_wacs_map" != unknown
 then
        cat >conftest.$ac_ext <<_ACEOF
-#line 18542 "configure"
+#line 18653 "configure"
 #include "confdefs.h"
 
 #ifndef _XOPEN_SOURCE_EXTENDED
@@ -18556,16 +18667,16 @@ cchar_t *foo = WACS_PLUS;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:18559: \"$ac_link\"") >&5
+if { (eval echo "$as_me:18670: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:18562: \$? = $ac_status" >&5
+  echo "$as_me:18673: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:18565: \"$ac_try\"") >&5
+  { (eval echo "$as_me:18676: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:18568: \$? = $ac_status" >&5
+  echo "$as_me:18679: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_curses_wacs_symbols=yes
 else
@@ -18575,7 +18686,7 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 else
        cat >conftest.$ac_ext <<_ACEOF
-#line 18578 "configure"
+#line 18689 "configure"
 #include "confdefs.h"
 
 #ifndef _XOPEN_SOURCE_EXTENDED
@@ -18591,16 +18702,16 @@ cchar_t *foo = WACS_PLUS
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:18594: \"$ac_link\"") >&5
+if { (eval echo "$as_me:18705: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:18597: \$? = $ac_status" >&5
+  echo "$as_me:18708: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:18600: \"$ac_try\"") >&5
+  { (eval echo "$as_me:18711: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:18603: \$? = $ac_status" >&5
+  echo "$as_me:18714: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_curses_wacs_symbols=yes
 else
@@ -18611,7 +18722,7 @@ rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
 
 fi
-echo "$as_me:18614: result: $cf_cv_curses_wacs_symbols" >&5
+echo "$as_me:18725: result: $cf_cv_curses_wacs_symbols" >&5
 echo "${ECHO_T}$cf_cv_curses_wacs_symbols" >&6
 
 test "$cf_cv_curses_wacs_symbols" != no &&
@@ -18621,10 +18732,10 @@ EOF
 
 fi
 
-echo "$as_me:18624: checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}" >&5
+echo "$as_me:18735: 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 18627 "configure"
+#line 18738 "configure"
 #include "confdefs.h"
 
 #ifndef _XOPEN_SOURCE_EXTENDED
@@ -18642,16 +18753,16 @@ attr_t foo
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:18645: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:18756: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:18648: \$? = $ac_status" >&5
+  echo "$as_me:18759: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:18651: \"$ac_try\"") >&5
+  { (eval echo "$as_me:18762: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:18654: \$? = $ac_status" >&5
+  echo "$as_me:18765: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_result=yes
 else
@@ -18660,7 +18771,7 @@ cat conftest.$ac_ext >&5
 cf_result=no
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:18663: result: $cf_result" >&5
+echo "$as_me:18774: 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:18684: checking if we must include wchar.h to declare mbstate_t" >&5
+echo "$as_me:18795: 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 18691 "configure"
+#line 18802 "configure"
 #include "confdefs.h"
 
 #include <stdlib.h>
@@ -18706,23 +18817,23 @@ mbstate_t state
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:18709: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:18820: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:18712: \$? = $ac_status" >&5
+  echo "$as_me:18823: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:18715: \"$ac_try\"") >&5
+  { (eval echo "$as_me:18826: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:18718: \$? = $ac_status" >&5
+  echo "$as_me:18829: \$? = $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 18725 "configure"
+#line 18836 "configure"
 #include "confdefs.h"
 
 #include <stdlib.h>
@@ -18741,16 +18852,16 @@ mbstate_t value
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:18744: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:18855: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:18747: \$? = $ac_status" >&5
+  echo "$as_me:18858: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:18750: \"$ac_try\"") >&5
+  { (eval echo "$as_me:18861: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:18753: \$? = $ac_status" >&5
+  echo "$as_me:18864: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_mbstate_t=yes
 else
@@ -18762,7 +18873,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:18765: result: $cf_cv_mbstate_t" >&5
+echo "$as_me:18876: result: $cf_cv_mbstate_t" >&5
 echo "${ECHO_T}$cf_cv_mbstate_t" >&6
 
 if test "$cf_cv_mbstate_t" = yes ; then
@@ -18785,14 +18896,14 @@ if test "$cf_cv_mbstate_t" != unknown ; then
 fi
 
 # This is needed on Tru64 5.0 to declare wchar_t
-echo "$as_me:18788: checking if we must include wchar.h to declare wchar_t" >&5
+echo "$as_me:18899: 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 18795 "configure"
+#line 18906 "configure"
 #include "confdefs.h"
 
 #include <stdlib.h>
@@ -18810,23 +18921,23 @@ wchar_t state
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:18813: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:18924: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:18816: \$? = $ac_status" >&5
+  echo "$as_me:18927: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:18819: \"$ac_try\"") >&5
+  { (eval echo "$as_me:18930: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:18822: \$? = $ac_status" >&5
+  echo "$as_me:18933: \$? = $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 18829 "configure"
+#line 18940 "configure"
 #include "confdefs.h"
 
 #include <stdlib.h>
@@ -18845,16 +18956,16 @@ wchar_t value
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:18848: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:18959: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:18851: \$? = $ac_status" >&5
+  echo "$as_me:18962: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:18854: \"$ac_try\"") >&5
+  { (eval echo "$as_me:18965: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:18857: \$? = $ac_status" >&5
+  echo "$as_me:18968: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_wchar_t=yes
 else
@@ -18866,7 +18977,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:18869: result: $cf_cv_wchar_t" >&5
+echo "$as_me:18980: result: $cf_cv_wchar_t" >&5
 echo "${ECHO_T}$cf_cv_wchar_t" >&6
 
 if test "$cf_cv_wchar_t" = yes ; then
@@ -18889,14 +19000,14 @@ if test "$cf_cv_wchar_t" != unknown ; then
 fi
 
 # This is needed on Tru64 5.0 to declare wint_t
-echo "$as_me:18892: checking if we must include wchar.h to declare wint_t" >&5
+echo "$as_me:19003: 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 18899 "configure"
+#line 19010 "configure"
 #include "confdefs.h"
 
 #include <stdlib.h>
@@ -18914,23 +19025,23 @@ wint_t state
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:18917: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:19028: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:18920: \$? = $ac_status" >&5
+  echo "$as_me:19031: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:18923: \"$ac_try\"") >&5
+  { (eval echo "$as_me:19034: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:18926: \$? = $ac_status" >&5
+  echo "$as_me:19037: \$? = $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 18933 "configure"
+#line 19044 "configure"
 #include "confdefs.h"
 
 #include <stdlib.h>
@@ -18949,16 +19060,16 @@ wint_t value
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:18952: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:19063: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:18955: \$? = $ac_status" >&5
+  echo "$as_me:19066: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:18958: \"$ac_try\"") >&5
+  { (eval echo "$as_me:19069: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:18961: \$? = $ac_status" >&5
+  echo "$as_me:19072: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_wint_t=yes
 else
@@ -18970,7 +19081,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:18973: result: $cf_cv_wint_t" >&5
+echo "$as_me:19084: result: $cf_cv_wint_t" >&5
 echo "${ECHO_T}$cf_cv_wint_t" >&6
 
 if test "$cf_cv_wint_t" = yes ; then
 
        if test "$NCURSES_OK_MBSTATE_T" = 0 ; then
 
-echo "$as_me:18997: checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}" >&5
+echo "$as_me:19108: 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 19000 "configure"
+#line 19111 "configure"
 #include "confdefs.h"
 
 #ifndef _XOPEN_SOURCE_EXTENDED
@@ -19015,16 +19126,16 @@ mbstate_t foo
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:19018: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:19129: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:19021: \$? = $ac_status" >&5
+  echo "$as_me:19132: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:19024: \"$ac_try\"") >&5
+  { (eval echo "$as_me:19135: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:19027: \$? = $ac_status" >&5
+  echo "$as_me:19138: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_result=yes
 else
@@ -19033,7 +19144,7 @@ cat conftest.$ac_ext >&5
 cf_result=no
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:19036: result: $cf_result" >&5
+echo "$as_me:19147: result: $cf_result" >&5
 echo "${ECHO_T}$cf_result" >&6
 if test $cf_result = yes ; then
 
 
        if test "$NCURSES_OK_WCHAR_T" = 0 ; then
 
-echo "$as_me:19058: checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}" >&5
+echo "$as_me:19169: 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 19061 "configure"
+#line 19172 "configure"
 #include "confdefs.h"
 
 #ifndef _XOPEN_SOURCE_EXTENDED
@@ -19076,16 +19187,16 @@ wchar_t foo
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:19079: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:19190: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:19082: \$? = $ac_status" >&5
+  echo "$as_me:19193: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:19085: \"$ac_try\"") >&5
+  { (eval echo "$as_me:19196: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:19088: \$? = $ac_status" >&5
+  echo "$as_me:19199: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_result=yes
 else
@@ -19094,7 +19205,7 @@ cat conftest.$ac_ext >&5
 cf_result=no
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:19097: result: $cf_result" >&5
+echo "$as_me:19208: result: $cf_result" >&5
 echo "${ECHO_T}$cf_result" >&6
 if test $cf_result = yes ; then
 
 
        if test "$NCURSES_OK_WINT_T" = 0 ; then
 
-echo "$as_me:19119: checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}" >&5
+echo "$as_me:19230: 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 19122 "configure"
+#line 19233 "configure"
 #include "confdefs.h"
 
 #ifndef _XOPEN_SOURCE_EXTENDED
@@ -19137,16 +19248,16 @@ wint_t foo
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:19140: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:19251: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:19143: \$? = $ac_status" >&5
+  echo "$as_me:19254: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:19146: \"$ac_try\"") >&5
+  { (eval echo "$as_me:19257: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:19149: \$? = $ac_status" >&5
+  echo "$as_me:19260: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_result=yes
 else
@@ -19155,7 +19266,7 @@ cat conftest.$ac_ext >&5
 cf_result=no
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:19158: result: $cf_result" >&5
+echo "$as_me:19269: result: $cf_result" >&5
 echo "${ECHO_T}$cf_result" >&6
 if test $cf_result = yes ; then
 
@@ -19184,11 +19295,11 @@ boolnames \
 boolfnames \
 ttytype
 do
-echo "$as_me:19187: checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
+echo "$as_me:19298: 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 19191 "configure"
+#line 19302 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_XCURSES
@@ -19216,16 +19327,16 @@ void *foo = &($cf_data)
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:19219: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:19330: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:19222: \$? = $ac_status" >&5
+  echo "$as_me:19333: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:19225: \"$ac_try\"") >&5
+  { (eval echo "$as_me:19336: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:19228: \$? = $ac_status" >&5
+  echo "$as_me:19339: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_result=yes
 
@@ -19235,7 +19346,7 @@ cat conftest.$ac_ext >&5
 cf_result=no
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:19238: result: $cf_result" >&5
+echo "$as_me:19349: result: $cf_result" >&5
 echo "${ECHO_T}$cf_result" >&6
 
 if test $cf_result = yes ; then
@@ -19247,14 +19358,14 @@ cf_result=`echo "have_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./
 EOF
 
 else
-       echo "$as_me:19250: checking for data $cf_data in library" >&5
+       echo "$as_me:19361: 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 19257 "configure"
+#line 19368 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_XCURSES
@@ -19287,16 +19398,16 @@ main (void)
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:19290: \"$ac_link\"") >&5
+if { (eval echo "$as_me:19401: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:19293: \$? = $ac_status" >&5
+  echo "$as_me:19404: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:19296: \"$ac_try\"") >&5
+  { (eval echo "$as_me:19407: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:19299: \$? = $ac_status" >&5
+  echo "$as_me:19410: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_result=yes
 else
@@ -19308,7 +19419,7 @@ rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 19311 "configure"
+#line 19422 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_XCURSES
@@ -19334,15 +19445,15 @@ int main(void)
 }
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:19337: \"$ac_link\"") >&5
+if { (eval echo "$as_me:19448: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:19340: \$? = $ac_status" >&5
+  echo "$as_me:19451: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:19342: \"$ac_try\"") >&5
+  { (eval echo "$as_me:19453: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:19345: \$? = $ac_status" >&5
+  echo "$as_me:19456: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_result=yes
 
@@ -19354,7 +19465,7 @@ cf_result=no
 fi
 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
-       echo "$as_me:19357: result: $cf_result" >&5
+       echo "$as_me:19468: result: $cf_result" >&5
 echo "${ECHO_T}$cf_result" >&6
        if test $cf_result = yes ; then
 
@@ -19371,7 +19482,7 @@ done
 
 if ( test "$GCC" = yes || test "$GXX" = yes )
 then
-echo "$as_me:19374: checking if you want to turn on gcc warnings" >&5
+echo "$as_me:19485: 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.
@@ -19388,7 +19499,7 @@ else
        with_warnings=no
 
 fi;
-echo "$as_me:19391: result: $with_warnings" >&5
+echo "$as_me:19502: result: $with_warnings" >&5
 echo "${ECHO_T}$with_warnings" >&6
 if test "$with_warnings" = "yes"
 then
@@ -19411,10 +19522,10 @@ cat > conftest.i <<EOF
 EOF
 if test "$GCC" = yes
 then
-       { echo "$as_me:19414: checking for $CC __attribute__ directives..." >&5
+       { echo "$as_me:19525: checking for $CC __attribute__ directives..." >&5
 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
 cat > conftest.$ac_ext <<EOF
-#line 19417 "${as_me:-configure}"
+#line 19528 "${as_me:-configure}"
 #include "confdefs.h"
 #include "conftest.h"
 #include "conftest.i"
@@ -19463,12 +19574,12 @@ EOF
                        ;;
                esac
 
-               if { (eval echo "$as_me:19466: \"$ac_compile\"") >&5
+               if { (eval echo "$as_me:19577: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:19469: \$? = $ac_status" >&5
+  echo "$as_me:19580: \$? = $ac_status" >&5
   (exit $ac_status); }; then
-                       test -n "$verbose" && echo "$as_me:19471: result: ... $cf_attribute" >&5
+                       test -n "$verbose" && echo "$as_me:19582: result: ... $cf_attribute" >&5
 echo "${ECHO_T}... $cf_attribute" >&6
                        cat conftest.h >>confdefs.h
                        case $cf_attribute in
 rm -rf conftest*
 fi
 
-INTEL_COMPILER=no
-
-if test "$GCC" = yes ; then
-       case $host_os in
-       (linux*|gnu*)
-               echo "$as_me:19535: 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 19540 "configure"
+if test "x$have_x" = xyes; then
+cat >conftest.$ac_ext <<_ACEOF
+#line 19643 "configure"
 #include "confdefs.h"
 
+#include <stdlib.h>
+#include <X11/Intrinsic.h>
+
 int
 main (void)
 {
-
-#ifdef __INTEL_COMPILER
-#else
-make an error
-#endif
-
+String foo = malloc(1)
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:19557: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:19658: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:19560: \$? = $ac_status" >&5
+  echo "$as_me:19661: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:19563: \"$ac_try\"") >&5
+  { (eval echo "$as_me:19664: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:19566: \$? = $ac_status" >&5
+  echo "$as_me:19667: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  INTEL_COMPILER=yes
-cf_save_CFLAGS="$cf_save_CFLAGS -we147"
 
+echo "$as_me:19670: checking for X11/Xt const-feature" >&5
+echo $ECHO_N "checking for X11/Xt const-feature... $ECHO_C" >&6
+if test "${cf_cv_const_x_string+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-               CFLAGS="$cf_save_CFLAGS"
-               echo "$as_me:19577: result: $INTEL_COMPILER" >&5
-echo "${ECHO_T}$INTEL_COMPILER" >&6
-               ;;
-       esac
-fi
-
-CLANG_COMPILER=no
 
-if test "$GCC" = yes ; then
-       echo "$as_me:19586: 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 19591 "configure"
+#line 19677 "configure"
 #include "confdefs.h"
 
+#define _CONST_X_STRING        /* X11R7.8 (perhaps) */
+#undef  XTSTRINGDEFINES        /* X11R5 and later */
+#include <stdlib.h>
+#include <X11/Intrinsic.h>
+
 int
 main (void)
 {
-
-#ifdef __clang__
-#else
-make an error
-#endif
-
+String foo = malloc(1); *foo = 0
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:19608: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:19694: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:19611: \$? = $ac_status" >&5
+  echo "$as_me:19697: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:19614: \"$ac_try\"") >&5
+  { (eval echo "$as_me:19700: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:19617: \$? = $ac_status" >&5
+  echo "$as_me:19703: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  CLANG_COMPILER=yes
-cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments"
+
+                       cf_cv_const_x_string=no
 
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
+
+                       cf_cv_const_x_string=yes
+
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
-       CFLAGS="$cf_save_CFLAGS"
-       echo "$as_me:19628: result: $CLANG_COMPILER" >&5
-echo "${ECHO_T}$CLANG_COMPILER" >&6
+
 fi
+echo "$as_me:19718: result: $cf_cv_const_x_string" >&5
+echo "${ECHO_T}$cf_cv_const_x_string" >&6
+
+case $cf_cv_const_x_string in
+(no)
+
+       test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
+       CPPFLAGS="${CPPFLAGS}-DXTSTRINGDEFINES"
+
+       ;;
+(*)
 
+       test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
+       CPPFLAGS="${CPPFLAGS}-D_CONST_X_STRING"
+
+       ;;
+esac
+
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ fi
 cat > conftest.$ac_ext <<EOF
-#line 19633 "${as_me:-configure}"
+#line 19743 "${as_me:-configure}"
 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
 EOF
-
 if test "$INTEL_COMPILER" = yes
 then
 # The "-wdXXX" options suppress warnings:
@@ -19647,7 +19756,7 @@ then
 # remark #981: operands are evaluated in unspecified order
 # warning #279: controlling expression is constant
 
-       { echo "$as_me:19650: checking for $CC warning options..." >&5
+       { echo "$as_me:19759: checking for $CC warning options..." >&5
 echo "$as_me: checking for $CC warning options..." >&6;}
        cf_save_CFLAGS="$CFLAGS"
        EXTRA_CFLAGS="-Wall"
@@ -19663,21 +19772,20 @@ echo "$as_me: checking for $CC warning options..." >&6;}
                wd981
        do
                CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
-               if { (eval echo "$as_me:19666: \"$ac_compile\"") >&5
+               if { (eval echo "$as_me:19775: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:19669: \$? = $ac_status" >&5
+  echo "$as_me:19778: \$? = $ac_status" >&5
   (exit $ac_status); }; then
-                       test -n "$verbose" && echo "$as_me:19671: result: ... -$cf_opt" >&5
+                       test -n "$verbose" && echo "$as_me:19780: result: ... -$cf_opt" >&5
 echo "${ECHO_T}... -$cf_opt" >&6
                        EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
                fi
        done
        CFLAGS="$cf_save_CFLAGS"
-
 elif test "$GCC" = yes
 then
-       { echo "$as_me:19680: checking for $CC warning options..." >&5
+       { echo "$as_me:19788: checking for $CC warning options..." >&5
 echo "$as_me: checking for $CC warning options..." >&6;}
        cf_save_CFLAGS="$CFLAGS"
        EXTRA_CFLAGS=
@@ -19701,26 +19809,20 @@ echo "$as_me: checking for $CC warning options..." >&6;}
                Wundef $cf_gcc_warnings $cf_warn_CONST Wno-unknown-pragmas
        do
                CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
-               if { (eval echo "$as_me:19704: \"$ac_compile\"") >&5
+               if { (eval echo "$as_me:19812: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:19707: \$? = $ac_status" >&5
+  echo "$as_me:19815: \$? = $ac_status" >&5
   (exit $ac_status); }; then
-                       test -n "$verbose" && echo "$as_me:19709: result: ... -$cf_opt" >&5
+                       test -n "$verbose" && echo "$as_me:19817: result: ... -$cf_opt" >&5
 echo "${ECHO_T}... -$cf_opt" >&6
                        case $cf_opt in
-                       (Wcast-qual)
-
-       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}:19723: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
+echo "${as_me:-configure}:19825: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
 
                                        continue;;
                                esac
@@ -19730,7 +19832,7 @@ echo "${as_me:-configure}:19723: 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}:19733: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
+echo "${as_me:-configure}:19835: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
 
                                        continue;;
                                esac
@@ -19746,7 +19848,7 @@ rm -rf conftest*
 fi
 fi
 
-echo "$as_me:19749: checking if you want to use dmalloc for testing" >&5
+echo "$as_me:19851: 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.
@@ -19763,7 +19865,7 @@ EOF
 else
   with_dmalloc=
 fi;
-echo "$as_me:19766: result: ${with_dmalloc:-no}" >&5
+echo "$as_me:19868: 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:19880: checking for dmalloc.h" >&5
+       echo "$as_me:19982: 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 19886 "configure"
+#line 19988 "configure"
 #include "confdefs.h"
 #include <dmalloc.h>
 _ACEOF
-if { (eval echo "$as_me:19890: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:19992: \"$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:19896: \$? = $ac_status" >&5
+  echo "$as_me:19998: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
@@ -19912,11 +20014,11 @@ else
 fi
 rm -f conftest.err conftest.$ac_ext
 fi
-echo "$as_me:19915: result: $ac_cv_header_dmalloc_h" >&5
+echo "$as_me:20017: 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:19919: checking for dmalloc_debug in -ldmalloc" >&5
+echo "$as_me:20021: 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
@@ -19924,7 +20026,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-ldmalloc  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 19927 "configure"
+#line 20029 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -19943,16 +20045,16 @@ dmalloc_debug ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:19946: \"$ac_link\"") >&5
+if { (eval echo "$as_me:20048: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:19949: \$? = $ac_status" >&5
+  echo "$as_me:20051: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:19952: \"$ac_try\"") >&5
+  { (eval echo "$as_me:20054: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:19955: \$? = $ac_status" >&5
+  echo "$as_me:20057: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_dmalloc_dmalloc_debug=yes
 else
@@ -19963,7 +20065,7 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:19966: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5
+echo "$as_me:20068: 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
@@ -19978,7 +20080,7 @@ fi
 
 fi
 
-echo "$as_me:19981: checking if you want to use dbmalloc for testing" >&5
+echo "$as_me:20083: 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.
@@ -19995,7 +20097,7 @@ EOF
 else
   with_dbmalloc=
 fi;
-echo "$as_me:19998: result: ${with_dbmalloc:-no}" >&5
+echo "$as_me:20100: 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:20112: checking for dbmalloc.h" >&5
+       echo "$as_me:20214: 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 20118 "configure"
+#line 20220 "configure"
 #include "confdefs.h"
 #include <dbmalloc.h>
 _ACEOF
-if { (eval echo "$as_me:20122: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:20224: \"$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:20128: \$? = $ac_status" >&5
+  echo "$as_me:20230: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
@@ -20144,11 +20246,11 @@ else
 fi
 rm -f conftest.err conftest.$ac_ext
 fi
-echo "$as_me:20147: result: $ac_cv_header_dbmalloc_h" >&5
+echo "$as_me:20249: 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:20151: checking for debug_malloc in -ldbmalloc" >&5
+echo "$as_me:20253: 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
@@ -20156,7 +20258,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-ldbmalloc  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 20159 "configure"
+#line 20261 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -20175,16 +20277,16 @@ debug_malloc ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:20178: \"$ac_link\"") >&5
+if { (eval echo "$as_me:20280: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:20181: \$? = $ac_status" >&5
+  echo "$as_me:20283: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:20184: \"$ac_try\"") >&5
+  { (eval echo "$as_me:20286: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:20187: \$? = $ac_status" >&5
+  echo "$as_me:20289: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_dbmalloc_debug_malloc=yes
 else
@@ -20195,7 +20297,7 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:20198: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5
+echo "$as_me:20300: 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
@@ -20210,7 +20312,7 @@ fi
 
 fi
 
-echo "$as_me:20213: checking if you want to use valgrind for testing" >&5
+echo "$as_me:20315: 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.
@@ -20227,7 +20329,7 @@ EOF
 else
   with_valgrind=
 fi;
-echo "$as_me:20230: result: ${with_valgrind:-no}" >&5
+echo "$as_me:20332: result: ${with_valgrind:-no}" >&5
 echo "${ECHO_T}${with_valgrind:-no}" >&6
 
 case .$with_cflags in
@@ -20340,7 +20442,7 @@ fi
        ;;
 esac
 
-echo "$as_me:20343: checking if you want to perform memory-leak testing" >&5
+echo "$as_me:20445: 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.
@@ -20350,7 +20452,7 @@ if test "${enable_leaks+set}" = set; then
 else
   : ${with_no_leaks:=no}
 fi;
-echo "$as_me:20353: result: $with_no_leaks" >&5
+echo "$as_me:20455: result: $with_no_leaks" >&5
 echo "${ECHO_T}$with_no_leaks" >&6
 
 if test "$with_no_leaks" = yes ; then
@@ -20368,7 +20470,7 @@ fi
 LD_RPATH_OPT=
 if test "x$cf_cv_enable_rpath" != xno
 then
-       echo "$as_me:20371: checking for an rpath option" >&5
+       echo "$as_me:20473: checking for an rpath option" >&5
 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
        case $cf_cv_system_name in
        (irix*)
@@ -20399,33 +20501,33 @@ echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
        (*)
                ;;
        esac
-       echo "$as_me:20402: result: $LD_RPATH_OPT" >&5
+       echo "$as_me:20504: result: $LD_RPATH_OPT" >&5
 echo "${ECHO_T}$LD_RPATH_OPT" >&6
 
        case "x$LD_RPATH_OPT" in
        (x-R*)
-               echo "$as_me:20407: checking if we need a space after rpath option" >&5
+               echo "$as_me:20509: 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_add_libs="${LD_RPATH_OPT}$libdir"
-# 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_libs="$LIBS"
+# reverse order
+cf_add_0lib=
+for cf_add_1lib in ${LD_RPATH_OPT}$libdir; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
+# filter duplicates
+for cf_add_1lib in $cf_add_0lib; 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"
+       test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
 done
 LIBS="$cf_add_libs"
 
                cat >conftest.$ac_ext <<_ACEOF
-#line 20428 "configure"
+#line 20530 "configure"
 #include "confdefs.h"
 
 int
@@ -20437,16 +20539,16 @@ main (void)
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:20440: \"$ac_link\"") >&5
+if { (eval echo "$as_me:20542: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:20443: \$? = $ac_status" >&5
+  echo "$as_me:20545: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:20446: \"$ac_try\"") >&5
+  { (eval echo "$as_me:20548: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:20449: \$? = $ac_status" >&5
+  echo "$as_me:20551: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_rpath_space=no
 else
@@ -20456,14 +20558,14 @@ cf_rpath_space=yes
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
                LIBS="$cf_save_LIBS"
-               echo "$as_me:20459: result: $cf_rpath_space" >&5
+               echo "$as_me:20561: result: $cf_rpath_space" >&5
 echo "${ECHO_T}$cf_rpath_space" >&6
                test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
                ;;
        esac
 fi
 
-echo "$as_me:20466: checking if rpath-hack should be disabled" >&5
+echo "$as_me:20568: 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.
@@ -20480,21 +20582,21 @@ else
        cf_disable_rpath_hack=no
 
 fi;
-echo "$as_me:20483: result: $cf_disable_rpath_hack" >&5
+echo "$as_me:20585: 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:20487: checking for updated LDFLAGS" >&5
+echo "$as_me:20589: 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:20490: result: maybe" >&5
+       echo "$as_me:20592: 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:20497: checking for $ac_word" >&5
+echo "$as_me:20599: 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
@@ -20509,7 +20611,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:20512: found $ac_dir/$ac_word" >&5
+echo "$as_me:20614: 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:20520: result: $cf_ldd_prog" >&5
+  echo "$as_me:20622: result: $cf_ldd_prog" >&5
 echo "${ECHO_T}$cf_ldd_prog" >&6
 else
-  echo "$as_me:20523: result: no" >&5
+  echo "$as_me:20625: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -20534,7 +20636,7 @@ test -n "$cf_ldd_prog" || cf_ldd_prog="no"
                cf_rpath_oops=
 
 cat >conftest.$ac_ext <<_ACEOF
-#line 20537 "configure"
+#line 20639 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 int
@@ -20546,16 +20648,16 @@ printf("Hello");
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:20549: \"$ac_link\"") >&5
+if { (eval echo "$as_me:20651: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:20552: \$? = $ac_status" >&5
+  echo "$as_me:20654: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:20555: \"$ac_try\"") >&5
+  { (eval echo "$as_me:20657: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:20558: \$? = $ac_status" >&5
+  echo "$as_me:20660: \$? = $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`
@@ -20583,7 +20685,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}:20586: testing ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src ..." 1>&5
+echo "${as_me:-configure}:20688: testing ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src ..." 1>&5
 
                                                LDFLAGS="$LDFLAGS -L$cf_rpath_dir/lib"
                                                break
@@ -20595,11 +20697,11 @@ echo "${as_me:-configure}:20586: testing ...adding -L$cf_rpath_dir/lib to LDFLAG
 
        test -n "$verbose" && echo "    ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
 
-echo "${as_me:-configure}:20598: testing ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
+echo "${as_me:-configure}:20700: testing ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
 
 test -n "$verbose" && echo "   ...checking LDFLAGS $LDFLAGS" 1>&6
 
-echo "${as_me:-configure}:20602: testing ...checking LDFLAGS $LDFLAGS ..." 1>&5
+echo "${as_me:-configure}:20704: testing ...checking LDFLAGS $LDFLAGS ..." 1>&5
 
 cf_rpath_dst=
 for cf_rpath_src in $LDFLAGS
@@ -20636,7 +20738,7 @@ do
                        then
                                test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
 
-echo "${as_me:-configure}:20639: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
+echo "${as_me:-configure}:20741: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
 
                                EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
                        fi
@@ -20649,11 +20751,11 @@ LDFLAGS=$cf_rpath_dst
 
 test -n "$verbose" && echo "   ...checked LDFLAGS $LDFLAGS" 1>&6
 
-echo "${as_me:-configure}:20652: testing ...checked LDFLAGS $LDFLAGS ..." 1>&5
+echo "${as_me:-configure}:20754: testing ...checked LDFLAGS $LDFLAGS ..." 1>&5
 
 test -n "$verbose" && echo "   ...checking LIBS $LIBS" 1>&6
 
-echo "${as_me:-configure}:20656: testing ...checking LIBS $LIBS ..." 1>&5
+echo "${as_me:-configure}:20758: testing ...checking LIBS $LIBS ..." 1>&5
 
 cf_rpath_dst=
 for cf_rpath_src in $LIBS
@@ -20690,7 +20792,7 @@ do
                        then
                                test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
 
-echo "${as_me:-configure}:20693: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
+echo "${as_me:-configure}:20795: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
 
                                EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
                        fi
@@ -20703,14 +20805,14 @@ LIBS=$cf_rpath_dst
 
 test -n "$verbose" && echo "   ...checked LIBS $LIBS" 1>&6
 
-echo "${as_me:-configure}:20706: testing ...checked LIBS $LIBS ..." 1>&5
+echo "${as_me:-configure}:20808: testing ...checked LIBS $LIBS ..." 1>&5
 
        test -n "$verbose" && echo "    ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
 
-echo "${as_me:-configure}:20710: testing ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
+echo "${as_me:-configure}:20812: testing ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
 
 else
-       echo "$as_me:20713: result: no" >&5
+       echo "$as_me:20815: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -20800,7 +20902,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:20803: creating $CONFIG_STATUS" >&5
+{ echo "$as_me:20905: creating $CONFIG_STATUS" >&5
 echo "$as_me: creating $CONFIG_STATUS" >&6;}
 cat >$CONFIG_STATUS <<_ACEOF
 #! $SHELL
@@ -20932,7 +21034,7 @@ EOF
 cat >>$CONFIG_STATUS <<EOF
 ac_cs_version="\\
 config.status
-configured by $0, generated by GNU Autoconf 2.52.20190828,
+configured by $0, generated by GNU Autoconf 2.52.20190901,
   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
 
 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
@@ -20976,7 +21078,7 @@ cat >>$CONFIG_STATUS <<\EOF
     echo "$ac_cs_version"; exit 0 ;;
   --he | --h)
     # Conflict between --help and --header
-    { { echo "$as_me:20979: error: ambiguous option: $1
+    { { echo "$as_me:21081: 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;}
@@ -20995,7 +21097,7 @@ Try \`$0 --help' for more information." >&2;}
     ac_need_defaults=false;;
 
   # This is an error.
-  -*) { { echo "$as_me:20998: error: unrecognized option: $1
+  -*) { { echo "$as_me:21100: 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;}
@@ -21014,7 +21116,7 @@ cat >&5 << _ACEOF
 ## Running config.status.  ##
 ## ----------------------- ##
 
-This file was extended by $as_me 2.52.20190828, executed with
+This file was extended by $as_me 2.52.20190901, executed with
   CONFIG_FILES    = $CONFIG_FILES
   CONFIG_HEADERS  = $CONFIG_HEADERS
   CONFIG_LINKS    = $CONFIG_LINKS
@@ -21045,7 +21147,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:21048: error: invalid argument: $ac_config_target" >&5
+  *) { { echo "$as_me:21150: error: invalid argument: $ac_config_target" >&5
 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
    { (exit 1); exit 1; }; };;
   esac
@@ -21341,7 +21443,7 @@ done; }
   esac
 
   if test x"$ac_file" != x-; then
-    { echo "$as_me:21344: creating $ac_file" >&5
+    { echo "$as_me:21446: creating $ac_file" >&5
 echo "$as_me: creating $ac_file" >&6;}
     rm -f "$ac_file"
   fi
@@ -21359,7 +21461,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:21362: error: cannot find input file: $f" >&5
+         test -f "$f" || { { echo "$as_me:21464: error: cannot find input file: $f" >&5
 echo "$as_me: error: cannot find input file: $f" >&2;}
    { (exit 1); exit 1; }; }
          echo $f;;
@@ -21372,7 +21474,7 @@ echo "$as_me: error: cannot find input file: $f" >&2;}
            echo $srcdir/$f
          else
            # /dev/null tree
-           { { echo "$as_me:21375: error: cannot find input file: $f" >&5
+           { { echo "$as_me:21477: error: cannot find input file: $f" >&5
 echo "$as_me: error: cannot find input file: $f" >&2;}
    { (exit 1); exit 1; }; }
          fi;;
@@ -21388,7 +21490,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:21391: WARNING: datarootdir was used implicitly but not set:
+          { echo "$as_me:21493: 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;}
@@ -21397,7 +21499,7 @@ $ac_seen" >&2;}
       fi
       ac_seen=`grep '${datarootdir}' $ac_item`
       if test -n "$ac_seen"; then
-        { echo "$as_me:21400: WARNING: datarootdir was used explicitly but not set:
+        { echo "$as_me:21502: 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;}
@@ -21434,7 +21536,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:21437: WARNING: Variable $ac_name is used but was not set:
+              { echo "$as_me:21539: 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;}
@@ -21445,7 +21547,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:21448: WARNING: Some variables may not be substituted:
+      { echo "$as_me:21550: WARNING: Some variables may not be substituted:
 $ac_seen" >&5
 echo "$as_me: WARNING: Some variables may not be substituted:
 $ac_seen" >&2;}
@@ -21494,7 +21596,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:21497: creating $ac_file" >&5
+  test x"$ac_file" != x- && { echo "$as_me:21599: creating $ac_file" >&5
 echo "$as_me: creating $ac_file" >&6;}
 
   # First look for the input files in the build tree, otherwise in the
@@ -21505,7 +21607,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:21508: error: cannot find input file: $f" >&5
+         test -f "$f" || { { echo "$as_me:21610: error: cannot find input file: $f" >&5
 echo "$as_me: error: cannot find input file: $f" >&2;}
    { (exit 1); exit 1; }; }
          echo $f;;
@@ -21518,7 +21620,7 @@ echo "$as_me: error: cannot find input file: $f" >&2;}
            echo $srcdir/$f
          else
            # /dev/null tree
-           { { echo "$as_me:21521: error: cannot find input file: $f" >&5
+           { { echo "$as_me:21623: error: cannot find input file: $f" >&5
 echo "$as_me: error: cannot find input file: $f" >&2;}
    { (exit 1); exit 1; }; }
          fi;;
@@ -21576,7 +21678,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:21579: $ac_file is unchanged" >&5
+      { echo "$as_me:21681: $ac_file is unchanged" >&5
 echo "$as_me: $ac_file is unchanged" >&6;}
     else
       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \