XEmacs 21.2.14.
[chise/xemacs-chise.git.1] / configure
index 0beba52..8e677b0 100755 (executable)
--- a/configure
+++ b/configure
@@ -7,6 +7,7 @@
 #### Copyright (C) 1993-1995 Board of Trustees, University of Illinois.
 #### Copyright (C) 1996, 1997 Sun Microsystems, Inc.
 #### Copyright (C) 1995, 1996 Ben Wing.
+#### Copyright (C) 1998, 1999 J. Kean Johnston.
 
 ### Don't edit this script!
 ### This script was automatically generated by the `autoconf' program
@@ -228,17 +229,20 @@ infodir='${datadir}/${PROGNAME}-${version}/info'
 infopath=''
 install_pp=''
 lispdir='${datadir}/${PROGNAME}-${version}/lisp'
+moduledir='${datadir}/${PROGNAME}-${version}/${configuration}/modules'
+sitelispdir='${datadir}/xemacs/site-lisp'
+sitemoduledir='${datadir}/xemacs/site-modules'
 pkgdir='${datadir}/${PROGNAME}-${version}/lisp'
 package_path=''
 etcdir='${datadir}/${PROGNAME}-${version}/etc'
 lockdir='${statedir}/${PROGNAME}/lock'
-archlibdir='${libdir}/${PROGNAME}-${version}/${configuration}'
+archlibdir='${datadir}/${PROGNAME}-${version}/${configuration}'
 with_site_lisp='no'
+with_site_modules='yes'
 with_menubars=''
 with_scrollbars=''
 with_dialogs=''
 with_file_coding=''
-puresize=''
 cpp='' cppflags='' libs='' ldflags=''
 dynamic=''
 with_x11=''
@@ -299,13 +303,12 @@ while test $# != 0; do
 
             case "$opt" in
 
-       run_in_place    | \
-        with_site_lisp  | \
+       with_site_lisp  | \
+    with_site_modules | \
        with_x          | \
        with_x11        | \
        with_msw        | \
        with_gcc        | \
-       with_gnu_make   | \
        dynamic         | \
        with_ncurses    | \
        with_dnet       | \
@@ -322,19 +325,20 @@ while test $# != 0; do
        with_tiff       | \
        with_session    | \
        with_xmu        | \
+       with_purify     | \
        with_quantify   | \
        with_toolbars   | \
        with_tty        | \
        with_xfs        | \
        with_i18n3      | \
        with_mule       | \
-       with_file_coding        | \
+       with_file_coding| \
        with_canna      | \
        with_wnn        | \
        with_wnn6       | \
        with_workshop   | \
        with_sparcworks | \
-       with_tooltalk   | \
+       with_tooltalk   | \
        with_ldap       | \
        with_pop        | \
        with_kerberos   | \
@@ -345,26 +349,22 @@ while test $# != 0; do
        verbose         | \
        extra_verbose   | \
        const_is_losing | \
-       usage_tracking  | \
-       use_union_type  | \
+       usage_tracking  | \
+       use_union_type  | \
        debug           | \
        use_assertions  | \
-       use_minimal_tagbits                     | \
-       use_indexed_lrecord_implementation      | \
-       gung_ho         | \
-       use_assertions  | \
        memory_usage_stats | \
        with_clash_detection | \
        with_shlib | \
        no_doc_file )
                  case "$val" in
            y | ye | yes )      val=yes ;;
-           n | no )            val=no  ;;
+           n | no )            val=no  ;;
            * ) (echo "$progname: Usage error:"
 echo " " "The \`--$optname' option requires a boolean value: \`yes' or \`no'."
 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
          esac
-          eval "$opt=\"$val\"" ;;
+         eval "$opt=\"$val\"" ;;
 
 
                        srcdir          | \
@@ -374,9 +374,8 @@ echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
        cppflags        | \
        libs            | \
        ldflags         | \
-       puresize        | \
        cache_file      | \
-       native_sound_lib | \
+       native_sound_lib| \
        site_lisp       | \
        x_includes      | \
        x_libraries     | \
@@ -425,7 +424,7 @@ echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
                * ) (echo "$progname: Usage error:"
 echo " " "The \`--$optname' option value
   must be either \`no' or a comma-separated list
-  of one or more of \`berkdb', \`dbm', or \`gnudbm'."
+  of one or more of \`berkdb' and either \`dbm' or \`gnudbm'."
 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
             esac
          done
@@ -467,18 +466,6 @@ echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
           eval "$opt=\"$val\""
         ;;
 
-               "with_xfs" )
-         case "$val" in
-         y | ye | yes )                val=yes ;;
-         n | no | non | none )         val=no  ;;
-         * ) (echo "$progname: Usage error:"
-echo " " "The \`--$optname' option must have one of these values:
- \`yes', or \`no'."
-echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
-         esac
-         eval "$opt=\"$val\""
-       ;;
-
                "mail_locking" )
          case "$val" in
            lockf )     val=lockf ;;
@@ -542,7 +529,7 @@ echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
                                
                prefix | exec_prefix | bindir | datadir | statedir | libdir | \
        mandir | infodir | infopath | lispdir | etcdir | lockdir | pkgdir | \
-       archlibdir | docdir | package_path )    
+       archlibdir | docdir | package_path )
                   if test "$valomitted" = "yes"; then
             if test "$#" = 0; then
                 (echo "$progname: Usage error:"
@@ -562,6 +549,22 @@ cat >> confdefs.h <<\EOF
 EOF
 }
  ;;
+             sitelispdir ) { test "$extra_verbose" = "yes" && cat << \EOF
+    Defining SITELISPDIR_USER_DEFINED
+EOF
+cat >> confdefs.h <<\EOF
+#define SITELISPDIR_USER_DEFINED 1
+EOF
+}
+ ;;
+             moduledir ) { test "$extra_verbose" = "yes" && cat << \EOF
+    Defining MODULEDIR_USER_DEFINED
+EOF
+cat >> confdefs.h <<\EOF
+#define MODULEDIR_USER_DEFINED 1
+EOF
+}
+ ;;
              etcdir  )  { test "$extra_verbose" = "yes" && cat << \EOF
     Defining ETCDIR_USER_DEFINED
 EOF
@@ -611,6 +614,14 @@ cat >> confdefs.h <<\EOF
 EOF
 }
 
+            { test "$extra_verbose" = "yes" && cat << \EOF
+    Defining MODULEDIR_USER_DEFINED
+EOF
+cat >> confdefs.h <<\EOF
+#define MODULEDIR_USER_DEFINED 1
+EOF
+}
+
                { test "$extra_verbose" = "yes" && cat << \EOF
     Defining ETCDIR_USER_DEFINED
 EOF
@@ -642,7 +653,9 @@ EOF
 
                "usage" | "help" ) ${PAGER-more} ${srcdir}/configure.usage; exit 0 ;;
 
-                       "with_menubars" | "with_scrollbars" | "with_dialogs" )
+               "with_menubars"   | \
+       "with_scrollbars" | \
+       "with_dialogs" )
          case "$val" in
            l | lu | luc | luci | lucid )               val=lucid  ;;
            m | mo | mot | moti | motif )               val=motif  ;;
@@ -657,6 +670,11 @@ echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
          eval "$opt=\"$val\""
        ;;
 
+               "run_in_place"  | \
+       "with_gnu_make" )
+         echo "configure: warning: Obsolete option \`--$optname' ignored." 1>&2
+       ;;
+
                * ) (echo "$progname: Usage error:"
 echo " " "Unrecognized option: $arg"
 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
@@ -683,25 +701,10 @@ eval set x "$quoted_arguments"; shift
 
 test "$extra_verbose" = "yes" && verbose=yes
 
-case "$site_includes" in *:* ) site_includes="`echo '' $site_includes | sed -e 's/^ //' -e 's/:/ /g'`";; esac
-case "$site_libraries" in *:* ) site_libraries="`echo '' $site_libraries | sed -e 's/^ //' -e 's/:/ /g'`";; esac
-case "$site_prefixes" in *:* ) site_prefixes="`echo '' $site_prefixes | sed -e 's/^ //' -e 's/:/ /g'`";; esac
-case "$site_runtime_libraries" in *:* ) site_runtime_libraries="`echo '' $site_runtime_libraries | sed -e 's/^ //' -e 's/:/ /g'`";; esac
-
 test -n "$with_x" && with_x11="$with_x"
 
-
-if test -n "$gung_ho"; then
-  test -z "$use_minimal_tagbits" && use_minimal_tagbits="$gung_ho"
-  test -z "$use_indexed_lrecord_implementation" && \
-    use_indexed_lrecord_implementation="$gung_ho"
-fi
-if test "$use_minimal_tagbits" = "no"; then
-  test "$with_dlmalloc" = "yes" && \
-    (echo "$progname: Usage error:"
-echo " " "--with-dlmalloc requires --use-minimal-tagbits"
-echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
-  with_dlmalloc=no
+if test "$with_purify" = "yes" -o "$with_quantify" = "yes"; then
+  test "$with_system_malloc" = "default" && with_system_malloc=yes
 fi
 
 
@@ -715,10 +718,6 @@ elif test "$with_cde" = "yes"; then with_tooltalk=yes
 fi
 
 
-if test "$run_in_place" = "yes"; then
-  echo "configure: warning: "The --run-in-place option is ignored because it is unnecessary."" 1>&2
-fi
-
 case "$srcdir" in
 
     "" )
@@ -754,13 +753,8 @@ echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
 esac
 
 if test -z "$configuration"; then
-  echo $ac_n "checking "host system type"""... $ac_c" 1>&6
-echo "configure:759: checking "host system type"" >&5
-    if configuration=`${CONFIG_SHELL-/bin/sh} $srcdir/config.guess | \
-    sed 's/^\([^-][^-]*-[^-][^-]*-[^-][^-]*\)-.*$/\1/'` ; then
-    echo "$ac_t""$configuration" 1>&6
-  else
-    echo "$ac_t""unknown" 1>&6
+    configuration=`${CONFIG_SHELL-/bin/sh} $srcdir/config.guess`
+  if test -z "$configuration"; then
     (echo "$progname: Usage error:"
 echo " " "XEmacs has not been ported to this host type.
 Try explicitly specifying the CONFIGURATION when rerunning configure."
@@ -769,7 +763,7 @@ echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
 fi
 
 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:773: checking whether ln -s works" >&5
+echo "configure:767: checking whether ln -s works" >&5
 
 rm -f conftestdata
 if ln -s X conftestdata 2>/dev/null
@@ -794,17 +788,26 @@ for dir in lisp etc man info; do
   fi
 done
 
+
 absolute_pwd="`pwd`";
 if test -n "$PWD" -a "`cd $PWD && pwd`" = "$absolute_pwd"
 then blddir="$PWD"
-else blddir="$absolute_pwd"
+else blddir="$absolute_pwd"; if test -d "/net"; then
+  if test -d "/tmp_mnt/net"; then tdir="tmp_mnt/net"; else tdir="tmp_mnt"; fi
+  blddir=`echo "$blddir" | \
+   sed -e "s|^${tdir}/|/net/|" -e "s|^/a/|/net/|" -e "s|^/amd/|/net/|"`
+fi
 fi
 
 
 case "$srcdir" in
   /* ) ;;
   .  ) srcdir="$blddir" ;;
-  *  ) srcdir="`cd $srcdir && pwd`" ;;
+  *  ) srcdir="`cd $srcdir && pwd`"; if test -d "/net"; then
+  if test -d "/tmp_mnt/net"; then tdir="tmp_mnt/net"; else tdir="tmp_mnt"; fi
+  srcdir=`echo "$srcdir" | \
+   sed -e "s|^${tdir}/|/net/|" -e "s|^/a/|/net/|" -e "s|^/amd/|/net/|"`
+fi ;;
 esac
 
 if test `pwd` != `sh -c cd $srcdir && pwd`  \
@@ -984,12 +987,13 @@ EOF
 
 
 
-echo "checking "the configuration name"" 1>&6
-echo "configure:989: checking "the configuration name"" >&5
+echo $ac_n "checking "host system type"""... $ac_c" 1>&6
+echo "configure:992: checking "host system type"" >&5
 internal_configuration=`echo $configuration | sed 's/-\(workshop\)//'`
-if canonical=`$srcdir/config.sub "$internal_configuration"` ; then : ; else
-  exit $?
-fi
+canonical=`${CONFIG_SHELL-/bin/sh} $srcdir/config.sub "$internal_configuration"`
+configuration=`echo "$configuration" | sed 's/^\([^-][^-]*-[^-][^-]*-[^-][^-]*\)-.*$/\1/'`
+canonical=`echo "$canonical" | sed 's/^\([^-][^-]*-[^-][^-]*-[^-][^-]*\)-.*$/\1/'`
+echo "$ac_t""$configuration" 1>&6
 
 
 
@@ -999,7 +1003,7 @@ machine='' opsys=''
 
 case "$canonical" in
   sparc-*-*        ) machine=sparc ;;
-  alpha-*-*        ) machine=alpha ;;
+  alpha*-*-*       ) machine=alpha ;;
   vax-*-*          ) machine=vax ;;
   mips-dec-*       ) machine=pmax ;;
   mips-sgi-*       ) machine=iris4d ;;
@@ -1012,6 +1016,8 @@ case "$canonical" in
   m68*-sony-*      ) machine=news ;;
   mips-sony-*      ) machine=news-risc ;;
   clipper-*        ) machine=clipper ;;
+  arm-*            ) machine=arm ;;
+  ns32k-*          ) machine=ns32000 ;;
 esac
 
 case "$canonical" in
@@ -1034,9 +1040,9 @@ case "$canonical" in
     *-*-aix3.1*  ) opsys=aix3-1        ;;
   *-*-aix3.2.5 ) opsys=aix3-2-5        ;;
   *-*-aix3*    ) opsys=aix3-2  ;;
-  *-*-aix4.2*  ) opsys=aix4-2  ;;
+  *-*-aix4.0*  ) opsys=aix4    ;;
   *-*-aix4.1*  ) opsys=aix4-1  ;;
-  *-*-aix4*    ) opsys=aix4    ;;
+  *-*-aix4*    ) opsys=aix4-2  ;;
 
     *-gnu* )                   opsys=gnu    ;;
   *-*-bsd4.[01] )              opsys=bsd4-1 ;;
@@ -1074,13 +1080,9 @@ case "$canonical" in
 
     *-*-openbsd* )
     case "${canonical}" in
-      alpha*-*-openbsd*)       machine=alpha ;;
       i386-*-openbsd*)         machine=intel386 ;;
       m68k-*-openbsd*)         machine=hp9000s300 ;;
       mipsel-*-openbsd*)       machine=pmax ;;
-      ns32k-*-openbsd*)                machine=ns32000 ;;
-      sparc-*-openbsd*)                machine=sparc ;;
-      vax-*-openbsd*)          machine=vax ;;
      esac
    ;;
 
@@ -1242,6 +1244,12 @@ case "$canonical" in
     NON_GNU_CPP=/usr/ccs/lib/cpp
   ;;
 
+    mips-nec-sysv*)
+    machine=mips-nec
+    NON_GNU_CC=/usr/ccs/bin/cc
+    NON_GNU_CPP=/usr/ccs/lib/cpp
+  ;;
+
       m68*-sgi-iris3.5* ) machine=irist opsys=iris3-5 ;;
   m68*-sgi-iris3.6* | m68*-sgi-iris*) machine=irist opsys=iris3-6 ;;
     mips-sgi-irix3.*    ) opsys=irix3-3 ;;
@@ -1353,6 +1361,7 @@ EOF
       *-xenix* )               opsys=xenix ;;
       *-sco3.2v4* )            opsys=sco4 NON_GNU_CPP=/lib/cpp  ;;
       *-bsd386* | *-bsdi1* )   opsys=bsd386 ;;
+      *-bsdi4* )               opsys=bsdos4 ;;
       *-bsdi3* )               opsys=bsdos3 ;;
       *-bsdi2.1* )             opsys=bsdos2-1 ;;
       *-bsdi2* )               opsys=bsdos2 ;;
@@ -1365,7 +1374,9 @@ EOF
       *-386bsd* )              opsys=386bsd ;;
       *-freebsd* )             opsys=freebsd ;;
       *-nextstep* )            opsys=nextstep ;;
-      *-pc-cygwin32 )          opsys=cygwin32 ;;
+      *-pc-cygwin* )           opsys=cygwin32 ;;
+      *-pc-mingw* )            opsys=mingw32 ;
+                               test -z "$with_tty" && with_tty="no";;
           esac
   ;;
 
@@ -1382,7 +1393,7 @@ fi
 
 if test -z "$dynamic"; then
   case "$opsys" in
-    hpux* | sunos4* | sco5 ) dynamic=no ;;
+    hpux* | sunos4* ) dynamic=no ;;
     *) dynamic=yes ;;
   esac
 fi
@@ -1469,7 +1480,7 @@ xe_save_CFLAGS="$CFLAGS"
 # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1473: checking for $ac_word" >&5
+echo "configure:1484: checking for $ac_word" >&5
 
 if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -1495,7 +1506,7 @@ if test -z "$CC"; then
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1499: checking for $ac_word" >&5
+echo "configure:1510: checking for $ac_word" >&5
 
 if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -1540,7 +1551,7 @@ fi
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1544: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:1555: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
@@ -1552,11 +1563,11 @@ ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_
 cross_compiling=no
 
 cat > conftest.$ac_ext <<EOF
-#line 1556 "configure"
+#line 1567 "configure"
 #include "confdefs.h"
 main(){return(0);}
 EOF
-if { (eval echo configure:1560: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1571: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -1576,19 +1587,19 @@ if test $ac_cv_prog_cc_works = no; then
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:1580: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:1591: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:1585: checking whether we are using GNU C" >&5
+echo "configure:1596: checking whether we are using GNU C" >&5
 
 cat > conftest.c <<EOF
 #ifdef __GNUC__
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1592: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1603: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -1602,7 +1613,7 @@ if test $ac_cv_prog_gcc = yes; then
   ac_save_CFLAGS="$CFLAGS"
   CFLAGS=
   echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:1606: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:1617: checking whether ${CC-cc} accepts -g" >&5
 
 echo 'void f(){}' > conftest.c
 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
@@ -1631,7 +1642,7 @@ if   test "$with_gcc" = "no"  -a "$GCC" = "yes"; then
   # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1635: checking for $ac_word" >&5
+echo "configure:1646: checking for $ac_word" >&5
 
 if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -1657,7 +1668,7 @@ if test -z "$CC"; then
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1661: checking for $ac_word" >&5
+echo "configure:1672: checking for $ac_word" >&5
 
 if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -1702,7 +1713,7 @@ fi
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1706: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:1717: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
@@ -1714,11 +1725,11 @@ ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_
 cross_compiling=no
 
 cat > conftest.$ac_ext <<EOF
-#line 1718 "configure"
+#line 1729 "configure"
 #include "confdefs.h"
 main(){return(0);}
 EOF
-if { (eval echo configure:1722: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1733: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -1738,19 +1749,19 @@ if test $ac_cv_prog_cc_works = no; then
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:1742: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:1753: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:1747: checking whether we are using GNU C" >&5
+echo "configure:1758: checking whether we are using GNU C" >&5
 
 cat > conftest.c <<EOF
 #ifdef __GNUC__
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1754: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1765: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -1764,7 +1775,7 @@ if test $ac_cv_prog_gcc = yes; then
   ac_save_CFLAGS="$CFLAGS"
   CFLAGS=
   echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:1768: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:1779: checking whether ${CC-cc} accepts -g" >&5
 
 echo 'void f(){}' > conftest.c
 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
@@ -1793,7 +1804,7 @@ elif test "$with_gcc" = "yes" -a "$GCC" != "yes" ; then
   # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1797: checking for $ac_word" >&5
+echo "configure:1808: checking for $ac_word" >&5
 
 if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -1819,7 +1830,7 @@ if test -z "$CC"; then
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1823: checking for $ac_word" >&5
+echo "configure:1834: checking for $ac_word" >&5
 
 if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -1864,7 +1875,7 @@ fi
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1868: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:1879: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
@@ -1876,11 +1887,11 @@ ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_
 cross_compiling=no
 
 cat > conftest.$ac_ext <<EOF
-#line 1880 "configure"
+#line 1891 "configure"
 #include "confdefs.h"
 main(){return(0);}
 EOF
-if { (eval echo configure:1884: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1895: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -1900,19 +1911,19 @@ if test $ac_cv_prog_cc_works = no; then
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:1904: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:1915: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:1909: checking whether we are using GNU C" >&5
+echo "configure:1920: checking whether we are using GNU C" >&5
 
 cat > conftest.c <<EOF
 #ifdef __GNUC__
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1916: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1927: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -1926,7 +1937,7 @@ if test $ac_cv_prog_gcc = yes; then
   ac_save_CFLAGS="$CFLAGS"
   CFLAGS=
   echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:1930: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:1941: checking whether ${CC-cc} accepts -g" >&5
 
 echo 'void f(){}' > conftest.c
 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
@@ -1959,7 +1970,7 @@ test -n "$CPP" -a -d "$CPP" && CPP=
 test -n "$NON_GNU_CPP" -a "$GCC" != "yes" -a -z "$CPP" && CPP="$NON_GNU_CPP"
 
 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:1963: checking how to run the C preprocessor" >&5
+echo "configure:1974: checking how to run the C preprocessor" >&5
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
@@ -1972,13 +1983,13 @@ if test -z "$CPP"; then
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp.
   cat > conftest.$ac_ext <<EOF
-#line 1976 "configure"
+#line 1987 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1982: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1993: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   :
@@ -1989,13 +2000,13 @@ else
   rm -rf conftest*
   CPP="${CC-cc} -E -traditional-cpp"
   cat > conftest.$ac_ext <<EOF
-#line 1993 "configure"
+#line 2004 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1999: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2010: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   :
@@ -2018,9 +2029,9 @@ echo "$ac_t""$CPP" 1>&6
 
 
 echo $ac_n "checking for AIX""... $ac_c" 1>&6
-echo "configure:2022: checking for AIX" >&5
+echo "configure:2033: checking for AIX" >&5
 cat > conftest.$ac_ext <<EOF
-#line 2024 "configure"
+#line 2035 "configure"
 #include "confdefs.h"
 #ifdef _AIX
   yes
@@ -2047,9 +2058,9 @@ rm -f conftest*
 
 
 echo $ac_n "checking for GNU libc""... $ac_c" 1>&6
-echo "configure:2051: checking for GNU libc" >&5
+echo "configure:2062: checking for GNU libc" >&5
 cat > conftest.$ac_ext <<EOF
-#line 2053 "configure"
+#line 2064 "configure"
 #include "confdefs.h"
 #include <features.h>
 int main() {
@@ -2061,7 +2072,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:2065: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2076: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   have_glibc=yes
 else
@@ -2081,31 +2092,35 @@ EOF
 }
 
 
-echo $ac_n "checking whether we are using SunPro C""... $ac_c" 1>&6
-echo "configure:2086: checking whether we are using SunPro C" >&5
+
 cat > conftest.$ac_ext <<EOF
-#line 2088 "configure"
+#line 2098 "configure"
 #include "confdefs.h"
-
-int main() {
-#ifndef __SUNPRO_C
-#error Not a  SunPro compiler :-(
-******* ======= ******** &&&&&&&&
+int main () {
+#if defined __SUNPRO_C
+return 11;
+#elif defined __DECC
+return 12;
+#else
+return 0;
 #endif
-
-; return 0; }
+}
 EOF
-if { (eval echo configure:2099: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
-  __sunpro_c=yes
+if { (eval echo configure:2110: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
+then
+  :
 else
+  conftest_rc="$?"
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  __sunpro_c=no
+  rm -fr conftest*
+  case "$conftest_rc" in
+  11) echo "You appear to be using the SunPro C compiler."; __SUNPRO_C=yes ;;
+  12) echo "You appear to be using the DEC C compiler."   ; __DECC=yes ;;
+esac
 fi
-rm -f conftest*
-echo "$ac_t""$__sunpro_c" 1>&6
+rm -fr conftest*
+
 
 
 
@@ -2264,9 +2279,15 @@ configure___ mail_use_lockf=yes
 configure___ mail_use_lockf=no
 #endif
 
+#ifdef HAVE_WIN32_PROCESSES
+configure___ win32_processes=yes
+#else
+configure___ win32_processes=no
+#endif
+
 EOF
 
-CPP=`eval "echo $CPP"`
+CPP=`eval "echo $CPP $CPPFLAGS"`
 eval `$CPP -Isrc $tempcname \
        | sed -n -e "s/[        ]*=[    \"]*/='/" -e "s/[       \"]*\$/'/" -e "s/^configure___//p"`
 
@@ -2277,20 +2298,22 @@ test "$extra_verbose" = "yes" && \
 
 test "$ordinary_link" = "no" -a -z "$libs_standard" && libs_standard="-lc"
 
+test "$__DECC" = "yes" && c_switch_site="$c_switch_site -std" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-std\" to \$c_switch_site"; fi
+
 if test "$cflags_specified" = "no"; then
       if   test "$GCC" = "yes"; then
     CFLAGS="-g -O3 -Wall -Wno-switch"
-                    test "$opsys $machine" = "cygwin32 intel386" && \
-      CFLAGS="-g -O2 -Wall -Wno-switch"
-  elif test "$__sunpro_c" = "yes"; then
+              elif test "$__SUNPRO_C" = "yes"; then
     case "$opsys" in
       sol2    ) CFLAGS="-v -xO4" ;;
       sunos4* ) CFLAGS="-xO2";;
     esac
+  elif test "$__DECC" = "yes"; then
+    CFLAGS="-O3"
   elif test "$CC" = "xlc"; then
-    CFLAGS="-O3 -qstrict -qnoansialias -qlibansi -qinfo -qro -qmaxmem=20000"
-  else
-        CFLAGS="-O" ;  fi
+    CFLAGS="-g -O3 -qstrict -qnoansialias -qlibansi -qinfo -qro -qmaxmem=20000"
+    else
+    CFLAGS="-O" ;  fi
 fi
 
 
@@ -2298,8 +2321,8 @@ if test "$GCC" = "yes"; then
   set x $ld_switch_system; shift; ld_switch_system=""
   while test -n "$1"; do
     case $1 in
-      -L  | -l  | -u         ) ld_switch_system="$ld_switch_system $1 $2"; shift ;;
-      -L* | -l* | -u* | -Wl* ) ld_switch_system="$ld_switch_system $1" ;;
+      -L  | -l  | -u               ) ld_switch_system="$ld_switch_system $1 $2"; shift ;;
+      -L* | -l* | -u* | -Wl* | -pg ) ld_switch_system="$ld_switch_system $1" ;;
       -Xlinker* ) ;;
       * ) ld_switch_system="$ld_switch_system -Xlinker $1" ;;
     esac
@@ -2311,8 +2334,8 @@ if test "$GCC" = "yes"; then
   set x $ld_switch_machine; shift; ld_switch_machine=""
   while test -n "$1"; do
     case $1 in
-      -L  | -l  | -u         ) ld_switch_machine="$ld_switch_machine $1 $2"; shift ;;
-      -L* | -l* | -u* | -Wl* ) ld_switch_machine="$ld_switch_machine $1" ;;
+      -L  | -l  | -u               ) ld_switch_machine="$ld_switch_machine $1 $2"; shift ;;
+      -L* | -l* | -u* | -Wl* | -pg ) ld_switch_machine="$ld_switch_machine $1" ;;
       -Xlinker* ) ;;
       * ) ld_switch_machine="$ld_switch_machine -Xlinker $1" ;;
     esac
@@ -2324,8 +2347,8 @@ if test "$GCC" = "yes"; then
   set x $LDFLAGS; shift; LDFLAGS=""
   while test -n "$1"; do
     case $1 in
-      -L  | -l  | -u         ) LDFLAGS="$LDFLAGS $1 $2"; shift ;;
-      -L* | -l* | -u* | -Wl* ) LDFLAGS="$LDFLAGS $1" ;;
+      -L  | -l  | -u               ) LDFLAGS="$LDFLAGS $1 $2"; shift ;;
+      -L* | -l* | -u* | -Wl* | -pg ) LDFLAGS="$LDFLAGS $1" ;;
       -Xlinker* ) ;;
       * ) LDFLAGS="$LDFLAGS -Xlinker $1" ;;
     esac
@@ -2337,8 +2360,8 @@ if test "$GCC" = "yes"; then
   set x $ld_call_shared; shift; ld_call_shared=""
   while test -n "$1"; do
     case $1 in
-      -L  | -l  | -u         ) ld_call_shared="$ld_call_shared $1 $2"; shift ;;
-      -L* | -l* | -u* | -Wl* ) ld_call_shared="$ld_call_shared $1" ;;
+      -L  | -l  | -u               ) ld_call_shared="$ld_call_shared $1 $2"; shift ;;
+      -L* | -l* | -u* | -Wl* | -pg ) ld_call_shared="$ld_call_shared $1" ;;
       -Xlinker* ) ;;
       * ) ld_call_shared="$ld_call_shared -Xlinker $1" ;;
     esac
@@ -2357,7 +2380,7 @@ test -n "$unexec"          && extra_objs="$extra_objs $unexec" &&  if test "$ext
  fi
 
 echo $ac_n "checking for dynodump""... $ac_c" 1>&6
-echo "configure:2361: checking for dynodump" >&5
+echo "configure:2384: checking for dynodump" >&5
 if test "$unexec" != "unexsol2.o"; then
   echo "$ac_t""no" 1>&6
 else
@@ -2395,12 +2418,12 @@ if test "$unexec" = "unexaix.o"; then
   done
   
 echo $ac_n "checking for terminateAndUnload in -lC""... $ac_c" 1>&6
-echo "configure:2399: checking for terminateAndUnload in -lC" >&5
+echo "configure:2422: checking for terminateAndUnload in -lC" >&5
 ac_lib_var=`echo C'_'terminateAndUnload | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lC "
 cat > conftest.$ac_ext <<EOF
-#line 2404 "configure"
+#line 2427 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2411,7 +2434,7 @@ int main() {
 terminateAndUnload()
 ; return 0; }
 EOF
-if { (eval echo configure:2415: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2438: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2449,36 +2472,56 @@ test "$GCC" != "yes" && lib_gcc=
 
 
 
-if test -n "$site_prefixes"; then
-  for arg in $site_prefixes; do
-    case "$arg" in
-       -* ) ;;
-       * ) argi="-I${arg}/include" ; argl="-L${arg}/lib" ;;
-    esac
-    c_switch_site="$c_switch_site $argi" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"$argi\" to \$c_switch_site"; fi
-    ld_switch_site="$ld_switch_site $argl" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"$argl\" to \$ld_switch_site"; fi
-  done
-fi
-
+case "$site_libraries" in *:* ) site_libraries="`echo '' $site_libraries | sed -e 's/^ //' -e 's/:/ /g'`";; esac
 if test -n "$site_libraries"; then
   for arg in $site_libraries; do
-    case "$arg" in -* ) ;; * ) arg="-L${arg}" ;; esac
+    case "$arg" in
+     -* ) ;;
+     * ) test -d "$arg" || \
+           { echo "Error:" "Invalid site library \`$arg': no such directory" >&2; exit 1; }
+       arg="-L${arg}" ;;
+    esac
     ld_switch_site="$ld_switch_site $arg" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"$arg\" to \$ld_switch_site"; fi
   done
 fi
 
+case "$site_includes" in *:* ) site_includes="`echo '' $site_includes | sed -e 's/^ //' -e 's/:/ /g'`";; esac
 if test -n "$site_includes"; then
   for arg in $site_includes; do
-    case "$arg" in -* ) ;; * ) arg="-I${arg}" ;; esac
+    case "$arg" in
+      -* ) ;;
+      * ) test -d "$arg" || \
+           { echo "Error:" "Invalid site include \`$arg': no such directory" >&2; exit 1; }
+      arg="-I${arg}" ;;
+    esac
     c_switch_site="$c_switch_site $arg" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"$arg\" to \$c_switch_site"; fi
   done
 fi
 
+case "$site_prefixes" in *:* ) site_prefixes="`echo '' $site_prefixes | sed -e 's/^ //' -e 's/:/ /g'`";; esac
+if test -n "$site_prefixes"; then
+  for dir in $site_prefixes; do
+    inc_dir="${dir}/include"
+    lib_dir="${dir}/lib"
+    if test ! -d "$dir"; then
+      { echo "Error:" "Invalid site prefix \`$dir': no such directory" >&2; exit 1; }
+    elif test ! -d "$inc_dir"; then
+      { echo "Error:" "Invalid site prefix \`$dir': no such directory \`$inc_dir'" >&2; exit 1; }
+    elif test ! -d "$lib_dir"; then
+      { echo "Error:" "Invalid site prefix \`$dir': no such directory \`$lib_dir'" >&2; exit 1; }
+    else
+      c_switch_site="$c_switch_site "-I$inc_dir"" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \""-I$inc_dir"\" to \$c_switch_site"; fi
+      ld_switch_site="$ld_switch_site "-L$lib_dir"" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \""-L$lib_dir"\" to \$ld_switch_site"; fi
+    fi
+  done
+fi
+
 
 for dir in "/usr/ccs/lib"; do
   test -d "$dir" && ld_switch_site="$ld_switch_site -L${dir}" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-L${dir}\" to \$ld_switch_site"; fi
 done
 
+case "$site_runtime_libraries" in *:* ) site_runtime_libraries="`echo '' $site_runtime_libraries | sed -e 's/^ //' -e 's/:/ /g'`";; esac
 if test -n "$site_runtime_libraries"; then
   LD_RUN_PATH="`echo $site_runtime_libraries | sed -e 's/  */:/g'`"
   export LD_RUN_PATH
@@ -2488,39 +2531,43 @@ fi
 if   test "$dynamic" = "no"; then add_runtime_path=no
 elif test -n "$LD_RUN_PATH"; then add_runtime_path=yes
 else case "$opsys" in
-       sol2 | irix* | *bsd* ) add_runtime_path=yes ;;
+       sol2 | irix* | *bsd* | decosf* ) add_runtime_path=yes ;;
        * ) add_runtime_path=no ;;
      esac
 fi
 
 if test "$add_runtime_path" = "yes"; then
       echo $ac_n "checking "for runtime libraries flag"""... $ac_c" 1>&6
-echo "configure:2499: checking "for runtime libraries flag"" >&5
-  dash_r=""
-  for try_dash_r in "-R" "-R " "-rpath "; do
-    xe_check_libs="${try_dash_r}/no/such/file-or-directory"
-    
+echo "configure:2542: checking "for runtime libraries flag"" >&5
+  case "$opsys" in
+    sol2 ) dash_r="-R" ;;
+    decosf* | linux* | irix*) dash_r="-rpath " ;;
+    *)
+      dash_r=""
+      for try_dash_r in "-R" "-R " "-rpath "; do
+        xe_check_libs="${try_dash_r}/no/such/file-or-directory"
+        
 if test "$GCC" = "yes"; then
   set x $xe_check_libs; shift; xe_check_libs=""
   while test -n "$1"; do
     case $1 in
-      -L  | -l  | -u         ) xe_check_libs="$xe_check_libs $1 $2"; shift ;;
-      -L* | -l* | -u* | -Wl* ) xe_check_libs="$xe_check_libs $1" ;;
+      -L  | -l  | -u               ) xe_check_libs="$xe_check_libs $1 $2"; shift ;;
+      -L* | -l* | -u* | -Wl* | -pg ) xe_check_libs="$xe_check_libs $1" ;;
       -Xlinker* ) ;;
       * ) xe_check_libs="$xe_check_libs -Xlinker $1" ;;
     esac
     shift
   done
 fi
-    cat > conftest.$ac_ext <<EOF
-#line 2517 "configure"
+        cat > conftest.$ac_ext <<EOF
+#line 2564 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:2524: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2571: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   dash_r="$try_dash_r"
 else
@@ -2528,9 +2575,10 @@ else
   cat conftest.$ac_ext >&5
 fi
 rm -f conftest*
-    xe_check_libs=""
-    test -n "$dash_r" && break
-  done
+        xe_check_libs=""
+        test -n "$dash_r" && break
+      done ;;
+  esac
   if test -n "$dash_r";
     then echo "$ac_t"""\"${dash_r}\""" 1>&6
     else echo "$ac_t""NONE" 1>&6
@@ -2598,8 +2646,8 @@ if test "$GCC" = "yes"; then
   set x $ld_switch_run; shift; ld_switch_run=""
   while test -n "$1"; do
     case $1 in
-      -L  | -l  | -u         ) ld_switch_run="$ld_switch_run $1 $2"; shift ;;
-      -L* | -l* | -u* | -Wl* ) ld_switch_run="$ld_switch_run $1" ;;
+      -L  | -l  | -u               ) ld_switch_run="$ld_switch_run $1 $2"; shift ;;
+      -L* | -l* | -u* | -Wl* | -pg ) ld_switch_run="$ld_switch_run $1" ;;
       -Xlinker* ) ;;
       * ) ld_switch_run="$ld_switch_run -Xlinker $1" ;;
     esac
@@ -2612,6 +2660,7 @@ fi
 
 
 
+
 GNU_MALLOC=yes
 if test "$with_dlmalloc" != "no"; then
        doug_lea_malloc=yes
@@ -2620,10 +2669,10 @@ else
 fi
 after_morecore_hook_exists=yes
 echo $ac_n "checking for malloc_get_state""... $ac_c" 1>&6
-echo "configure:2624: checking for malloc_get_state" >&5
+echo "configure:2673: checking for malloc_get_state" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 2627 "configure"
+#line 2676 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char malloc_get_state(); below.  */
@@ -2646,7 +2695,7 @@ malloc_get_state();
 
 ; return 0; }
 EOF
-if { (eval echo configure:2650: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2699: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_malloc_get_state=yes"
 else
@@ -2666,10 +2715,10 @@ doug_lea_malloc=no
 fi
 
 echo $ac_n "checking for malloc_set_state""... $ac_c" 1>&6
-echo "configure:2670: checking for malloc_set_state" >&5
+echo "configure:2719: checking for malloc_set_state" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 2673 "configure"
+#line 2722 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char malloc_set_state(); below.  */
@@ -2692,7 +2741,7 @@ malloc_set_state();
 
 ; return 0; }
 EOF
-if { (eval echo configure:2696: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2745: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_malloc_set_state=yes"
 else
@@ -2712,16 +2761,16 @@ doug_lea_malloc=no
 fi
 
 echo $ac_n "checking whether __after_morecore_hook exists""... $ac_c" 1>&6
-echo "configure:2716: checking whether __after_morecore_hook exists" >&5
+echo "configure:2765: checking whether __after_morecore_hook exists" >&5
 cat > conftest.$ac_ext <<EOF
-#line 2718 "configure"
+#line 2767 "configure"
 #include "confdefs.h"
 extern void (* __after_morecore_hook)();
 int main() {
 __after_morecore_hook = 0
 ; return 0; }
 EOF
-if { (eval echo configure:2725: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2774: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
 else
@@ -2780,7 +2829,7 @@ fi
 # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2784: checking for $ac_word" >&5
+echo "configure:2833: checking for $ac_word" >&5
 
 if test -n "$RANLIB"; then
   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
@@ -2833,7 +2882,7 @@ ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # ./install, which can be erroneously created by make from ./install.sh.
 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:2837: checking for a BSD compatible install" >&5
+echo "configure:2886: checking for a BSD compatible install" >&5
 if test -z "$INSTALL"; then
 
   IFS="${IFS=  }"; ac_save_IFS="$IFS"; IFS="${IFS}:"
@@ -2884,7 +2933,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2888: checking for $ac_word" >&5
+echo "configure:2937: checking for $ac_word" >&5
 
 if test -n "$YACC"; then
   ac_cv_prog_YACC="$YACC" # Let the user override the test.
@@ -2915,15 +2964,15 @@ for ac_hdr in mach/mach.h sys/stropts.h sys/timeb.h sys/time.h unistd.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2919: checking for $ac_hdr" >&5
+echo "configure:2968: checking for $ac_hdr" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 2922 "configure"
+#line 2971 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2927: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2976: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2952,19 +3001,19 @@ else
 fi
 done
 
-for ac_hdr in utime.h locale.h libgen.h fcntl.h ulimit.h
+for ac_hdr in utime.h locale.h libgen.h fcntl.h ulimit.h cygwin/version.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2960: checking for $ac_hdr" >&5
+echo "configure:3009: checking for $ac_hdr" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 2963 "configure"
+#line 3012 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2968: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3017: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2993,19 +3042,19 @@ else
 fi
 done
 
-for ac_hdr in linux/version.h kstat.h sys/pstat.h inttypes.h sys/un.h a.out.h
+for ac_hdr in kstat.h sys/pstat.h inttypes.h sys/un.h a.out.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3001: checking for $ac_hdr" >&5
+echo "configure:3050: checking for $ac_hdr" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 3004 "configure"
+#line 3053 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3009: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3058: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -3035,10 +3084,10 @@ fi
 done
 
 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
-echo "configure:3039: checking for sys/wait.h that is POSIX.1 compatible" >&5
+echo "configure:3088: checking for sys/wait.h that is POSIX.1 compatible" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 3042 "configure"
+#line 3091 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/wait.h>
@@ -3054,7 +3103,7 @@ wait (&s);
 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
 ; return 0; }
 EOF
-if { (eval echo configure:3058: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3107: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_sys_wait_h=yes
 else
@@ -3078,10 +3127,10 @@ EOF
 fi
 
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:3082: checking for ANSI C header files" >&5
+echo "configure:3131: checking for ANSI C header files" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 3085 "configure"
+#line 3134 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -3089,7 +3138,7 @@ cat > conftest.$ac_ext <<EOF
 #include <float.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3093: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3142: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -3106,7 +3155,7 @@ rm -f conftest*
 if test $ac_cv_header_stdc = yes; then
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 3110 "configure"
+#line 3159 "configure"
 #include "confdefs.h"
 #include <string.h>
 EOF
@@ -3124,7 +3173,7 @@ fi
 if test $ac_cv_header_stdc = yes; then
   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 3128 "configure"
+#line 3177 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
@@ -3142,7 +3191,7 @@ fi
 if test $ac_cv_header_stdc = yes; then
   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
 cat > conftest.$ac_ext <<EOF
-#line 3146 "configure"
+#line 3195 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -3153,10 +3202,11 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
 exit (0); }
 
 EOF
-if { (eval echo configure:3157: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
+if { (eval echo configure:3206: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
 then
   :
 else
+  conftest_rc="$?"
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -fr conftest*
@@ -3178,10 +3228,10 @@ EOF
 fi
 
 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:3182: checking whether time.h and sys/time.h may both be included" >&5
+echo "configure:3232: checking whether time.h and sys/time.h may both be included" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 3185 "configure"
+#line 3235 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/time.h>
@@ -3190,7 +3240,7 @@ int main() {
 struct tm *tp;
 ; return 0; }
 EOF
-if { (eval echo configure:3194: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3244: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_time=yes
 else
@@ -3214,10 +3264,10 @@ EOF
 fi
 
 echo $ac_n "checking for sys_siglist declaration in signal.h or unistd.h""... $ac_c" 1>&6
-echo "configure:3218: checking for sys_siglist declaration in signal.h or unistd.h" >&5
+echo "configure:3268: checking for sys_siglist declaration in signal.h or unistd.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 3221 "configure"
+#line 3271 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <signal.h>
@@ -3229,7 +3279,7 @@ int main() {
 char *msg = *(sys_siglist + 1);
 ; return 0; }
 EOF
-if { (eval echo configure:3233: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3283: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_decl_sys_siglist=yes
 else
@@ -3254,9 +3304,9 @@ fi
 
 
 echo $ac_n "checking for struct utimbuf""... $ac_c" 1>&6
-echo "configure:3258: checking for struct utimbuf" >&5
+echo "configure:3308: checking for struct utimbuf" >&5
 cat > conftest.$ac_ext <<EOF
-#line 3260 "configure"
+#line 3310 "configure"
 #include "confdefs.h"
 #ifdef TIME_WITH_SYS_TIME
 #include <sys/time.h>
@@ -3275,7 +3325,7 @@ int main() {
 static struct utimbuf x; x.actime = x.modtime;
 ; return 0; }
 EOF
-if { (eval echo configure:3279: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3329: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
    { test "$extra_verbose" = "yes" && cat << \EOF
@@ -3295,10 +3345,10 @@ fi
 rm -f conftest*
 
 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:3299: checking return type of signal handlers" >&5
+echo "configure:3349: checking return type of signal handlers" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 3302 "configure"
+#line 3352 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <signal.h>
@@ -3315,7 +3365,7 @@ int main() {
 int i;
 ; return 0; }
 EOF
-if { (eval echo configure:3319: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3369: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_type_signal=void
 else
@@ -3337,10 +3387,10 @@ EOF
 
 
 echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:3341: checking for size_t" >&5
+echo "configure:3391: checking for size_t" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 3344 "configure"
+#line 3394 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -3371,10 +3421,10 @@ EOF
 fi
 
 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
-echo "configure:3375: checking for pid_t" >&5
+echo "configure:3425: checking for pid_t" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 3378 "configure"
+#line 3428 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -3405,10 +3455,10 @@ EOF
 fi
 
 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
-echo "configure:3409: checking for uid_t in sys/types.h" >&5
+echo "configure:3459: checking for uid_t in sys/types.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 3412 "configure"
+#line 3462 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 EOF
@@ -3444,10 +3494,10 @@ EOF
 fi
 
 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
-echo "configure:3448: checking for mode_t" >&5
+echo "configure:3498: checking for mode_t" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 3451 "configure"
+#line 3501 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -3478,10 +3528,10 @@ EOF
 fi
 
 echo $ac_n "checking for off_t""... $ac_c" 1>&6
-echo "configure:3482: checking for off_t" >&5
+echo "configure:3532: checking for off_t" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 3485 "configure"
+#line 3535 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -3513,9 +3563,9 @@ fi
 
 
 echo $ac_n "checking for struct timeval""... $ac_c" 1>&6
-echo "configure:3517: checking for struct timeval" >&5
+echo "configure:3567: checking for struct timeval" >&5
 cat > conftest.$ac_ext <<EOF
-#line 3519 "configure"
+#line 3569 "configure"
 #include "confdefs.h"
 #ifdef TIME_WITH_SYS_TIME
 #include <sys/time.h>
@@ -3531,7 +3581,7 @@ int main() {
 static struct timeval x; x.tv_sec = x.tv_usec;
 ; return 0; }
 EOF
-if { (eval echo configure:3535: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3585: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
   HAVE_TIMEVAL=yes
@@ -3553,10 +3603,10 @@ fi
 rm -f conftest*
 
 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
-echo "configure:3557: checking whether struct tm is in sys/time.h or time.h" >&5
+echo "configure:3607: checking whether struct tm is in sys/time.h or time.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 3560 "configure"
+#line 3610 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <time.h>
@@ -3564,7 +3614,7 @@ int main() {
 struct tm *tp; tp->tm_sec;
 ; return 0; }
 EOF
-if { (eval echo configure:3568: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3618: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_struct_tm=time.h
 else
@@ -3588,10 +3638,10 @@ EOF
 fi
 
 echo $ac_n "checking for tm_zone in struct tm""... $ac_c" 1>&6
-echo "configure:3592: checking for tm_zone in struct tm" >&5
+echo "configure:3642: checking for tm_zone in struct tm" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 3595 "configure"
+#line 3645 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <$ac_cv_struct_tm>
@@ -3599,7 +3649,7 @@ int main() {
 struct tm tm; tm.tm_zone;
 ; return 0; }
 EOF
-if { (eval echo configure:3603: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3653: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_struct_tm_zone=yes
 else
@@ -3622,10 +3672,10 @@ EOF
 
 else
   echo $ac_n "checking for tzname""... $ac_c" 1>&6
-echo "configure:3626: checking for tzname" >&5
+echo "configure:3676: checking for tzname" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 3629 "configure"
+#line 3679 "configure"
 #include "confdefs.h"
 #include <time.h>
 #ifndef tzname /* For SGI.  */
@@ -3635,7 +3685,7 @@ int main() {
 atoi(*tzname);
 ; return 0; }
 EOF
-if { (eval echo configure:3639: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3689: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   ac_cv_var_tzname=yes
 else
@@ -3661,10 +3711,10 @@ fi
 
 
 echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:3665: checking for working const" >&5
+echo "configure:3715: checking for working const" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 3668 "configure"
+#line 3718 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -3713,7 +3763,7 @@ ccp = (char const *const *) p;
 
 ; return 0; }
 EOF
-if { (eval echo configure:3717: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3767: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_const=yes
 else
@@ -3738,7 +3788,7 @@ fi
 
 
 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:3742: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:3792: checking whether ${MAKE-make} sets \${MAKE}" >&5
 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
 
 cat > conftestmake <<\EOF
@@ -3763,12 +3813,12 @@ fi
 
 
 echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
-echo "configure:3767: checking whether byte ordering is bigendian" >&5
+echo "configure:3817: checking whether byte ordering is bigendian" >&5
 
 ac_cv_c_bigendian=unknown
 # See if sys/param.h defines the BYTE_ORDER macro.
 cat > conftest.$ac_ext <<EOF
-#line 3772 "configure"
+#line 3822 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/param.h>
@@ -3779,11 +3829,11 @@ int main() {
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:3783: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3833: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   # It does; now see whether it defined to BIG_ENDIAN or not.
 cat > conftest.$ac_ext <<EOF
-#line 3787 "configure"
+#line 3837 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/param.h>
@@ -3794,7 +3844,7 @@ int main() {
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:3798: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3848: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_bigendian=yes
 else
@@ -3811,7 +3861,7 @@ fi
 rm -f conftest*
 if test $ac_cv_c_bigendian = unknown; then
 cat > conftest.$ac_ext <<EOF
-#line 3815 "configure"
+#line 3865 "configure"
 #include "confdefs.h"
 main () {
   /* Are we little or big endian?  From Harbison&Steele.  */
@@ -3824,10 +3874,11 @@ main () {
   exit (u.c[sizeof (long) - 1] == 1);
 }
 EOF
-if { (eval echo configure:3828: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
+if { (eval echo configure:3878: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
 then
   ac_cv_c_bigendian=no
 else
+  conftest_rc="$?"
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -fr conftest*
@@ -3850,10 +3901,10 @@ fi
 
 
 echo $ac_n "checking size of short""... $ac_c" 1>&6
-echo "configure:3854: checking size of short" >&5
+echo "configure:3905: checking size of short" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 3857 "configure"
+#line 3908 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -3864,10 +3915,11 @@ main()
   exit(0);
 }
 EOF
-if { (eval echo configure:3868: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
+if { (eval echo configure:3919: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
 then
   ac_cv_sizeof_short=`cat conftestval`
 else
+  conftest_rc="$?"
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -fr conftest*
@@ -3891,10 +3943,10 @@ if test "$ac_cv_sizeof_short" = 0; then
   exit 1
 fi
 echo $ac_n "checking size of int""... $ac_c" 1>&6
-echo "configure:3895: checking size of int" >&5
+echo "configure:3947: checking size of int" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 3898 "configure"
+#line 3950 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -3905,10 +3957,11 @@ main()
   exit(0);
 }
 EOF
-if { (eval echo configure:3909: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
+if { (eval echo configure:3961: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
 then
   ac_cv_sizeof_int=`cat conftestval`
 else
+  conftest_rc="$?"
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -fr conftest*
@@ -3926,10 +3979,10 @@ EOF
 
 
 echo $ac_n "checking size of long""... $ac_c" 1>&6
-echo "configure:3930: checking size of long" >&5
+echo "configure:3983: checking size of long" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 3933 "configure"
+#line 3986 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -3940,10 +3993,11 @@ main()
   exit(0);
 }
 EOF
-if { (eval echo configure:3944: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
+if { (eval echo configure:3997: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
 then
   ac_cv_sizeof_long=`cat conftestval`
 else
+  conftest_rc="$?"
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -fr conftest*
@@ -3961,10 +4015,10 @@ EOF
 
 
 echo $ac_n "checking size of long long""... $ac_c" 1>&6
-echo "configure:3965: checking size of long long" >&5
+echo "configure:4019: checking size of long long" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 3968 "configure"
+#line 4022 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -3975,10 +4029,11 @@ main()
   exit(0);
 }
 EOF
-if { (eval echo configure:3979: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
+if { (eval echo configure:4033: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
 then
   ac_cv_sizeof_long_long=`cat conftestval`
 else
+  conftest_rc="$?"
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -fr conftest*
@@ -3996,10 +4051,10 @@ EOF
 
 
 echo $ac_n "checking size of void *""... $ac_c" 1>&6
-echo "configure:4000: checking size of void *" >&5
+echo "configure:4055: checking size of void *" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 4003 "configure"
+#line 4058 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -4010,10 +4065,11 @@ main()
   exit(0);
 }
 EOF
-if { (eval echo configure:4014: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
+if { (eval echo configure:4069: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
 then
   ac_cv_sizeof_void_p=`cat conftestval`
 else
+  conftest_rc="$?"
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -fr conftest*
@@ -4032,7 +4088,7 @@ EOF
 
 
 echo $ac_n "checking for long file names""... $ac_c" 1>&6
-echo "configure:4036: checking for long file names" >&5
+echo "configure:4092: checking for long file names" >&5
 
 ac_cv_sys_long_file_names=yes
 # Test for long file names in all the places we know might matter:
@@ -4077,14 +4133,57 @@ EOF
 fi
 
 
+echo $ac_n "checking for sin""... $ac_c" 1>&6
+echo "configure:4138: checking for sin" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 4141 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char sin(); below.  */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char sin();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_sin) || defined (__stub___sin)
+choke me
+#else
+sin();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:4164: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+  rm -rf conftest*
+  eval "ac_cv_func_sin=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_func_sin=no"
+fi
+rm -f conftest*
+
+if eval "test \"`echo '$ac_cv_func_'sin`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  :
+else
+  echo "$ac_t""no" 1>&6
 
 echo $ac_n "checking for sin in -lm""... $ac_c" 1>&6
-echo "configure:4083: checking for sin in -lm" >&5
+echo "configure:4182: checking for sin in -lm" >&5
 ac_lib_var=`echo m'_'sin | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lm "
 cat > conftest.$ac_ext <<EOF
-#line 4088 "configure"
+#line 4187 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4095,7 +4194,7 @@ int main() {
 sin()
 ; return 0; }
 EOF
-if { (eval echo configure:4099: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4198: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4109,7 +4208,7 @@ xe_check_libs=""
 
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
   echo "$ac_t""yes" 1>&6
-    ac_tr_lib=HAVE_LIB`echo m | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+    ac_tr_lib=HAVE_LIB`echo m | sed -e 's/^a-zA-Z0-9_/_/g' \
     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
   { test "$extra_verbose" = "yes" && cat << EOF
     Defining $ac_tr_lib
@@ -4126,6 +4225,8 @@ else
 fi
 
 
+fi
+
 
 { test "$extra_verbose" = "yes" && cat << \EOF
     Defining LISP_FLOAT_TYPE
@@ -4137,14 +4238,14 @@ EOF
 
 
 cat > conftest.$ac_ext <<EOF
-#line 4141 "configure"
+#line 4242 "configure"
 #include "confdefs.h"
 #include <math.h>
 int main() {
 return atanh(1.0) + asinh(1.0) + acosh(1.0); 
 ; return 0; }
 EOF
-if { (eval echo configure:4148: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4249: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   { test "$extra_verbose" = "yes" && cat << \EOF
     Defining HAVE_INVERSE_HYPERBOLIC
@@ -4161,7 +4262,7 @@ fi
 rm -f conftest*
 
 echo "checking type of mail spool file locking" 1>&6
-echo "configure:4165: checking type of mail spool file locking" >&5
+echo "configure:4266: checking type of mail spool file locking" >&5
 test -z "$mail_locking" -a "$mail_use_flock" = "yes" && mail_locking=flock
 test -z "$mail_locking" -a "$mail_use_lockf" = "yes" && mail_locking=lockf
 if   test "$mail_locking" = "lockf"; then { test "$extra_verbose" = "yes" && cat << \EOF
@@ -4183,115 +4284,15 @@ EOF
 else mail_locking="dot-locking"
 fi
 
-
-echo $ac_n "checking for kstat_open in -lkstat""... $ac_c" 1>&6
-echo "configure:4189: checking for kstat_open in -lkstat" >&5
-ac_lib_var=`echo kstat'_'kstat_open | sed 'y%./+-%__p_%'`
-
-xe_check_libs=" -lkstat "
-cat > conftest.$ac_ext <<EOF
-#line 4194 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char kstat_open();
-
-int main() {
-kstat_open()
-; return 0; }
-EOF
-if { (eval echo configure:4205: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-xe_check_libs=""
-
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_lib=HAVE_LIB`echo kstat | sed -e 's/[^a-zA-Z0-9_]/_/g' \
-    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
-  { test "$extra_verbose" = "yes" && cat << EOF
-    Defining $ac_tr_lib
-EOF
-cat >> confdefs.h <<EOF
-#define $ac_tr_lib 1
-EOF
-}
-
-  LIBS="-lkstat $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lkstat\" to \$LIBS"; fi
-
-else
-  echo "$ac_t""no" 1>&6
-fi
-
-
-
-
-echo $ac_n "checking for kvm_read in -lkvm""... $ac_c" 1>&6
-echo "configure:4239: checking for kvm_read in -lkvm" >&5
-ac_lib_var=`echo kvm'_'kvm_read | sed 'y%./+-%__p_%'`
-
-xe_check_libs=" -lkvm "
-cat > conftest.$ac_ext <<EOF
-#line 4244 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char kvm_read();
-
-int main() {
-kvm_read()
-; return 0; }
-EOF
-if { (eval echo configure:4255: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-xe_check_libs=""
-
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_lib=HAVE_LIB`echo kvm | sed -e 's/[^a-zA-Z0-9_]/_/g' \
-    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
-  { test "$extra_verbose" = "yes" && cat << EOF
-    Defining $ac_tr_lib
-EOF
-cat >> confdefs.h <<EOF
-#define $ac_tr_lib 1
-EOF
-}
-
-  LIBS="-lkvm $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lkvm\" to \$LIBS"; fi
-
-else
-  echo "$ac_t""no" 1>&6
-fi
-
-
-
 case "$opsys" in decosf*)
   
 echo $ac_n "checking for cma_open in -lpthreads""... $ac_c" 1>&6
-echo "configure:4290: checking for cma_open in -lpthreads" >&5
+echo "configure:4291: checking for cma_open in -lpthreads" >&5
 ac_lib_var=`echo pthreads'_'cma_open | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lpthreads "
 cat > conftest.$ac_ext <<EOF
-#line 4295 "configure"
+#line 4296 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4302,7 +4303,7 @@ int main() {
 cma_open()
 ; return 0; }
 EOF
-if { (eval echo configure:4306: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4307: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4338,7 +4339,7 @@ fi
 esac
 
 echo $ac_n "checking whether the -xildoff compiler flag is required""... $ac_c" 1>&6
-echo "configure:4342: checking whether the -xildoff compiler flag is required" >&5
+echo "configure:4343: checking whether the -xildoff compiler flag is required" >&5
 if   ${CC-cc} '-###' -xildon  no_such_file.c 2>&1 | grep '^[^ ]*/ild ' > /dev/null ; then
   if ${CC-cc} '-###' -xildoff no_such_file.c 2>&1 | grep '^[^ ]*/ild ' > /dev/null ;
     then echo "$ac_t""no" 1>&6;
@@ -4349,7 +4350,7 @@ fi
 
 if test "$opsys" = "sol2" && test "$OS_RELEASE" -ge 56; then
   echo $ac_n "checking for \"-z ignore\" linker flag""... $ac_c" 1>&6
-echo "configure:4353: checking for \"-z ignore\" linker flag" >&5
+echo "configure:4354: checking for \"-z ignore\" linker flag" >&5
   case "`ld -h 2>&1`" in
     *-z\ ignore\|record* ) echo "$ac_t""yes" 1>&6
       ld_switch_site="-z ignore $ld_switch_site" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-z ignore\" to \$ld_switch_site"; fi ;;
@@ -4359,7 +4360,7 @@ fi
 
 
 echo "checking "for specified window system"" 1>&6
-echo "configure:4363: checking "for specified window system"" >&5
+echo "configure:4364: checking "for specified window system"" >&5
 
 if test "$with_x11" != "no"; then
     test "$x_includes $x_libraries" != "NONE NONE" && \
@@ -4392,7 +4393,7 @@ if test "$with_x11" != "no"; then
 # Uses ac_ vars as temps to allow command line to override cache and checks.
 # --without-x overrides everything else, but does not touch the cache.
 echo $ac_n "checking for X""... $ac_c" 1>&6
-echo "configure:4396: checking for X" >&5
+echo "configure:4397: checking for X" >&5
 
 # Check whether --with-x or --without-x was given.
 if test "${with_x+set}" = set; then
@@ -4452,12 +4453,12 @@ if test "$ac_x_includes" = NO; then
 
   # First, try using that file with no special directory specified.
 cat > conftest.$ac_ext <<EOF
-#line 4456 "configure"
+#line 4457 "configure"
 #include "confdefs.h"
 #include <$x_direct_test_include>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4461: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4462: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -4526,14 +4527,14 @@ if test "$ac_x_libraries" = NO; then
   ac_save_LIBS="$LIBS"
   LIBS="-l$x_direct_test_library $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4530 "configure"
+#line 4531 "configure"
 #include "confdefs.h"
 
 int main() {
 ${x_direct_test_function}()
 ; return 0; }
 EOF
-if { (eval echo configure:4537: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4538: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   LIBS="$ac_save_LIBS"
 # We can link X programs with no special library path.
@@ -4642,17 +4643,17 @@ else
     case "`(uname -sr) 2>/dev/null`" in
     "SunOS 5"*)
       echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6
-echo "configure:4646: checking whether -R must be followed by a space" >&5
+echo "configure:4647: checking whether -R must be followed by a space" >&5
       ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries"
       cat > conftest.$ac_ext <<EOF
-#line 4649 "configure"
+#line 4650 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:4656: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4657: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   ac_R_nospace=yes
 else
@@ -4668,14 +4669,14 @@ rm -f conftest*
       else
        LIBS="$ac_xsave_LIBS -R $x_libraries"
        cat > conftest.$ac_ext <<EOF
-#line 4672 "configure"
+#line 4673 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:4679: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4680: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   ac_R_space=yes
 else
@@ -4711,12 +4712,12 @@ ac_cv_lib_dnet_dnet_ntoa=no
 else
 
 echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6
-echo "configure:4715: checking for dnet_ntoa in -ldnet" >&5
+echo "configure:4716: checking for dnet_ntoa in -ldnet" >&5
 ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -ldnet "
 cat > conftest.$ac_ext <<EOF
-#line 4720 "configure"
+#line 4721 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4727,7 +4728,7 @@ int main() {
 dnet_ntoa()
 ; return 0; }
 EOF
-if { (eval echo configure:4731: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4732: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4751,12 +4752,12 @@ fi
     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
       
 echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6
-echo "configure:4755: checking for dnet_ntoa in -ldnet_stub" >&5
+echo "configure:4756: checking for dnet_ntoa in -ldnet_stub" >&5
 ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -ldnet_stub "
 cat > conftest.$ac_ext <<EOF
-#line 4760 "configure"
+#line 4761 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4767,7 +4768,7 @@ int main() {
 dnet_ntoa()
 ; return 0; }
 EOF
-if { (eval echo configure:4771: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4772: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4796,10 +4797,10 @@ fi
     # The nsl library prevents programs from opening the X display
     # on Irix 5.2, according to dickey@clark.net.
     echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
-echo "configure:4800: checking for gethostbyname" >&5
+echo "configure:4801: checking for gethostbyname" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 4803 "configure"
+#line 4804 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char gethostbyname(); below.  */
@@ -4822,7 +4823,7 @@ gethostbyname();
 
 ; return 0; }
 EOF
-if { (eval echo configure:4826: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4827: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_gethostbyname=yes"
 else
@@ -4843,12 +4844,12 @@ fi
     if test $ac_cv_func_gethostbyname = no; then
       
 echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
-echo "configure:4847: checking for gethostbyname in -lnsl" >&5
+echo "configure:4848: checking for gethostbyname in -lnsl" >&5
 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lnsl "
 cat > conftest.$ac_ext <<EOF
-#line 4852 "configure"
+#line 4853 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4859,7 +4860,7 @@ int main() {
 gethostbyname()
 ; return 0; }
 EOF
-if { (eval echo configure:4863: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4864: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4889,10 +4890,10 @@ fi
     # -lsocket must be given before -lnsl if both are needed.
     # We assume that if connect needs -lnsl, so does gethostbyname.
     echo $ac_n "checking for connect""... $ac_c" 1>&6
-echo "configure:4893: checking for connect" >&5
+echo "configure:4894: checking for connect" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 4896 "configure"
+#line 4897 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char connect(); below.  */
@@ -4915,7 +4916,7 @@ connect();
 
 ; return 0; }
 EOF
-if { (eval echo configure:4919: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4920: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_connect=yes"
 else
@@ -4938,12 +4939,12 @@ fi
 xe_msg_checking="for connect in -lsocket"
 test -n "$X_EXTRA_LIBS" && xe_msg_checking="$xe_msg_checking using extra libs $X_EXTRA_LIBS"
 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
-echo "configure:4942: checking "$xe_msg_checking"" >&5
+echo "configure:4943: checking "$xe_msg_checking"" >&5
 ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lsocket $X_EXTRA_LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4947 "configure"
+#line 4948 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4954,7 +4955,7 @@ int main() {
 connect()
 ; return 0; }
 EOF
-if { (eval echo configure:4958: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4959: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4978,10 +4979,10 @@ fi
 
     # gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX.
     echo $ac_n "checking for remove""... $ac_c" 1>&6
-echo "configure:4982: checking for remove" >&5
+echo "configure:4983: checking for remove" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 4985 "configure"
+#line 4986 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char remove(); below.  */
@@ -5004,7 +5005,7 @@ remove();
 
 ; return 0; }
 EOF
-if { (eval echo configure:5008: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5009: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_remove=yes"
 else
@@ -5025,12 +5026,12 @@ fi
     if test $ac_cv_func_remove = no; then
       
 echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6
-echo "configure:5029: checking for remove in -lposix" >&5
+echo "configure:5030: checking for remove in -lposix" >&5
 ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lposix "
 cat > conftest.$ac_ext <<EOF
-#line 5034 "configure"
+#line 5035 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -5041,7 +5042,7 @@ int main() {
 remove()
 ; return 0; }
 EOF
-if { (eval echo configure:5045: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5046: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5065,10 +5066,10 @@ fi
 
     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
     echo $ac_n "checking for shmat""... $ac_c" 1>&6
-echo "configure:5069: checking for shmat" >&5
+echo "configure:5070: checking for shmat" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 5072 "configure"
+#line 5073 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char shmat(); below.  */
@@ -5091,7 +5092,7 @@ shmat();
 
 ; return 0; }
 EOF
-if { (eval echo configure:5095: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5096: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_shmat=yes"
 else
@@ -5112,12 +5113,12 @@ fi
     if test $ac_cv_func_shmat = no; then
       
 echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6
-echo "configure:5116: checking for shmat in -lipc" >&5
+echo "configure:5117: checking for shmat in -lipc" >&5
 ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lipc "
 cat > conftest.$ac_ext <<EOF
-#line 5121 "configure"
+#line 5122 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -5128,7 +5129,7 @@ int main() {
 shmat()
 ; return 0; }
 EOF
-if { (eval echo configure:5132: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5133: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5162,12 +5163,12 @@ fi
   #  --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
   
 echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>&6
-echo "configure:5166: checking for IceConnectionNumber in -lICE" >&5
+echo "configure:5167: checking for IceConnectionNumber in -lICE" >&5
 ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lICE "
 cat > conftest.$ac_ext <<EOF
-#line 5171 "configure"
+#line 5172 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -5178,7 +5179,7 @@ int main() {
 IceConnectionNumber()
 ; return 0; }
 EOF
-if { (eval echo configure:5182: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5183: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5253,6 +5254,8 @@ EOF
       break;     fi
   done
 
+    if test "$GCC" = yes -a -d /usr/shlib; then X_LIBS="$X_LIBS -L/usr/shlib" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-L/usr/shlib\" to \$X_LIBS"; fi; fi
+
   ld_switch_x_site="$X_LIBS"
 
   
@@ -5304,8 +5307,8 @@ if test "$GCC" = "yes"; then
   set x $ld_switch_run; shift; ld_switch_run=""
   while test -n "$1"; do
     case $1 in
-      -L  | -l  | -u         ) ld_switch_run="$ld_switch_run $1 $2"; shift ;;
-      -L* | -l* | -u* | -Wl* ) ld_switch_run="$ld_switch_run $1" ;;
+      -L  | -l  | -u               ) ld_switch_run="$ld_switch_run $1 $2"; shift ;;
+      -L* | -l* | -u* | -Wl* | -pg ) ld_switch_run="$ld_switch_run $1" ;;
       -Xlinker* ) ;;
       * ) ld_switch_run="$ld_switch_run -Xlinker $1" ;;
     esac
@@ -5345,7 +5348,7 @@ EOF
 
 
     echo "checking for X defines extracted by xmkmf" 1>&6
-echo "configure:5349: checking for X defines extracted by xmkmf" >&5
+echo "configure:5352: checking for X defines extracted by xmkmf" >&5
   rm -fr conftestdir
   if mkdir conftestdir; then
     cd conftestdir
@@ -5377,15 +5380,15 @@ EOF
 
     ac_safe=`echo "X11/Intrinsic.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for X11/Intrinsic.h""... $ac_c" 1>&6
-echo "configure:5381: checking for X11/Intrinsic.h" >&5
+echo "configure:5384: checking for X11/Intrinsic.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 5384 "configure"
+#line 5387 "configure"
 #include "confdefs.h"
 #include <X11/Intrinsic.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5389: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5392: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5409,12 +5412,12 @@ fi
 
       
 echo $ac_n "checking for XOpenDisplay in -lX11""... $ac_c" 1>&6
-echo "configure:5413: checking for XOpenDisplay in -lX11" >&5
+echo "configure:5416: checking for XOpenDisplay in -lX11" >&5
 ac_lib_var=`echo X11'_'XOpenDisplay | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lX11 "
 cat > conftest.$ac_ext <<EOF
-#line 5418 "configure"
+#line 5421 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -5425,7 +5428,7 @@ int main() {
 XOpenDisplay()
 ; return 0; }
 EOF
-if { (eval echo configure:5429: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5432: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5450,12 +5453,12 @@ fi
 xe_msg_checking="for XGetFontProperty in -lX11"
 test -n "-b i486-linuxaout" && xe_msg_checking="$xe_msg_checking using extra libs -b i486-linuxaout"
 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
-echo "configure:5454: checking "$xe_msg_checking"" >&5
+echo "configure:5457: checking "$xe_msg_checking"" >&5
 ac_lib_var=`echo X11'_'XGetFontProperty | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lX11 -b i486-linuxaout"
 cat > conftest.$ac_ext <<EOF
-#line 5459 "configure"
+#line 5462 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -5466,7 +5469,7 @@ int main() {
 XGetFontProperty()
 ; return 0; }
 EOF
-if { (eval echo configure:5470: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5473: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5493,12 +5496,12 @@ fi
 
     
 echo $ac_n "checking for XShapeSelectInput in -lXext""... $ac_c" 1>&6
-echo "configure:5497: checking for XShapeSelectInput in -lXext" >&5
+echo "configure:5500: checking for XShapeSelectInput in -lXext" >&5
 ac_lib_var=`echo Xext'_'XShapeSelectInput | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lXext "
 cat > conftest.$ac_ext <<EOF
-#line 5502 "configure"
+#line 5505 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -5509,7 +5512,7 @@ int main() {
 XShapeSelectInput()
 ; return 0; }
 EOF
-if { (eval echo configure:5513: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5516: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5532,12 +5535,12 @@ fi
 
     
 echo $ac_n "checking for XtOpenDisplay in -lXt""... $ac_c" 1>&6
-echo "configure:5536: checking for XtOpenDisplay in -lXt" >&5
+echo "configure:5539: checking for XtOpenDisplay in -lXt" >&5
 ac_lib_var=`echo Xt'_'XtOpenDisplay | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lXt "
 cat > conftest.$ac_ext <<EOF
-#line 5541 "configure"
+#line 5544 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -5548,7 +5551,7 @@ int main() {
 XtOpenDisplay()
 ; return 0; }
 EOF
-if { (eval echo configure:5552: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5555: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5571,17 +5574,18 @@ fi
 
 
   echo $ac_n "checking the version of X11 being used""... $ac_c" 1>&6
-echo "configure:5575: checking the version of X11 being used" >&5
+echo "configure:5578: checking the version of X11 being used" >&5
   cat > conftest.$ac_ext <<EOF
-#line 5577 "configure"
+#line 5580 "configure"
 #include "confdefs.h"
 #include <X11/Intrinsic.h>
     int main(int c, char *v[]) { return c>1 ? XlibSpecificationRelease : 0; }
 EOF
-if { (eval echo configure:5582: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
+if { (eval echo configure:5585: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
 then
   ./conftest foobar; x11_release=$?
 else
+  conftest_rc="$?"
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -fr conftest*
@@ -5602,15 +5606,15 @@ EOF
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5606: checking for $ac_hdr" >&5
+echo "configure:5610: checking for $ac_hdr" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 5609 "configure"
+#line 5613 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5614: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5618: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5641,7 +5645,7 @@ done
 
 
     echo $ac_n "checking for XFree86""... $ac_c" 1>&6
-echo "configure:5645: checking for XFree86" >&5
+echo "configure:5649: checking for XFree86" >&5
   if test -d "/usr/X386/include" -o \
           -f "/etc/XF86Config"    -o \
          -f "/etc/X11/XF86Config" -o \
@@ -5661,12 +5665,12 @@ EOF
 
     test -z "$with_xmu" && { 
 echo $ac_n "checking for XmuReadBitmapDataFromFile in -lXmu""... $ac_c" 1>&6
-echo "configure:5665: checking for XmuReadBitmapDataFromFile in -lXmu" >&5
+echo "configure:5669: checking for XmuReadBitmapDataFromFile in -lXmu" >&5
 ac_lib_var=`echo Xmu'_'XmuReadBitmapDataFromFile | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lXmu "
 cat > conftest.$ac_ext <<EOF
-#line 5670 "configure"
+#line 5674 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -5677,7 +5681,7 @@ int main() {
 XmuReadBitmapDataFromFile()
 ; return 0; }
 EOF
-if { (eval echo configure:5681: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5685: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5716,19 +5720,19 @@ EOF
 
       
 echo $ac_n "checking for main in -lXbsd""... $ac_c" 1>&6
-echo "configure:5720: checking for main in -lXbsd" >&5
+echo "configure:5724: checking for main in -lXbsd" >&5
 ac_lib_var=`echo Xbsd'_'main | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lXbsd "
 cat > conftest.$ac_ext <<EOF
-#line 5725 "configure"
+#line 5729 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:5732: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5736: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5765,22 +5769,22 @@ fi
 fi 
 if test "$with_msw" != "no"; then
   echo "checking for MS-Windows" 1>&6
-echo "configure:5769: checking for MS-Windows" >&5
+echo "configure:5773: checking for MS-Windows" >&5
   
 echo $ac_n "checking for main in -lgdi32""... $ac_c" 1>&6
-echo "configure:5772: checking for main in -lgdi32" >&5
+echo "configure:5776: checking for main in -lgdi32" >&5
 ac_lib_var=`echo gdi32'_'main | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lgdi32 "
 cat > conftest.$ac_ext <<EOF
-#line 5777 "configure"
+#line 5781 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:5784: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5788: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5811,6 +5815,7 @@ EOF
 
     install_pp="$blddir/lib-src/installexe.sh"
     libs_system="$libs_system -lshell32 -lgdi32 -luser32 -lcomctl32" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-lshell32 -lgdi32 -luser32 -lcomctl32\" to \$libs_system"; fi
+    test "$with_dragndrop" != no && dragndrop_proto="$dragndrop_proto msw" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"msw\" to \$dragndrop_proto"; fi
     if test "$window_system" != x11; then
        window_system=msw
        test "$with_scrollbars" != "no" && with_scrollbars=msw \
@@ -5830,7 +5835,7 @@ EOF
    echo "    xemacs will be linked with \"dialog-msw.o\""
  fi
     else
-       test "$with_scrollbars"   != "no" && extra_objs="$extra_objs scrollbar-msw.o" &&  if test "$extra_verbose" = "yes"; then
+       test "$with_scrollbars" != "no" && extra_objs="$extra_objs scrollbar-msw.o" &&  if test "$extra_verbose" = "yes"; then
    echo "    xemacs will be linked with \"scrollbar-msw.o\""
  fi
        test "$with_menubars"   != "no" && extra_objs="$extra_objs menubar-msw.o" &&  if test "$extra_verbose" = "yes"; then
@@ -5839,17 +5844,17 @@ EOF
        test "$with_toolbars"   != "no" && extra_objs="$extra_objs toolbar-msw.o" &&  if test "$extra_verbose" = "yes"; then
    echo "    xemacs will be linked with \"toolbar-msw.o\""
  fi
-       test "$with_dialogs"   != "no" && extra_objs="$extra_objs dialog-msw.o" &&  if test "$extra_verbose" = "yes"; then
+       test "$with_dialogs"    != "no" && extra_objs="$extra_objs dialog-msw.o" &&  if test "$extra_verbose" = "yes"; then
    echo "    xemacs will be linked with \"dialog-msw.o\""
  fi
     fi
         cat > conftest.$ac_ext <<EOF
-#line 5848 "configure"
+#line 5853 "configure"
 #include "confdefs.h"
 #include <fcntl.h>
     int main() { return (open("/dev/windows", O_RDONLY, 0) > 0)? 0 : 1; }
 EOF
-if { (eval echo configure:5853: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
+if { (eval echo configure:5858: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
 then
   { test "$extra_verbose" = "yes" && cat << \EOF
     Defining HAVE_MSG_SELECT
@@ -5860,16 +5865,15 @@ EOF
 }
 
 else
+  conftest_rc="$?"
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
 fi
 rm -fr conftest*
     const_is_losing=no
     with_file_coding=yes
-    use_minimal_tagbits=yes
-    use_indexed_lrecord_implementation=yes
-    extra_objs="$extra_objs console-msw.o device-msw.o event-msw.o frame-msw.o objects-msw.o select-msw.o redisplay-msw.o glyphs-msw.o" &&  if test "$extra_verbose" = "yes"; then
-   echo "    xemacs will be linked with \"console-msw.o device-msw.o event-msw.o frame-msw.o objects-msw.o select-msw.o redisplay-msw.o glyphs-msw.o\""
+    extra_objs="$extra_objs console-msw.o device-msw.o event-msw.o frame-msw.o objects-msw.o select-msw.o redisplay-msw.o glyphs-msw.o gui-msw.o" &&  if test "$extra_verbose" = "yes"; then
+   echo "    xemacs will be linked with \"console-msw.o device-msw.o event-msw.o frame-msw.o objects-msw.o select-msw.o redisplay-msw.o glyphs-msw.o gui-msw.o\""
  fi
   fi
 fi
@@ -5879,7 +5883,7 @@ fi
 test -z "$window_system" && window_system="none"
 
 if test "$window_system" = "none"; then
-  for feature in menubars scrollbars toolbars dialogs dragndrop
+  for feature in menubars scrollbars toolbars dialogs dragndrop xface
   do
     if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
        echo "configure: warning: --with-$feature ignored:  Not valid without window system support" 1>&2
@@ -5903,8 +5907,7 @@ else
 fi
 
 if test "$with_x11" != "yes"; then
-            for feature in tooltalk cde offix session xim xmu \
-                 xface
+            for feature in tooltalk cde offix session xim xmu
   do
     if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
        echo "configure: warning: --with-$feature ignored:  Not valid without X support" 1>&2
@@ -5927,7 +5930,7 @@ case "$x_libraries" in *X11R4* )
 esac
 
 echo "checking for session-management option" 1>&6
-echo "configure:5931: checking for session-management option" >&5;
+echo "configure:5934: checking for session-management option" >&5;
 if test "$with_session" != "no"; then
   { test "$extra_verbose" = "yes" && cat << \EOF
     Defining HAVE_SESSION
@@ -5942,15 +5945,15 @@ fi
 test -z "$with_xauth" && test "$window_system" = "none" && with_xauth=no
 test -z "$with_xauth" && { ac_safe=`echo "X11/Xauth.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for X11/Xauth.h""... $ac_c" 1>&6
-echo "configure:5946: checking for X11/Xauth.h" >&5
+echo "configure:5949: checking for X11/Xauth.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 5949 "configure"
+#line 5952 "configure"
 #include "confdefs.h"
 #include <X11/Xauth.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5954: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5957: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5973,12 +5976,12 @@ fi
  }
 test -z "$with_xauth" && { 
 echo $ac_n "checking for XauGetAuthByAddr in -lXau""... $ac_c" 1>&6
-echo "configure:5977: checking for XauGetAuthByAddr in -lXau" >&5
+echo "configure:5980: checking for XauGetAuthByAddr in -lXau" >&5
 ac_lib_var=`echo Xau'_'XauGetAuthByAddr | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lXau "
 cat > conftest.$ac_ext <<EOF
-#line 5982 "configure"
+#line 5985 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -5989,7 +5992,7 @@ int main() {
 XauGetAuthByAddr()
 ; return 0; }
 EOF
-if { (eval echo configure:5993: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5996: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6034,15 +6037,15 @@ if test "$with_tooltalk" != "no" ; then
       for dir in "" "Tt/" "desktop/" ; do
     ac_safe=`echo "${dir}tt_c.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for ${dir}tt_c.h""... $ac_c" 1>&6
-echo "configure:6038: checking for ${dir}tt_c.h" >&5
+echo "configure:6041: checking for ${dir}tt_c.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 6041 "configure"
+#line 6044 "configure"
 #include "confdefs.h"
 #include <${dir}tt_c.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6046: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6049: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6078,12 +6081,12 @@ if test "$with_tooltalk" != "no" ; then
 xe_msg_checking="for tt_message_create in -ltt"
 test -n "$extra_libs" && xe_msg_checking="$xe_msg_checking using extra libs $extra_libs"
 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
-echo "configure:6082: checking "$xe_msg_checking"" >&5
+echo "configure:6085: checking "$xe_msg_checking"" >&5
 ac_lib_var=`echo tt'_'tt_message_create | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -ltt $extra_libs"
 cat > conftest.$ac_ext <<EOF
-#line 6087 "configure"
+#line 6090 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -6094,7 +6097,7 @@ int main() {
 tt_message_create()
 ; return 0; }
 EOF
-if { (eval echo configure:6098: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6101: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6151,15 +6154,15 @@ fi
 
 test -z "$with_cde" && { ac_safe=`echo "Dt/Dt.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for Dt/Dt.h""... $ac_c" 1>&6
-echo "configure:6155: checking for Dt/Dt.h" >&5
+echo "configure:6158: checking for Dt/Dt.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 6158 "configure"
+#line 6161 "configure"
 #include "confdefs.h"
 #include <Dt/Dt.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6163: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6166: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6182,12 +6185,12 @@ fi
  }
 test -z "$with_cde" && { 
 echo $ac_n "checking for DtDndDragStart in -lDtSvc""... $ac_c" 1>&6
-echo "configure:6186: checking for DtDndDragStart in -lDtSvc" >&5
+echo "configure:6189: checking for DtDndDragStart in -lDtSvc" >&5
 ac_lib_var=`echo DtSvc'_'DtDndDragStart | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lDtSvc "
 cat > conftest.$ac_ext <<EOF
-#line 6191 "configure"
+#line 6194 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -6198,7 +6201,7 @@ int main() {
 DtDndDragStart()
 ; return 0; }
 EOF
-if { (eval echo configure:6202: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6205: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6267,7 +6270,7 @@ EOF
 fi
 
 echo $ac_n "checking if drag and drop API is needed""... $ac_c" 1>&6
-echo "configure:6271: checking if drag and drop API is needed" >&5
+echo "configure:6274: checking if drag and drop API is needed" >&5
 if test "$with_dragndrop" != "no" ; then
   if test -n "$dragndrop_proto" ; then
     with_dragndrop=yes
@@ -6288,18 +6291,18 @@ EOF
 fi
 
 echo "checking for LDAP" 1>&6
-echo "configure:6292: checking for LDAP" >&5
+echo "configure:6295: checking for LDAP" >&5
 test -z "$with_ldap" && { ac_safe=`echo "ldap.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for ldap.h""... $ac_c" 1>&6
-echo "configure:6295: checking for ldap.h" >&5
+echo "configure:6298: checking for ldap.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 6298 "configure"
+#line 6301 "configure"
 #include "confdefs.h"
 #include <ldap.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6303: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6306: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6322,15 +6325,15 @@ fi
  }
 test -z "$with_ldap" && { ac_safe=`echo "lber.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for lber.h""... $ac_c" 1>&6
-echo "configure:6326: checking for lber.h" >&5
+echo "configure:6329: checking for lber.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 6329 "configure"
+#line 6332 "configure"
 #include "confdefs.h"
 #include <lber.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6334: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6337: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6356,12 +6359,12 @@ if test "$with_ldap" != "no"; then
 xe_msg_checking="for ldap_open in -lldap"
 test -n "-llber" && xe_msg_checking="$xe_msg_checking using extra libs -llber"
 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
-echo "configure:6360: checking "$xe_msg_checking"" >&5
+echo "configure:6363: checking "$xe_msg_checking"" >&5
 ac_lib_var=`echo ldap'_'ldap_open | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lldap -llber"
 cat > conftest.$ac_ext <<EOF
-#line 6365 "configure"
+#line 6368 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -6372,7 +6375,7 @@ int main() {
 ldap_open()
 ; return 0; }
 EOF
-if { (eval echo configure:6376: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6379: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6395,12 +6398,12 @@ fi
  }
   test "$with_umich_ldap" = "no" && { 
 echo $ac_n "checking for ldap_set_option in -lldap10""... $ac_c" 1>&6
-echo "configure:6399: checking for ldap_set_option in -lldap10" >&5
+echo "configure:6402: checking for ldap_set_option in -lldap10" >&5
 ac_lib_var=`echo ldap10'_'ldap_set_option | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lldap10 "
 cat > conftest.$ac_ext <<EOF
-#line 6404 "configure"
+#line 6407 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -6411,7 +6414,7 @@ int main() {
 ldap_set_option()
 ; return 0; }
 EOF
-if { (eval echo configure:6415: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6418: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6475,14 +6478,15 @@ fi
 
 if test "$window_system" != "none"; then
   echo "checking for graphics libraries" 1>&6
-echo "configure:6479: checking for graphics libraries" >&5
+echo "configure:6482: checking for graphics libraries" >&5
 
-    if test -z "$with_xpm"; then
+    xpm_problem=""
+  if test -z "$with_xpm"; then
     echo $ac_n "checking for Xpm - no older than 3.4f""... $ac_c" 1>&6
-echo "configure:6483: checking for Xpm - no older than 3.4f" >&5
+echo "configure:6487: checking for Xpm - no older than 3.4f" >&5
     xe_check_libs=-lXpm
     cat > conftest.$ac_ext <<EOF
-#line 6486 "configure"
+#line 6490 "configure"
 #include "confdefs.h"
 #include <X11/xpm.h>
     int main(int c, char **v) {
@@ -6490,27 +6494,28 @@ echo "configure:6483: checking for Xpm - no older than 3.4f" >&5
       XpmIncludeVersion != XpmLibraryVersion() ? 1 :
       XpmIncludeVersion < 30406 ? 2 : 0 ;}
 EOF
-if { (eval echo configure:6494: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
+if { (eval echo configure:6498: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
 then
   ./conftest dummy_arg; xpm_status=$?;
-      if test "$?" = "0"; then
+      if test "$xpm_status" = "0"; then
         with_xpm=yes;
       else
         with_xpm=no;
-        if test "$?" = "1"; then
+        if test "$xpm_status" = "1"; then
           xpm_problem="Xpm library version and header file version don't match!"
-        elif test "$?" = "2"; then
+        elif test "$xpm_status" = "2"; then
           xpm_problem="Xpm library version is too old!"
         else
           xpm_problem="Internal xpm detection logic error!"
         fi
         echo "
-*** WARNING *** $problem
+*** WARNING *** $xpm_problem
   I'm not touching that with a 10-foot pole!
   If you really want to use the installed version of Xpm, rerun
-  configure --with-xpm=yes, but don't blame me if XEmacs crashes!"
+  configure and add '--with-xpm=yes', but don't blame me if XEmacs crashes!"
     fi
 else
+  conftest_rc="$?"
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -fr conftest*
@@ -6531,17 +6536,17 @@ EOF
 
     libs_x="-lXpm $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXpm\" to \$libs_x"; fi
     echo $ac_n "checking for \"FOR_MSW\" xpm""... $ac_c" 1>&6
-echo "configure:6535: checking for \"FOR_MSW\" xpm" >&5
+echo "configure:6540: checking for \"FOR_MSW\" xpm" >&5
     xe_check_libs=-lXpm
     cat > conftest.$ac_ext <<EOF
-#line 6538 "configure"
+#line 6543 "configure"
 #include "confdefs.h"
 
 int main() {
 XpmCreatePixmapFromData()
 ; return 0; }
 EOF
-if { (eval echo configure:6545: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6550: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   xpm_for_msw=no
 else
@@ -6565,58 +6570,53 @@ EOF
     fi
   fi
 
-      if test "$with_png $with_tiff" != "no no"; then
-    
-echo $ac_n "checking for inflate in -lc""... $ac_c" 1>&6
-echo "configure:6572: checking for inflate in -lc" >&5
-ac_lib_var=`echo c'_'inflate | sed 'y%./+-%__p_%'`
+    test -z "$with_xface" && { ac_safe=`echo "compface.h" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for compface.h""... $ac_c" 1>&6
+echo "configure:6576: checking for compface.h" >&5
 
-xe_check_libs=" -lc "
 cat > conftest.$ac_ext <<EOF
-#line 6577 "configure"
+#line 6579 "configure"
 #include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char inflate();
-
-int main() {
-inflate()
-; return 0; }
+#include <compface.h>
 EOF
-if { (eval echo configure:6588: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:6584: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out`
+if test -z "$ac_err"; then
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+  eval "ac_cv_header_$ac_safe=yes"
 else
+  echo "$ac_err" >&5
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+  eval "ac_cv_header_$ac_safe=no"
 fi
 rm -f conftest*
-xe_check_libs=""
-
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   :
 else
   echo "$ac_t""no" 1>&6
+with_xface=no
+fi
+ }
+  test -z "$with_xface" && { 
+echo $ac_n "checking for UnGenFace in -lcompface""... $ac_c" 1>&6
+echo "configure:6607: checking for UnGenFace in -lcompface" >&5
+ac_lib_var=`echo compface'_'UnGenFace | sed 'y%./+-%__p_%'`
 
-echo $ac_n "checking for inflate in -lz""... $ac_c" 1>&6
-echo "configure:6607: checking for inflate in -lz" >&5
-ac_lib_var=`echo z'_'inflate | sed 'y%./+-%__p_%'`
-
-xe_check_libs=" -lz "
+xe_check_libs=" -lcompface "
 cat > conftest.$ac_ext <<EOF
 #line 6612 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
     builtin and then its argument prototype would still apply.  */
-char inflate();
+char UnGenFace();
 
 int main() {
-inflate()
+UnGenFace()
 ; return 0; }
 EOF
 if { (eval echo configure:6623: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
@@ -6633,17 +6633,50 @@ xe_check_libs=""
 
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
   echo "$ac_t""yes" 1>&6
-  libs_x="-lz $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lz\" to \$libs_x"; fi
+  : 
 else
   echo "$ac_t""no" 1>&6
+with_xface=no
+fi
 
-echo $ac_n "checking for inflate in -lgz""... $ac_c" 1>&6
-echo "configure:6642: checking for inflate in -lgz" >&5
-ac_lib_var=`echo gz'_'inflate | sed 'y%./+-%__p_%'`
+ }
+  test -z "$with_xface" && with_xface=yes
+  if test "$with_xface" = "yes"; then
+    { test "$extra_verbose" = "yes" && cat << \EOF
+    Defining HAVE_XFACE
+EOF
+cat >> confdefs.h <<\EOF
+#define HAVE_XFACE 1
+EOF
+}
 
-xe_check_libs=" -lgz "
+    libs_x="-lcompface $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lcompface\" to \$libs_x"; fi
+  fi
+
+        if test "$with_gif" != "no"; then
+    with_gif="yes"
+    { test "$extra_verbose" = "yes" && cat << \EOF
+    Defining HAVE_GIF
+EOF
+cat >> confdefs.h <<\EOF
+#define HAVE_GIF 1
+EOF
+}
+
+    extra_objs="$extra_objs dgif_lib.o gif_io.o" &&  if test "$extra_verbose" = "yes"; then
+   echo "    xemacs will be linked with \"dgif_lib.o gif_io.o\""
+ fi
+  fi
+
+      if test "$with_png $with_tiff" != "no no"; then
+    
+echo $ac_n "checking for inflate in -lc""... $ac_c" 1>&6
+echo "configure:6675: checking for inflate in -lc" >&5
+ac_lib_var=`echo c'_'inflate | sed 'y%./+-%__p_%'`
+
+xe_check_libs=" -lc "
 cat > conftest.$ac_ext <<EOF
-#line 6647 "configure"
+#line 6680 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -6654,7 +6687,7 @@ int main() {
 inflate()
 ; return 0; }
 EOF
-if { (eval echo configure:6658: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6691: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6668,72 +6701,63 @@ xe_check_libs=""
 
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
   echo "$ac_t""yes" 1>&6
-  libs_x="-lgz $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lgz\" to \$libs_x"; fi
+  :
 else
   echo "$ac_t""no" 1>&6
-fi
-
-
-fi
-
-
-fi
 
+echo $ac_n "checking for inflate in -lz""... $ac_c" 1>&6
+echo "configure:6710: checking for inflate in -lz" >&5
+ac_lib_var=`echo z'_'inflate | sed 'y%./+-%__p_%'`
 
-  fi
-
-    echo $ac_n "checking for gifreader""... $ac_c" 1>&6
-echo "configure:6687: checking for gifreader" >&5
-  test -z "$with_gif" && { ac_safe=`echo "gifrlib.h" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for gifrlib.h""... $ac_c" 1>&6
-echo "configure:6690: checking for gifrlib.h" >&5
-
+xe_check_libs=" -lz "
 cat > conftest.$ac_ext <<EOF
-#line 6693 "configure"
+#line 6715 "configure"
 #include "confdefs.h"
-#include <gifrlib.h>
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char inflate();
+
+int main() {
+inflate()
+; return 0; }
 EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6698: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
-if test -z "$ac_err"; then
+if { (eval echo configure:6726: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=yes"
+  eval "ac_cv_lib_$ac_lib_var=yes"
 else
-  echo "$ac_err" >&5
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=no"
+  eval "ac_cv_lib_$ac_lib_var=no"
 fi
 rm -f conftest*
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+xe_check_libs=""
+
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
   echo "$ac_t""yes" 1>&6
-  :
+  libs_x="-lz $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lz\" to \$libs_x"; fi
 else
   echo "$ac_t""no" 1>&6
-with_gif=no
-fi
- }
-  test -z "$with_gif" && { 
-echo $ac_n "checking for GetGifError in -lgifreader""... $ac_c" 1>&6
-echo "configure:6721: checking for GetGifError in -lgifreader" >&5
-ac_lib_var=`echo gifreader'_'GetGifError | sed 'y%./+-%__p_%'`
 
-xe_check_libs=" -lgifreader "
+echo $ac_n "checking for inflate in -lgz""... $ac_c" 1>&6
+echo "configure:6745: checking for inflate in -lgz" >&5
+ac_lib_var=`echo gz'_'inflate | sed 'y%./+-%__p_%'`
+
+xe_check_libs=" -lgz "
 cat > conftest.$ac_ext <<EOF
-#line 6726 "configure"
+#line 6750 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
     builtin and then its argument prototype would still apply.  */
-char GetGifError();
+char inflate();
 
 int main() {
-GetGifError()
+inflate()
 ; return 0; }
 EOF
-if { (eval echo configure:6737: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6761: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6747,37 +6771,31 @@ xe_check_libs=""
 
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
   echo "$ac_t""yes" 1>&6
-  : 
+  libs_x="-lgz $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lgz\" to \$libs_x"; fi
 else
   echo "$ac_t""no" 1>&6
-with_gif=no
 fi
 
- }
-  test -z "$with_gif" && with_gif=yes
-  if test "$with_gif" = "yes"; then
-    { test "$extra_verbose" = "yes" && cat << \EOF
-    Defining HAVE_GIF
-EOF
-cat >> confdefs.h <<\EOF
-#define HAVE_GIF 1
-EOF
-}
 
-    libs_x="-lgifreader $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lgifreader\" to \$libs_x"; fi
+fi
+
+
+fi
+
+
   fi
 
     test -z "$with_jpeg" && { ac_safe=`echo "jpeglib.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for jpeglib.h""... $ac_c" 1>&6
-echo "configure:6773: checking for jpeglib.h" >&5
+echo "configure:6791: checking for jpeglib.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 6776 "configure"
+#line 6794 "configure"
 #include "confdefs.h"
 #include <jpeglib.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6781: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6799: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6800,12 +6818,12 @@ fi
  }
   test -z "$with_jpeg" && { 
 echo $ac_n "checking for jpeg_destroy_decompress in -ljpeg""... $ac_c" 1>&6
-echo "configure:6804: checking for jpeg_destroy_decompress in -ljpeg" >&5
+echo "configure:6822: checking for jpeg_destroy_decompress in -ljpeg" >&5
 ac_lib_var=`echo jpeg'_'jpeg_destroy_decompress | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -ljpeg "
 cat > conftest.$ac_ext <<EOF
-#line 6809 "configure"
+#line 6827 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -6816,7 +6834,7 @@ int main() {
 jpeg_destroy_decompress()
 ; return 0; }
 EOF
-if { (eval echo configure:6820: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6838: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6850,34 +6868,12 @@ EOF
     libs_x="-ljpeg $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-ljpeg\" to \$libs_x"; fi
   fi
 
-    if test -z "$with_png"; then
-    echo $ac_n "checking for png.h - no older than 0.96""... $ac_c" 1>&6
-echo "configure:6856: checking for png.h - no older than 0.96" >&5
-    cat > conftest.$ac_ext <<EOF
-#line 6858 "configure"
-#include "confdefs.h"
-#include <png.h>
-#if PNG_LIBPNG_VER >= 96
-yes
-#endif
-
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "yes" >/dev/null 2>&1; then
-  rm -rf conftest*
-  echo "$ac_t""yes" 1>&6
-else
-  rm -rf conftest*
-  echo "$ac_t""no" 1>&6; with_png=no
-fi
-rm -f conftest*
-
-  fi
+    png_problem=""
   test -z "$with_png" && { echo $ac_n "checking for pow""... $ac_c" 1>&6
-echo "configure:6878: checking for pow" >&5
+echo "configure:6874: checking for pow" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 6881 "configure"
+#line 6877 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char pow(); below.  */
@@ -6900,7 +6896,7 @@ pow();
 
 ; return 0; }
 EOF
-if { (eval echo configure:6904: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6900: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_pow=yes"
 else
@@ -6919,14 +6915,45 @@ else
 with_png=no
 fi
  }
+  test -z "$with_png" && { ac_safe=`echo "png.h" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for png.h""... $ac_c" 1>&6
+echo "configure:6921: checking for png.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 6924 "configure"
+#include "confdefs.h"
+#include <png.h>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:6929: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out`
+if test -z "$ac_err"; then
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=yes"
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  :
+else
+  echo "$ac_t""no" 1>&6
+with_png=no
+fi
+ }
   test -z "$with_png" && { 
 echo $ac_n "checking for png_read_image in -lpng""... $ac_c" 1>&6
-echo "configure:6925: checking for png_read_image in -lpng" >&5
+echo "configure:6952: checking for png_read_image in -lpng" >&5
 ac_lib_var=`echo png'_'png_read_image | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lpng "
 cat > conftest.$ac_ext <<EOF
-#line 6930 "configure"
+#line 6957 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -6937,7 +6964,7 @@ int main() {
 png_read_image()
 ; return 0; }
 EOF
-if { (eval echo configure:6941: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6968: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6958,7 +6985,48 @@ with_png=no
 fi
 
  }
-  test -z "$with_png" && with_png=yes
+  if test -z "$with_png"; then
+    echo $ac_n "checking for workable png version information""... $ac_c" 1>&6
+echo "configure:6991: checking for workable png version information" >&5
+    xe_check_libs="-lpng -lz"
+    cat > conftest.$ac_ext <<EOF
+#line 6994 "configure"
+#include "confdefs.h"
+#include <png.h>
+    int main(int c, char **v) {
+    if (c == 1) return 0;
+    if (strcmp(png_libpng_ver, PNG_LIBPNG_VER_STRING) != 0) return 1;
+    return (PNG_LIBPNG_VER < 10002) ? 2 : 0 ;}
+EOF
+if { (eval echo configure:7002: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
+then
+  ./conftest dummy_arg; png_status=$?;
+      if test "$png_status" = "0"; then
+       with_png=yes;
+      else
+       with_png=no;
+       if test "$png_status" = "1"; then
+         png_problem="PNG library version and header file don't match!"
+        elif test "$png_status" = "2"; then
+         png_problem="PNG library version too old (pre 1.0.2)!"
+       fi
+       echo "
+*** WARNING *** $png_problem
+  I'm not touching that with a 10-foot pole!
+  If you really want to use the installed version of libPNG, rerun
+  configure and add '--with-png=yes', but don't blame me if XEmacs crashes!"
+    fi
+else
+  conftest_rc="$?"
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -fr conftest*
+  with_png=no
+fi
+rm -fr conftest*
+    xe_check_libs=
+    echo "$ac_t""$with_png" 1>&6
+  fi
   if test "$with_png" = "yes"; then
     { test "$extra_verbose" = "yes" && cat << \EOF
     Defining HAVE_PNG
@@ -6973,15 +7041,15 @@ EOF
 
     test -z "$with_tiff" && { ac_safe=`echo "tiffio.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for tiffio.h""... $ac_c" 1>&6
-echo "configure:6977: checking for tiffio.h" >&5
+echo "configure:7045: checking for tiffio.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 6980 "configure"
+#line 7048 "configure"
 #include "confdefs.h"
 #include <tiffio.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6985: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7053: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -7004,12 +7072,12 @@ fi
  }
   test -z "$with_tiff" && { 
 echo $ac_n "checking for TIFFClientOpen in -ltiff""... $ac_c" 1>&6
-echo "configure:7008: checking for TIFFClientOpen in -ltiff" >&5
+echo "configure:7076: checking for TIFFClientOpen in -ltiff" >&5
 ac_lib_var=`echo tiff'_'TIFFClientOpen | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -ltiff "
 cat > conftest.$ac_ext <<EOF
-#line 7013 "configure"
+#line 7081 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -7020,7 +7088,7 @@ int main() {
 TIFFClientOpen()
 ; return 0; }
 EOF
-if { (eval echo configure:7024: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7092: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7059,99 +7127,16 @@ fi
 if test "$with_x11" = "yes"; then
 
   echo "checking for X11 graphics libraries" 1>&6
-echo "configure:7063: checking for X11 graphics libraries" >&5
-
-    test -z "$with_xface" && { ac_safe=`echo "compface.h" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for compface.h""... $ac_c" 1>&6
-echo "configure:7067: checking for compface.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 7070 "configure"
-#include "confdefs.h"
-#include <compface.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7075: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
-if test -z "$ac_err"; then
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=yes"
-else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=no"
-fi
-rm -f conftest*
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  :
-else
-  echo "$ac_t""no" 1>&6
-with_xface=no
-fi
- }
-  test -z "$with_xface" && { 
-echo $ac_n "checking for UnGenFace in -lcompface""... $ac_c" 1>&6
-echo "configure:7098: checking for UnGenFace in -lcompface" >&5
-ac_lib_var=`echo compface'_'UnGenFace | sed 'y%./+-%__p_%'`
-
-xe_check_libs=" -lcompface "
-cat > conftest.$ac_ext <<EOF
-#line 7103 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char UnGenFace();
-
-int main() {
-UnGenFace()
-; return 0; }
-EOF
-if { (eval echo configure:7114: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-xe_check_libs=""
-
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
-  echo "$ac_t""yes" 1>&6
-  : 
-else
-  echo "$ac_t""no" 1>&6
-with_xface=no
-fi
-
- }
-  test -z "$with_xface" && with_xface=yes
-  if test "$with_xface" = "yes"; then
-    { test "$extra_verbose" = "yes" && cat << \EOF
-    Defining HAVE_XFACE
-EOF
-cat >> confdefs.h <<\EOF
-#define HAVE_XFACE 1
-EOF
-}
-
-    libs_x="-lcompface $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lcompface\" to \$libs_x"; fi
-  fi
+echo "configure:7131: checking for X11 graphics libraries" >&5
 
     
 echo $ac_n "checking for XawScrollbarSetThumb in -lXaw""... $ac_c" 1>&6
-echo "configure:7150: checking for XawScrollbarSetThumb in -lXaw" >&5
+echo "configure:7135: checking for XawScrollbarSetThumb in -lXaw" >&5
 ac_lib_var=`echo Xaw'_'XawScrollbarSetThumb | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lXaw "
 cat > conftest.$ac_ext <<EOF
-#line 7155 "configure"
+#line 7140 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -7162,7 +7147,7 @@ int main() {
 XawScrollbarSetThumb()
 ; return 0; }
 EOF
-if { (eval echo configure:7166: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7151: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7186,15 +7171,15 @@ fi
                     
     ac_safe=`echo "Xm/Xm.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for Xm/Xm.h""... $ac_c" 1>&6
-echo "configure:7190: checking for Xm/Xm.h" >&5
+echo "configure:7175: checking for Xm/Xm.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 7193 "configure"
+#line 7178 "configure"
 #include "confdefs.h"
 #include <Xm/Xm.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7198: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7183: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -7211,12 +7196,12 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   
 echo $ac_n "checking for XmStringFree in -lXm""... $ac_c" 1>&6
-echo "configure:7215: checking for XmStringFree in -lXm" >&5
+echo "configure:7200: checking for XmStringFree in -lXm" >&5
 ac_lib_var=`echo Xm'_'XmStringFree | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lXm "
 cat > conftest.$ac_ext <<EOF
-#line 7220 "configure"
+#line 7205 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -7227,7 +7212,7 @@ int main() {
 XmStringFree()
 ; return 0; }
 EOF
-if { (eval echo configure:7231: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7216: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7256,9 +7241,9 @@ fi
 
   if test "$have_motif" = "yes"; then
         echo $ac_n "checking for Lesstif""... $ac_c" 1>&6
-echo "configure:7260: checking for Lesstif" >&5
+echo "configure:7245: checking for Lesstif" >&5
     cat > conftest.$ac_ext <<EOF
-#line 7262 "configure"
+#line 7247 "configure"
 #include "confdefs.h"
 #include <Xm/Xm.h>
 #ifdef LESSTIF_VERSION
@@ -7475,9 +7460,6 @@ test "$with_dialogs"    != "no"      && extra_objs="$extra_objs dialog.o" &&  if
 test "$with_toolbars"   != "no"      && extra_objs="$extra_objs toolbar.o" &&  if test "$extra_verbose" = "yes"; then
    echo "    xemacs will be linked with \"toolbar.o\""
  fi
-test "$all_widgets" != "no no no no" && extra_objs="$extra_objs gui.o" &&  if test "$extra_verbose" = "yes"; then
-   echo "    xemacs will be linked with \"gui.o\""
- fi
 
 if test "$with_x11" = "yes"; then
   test "$with_menubars"   != "no"      && extra_objs="$extra_objs menubar-x.o" &&  if test "$extra_verbose" = "yes"; then
@@ -7503,24 +7485,6 @@ else
   fi
 fi
 
-test "$use_minimal_tagbits" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
-    Defining USE_MINIMAL_TAGBITS
-EOF
-cat >> confdefs.h <<\EOF
-#define USE_MINIMAL_TAGBITS 1
-EOF
-}
-
-test "$use_indexed_lrecord_implementation" = "yes" && \
-  { test "$extra_verbose" = "yes" && cat << \EOF
-    Defining USE_INDEXED_LRECORD_IMPLEMENTATION
-EOF
-cat >> confdefs.h <<\EOF
-#define USE_INDEXED_LRECORD_IMPLEMENTATION 1
-EOF
-}
-
-
 
 test -z "$with_mule" && with_mule=no
 test -z "$with_file_coding" && with_file_coding=no
@@ -7542,7 +7506,7 @@ fi
 
 if test "$with_mule" = "yes" ; then
   echo "checking for Mule-related features" 1>&6
-echo "configure:7546: checking for Mule-related features" >&5
+echo "configure:7510: checking for Mule-related features" >&5
   { test "$extra_verbose" = "yes" && cat << \EOF
     Defining MULE
 EOF
@@ -7559,23 +7523,23 @@ cat >> confdefs.h <<\EOF
 EOF
 }
 
-  extra_objs="$extra_objs mule.o mule-ccl.o mule-charset.o mule-coding.o file-coding.o" &&  if test "$extra_verbose" = "yes"; then
-   echo "    xemacs will be linked with \"mule.o mule-ccl.o mule-charset.o mule-coding.o file-coding.o\""
+  extra_objs="$extra_objs mule.o mule-ccl.o mule-charset.o file-coding.o" &&  if test "$extra_verbose" = "yes"; then
+   echo "    xemacs will be linked with \"mule.o mule-ccl.o mule-charset.o file-coding.o\""
  fi
 
     for ac_hdr in libintl.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:7571: checking for $ac_hdr" >&5
+echo "configure:7535: checking for $ac_hdr" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 7574 "configure"
+#line 7538 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7579: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7543: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -7606,12 +7570,12 @@ done
 
   
 echo $ac_n "checking for strerror in -lintl""... $ac_c" 1>&6
-echo "configure:7610: checking for strerror in -lintl" >&5
+echo "configure:7574: checking for strerror in -lintl" >&5
 ac_lib_var=`echo intl'_'strerror | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lintl "
 cat > conftest.$ac_ext <<EOF
-#line 7615 "configure"
+#line 7579 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -7622,7 +7586,7 @@ int main() {
 strerror()
 ; return 0; }
 EOF
-if { (eval echo configure:7626: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7590: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7655,19 +7619,58 @@ fi
 
 
   echo "checking for Mule input methods" 1>&6
-echo "configure:7659: checking for Mule input methods" >&5
+echo "configure:7623: checking for Mule input methods" >&5
         case "$with_xim" in "" | "yes" )
     echo "checking for XIM" 1>&6
-echo "configure:7662: checking for XIM" >&5
-        if test "$have_lesstif" = "yes"; then with_xim=xlib
-    else 
+echo "configure:7626: checking for XIM" >&5
+    
+echo $ac_n "checking for XOpenIM in -lX11""... $ac_c" 1>&6
+echo "configure:7629: checking for XOpenIM in -lX11" >&5
+ac_lib_var=`echo X11'_'XOpenIM | sed 'y%./+-%__p_%'`
+
+xe_check_libs=" -lX11 "
+cat > conftest.$ac_ext <<EOF
+#line 7634 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char XOpenIM();
+
+int main() {
+XOpenIM()
+; return 0; }
+EOF
+if { (eval echo configure:7645: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+xe_check_libs=""
+
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
+  echo "$ac_t""yes" 1>&6
+  with_xim=xlib
+else
+  echo "$ac_t""no" 1>&6
+with_xim=no
+fi
+
+
+        if test "$have_motif $have_lesstif" = "yes no"; then
+      
 echo $ac_n "checking for XmImMbLookupString in -lXm""... $ac_c" 1>&6
-echo "configure:7666: checking for XmImMbLookupString in -lXm" >&5
+echo "configure:7669: checking for XmImMbLookupString in -lXm" >&5
 ac_lib_var=`echo Xm'_'XmImMbLookupString | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lXm "
 cat > conftest.$ac_ext <<EOF
-#line 7671 "configure"
+#line 7674 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -7678,7 +7681,7 @@ int main() {
 XmImMbLookupString()
 ; return 0; }
 EOF
-if { (eval echo configure:7682: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7685: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7695,11 +7698,10 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
   with_xim=motif
 else
   echo "$ac_t""no" 1>&6
-with_xim=xlib
 fi
 
 
-    fi
+    fi ;;
   esac
   if test "$with_xim" != "no"; then
     { test "$extra_verbose" = "yes" && cat << \EOF
@@ -7744,15 +7746,15 @@ EOF
 
     if test "$with_xfs" = "yes" ; then
     echo "checking for XFontSet" 1>&6
-echo "configure:7748: checking for XFontSet" >&5
+echo "configure:7750: checking for XFontSet" >&5
     
 echo $ac_n "checking for XmbDrawString in -lX11""... $ac_c" 1>&6
-echo "configure:7751: checking for XmbDrawString in -lX11" >&5
+echo "configure:7753: checking for XmbDrawString in -lX11" >&5
 ac_lib_var=`echo X11'_'XmbDrawString | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lX11 "
 cat > conftest.$ac_ext <<EOF
-#line 7756 "configure"
+#line 7758 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -7763,7 +7765,7 @@ int main() {
 XmbDrawString()
 ; return 0; }
 EOF
-if { (eval echo configure:7767: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7769: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7803,15 +7805,15 @@ EOF
     test "$with_wnn6" = "yes" && with_wnn=yes # wnn6 implies wnn support
   test -z "$with_wnn" && { ac_safe=`echo "wnn/jllib.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for wnn/jllib.h""... $ac_c" 1>&6
-echo "configure:7807: checking for wnn/jllib.h" >&5
+echo "configure:7809: checking for wnn/jllib.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 7810 "configure"
+#line 7812 "configure"
 #include "confdefs.h"
 #include <wnn/jllib.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7815: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7817: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -7836,10 +7838,10 @@ fi
     for ac_func in crypt
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:7840: checking for $ac_func" >&5
+echo "configure:7842: checking for $ac_func" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 7843 "configure"
+#line 7845 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -7862,7 +7864,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:7866: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7868: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -7891,12 +7893,12 @@ done
 
     test "$ac_cv_func_crypt" != "yes" && { 
 echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
-echo "configure:7895: checking for crypt in -lcrypt" >&5
+echo "configure:7897: checking for crypt in -lcrypt" >&5
 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lcrypt "
 cat > conftest.$ac_ext <<EOF
-#line 7900 "configure"
+#line 7902 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -7907,7 +7909,7 @@ int main() {
 crypt()
 ; return 0; }
 EOF
-if { (eval echo configure:7911: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7913: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7939,14 +7941,15 @@ fi
 
  }
   fi
-    test -z "$with_wnn" && { 
+    if test -z "$with_wnn" -o "$with_wnn" = "yes"; then
+    
 echo $ac_n "checking for jl_dic_list_e in -lwnn""... $ac_c" 1>&6
-echo "configure:7945: checking for jl_dic_list_e in -lwnn" >&5
+echo "configure:7948: checking for jl_dic_list_e in -lwnn" >&5
 ac_lib_var=`echo wnn'_'jl_dic_list_e | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lwnn "
 cat > conftest.$ac_ext <<EOF
-#line 7950 "configure"
+#line 7953 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -7957,7 +7960,7 @@ int main() {
 jl_dic_list_e()
 ; return 0; }
 EOF
-if { (eval echo configure:7961: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7964: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7971,13 +7974,125 @@ xe_check_libs=""
 
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
   echo "$ac_t""yes" 1>&6
-  :
+  libwnn=wnn
+else
+  echo "$ac_t""no" 1>&6
+echo $ac_n "checking for jl_dic_list_e in -lwnn4""... $ac_c" 1>&6
+echo "configure:7982: checking for jl_dic_list_e in -lwnn4" >&5
+ac_lib_var=`echo wnn4'_'jl_dic_list_e | sed 'y%./+-%__p_%'`
+
+xe_check_libs=" -lwnn4 "
+cat > conftest.$ac_ext <<EOF
+#line 7987 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char jl_dic_list_e();
+
+int main() {
+jl_dic_list_e()
+; return 0; }
+EOF
+if { (eval echo configure:7998: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+xe_check_libs=""
+
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
+  echo "$ac_t""yes" 1>&6
+  libwnn=wnn4
+else
+  echo "$ac_t""no" 1>&6
+echo $ac_n "checking for jl_dic_list_e in -lwnn6""... $ac_c" 1>&6
+echo "configure:8016: checking for jl_dic_list_e in -lwnn6" >&5
+ac_lib_var=`echo wnn6'_'jl_dic_list_e | sed 'y%./+-%__p_%'`
+
+xe_check_libs=" -lwnn6 "
+cat > conftest.$ac_ext <<EOF
+#line 8021 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char jl_dic_list_e();
+
+int main() {
+jl_dic_list_e()
+; return 0; }
+EOF
+if { (eval echo configure:8032: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+xe_check_libs=""
+
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
+  echo "$ac_t""yes" 1>&6
+  libwnn=wnn6
+else
+  echo "$ac_t""no" 1>&6
+echo $ac_n "checking for dic_list_e in -lwnn6_fromsrc""... $ac_c" 1>&6
+echo "configure:8050: checking for dic_list_e in -lwnn6_fromsrc" >&5
+ac_lib_var=`echo wnn6_fromsrc'_'dic_list_e | sed 'y%./+-%__p_%'`
+
+xe_check_libs=" -lwnn6_fromsrc "
+cat > conftest.$ac_ext <<EOF
+#line 8055 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char dic_list_e();
+
+int main() {
+dic_list_e()
+; return 0; }
+EOF
+if { (eval echo configure:8066: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+xe_check_libs=""
+
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
+  echo "$ac_t""yes" 1>&6
+  libwnn=wnn6_fromsrc
 else
   echo "$ac_t""no" 1>&6
 with_wnn=no
 fi
 
- }
+
+fi
+
+
+fi
+
+
+fi
+
+
+  fi
   test -z "$with_wnn" && with_wnn=yes
   if test "$with_wnn" = "yes"; then
     { test "$extra_verbose" = "yes" && cat << \EOF
@@ -7988,19 +8103,19 @@ cat >> confdefs.h <<\EOF
 EOF
 }
 
-    libs_x="-lwnn $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lwnn\" to \$libs_x"; fi
+    libs_x="-l$libwnn $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-l$libwnn\" to \$libs_x"; fi
     extra_objs="$extra_objs mule-wnnfns.o" &&  if test "$extra_verbose" = "yes"; then
    echo "    xemacs will be linked with \"mule-wnnfns.o\""
  fi
     if test "$with_wnn6" != "no"; then
       
-echo $ac_n "checking for jl_fi_dic_list in -lwnn""... $ac_c" 1>&6
-echo "configure:7999: checking for jl_fi_dic_list in -lwnn" >&5
-ac_lib_var=`echo wnn'_'jl_fi_dic_list | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for jl_fi_dic_list in -l$libwnn""... $ac_c" 1>&6
+echo "configure:8114: checking for jl_fi_dic_list in -l$libwnn" >&5
+ac_lib_var=`echo $libwnn'_'jl_fi_dic_list | sed 'y%./+-%__p_%'`
 
-xe_check_libs=" -lwnn "
+xe_check_libs=" -l$libwnn "
 cat > conftest.$ac_ext <<EOF
-#line 8004 "configure"
+#line 8119 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -8011,7 +8126,7 @@ int main() {
 jl_fi_dic_list()
 ; return 0; }
 EOF
-if { (eval echo configure:8015: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:8130: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -8046,15 +8161,15 @@ EOF
   if test "$with_canna" != "no"; then
     ac_safe=`echo "canna/jrkanji.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for canna/jrkanji.h""... $ac_c" 1>&6
-echo "configure:8050: checking for canna/jrkanji.h" >&5
+echo "configure:8165: checking for canna/jrkanji.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 8053 "configure"
+#line 8168 "configure"
 #include "confdefs.h"
 #include <canna/jrkanji.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8058: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8173: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8081,15 +8196,15 @@ fi
     c_switch_site="$c_switch_site -I/usr/local/canna/include"
     ac_safe=`echo "canna/jrkanji.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for canna/jrkanji.h""... $ac_c" 1>&6
-echo "configure:8085: checking for canna/jrkanji.h" >&5
+echo "configure:8200: checking for canna/jrkanji.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 8088 "configure"
+#line 8203 "configure"
 #include "confdefs.h"
 #include <canna/jrkanji.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8093: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8208: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8117,15 +8232,15 @@ fi
 
   test -z "$with_canna" && { ac_safe=`echo "canna/RK.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for canna/RK.h""... $ac_c" 1>&6
-echo "configure:8121: checking for canna/RK.h" >&5
+echo "configure:8236: checking for canna/RK.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 8124 "configure"
+#line 8239 "configure"
 #include "confdefs.h"
 #include <canna/RK.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8129: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8244: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8148,12 +8263,12 @@ fi
  }
   test -z "$with_canna" && { 
 echo $ac_n "checking for RkBgnBun in -lRKC""... $ac_c" 1>&6
-echo "configure:8152: checking for RkBgnBun in -lRKC" >&5
+echo "configure:8267: checking for RkBgnBun in -lRKC" >&5
 ac_lib_var=`echo RKC'_'RkBgnBun | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lRKC "
 cat > conftest.$ac_ext <<EOF
-#line 8157 "configure"
+#line 8272 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -8164,7 +8279,7 @@ int main() {
 RkBgnBun()
 ; return 0; }
 EOF
-if { (eval echo configure:8168: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:8283: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -8187,12 +8302,12 @@ fi
  }
   test -z "$with_canna" && { 
 echo $ac_n "checking for jrKanjiControl in -lcanna""... $ac_c" 1>&6
-echo "configure:8191: checking for jrKanjiControl in -lcanna" >&5
+echo "configure:8306: checking for jrKanjiControl in -lcanna" >&5
 ac_lib_var=`echo canna'_'jrKanjiControl | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lcanna "
 cat > conftest.$ac_ext <<EOF
-#line 8196 "configure"
+#line 8311 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -8203,7 +8318,7 @@ int main() {
 jrKanjiControl()
 ; return 0; }
 EOF
-if { (eval echo configure:8207: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:8322: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -8252,12 +8367,12 @@ if test "$need_motif" = "yes" ; then
   libs_x="-lXm $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXm\" to \$libs_x"; fi
     
 echo $ac_n "checking for layout_object_getvalue in -li18n""... $ac_c" 1>&6
-echo "configure:8256: checking for layout_object_getvalue in -li18n" >&5
+echo "configure:8371: checking for layout_object_getvalue in -li18n" >&5
 ac_lib_var=`echo i18n'_'layout_object_getvalue | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -li18n "
 cat > conftest.$ac_ext <<EOF
-#line 8261 "configure"
+#line 8376 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -8268,7 +8383,7 @@ int main() {
 layout_object_getvalue()
 ; return 0; }
 EOF
-if { (eval echo configure:8272: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:8387: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -8337,8 +8452,8 @@ if test "$GCC" = "yes"; then
   set x $ld_switch_run; shift; ld_switch_run=""
   while test -n "$1"; do
     case $1 in
-      -L  | -l  | -u         ) ld_switch_run="$ld_switch_run $1 $2"; shift ;;
-      -L* | -l* | -u* | -Wl* ) ld_switch_run="$ld_switch_run $1" ;;
+      -L  | -l  | -u               ) ld_switch_run="$ld_switch_run $1 $2"; shift ;;
+      -L* | -l* | -u* | -Wl* | -pg ) ld_switch_run="$ld_switch_run $1" ;;
       -Xlinker* ) ;;
       * ) ld_switch_run="$ld_switch_run -Xlinker $1" ;;
     esac
@@ -8349,15 +8464,82 @@ fi
   fi
 fi
 
-fi
+fi
+
+for ac_func in cbrt closedir dup2 eaccess fmod fpathconf frexp ftime gethostname getpagesize gettimeofday getcwd getwd logb lrand48 matherr mkdir mktime perror poll random rename res_init rint rmdir select setitimer setpgid setlocale setsid sigblock sighold sigprocmask snprintf strcasecmp strerror tzset ulimit usleep utimes waitpid vsnprintf
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:8473: checking for $ac_func" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 8476 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func(); below.  */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char $ac_func();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:8499: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+  rm -rf conftest*
+  eval "ac_cv_func_$ac_func=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+  { test "$extra_verbose" = "yes" && cat << EOF
+    Defining $ac_tr_func
+EOF
+cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+}
+else
+  echo "$ac_t""no" 1>&6
+fi
+done
+
 
-for ac_func in cbrt closedir dup2 eaccess fmod fpathconf frexp ftime gethostname getpagesize gettimeofday getcwd getwd logb lrand48 matherr mkdir mktime perror poll random rename res_init rint rmdir select setitimer setpgid setlocale setsid sigblock sighold sigprocmask snprintf strcasecmp strerror tzset ulimit usleep utimes waitpid vsnprintf
+
+case "$opsys" in
+  linuxaout* | bsdos3* | freebsd* | decosf4-0* | aix4* ) extra_objs="$extra_objs realpath.o" &&  if test "$extra_verbose" = "yes"; then
+   echo "    xemacs will be linked with \"realpath.o\""
+ fi ;;
+  * )
+    case "$canonical" in
+      *-*-sysv4.2uw2* ) extra_objs="$extra_objs realpath.o" &&  if test "$extra_verbose" = "yes"; then
+   echo "    xemacs will be linked with \"realpath.o\""
+ fi ;;
+      * ) for ac_func in realpath
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:8358: checking for $ac_func" >&5
+echo "configure:8540: checking for $ac_func" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 8361 "configure"
+#line 8543 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -8380,7 +8562,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:8384: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:8566: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -8407,20 +8589,19 @@ else
 fi
 done
 
-
-
-case "$opsys" in
-  linuxaout* | bsdos3* | freebsd* | decosf4-0* | aix4* ) extra_objs="$extra_objs realpath.o" &&  if test "$extra_verbose" = "yes"; then
+         test "$ac_cv_func_realpath" != "yes" && extra_objs="$extra_objs realpath.o" &&  if test "$extra_verbose" = "yes"; then
    echo "    xemacs will be linked with \"realpath.o\""
  fi ;;
-  * )
-    for ac_func in realpath
+    esac ;;
+esac
+
+for ac_func in getloadavg
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:8421: checking for $ac_func" >&5
+echo "configure:8602: checking for $ac_func" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 8424 "configure"
+#line 8605 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -8443,7 +8624,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:8447: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:8628: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -8470,22 +8651,125 @@ else
 fi
 done
 
-    test "$ac_cv_func_realpath" != "yes" && extra_objs="$extra_objs realpath.o" &&  if test "$extra_verbose" = "yes"; then
-   echo "    xemacs will be linked with \"realpath.o\""
- fi ;;
-esac
+
+if test "$ac_cv_func_getloadavg" != "yes"
+then
+  extra_objs="$extra_objs getloadavg.o" &&  if test "$extra_verbose" = "yes"; then
+   echo "    xemacs will be linked with \"getloadavg.o\""
+ fi
+
+    
+echo $ac_n "checking for kstat_open in -lkstat""... $ac_c" 1>&6
+echo "configure:8664: checking for kstat_open in -lkstat" >&5
+ac_lib_var=`echo kstat'_'kstat_open | sed 'y%./+-%__p_%'`
+
+xe_check_libs=" -lkstat "
+cat > conftest.$ac_ext <<EOF
+#line 8669 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char kstat_open();
+
+int main() {
+kstat_open()
+; return 0; }
+EOF
+if { (eval echo configure:8680: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+xe_check_libs=""
+
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_lib=HAVE_LIB`echo kstat | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+  { test "$extra_verbose" = "yes" && cat << EOF
+    Defining $ac_tr_lib
+EOF
+cat >> confdefs.h <<EOF
+#define $ac_tr_lib 1
+EOF
+}
+
+  LIBS="-lkstat $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lkstat\" to \$LIBS"; fi
+
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+
+
+    
+echo $ac_n "checking for kvm_read in -lkvm""... $ac_c" 1>&6
+echo "configure:8714: checking for kvm_read in -lkvm" >&5
+ac_lib_var=`echo kvm'_'kvm_read | sed 'y%./+-%__p_%'`
+
+xe_check_libs=" -lkvm "
+cat > conftest.$ac_ext <<EOF
+#line 8719 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char kvm_read();
+
+int main() {
+kvm_read()
+; return 0; }
+EOF
+if { (eval echo configure:8730: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+xe_check_libs=""
+
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_lib=HAVE_LIB`echo kvm | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+  { test "$extra_verbose" = "yes" && cat << EOF
+    Defining $ac_tr_lib
+EOF
+cat >> confdefs.h <<EOF
+#define $ac_tr_lib 1
+EOF
+}
+
+  LIBS="-lkvm $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lkvm\" to \$LIBS"; fi
+
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+
+fi
 
 echo $ac_n "checking whether netdb declares h_errno""... $ac_c" 1>&6
-echo "configure:8480: checking whether netdb declares h_errno" >&5
+echo "configure:8764: checking whether netdb declares h_errno" >&5
 cat > conftest.$ac_ext <<EOF
-#line 8482 "configure"
+#line 8766 "configure"
 #include "confdefs.h"
 #include <netdb.h>
 int main() {
 return h_errno;
 ; return 0; }
 EOF
-if { (eval echo configure:8489: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:8773: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
    { test "$extra_verbose" = "yes" && cat << \EOF
@@ -8505,16 +8789,16 @@ fi
 rm -f conftest*
 
 echo $ac_n "checking for sigsetjmp""... $ac_c" 1>&6
-echo "configure:8509: checking for sigsetjmp" >&5
+echo "configure:8793: checking for sigsetjmp" >&5
 cat > conftest.$ac_ext <<EOF
-#line 8511 "configure"
+#line 8795 "configure"
 #include "confdefs.h"
 #include <setjmp.h>
 int main() {
 sigjmp_buf bar; sigsetjmp (bar, 0);
 ; return 0; }
 EOF
-if { (eval echo configure:8518: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8802: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
    { test "$extra_verbose" = "yes" && cat << \EOF
@@ -8534,11 +8818,11 @@ fi
 rm -f conftest*
 
 echo $ac_n "checking whether localtime caches TZ""... $ac_c" 1>&6
-echo "configure:8538: checking whether localtime caches TZ" >&5
+echo "configure:8822: checking whether localtime caches TZ" >&5
 
 if test "$ac_cv_func_tzset" = "yes"; then
 cat > conftest.$ac_ext <<EOF
-#line 8542 "configure"
+#line 8826 "configure"
 #include "confdefs.h"
 #include <time.h>
 #if STDC_HEADERS
@@ -8573,10 +8857,11 @@ main()
   exit (0);
 }
 EOF
-if { (eval echo configure:8577: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
+if { (eval echo configure:8861: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
 then
   emacs_cv_localtime_cache=no
 else
+  conftest_rc="$?"
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -fr conftest*
@@ -8602,9 +8887,9 @@ fi
 
 if test "$HAVE_TIMEVAL" = "yes"; then
 echo $ac_n "checking whether gettimeofday accepts one or two arguments""... $ac_c" 1>&6
-echo "configure:8606: checking whether gettimeofday accepts one or two arguments" >&5
+echo "configure:8891: checking whether gettimeofday accepts one or two arguments" >&5
 cat > conftest.$ac_ext <<EOF
-#line 8608 "configure"
+#line 8893 "configure"
 #include "confdefs.h"
 
 #ifdef TIME_WITH_SYS_TIME
@@ -8626,7 +8911,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:8630: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:8915: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   echo "$ac_t""two" 1>&6
 else
@@ -8648,19 +8933,19 @@ fi
 
 
 echo $ac_n "checking for inline""... $ac_c" 1>&6
-echo "configure:8652: checking for inline" >&5
+echo "configure:8937: checking for inline" >&5
 
 ac_cv_c_inline=no
 for ac_kw in inline __inline__ __inline; do
   cat > conftest.$ac_ext <<EOF
-#line 8657 "configure"
+#line 8942 "configure"
 #include "confdefs.h"
 
 int main() {
 } $ac_kw foo() {
 ; return 0; }
 EOF
-if { (eval echo configure:8664: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8949: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_inline=$ac_kw; break
 else
@@ -8710,17 +8995,17 @@ fi
 # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
 # for constant arguments.  Useless!
 echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
-echo "configure:8714: checking for working alloca.h" >&5
+echo "configure:8999: checking for working alloca.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 8717 "configure"
+#line 9002 "configure"
 #include "confdefs.h"
 #include <alloca.h>
 int main() {
 char *p = alloca(2 * sizeof(int));
 ; return 0; }
 EOF
-if { (eval echo configure:8724: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:9009: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   ac_cv_header_alloca_h=yes
 else
@@ -8744,10 +9029,10 @@ EOF
 fi
 
 echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:8748: checking for alloca" >&5
+echo "configure:9033: checking for alloca" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 8751 "configure"
+#line 9036 "configure"
 #include "confdefs.h"
 
 #ifdef __GNUC__
@@ -8770,7 +9055,7 @@ int main() {
 char *p = (char *) alloca(1);
 ; return 0; }
 EOF
-if { (eval echo configure:8774: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:9059: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   ac_cv_func_alloca_works=yes
 else
@@ -8809,10 +9094,10 @@ EOF
 
 
 echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:8813: checking whether alloca needs Cray hooks" >&5
+echo "configure:9098: checking whether alloca needs Cray hooks" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 8816 "configure"
+#line 9101 "configure"
 #include "confdefs.h"
 #if defined(CRAY) && ! defined(CRAY2)
 webecray
@@ -8836,10 +9121,10 @@ echo "$ac_t""$ac_cv_os_cray" 1>&6
 if test $ac_cv_os_cray = yes; then
 for ac_func in _getb67 GETB67 getb67; do
   echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:8840: checking for $ac_func" >&5
+echo "configure:9125: checking for $ac_func" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 8843 "configure"
+#line 9128 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -8862,7 +9147,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:8866: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:9151: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -8892,10 +9177,10 @@ done
 fi
 
 echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:8896: checking stack direction for C alloca" >&5
+echo "configure:9181: checking stack direction for C alloca" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 8899 "configure"
+#line 9184 "configure"
 #include "confdefs.h"
 find_stack_direction ()
 {
@@ -8914,10 +9199,11 @@ main ()
   exit (find_stack_direction() < 0);
 }
 EOF
-if { (eval echo configure:8918: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
+if { (eval echo configure:9203: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
 then
   ac_cv_c_stack_direction=1
 else
+  conftest_rc="$?"
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -fr conftest*
@@ -8942,15 +9228,15 @@ test -n "$ALLOCA" && extra_objs="$extra_objs $ALLOCA" &&  if test "$extra_verbos
 
 ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for vfork.h""... $ac_c" 1>&6
-echo "configure:8946: checking for vfork.h" >&5
+echo "configure:9232: checking for vfork.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 8949 "configure"
+#line 9235 "configure"
 #include "confdefs.h"
 #include <vfork.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8954: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9240: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8978,10 +9264,10 @@ else
 fi
 
 echo $ac_n "checking for working vfork""... $ac_c" 1>&6
-echo "configure:8982: checking for working vfork" >&5
+echo "configure:9268: checking for working vfork" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 8985 "configure"
+#line 9271 "configure"
 #include "confdefs.h"
 /* Thanks to Paul Eggert for this test.  */
 #include <stdio.h>
@@ -9076,10 +9362,11 @@ main() {
   }
 }
 EOF
-if { (eval echo configure:9080: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
+if { (eval echo configure:9366: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
 then
   ac_cv_func_vfork_works=yes
 else
+  conftest_rc="$?"
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -fr conftest*
@@ -9101,10 +9388,10 @@ fi
 
 
 echo $ac_n "checking for working strcoll""... $ac_c" 1>&6
-echo "configure:9105: checking for working strcoll" >&5
+echo "configure:9392: checking for working strcoll" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 9108 "configure"
+#line 9395 "configure"
 #include "confdefs.h"
 #include <string.h>
 main ()
@@ -9114,10 +9401,11 @@ main ()
        strcoll ("123", "456") >= 0);
 }
 EOF
-if { (eval echo configure:9118: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
+if { (eval echo configure:9405: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
 then
   ac_cv_func_strcoll_works=yes
 else
+  conftest_rc="$?"
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -fr conftest*
@@ -9141,10 +9429,10 @@ fi
 for ac_func in getpgrp
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:9145: checking for $ac_func" >&5
+echo "configure:9433: checking for $ac_func" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 9148 "configure"
+#line 9436 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -9167,7 +9455,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:9171: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:9459: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -9195,10 +9483,10 @@ fi
 done
 
 echo $ac_n "checking whether getpgrp takes no argument""... $ac_c" 1>&6
-echo "configure:9199: checking whether getpgrp takes no argument" >&5
+echo "configure:9487: checking whether getpgrp takes no argument" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 9202 "configure"
+#line 9490 "configure"
 #include "confdefs.h"
 
 /*
@@ -9253,10 +9541,11 @@ main()
 }
 
 EOF
-if { (eval echo configure:9257: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
+if { (eval echo configure:9545: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
 then
   ac_cv_func_getpgrp_void=yes
 else
+  conftest_rc="$?"
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -fr conftest*
@@ -9279,10 +9568,10 @@ fi
 
 
 echo $ac_n "checking for working mmap""... $ac_c" 1>&6
-echo "configure:9283: checking for working mmap" >&5
+echo "configure:9572: checking for working mmap" >&5
 case "$opsys" in ultrix* ) have_mmap=no ;; *)
 cat > conftest.$ac_ext <<EOF
-#line 9286 "configure"
+#line 9575 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 #include <unistd.h>
@@ -9307,27 +9596,291 @@ int main (int argc, char *argv[])
     return 1;
 #define MAP_ANONYMOUS 0
 #endif
-  if (mmap(0, 1024, PROT_READ | PROT_WRITE,
-          MAP_PRIVATE | MAP_VARIABLE | MAP_ANONYMOUS,
-          fd, 0) != (void *) MAP_FAILED)
-    return 0;
-  perror ("conftest: mmap failed");
-  return 1;
-}
-EOF
-if { (eval echo configure:9319: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
+  if (mmap(0, 1024, PROT_READ | PROT_WRITE,
+          MAP_PRIVATE | MAP_VARIABLE | MAP_ANONYMOUS,
+          fd, 0) != (void *) MAP_FAILED)
+    return 0;
+  perror ("conftest: mmap failed");
+  return 1;
+}
+EOF
+if { (eval echo configure:9608: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
+then
+  have_mmap=yes
+else
+  conftest_rc="$?"
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -fr conftest*
+  have_mmap=no
+fi
+rm -fr conftest* ;;
+esac
+echo "$ac_t""$have_mmap" 1>&6
+test "$have_mmap" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
+    Defining HAVE_MMAP
+EOF
+cat >> confdefs.h <<\EOF
+#define HAVE_MMAP 1
+EOF
+}
+
+for ac_hdr in unistd.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:9633: checking for $ac_hdr" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 9636 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:9641: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out`
+if test -z "$ac_err"; then
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=yes"
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+  { test "$extra_verbose" = "yes" && cat << EOF
+    Defining $ac_tr_hdr
+EOF
+cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+}
+else
+  echo "$ac_t""no" 1>&6
+fi
+done
+
+for ac_func in getpagesize
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:9673: checking for $ac_func" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 9676 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func(); below.  */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char $ac_func();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:9699: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+  rm -rf conftest*
+  eval "ac_cv_func_$ac_func=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+  { test "$extra_verbose" = "yes" && cat << EOF
+    Defining $ac_tr_func
+EOF
+cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+}
+else
+  echo "$ac_t""no" 1>&6
+fi
+done
+
+echo $ac_n "checking for working mmap""... $ac_c" 1>&6
+echo "configure:9727: checking for working mmap" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 9730 "configure"
+#include "confdefs.h"
+
+/* Thanks to Mike Haertel and Jim Avera for this test.
+   Here is a matrix of mmap possibilities:
+       mmap private not fixed
+       mmap private fixed at somewhere currently unmapped
+       mmap private fixed at somewhere already mapped
+       mmap shared not fixed
+       mmap shared fixed at somewhere currently unmapped
+       mmap shared fixed at somewhere already mapped
+   For private mappings, we should verify that changes cannot be read()
+   back from the file, nor mmap's back from the file at a different
+   address.  (There have been systems where private was not correctly
+   implemented like the infamous i386 svr4.0, and systems where the
+   VM page cache was not coherent with the filesystem buffer cache
+   like early versions of FreeBSD and possibly contemporary NetBSD.)
+   For shared mappings, we should conversely verify that changes get
+   propogated back to all the places they're supposed to be.
+
+   Grep wants private fixed already mapped.
+   The main things grep needs to know about mmap are:
+   * does it exist and is it safe to write into the mmap'd area
+   * how to use it (BSD variants)  */
+#include <sys/types.h>
+#include <fcntl.h>
+#include <sys/mman.h>
+
+/* This mess was copied from the GNU getpagesize.h.  */
+#ifndef HAVE_GETPAGESIZE
+# ifdef HAVE_UNISTD_H
+#  include <unistd.h>
+# endif
+
+/* Assume that all systems that can run configure have sys/param.h.  */
+# ifndef HAVE_SYS_PARAM_H
+#  define HAVE_SYS_PARAM_H 1
+# endif
+
+# ifdef _SC_PAGESIZE
+#  define getpagesize() sysconf(_SC_PAGESIZE)
+# else /* no _SC_PAGESIZE */
+#  ifdef HAVE_SYS_PARAM_H
+#   include <sys/param.h>
+#   ifdef EXEC_PAGESIZE
+#    define getpagesize() EXEC_PAGESIZE
+#   else /* no EXEC_PAGESIZE */
+#    ifdef NBPG
+#     define getpagesize() NBPG * CLSIZE
+#     ifndef CLSIZE
+#      define CLSIZE 1
+#     endif /* no CLSIZE */
+#    else /* no NBPG */
+#     ifdef NBPC
+#      define getpagesize() NBPC
+#     else /* no NBPC */
+#      ifdef PAGESIZE
+#       define getpagesize() PAGESIZE
+#      endif /* PAGESIZE */
+#     endif /* no NBPC */
+#    endif /* no NBPG */
+#   endif /* no EXEC_PAGESIZE */
+#  else /* no HAVE_SYS_PARAM_H */
+#   define getpagesize() 8192  /* punt totally */
+#  endif /* no HAVE_SYS_PARAM_H */
+# endif /* no _SC_PAGESIZE */
+
+#endif /* no HAVE_GETPAGESIZE */
+
+#ifdef __cplusplus
+extern "C" { void *malloc(unsigned); }
+#else
+char *malloc();
+#endif
+
+int
+main()
+{
+       char *data, *data2, *data3;
+       int i, pagesize;
+       int fd;
+
+       pagesize = getpagesize();
+
+       /*
+        * First, make a file with some known garbage in it.
+        */
+       data = malloc(pagesize);
+       if (!data)
+               exit(1);
+       for (i = 0; i < pagesize; ++i)
+               *(data + i) = rand();
+       umask(0);
+       fd = creat("conftestmmap", 0600);
+       if (fd < 0)
+               exit(1);
+       if (write(fd, data, pagesize) != pagesize)
+               exit(1);
+       close(fd);
+
+       /*
+        * Next, try to mmap the file at a fixed address which
+        * already has something else allocated at it.  If we can,
+        * also make sure that we see the same garbage.
+        */
+       fd = open("conftestmmap", O_RDWR);
+       if (fd < 0)
+               exit(1);
+       data2 = malloc(2 * pagesize);
+       if (!data2)
+               exit(1);
+       data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1);
+       if (data2 != mmap(data2, pagesize, PROT_READ | PROT_WRITE,
+           MAP_PRIVATE | MAP_FIXED, fd, 0L))
+               exit(1);
+       for (i = 0; i < pagesize; ++i)
+               if (*(data + i) != *(data2 + i))
+                       exit(1);
+
+       /*
+        * Finally, make sure that changes to the mapped area
+        * do not percolate back to the file as seen by read().
+        * (This is a bug on some variants of i386 svr4.0.)
+        */
+       for (i = 0; i < pagesize; ++i)
+               *(data2 + i) = *(data2 + i) + 1;
+       data3 = malloc(pagesize);
+       if (!data3)
+               exit(1);
+       if (read(fd, data3, pagesize) != pagesize)
+               exit(1);
+       for (i = 0; i < pagesize; ++i)
+               if (*(data + i) != *(data3 + i))
+                       exit(1);
+       close(fd);
+       unlink("conftestmmap");
+       exit(0);
+}
+
+EOF
+if { (eval echo configure:9870: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
 then
-  have_mmap=yes
+  ac_cv_func_mmap_fixed_mapped=yes
 else
+  conftest_rc="$?"
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -fr conftest*
-  have_mmap=no
+  ac_cv_func_mmap_fixed_mapped=no
 fi
-rm -fr conftest* ;;
-esac
-echo "$ac_t""$have_mmap" 1>&6
-test "$have_mmap" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
+rm -fr conftest*
+
+echo "$ac_t""$ac_cv_func_mmap_fixed_mapped" 1>&6
+if test $ac_cv_func_mmap_fixed_mapped = yes; then
+  { test "$extra_verbose" = "yes" && cat << \EOF
     Defining HAVE_MMAP
 EOF
 cat >> confdefs.h <<\EOF
@@ -9335,6 +9888,8 @@ cat >> confdefs.h <<\EOF
 EOF
 }
 
+fi
+
 
 test "$GNU_MALLOC" != "yes"   -a "$have_mmap" != "yes" && rel_alloc=no
 test "$rel_alloc" = "default" -a "$have_mmap"  = "yes" && rel_alloc=yes
@@ -9349,15 +9904,15 @@ EOF
 
 ac_safe=`echo "termios.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for termios.h""... $ac_c" 1>&6
-echo "configure:9353: checking for termios.h" >&5
+echo "configure:9908: checking for termios.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 9356 "configure"
+#line 9911 "configure"
 #include "confdefs.h"
 #include <termios.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9361: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9916: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -9400,15 +9955,15 @@ else
   echo "$ac_t""no" 1>&6
 ac_safe=`echo "termio.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for termio.h""... $ac_c" 1>&6
-echo "configure:9404: checking for termio.h" >&5
+echo "configure:9959: checking for termio.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 9407 "configure"
+#line 9962 "configure"
 #include "confdefs.h"
 #include <termio.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9412: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9967: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -9440,10 +9995,10 @@ fi
 
 
 echo $ac_n "checking for socket""... $ac_c" 1>&6
-echo "configure:9444: checking for socket" >&5
+echo "configure:9999: checking for socket" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 9447 "configure"
+#line 10002 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char socket(); below.  */
@@ -9466,7 +10021,7 @@ socket();
 
 ; return 0; }
 EOF
-if { (eval echo configure:9470: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:10025: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_socket=yes"
 else
@@ -9481,15 +10036,15 @@ if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   ac_safe=`echo "netinet/in.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for netinet/in.h""... $ac_c" 1>&6
-echo "configure:9485: checking for netinet/in.h" >&5
+echo "configure:10040: checking for netinet/in.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 9488 "configure"
+#line 10043 "configure"
 #include "confdefs.h"
 #include <netinet/in.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9493: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:10048: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -9506,15 +10061,15 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   ac_safe=`echo "arpa/inet.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for arpa/inet.h""... $ac_c" 1>&6
-echo "configure:9510: checking for arpa/inet.h" >&5
+echo "configure:10065: checking for arpa/inet.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 9513 "configure"
+#line 10068 "configure"
 #include "confdefs.h"
 #include <arpa/inet.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9518: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:10073: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -9539,9 +10094,9 @@ EOF
 }
 
       echo $ac_n "checking "for sun_len member in struct sockaddr_un"""... $ac_c" 1>&6
-echo "configure:9543: checking "for sun_len member in struct sockaddr_un"" >&5
+echo "configure:10098: checking "for sun_len member in struct sockaddr_un"" >&5
       cat > conftest.$ac_ext <<EOF
-#line 9545 "configure"
+#line 10100 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -9552,7 +10107,7 @@ int main() {
 static struct sockaddr_un x; x.sun_len = 1;
 ; return 0; }
 EOF
-if { (eval echo configure:9556: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:10111: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6; { test "$extra_verbose" = "yes" && cat << \EOF
     Defining HAVE_SOCKADDR_SUN_LEN
@@ -9570,9 +10125,9 @@ else
 fi
 rm -f conftest*
       echo $ac_n "checking "for ip_mreq struct in netinet/in.h"""... $ac_c" 1>&6
-echo "configure:9574: checking "for ip_mreq struct in netinet/in.h"" >&5
+echo "configure:10129: checking "for ip_mreq struct in netinet/in.h"" >&5
       cat > conftest.$ac_ext <<EOF
-#line 9576 "configure"
+#line 10131 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -9582,7 +10137,7 @@ int main() {
 static struct ip_mreq x;
 ; return 0; }
 EOF
-if { (eval echo configure:9586: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:10141: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6; { test "$extra_verbose" = "yes" && cat << \EOF
     Defining HAVE_MULTICAST
 
 
 echo $ac_n "checking for msgget""... $ac_c" 1>&6
-echo "configure:9617: checking for msgget" >&5
+echo "configure:10172: checking for msgget" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 9620 "configure"
+#line 10175 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char msgget(); below.  */
@@ -9639,7 +10194,7 @@ msgget();
 
 ; return 0; }
 EOF
-if { (eval echo configure:9643: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:10198: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_msgget=yes"
 else
@@ -9654,15 +10209,15 @@ if eval "test \"`echo '$ac_cv_func_'msgget`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   ac_safe=`echo "sys/ipc.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for sys/ipc.h""... $ac_c" 1>&6
-echo "configure:9658: checking for sys/ipc.h" >&5
+echo "configure:10213: checking for sys/ipc.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 9661 "configure"
+#line 10216 "configure"
 #include "confdefs.h"
 #include <sys/ipc.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9666: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:10221: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -9679,15 +10234,15 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   ac_safe=`echo "sys/msg.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for sys/msg.h""... $ac_c" 1>&6
-echo "configure:9683: checking for sys/msg.h" >&5
+echo "configure:10238: checking for sys/msg.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 9686 "configure"
+#line 10241 "configure"
 #include "confdefs.h"
 #include <sys/msg.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9691: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:10246: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
 
 ac_safe=`echo "dirent.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for dirent.h""... $ac_c" 1>&6
-echo "configure:9729: checking for dirent.h" >&5
+echo "configure:10284: checking for dirent.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 9732 "configure"
+#line 10287 "configure"
 #include "confdefs.h"
 #include <dirent.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9737: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:10292: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -9760,15 +10315,15 @@ else
   echo "$ac_t""no" 1>&6
 ac_safe=`echo "sys/dir.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for sys/dir.h""... $ac_c" 1>&6
-echo "configure:9764: checking for sys/dir.h" >&5
+echo "configure:10319: checking for sys/dir.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 9767 "configure"
+#line 10322 "configure"
 #include "confdefs.h"
 #include <sys/dir.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9772: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:10327: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
 
 ac_safe=`echo "nlist.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for nlist.h""... $ac_c" 1>&6
-echo "configure:9805: checking for nlist.h" >&5
+echo "configure:10360: checking for nlist.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 9808 "configure"
+#line 10363 "configure"
 #include "confdefs.h"
 #include <nlist.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9813: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:10368: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -9839,7 +10394,7 @@ fi
 
 
 echo "checking "for sound support"" 1>&6
-echo "configure:9843: checking "for sound support"" >&5
+echo "configure:10398: checking "for sound support"" >&5
 case "$with_sound" in
   native | both ) with_native_sound=yes;;
   nas    | no   ) with_native_sound=no;;
@@ -9850,15 +10405,15 @@ if test "$with_native_sound" != "no"; then
     if test -n "$native_sound_lib"; then
     ac_safe=`echo "multimedia/audio_device.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for multimedia/audio_device.h""... $ac_c" 1>&6
-echo "configure:9854: checking for multimedia/audio_device.h" >&5
+echo "configure:10409: checking for multimedia/audio_device.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 9857 "configure"
+#line 10412 "configure"
 #include "confdefs.h"
 #include <multimedia/audio_device.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9862: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:10417: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
       if test -z "$native_sound_lib"; then
         
 echo $ac_n "checking for ALopenport in -laudio""... $ac_c" 1>&6
-echo "configure:9910: checking for ALopenport in -laudio" >&5
+echo "configure:10465: checking for ALopenport in -laudio" >&5
 ac_lib_var=`echo audio'_'ALopenport | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -laudio "
 cat > conftest.$ac_ext <<EOF
-#line 9915 "configure"
+#line 10470 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -9922,7 +10477,7 @@ int main() {
 ALopenport()
 ; return 0; }
 EOF
-if { (eval echo configure:9926: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:10481: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
       if test -z "$native_sound_lib"; then
        
 echo $ac_n "checking for AOpenAudio in -lAlib""... $ac_c" 1>&6
-echo "configure:9957: checking for AOpenAudio in -lAlib" >&5
+echo "configure:10512: checking for AOpenAudio in -lAlib" >&5
 ac_lib_var=`echo Alib'_'AOpenAudio | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lAlib "
 cat > conftest.$ac_ext <<EOF
-#line 9962 "configure"
+#line 10517 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -9969,7 +10524,7 @@ int main() {
 AOpenAudio()
 ; return 0; }
 EOF
-if { (eval echo configure:9973: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:10528: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
     for dir in "machine" "sys" "linux"; do
       ac_safe=`echo "${dir}/soundcard.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for ${dir}/soundcard.h""... $ac_c" 1>&6
-echo "configure:10011: checking for ${dir}/soundcard.h" >&5
+echo "configure:10566: checking for ${dir}/soundcard.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 10014 "configure"
+#line 10569 "configure"
 #include "confdefs.h"
 #include <${dir}/soundcard.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:10019: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:10574: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -10085,7 +10640,7 @@ EOF
  fi
   libs_x="-laudio $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-laudio\" to \$libs_x"; fi
       cat > conftest.$ac_ext <<EOF
-#line 10089 "configure"
+#line 10644 "configure"
 #include "confdefs.h"
 #include <audio/Xtutil.h>
 EOF
@@ -10112,7 +10667,7 @@ test -z "$with_tty" && with_tty=yes
 
 if test "$with_tty" = "yes"  ; then
   echo "checking for TTY-related features" 1>&6
-echo "configure:10116: checking for TTY-related features" >&5
+echo "configure:10671: checking for TTY-related features" >&5
   { test "$extra_verbose" = "yes" && cat << \EOF
     Defining HAVE_TTY
 EOF
@@ -10128,12 +10683,12 @@ EOF
     if test -z "$with_ncurses"; then
     
 echo $ac_n "checking for tgetent in -lncurses""... $ac_c" 1>&6
-echo "configure:10132: checking for tgetent in -lncurses" >&5
+echo "configure:10687: checking for tgetent in -lncurses" >&5
 ac_lib_var=`echo ncurses'_'tgetent | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lncurses "
 cat > conftest.$ac_ext <<EOF
-#line 10137 "configure"
+#line 10692 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -10144,7 +10699,7 @@ int main() {
 tgetent()
 ; return 0; }
 EOF
-if { (eval echo configure:10148: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:10703: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -10177,15 +10732,15 @@ EOF
 
     ac_safe=`echo "ncurses/curses.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for ncurses/curses.h""... $ac_c" 1>&6
-echo "configure:10181: checking for ncurses/curses.h" >&5
+echo "configure:10736: checking for ncurses/curses.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 10184 "configure"
+#line 10739 "configure"
 #include "confdefs.h"
 #include <ncurses/curses.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:10189: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:10744: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
 
     ac_safe=`echo "ncurses/term.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for ncurses/term.h""... $ac_c" 1>&6
-echo "configure:10211: checking for ncurses/term.h" >&5
+echo "configure:10766: checking for ncurses/term.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 10214 "configure"
+#line 10769 "configure"
 #include "confdefs.h"
 #include <ncurses/term.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:10219: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:10774: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
       c_switch_site="$c_switch_site -I/usr/include/ncurses"
       ac_safe=`echo "ncurses/curses.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for ncurses/curses.h""... $ac_c" 1>&6
-echo "configure:10249: checking for ncurses/curses.h" >&5
+echo "configure:10804: checking for ncurses/curses.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 10252 "configure"
+#line 10807 "configure"
 #include "confdefs.h"
 #include <ncurses/curses.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:10257: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:10812: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
        for lib in curses termlib termcap; do
          
 echo $ac_n "checking for tgetent in -l$lib""... $ac_c" 1>&6
-echo "configure:10292: checking for tgetent in -l$lib" >&5
+echo "configure:10847: checking for tgetent in -l$lib" >&5
 ac_lib_var=`echo $lib'_'tgetent | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -l$lib "
 cat > conftest.$ac_ext <<EOF
-#line 10297 "configure"
+#line 10852 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -10304,7 +10859,7 @@ int main() {
 tgetent()
 ; return 0; }
 EOF
-if { (eval echo configure:10308: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:10863: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
       else
        
 echo $ac_n "checking for tgetent in -lcurses""... $ac_c" 1>&6
-echo "configure:10339: checking for tgetent in -lcurses" >&5
+echo "configure:10894: checking for tgetent in -lcurses" >&5
 ac_lib_var=`echo curses'_'tgetent | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lcurses "
 cat > conftest.$ac_ext <<EOF
-#line 10344 "configure"
+#line 10899 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -10351,7 +10906,7 @@ int main() {
 tgetent()
 ; return 0; }
 EOF
-if { (eval echo configure:10355: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:10910: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -10369,12 +10924,12 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
 else
   echo "$ac_t""no" 1>&6
 echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6
-echo "configure:10373: checking for tgetent in -ltermcap" >&5
+echo "configure:10928: checking for tgetent in -ltermcap" >&5
 ac_lib_var=`echo termcap'_'tgetent | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -ltermcap "
 cat > conftest.$ac_ext <<EOF
-#line 10378 "configure"
+#line 10933 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -10385,7 +10940,7 @@ int main() {
 tgetent()
 ; return 0; }
 EOF
-if { (eval echo configure:10389: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:10944: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -10433,15 +10988,15 @@ EOF
 
     test -z "$with_gpm" && { ac_safe=`echo "gpm.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for gpm.h""... $ac_c" 1>&6
-echo "configure:10437: checking for gpm.h" >&5
+echo "configure:10992: checking for gpm.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 10440 "configure"
+#line 10995 "configure"
 #include "confdefs.h"
 #include <gpm.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:10445: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:11000: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
  }
   test -z "$with_gpm" && { 
 echo $ac_n "checking for Gpm_Open in -lgpm""... $ac_c" 1>&6
-echo "configure:10468: checking for Gpm_Open in -lgpm" >&5
+echo "configure:11023: checking for Gpm_Open in -lgpm" >&5
 ac_lib_var=`echo gpm'_'Gpm_Open | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lgpm "
 cat > conftest.$ac_ext <<EOF
-#line 10473 "configure"
+#line 11028 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -10480,7 +11035,7 @@ int main() {
 Gpm_Open()
 ; return 0; }
 EOF
-if { (eval echo configure:10484: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:11039: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -10528,23 +11083,22 @@ test "$with_x11" = "yes" -o "$with_tty" = "yes" && extra_objs="$extra_objs event
  fi
 
 
-echo "checking for database support" 1>&6
-echo "configure:10533: checking for database support" >&5
+test "$with_database_gnudbm $with_database_dbm $with_database_berkdb" \
+  != "no no no" && echo "checking for database support" 1>&6
+echo "configure:11089: checking for database support" >&5
 
-if test "$with_database_gnudbm" != "no"; then
-  for ac_hdr in ndbm.h
-do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:10540: checking for $ac_hdr" >&5
+if test "$with_database_gnudbm $with_database_dbm" != "no no"; then
+  ac_safe=`echo "ndbm.h" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for ndbm.h""... $ac_c" 1>&6
+echo "configure:11094: checking for ndbm.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 10543 "configure"
+#line 11097 "configure"
 #include "confdefs.h"
-#include <$ac_hdr>
+#include <ndbm.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:10548: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:11102: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
 rm -f conftest*
 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
-  { test "$extra_verbose" = "yes" && cat << EOF
-    Defining $ac_tr_hdr
-EOF
-cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
-EOF
-}
- have_ndbm_h=yes
+  :
 else
   echo "$ac_t""no" 1>&6
+
+    test "$with_database_gnudbm" = "yes" -o \
+         "$with_database_dbm"    = "yes" && \
+      { echo "Error:" "Required DBM support cannot be provided." >&2; exit 1; }
+    with_database_gnudbm=no with_database_dbm=no
 fi
-done
 
-  if test "$have_ndbm_h" = "yes"; then
-    
+fi
+
+if test "$with_database_gnudbm" != "no"; then
+  
 echo $ac_n "checking for dbm_open in -lgdbm""... $ac_c" 1>&6
-echo "configure:10580: checking for dbm_open in -lgdbm" >&5
+echo "configure:11132: checking for dbm_open in -lgdbm" >&5
 ac_lib_var=`echo gdbm'_'dbm_open | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lgdbm "
 cat > conftest.$ac_ext <<EOF
-#line 10585 "configure"
+#line 11137 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -10592,7 +11144,7 @@ int main() {
 dbm_open()
 ; return 0; }
 EOF
-if { (eval echo configure:10596: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:11148: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -10606,81 +11158,24 @@ xe_check_libs=""
 
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
   echo "$ac_t""yes" 1>&6
-  with_database_gnudbm=yes have_libgdbm=yes
-else
-  echo "$ac_t""no" 1>&6
-fi
-
-
-  fi
-  if test "$with_database_gnudbm" != "yes"; then
-    echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
-echo "configure:10619: checking for dbm_open" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 10622 "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char dbm_open(); below.  */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char dbm_open();
-
-int main() {
-
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined (__stub_dbm_open) || defined (__stub___dbm_open)
-choke me
-#else
-dbm_open();
-#endif
-
-; return 0; }
-EOF
-if { (eval echo configure:10645: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
-  rm -rf conftest*
-  eval "ac_cv_func_dbm_open=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_func_dbm_open=no"
-fi
-rm -f conftest*
-
-if eval "test \"`echo '$ac_cv_func_'dbm_open`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  with_database_gnudbm=yes
+  with_database_gnudbm=yes with_database_dbm=no libdbm=-lgdbm
 else
   echo "$ac_t""no" 1>&6
+if test "$with_database_gnudbm" = "yes"; then
+     { echo "Error:" "Required GNU DBM support cannot be provided." >&2; exit 1; }
+   fi
+   with_database_gnudbm=no
 fi
 
-      fi
-  if test "$with_database_gnudbm" = "yes"; then
-    { test "$extra_verbose" = "yes" && cat << \EOF
-    Defining HAVE_DBM
-EOF
-cat >> confdefs.h <<\EOF
-#define HAVE_DBM 1
-EOF
-}
 
-    test "$have_libgdbm" = "yes" && LIBS="-lgdbm $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lgdbm\" to \$LIBS"; fi
-    with_database_dbm=no
-  else with_database_gnudbm=no
-  fi
 fi
 
 if test "$with_database_dbm" != "no"; then
   echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
-echo "configure:10681: checking for dbm_open" >&5
+echo "configure:11176: checking for dbm_open" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 10684 "configure"
+#line 11179 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char dbm_open(); below.  */
@@ -10703,7 +11198,7 @@ dbm_open();
 
 ; return 0; }
 EOF
-if { (eval echo configure:10707: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:11202: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_dbm_open=yes"
 else
@@ -10716,20 +11211,18 @@ rm -f conftest*
 
 if eval "test \"`echo '$ac_cv_func_'dbm_open`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-  with_database_dbm=yes need_libdbm=no
+  with_database_dbm=yes libdbm=
 else
   echo "$ac_t""no" 1>&6
-fi
 
-  if test "$need_libdbm" != "no"; then
     
 echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
-echo "configure:10728: checking for dbm_open in -ldbm" >&5
+echo "configure:11221: checking for dbm_open in -ldbm" >&5
 ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -ldbm "
 cat > conftest.$ac_ext <<EOF
-#line 10733 "configure"
+#line 11226 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -10740,7 +11233,7 @@ int main() {
 dbm_open()
 ; return 0; }
 EOF
-if { (eval echo configure:10744: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:11237: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -10754,15 +11247,23 @@ xe_check_libs=""
 
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
   echo "$ac_t""yes" 1>&6
-  with_database_dbm=yes need_libdbm=yes
+  with_database_dbm=yes libdbm=-ldbm
 else
   echo "$ac_t""no" 1>&6
+test "$with_database_dbm" = "yes" && \
+        { echo "Error:" "Required DBM support cannot be provided." >&2; exit 1; }
+      with_database_dbm=no
 fi
 
 
-  fi
-  if test "$with_database_dbm" = "yes"; then
-    { test "$extra_verbose" = "yes" && cat << \EOF
+fi
+
+fi
+
+test -n "$libdbm" && LIBS=""$libdbm" $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \""$libdbm"\" to \$LIBS"; fi
+test "$with_database_gnudbm" = "yes" -o \
+     "$with_database_dbm"    = "yes" && \
+  { test "$extra_verbose" = "yes" && cat << \EOF
     Defining HAVE_DBM
 EOF
 cat >> confdefs.h <<\EOF
@@ -10770,17 +11271,13 @@ cat >> confdefs.h <<\EOF
 EOF
 }
 
-    test "$need_libdbm" = "yes" && LIBS="-ldbm $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-ldbm\" to \$LIBS"; fi
-  else with_database_dbm=no
-  fi
-fi
 
 if test "$with_database_berkdb" != "no"; then
   echo $ac_n "checking for Berkeley db.h""... $ac_c" 1>&6
-echo "configure:10781: checking for Berkeley db.h" >&5
+echo "configure:11278: checking for Berkeley db.h" >&5
   for path in "db/db.h" "db.h"; do
     cat > conftest.$ac_ext <<EOF
-#line 10784 "configure"
+#line 11281 "configure"
 #include "confdefs.h"
 #ifdef HAVE_INTTYPES_H
 #define __BIT_TYPES_DEFINED__
@@ -10798,7 +11295,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:10802: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:11299: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   db_h_path="$path"; break
 else
@@ -10807,16 +11304,16 @@ else
 fi
 rm -f conftest*
   done
-  if test -z "$db_h_path" 
+  if test -z "$db_h_path"
   then echo "$ac_t""no" 1>&6; with_database_berkdb=no
   else echo "$ac_t""$db_h_path" 1>&6
   fi
 
   if test "$with_database_berkdb" != "no"; then
     echo $ac_n "checking for Berkeley DB version""... $ac_c" 1>&6
-echo "configure:10818: checking for Berkeley DB version" >&5
+echo "configure:11315: checking for Berkeley DB version" >&5
     cat > conftest.$ac_ext <<EOF
-#line 10820 "configure"
+#line 11317 "configure"
 #include "confdefs.h"
 #include <$db_h_path>
 #if DB_VERSION_MAJOR > 1
 rm -f conftest*
 
     echo $ac_n "checking for $dbfunc""... $ac_c" 1>&6
-echo "configure:10839: checking for $dbfunc" >&5
+echo "configure:11336: checking for $dbfunc" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 10842 "configure"
+#line 11339 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $dbfunc(); below.  */
@@ -10861,7 +11358,7 @@ $dbfunc();
 
 ; return 0; }
 EOF
-if { (eval echo configure:10865: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:11362: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$dbfunc=yes"
 else
@@ -10880,12 +11377,12 @@ else
 
     
 echo $ac_n "checking for $dbfunc in -ldb""... $ac_c" 1>&6
-echo "configure:10884: checking for $dbfunc in -ldb" >&5
+echo "configure:11381: checking for $dbfunc in -ldb" >&5
 ac_lib_var=`echo db'_'$dbfunc | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -ldb "
 cat > conftest.$ac_ext <<EOF
-#line 10889 "configure"
+#line 11386 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -10896,7 +11393,7 @@ int main() {
 $dbfunc()
 ; return 0; }
 EOF
-if { (eval echo configure:10900: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:11397: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
 if test "$with_socks" = "yes"; then
   
 echo $ac_n "checking for SOCKSinit in -lsocks""... $ac_c" 1>&6
-echo "configure:10964: checking for SOCKSinit in -lsocks" >&5
+echo "configure:11461: checking for SOCKSinit in -lsocks" >&5
 ac_lib_var=`echo socks'_'SOCKSinit | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lsocks "
 cat > conftest.$ac_ext <<EOF
-#line 10969 "configure"
+#line 11466 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -10976,7 +11473,7 @@ int main() {
 SOCKSinit()
 ; return 0; }
 EOF
-if { (eval echo configure:10980: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:11477: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -11033,15 +11530,15 @@ for ac_hdr in dlfcn.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:11037: checking for $ac_hdr" >&5
+echo "configure:11534: checking for $ac_hdr" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 11040 "configure"
+#line 11537 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:11045: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:11542: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -11065,6 +11562,14 @@ cat >> confdefs.h <<EOF
 EOF
 }
  have_dlfcn=yes
+  { test "$extra_verbose" = "yes" && cat << \EOF
+    Defining HAVE_DLFCN_H
+EOF
+cat >> confdefs.h <<\EOF
+#define HAVE_DLFCN_H 1
+EOF
+}
+
 else
   echo "$ac_t""no" 1>&6
 fi
@@ -11072,12 +11577,12 @@ done
 
 test -z "$with_shlib" && test ! -z "$have_dlfcn" && { 
 echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
-echo "configure:11076: checking for dlopen in -ldl" >&5
+echo "configure:11581: checking for dlopen in -ldl" >&5
 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -ldl "
 cat > conftest.$ac_ext <<EOF
-#line 11081 "configure"
+#line 11586 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -11088,7 +11593,7 @@ int main() {
 dlopen()
 ; return 0; }
 EOF
-if { (eval echo configure:11092: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:11597: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
  }
 test -z "$with_shlib" && test ! -z "$have_dlfcn" && { 
 echo $ac_n "checking for _dlopen in -lc""... $ac_c" 1>&6
-echo "configure:11121: checking for _dlopen in -lc" >&5
+echo "configure:11626: checking for _dlopen in -lc" >&5
 ac_lib_var=`echo c'_'_dlopen | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lc "
 cat > conftest.$ac_ext <<EOF
-#line 11126 "configure"
+#line 11631 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -11133,7 +11638,7 @@ int main() {
 _dlopen()
 ; return 0; }
 EOF
-if { (eval echo configure:11137: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:11642: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
  }
 test -z "$with_shlib" && test ! -z "$have_dlfcn" && { 
 echo $ac_n "checking for dlopen in -lc""... $ac_c" 1>&6
-echo "configure:11166: checking for dlopen in -lc" >&5
+echo "configure:11671: checking for dlopen in -lc" >&5
 ac_lib_var=`echo c'_'dlopen | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lc "
 cat > conftest.$ac_ext <<EOF
-#line 11171 "configure"
+#line 11676 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -11178,7 +11683,7 @@ int main() {
 dlopen()
 ; return 0; }
 EOF
-if { (eval echo configure:11182: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:11687: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
  }
 test -z "$with_shlib" && { 
 echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6
-echo "configure:11211: checking for shl_load in -ldld" >&5
+echo "configure:11716: checking for shl_load in -ldld" >&5
 ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -ldld "
 cat > conftest.$ac_ext <<EOF
-#line 11216 "configure"
+#line 11721 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -11223,80 +11728,648 @@ int main() {
 shl_load()
 ; return 0; }
 EOF
-if { (eval echo configure:11227: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:11732: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+xe_check_libs=""
+
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
+  echo "$ac_t""yes" 1>&6
+  { test "$extra_verbose" = "yes" && cat << \EOF
+    Defining HAVE_SHL_LOAD
+EOF
+cat >> confdefs.h <<\EOF
+#define HAVE_SHL_LOAD 1
+EOF
+}
+ DLL_LIB=dld; with_shlib=yes
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+ }
+test -z "$with_shlib" && { 
+echo $ac_n "checking for dld_init in -ldld""... $ac_c" 1>&6
+echo "configure:11761: checking for dld_init in -ldld" >&5
+ac_lib_var=`echo dld'_'dld_init | sed 'y%./+-%__p_%'`
+
+xe_check_libs=" -ldld "
+cat > conftest.$ac_ext <<EOF
+#line 11766 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char dld_init();
+
+int main() {
+dld_init()
+; return 0; }
+EOF
+if { (eval echo configure:11777: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+xe_check_libs=""
+
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
+  echo "$ac_t""yes" 1>&6
+  { test "$extra_verbose" = "yes" && cat << \EOF
+    Defining HAVE_DLD_INIT
+EOF
+cat >> confdefs.h <<\EOF
+#define HAVE_DLD_INIT 1
+EOF
+}
+ DLL_LIB=dld; with_shlib=yes
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+ }
+if test "$with_shlib" = "yes"; then
+  
+dll_ld=
+dll_ldflags=
+dll_cflags=
+dll_post=
+dll_ldo="-o"
+ld_dynamic_link_flags=
+xehost=$canonical
+xealias=$internal_configuration
+
+echo "checking how to build dynamic libraries for ${xehost}" 1>&6
+echo "configure:11816: checking how to build dynamic libraries for ${xehost}" >&5
+# Transform *-*-linux* to *-*-linux-gnu*, to support old configure scripts.
+case "$xehost" in
+*-*-linux-gnu*) ;;
+*-*-linux*) xehost=`echo $xehost | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
+esac
+
+xehost_cpu=`echo $xehost | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+xehost_vendor=`echo $xehost | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+xehost_os=`echo $xehost | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+case "$xehost_os" in
+aix3*)
+  # AIX sometimes has problems with the GCC collect2 program.  For some
+  # reason, if we set the COLLECT_NAMES environment variable, the problems
+  # vanish in a puff of smoke.
+  if test "${COLLECT_NAMES+set}" != set; then
+    COLLECT_NAMES=
+    export COLLECT_NAMES
+  fi
+  ;;
+esac
+
+# Now see if the compiler is really GCC.
+if test "$GCC" = "yes"; then
+  XEGCC=yes
+else
+  echo $ac_n "checking checking whether we are using GNU C""... $ac_c" 1>&6
+echo "configure:11844: checking checking whether we are using GNU C" >&5
+  cat > conftest.$ac_ext <<EOF
+#line 11846 "configure"
+#include "confdefs.h"
+
+#ifdef __GNUC__
+  yes;
+#endif
+
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "yes" >/dev/null 2>&1; then
+  rm -rf conftest*
+  XEGCC=yes
+else
+  rm -rf conftest*
+  XEGCC=no
+fi
+rm -f conftest*
+
+  echo "$ac_t""${XEGCC}" 1>&6
+fi
+
+echo $ac_n "checking how to produce PIC code""... $ac_c" 1>&6
+echo "configure:11868: checking how to produce PIC code" >&5
+wl=
+
+can_build_shared=yes
+if test "$XEGCC" = yes; then
+  wl='-Wl,'
+
+  case "$xehost_os" in
+  aix3* | aix4* | irix5* | irix6* | osf3* | osf4*)
+    # PIC is the default for these OSes.
+    ;;
+
+  os2*)
+    # We can build DLLs from non-PIC.
+    ;;
+  amigaos*)
+    # FIXME: we need at least 68020 code to build shared libraries, but
+    # adding the `-m68020' flag to GCC prevents building anything better,
+    # like `-m68040'.
+    dll_cflags='-m68020 -resident32 -malways-restore-a4'
+    ;;
+  *)
+    dll_cflags='-fPIC'
+    ;;
+  esac
+else
+  # PORTME Check for PIC flags for the system compiler.
+  case "$xehost_os" in
+  hpux9* | hpux10*)
+    # Is there a better link_static_flag that works with the bundled CC?
+    wl='-Wl,'
+    dll_cflags='+Z'
+    ;;
+
+  irix5* | irix6*)
+    wl='-Wl,'
+    # PIC (with -KPIC) is the default.
+    ;;
+
+  os2*)
+    # We can build DLLs from non-PIC.
+    ;;
+
+  osf3* | osf4*)
+    # All OSF/1 code is PIC.
+    wl='-Wl,'
+    ;;
+
+  sco3.2v5*)
+    dll_cflags='-belf -Kpic'
+    wl='-Wl,'
+    ;;
+
+  unixware*)
+    dll_cflags="-KPIC"
+    wl="-Wl,"
+    ;;
+
+  sysv4*)
+    dll_cflags="-KPIC"
+    wl="-Wl,"
+    ;;
+
+  sysv5*)
+    dll_cflags="-KPIC"
+    wl="-Wl,"
+    ;;
+
+  solaris2*)
+    dll_cflags='-KPIC'
+    wl='-Wl,'
+    ;;
+
+  sunos4*)
+    dll_cflags='-PIC'
+    wl='-Qoption ld '
+    ;;
+
+  uts4*)
+    dll_cflags='-pic'
+    ;;
+
+  *)
+    can_build_shared=no
+    ;;
+  esac
+fi
+
+if test -n "$dll_cflags"; then
+  echo "$ac_t""${dll_cflags}" 1>&6
+  
+  # Check to make sure the dll_cflags actually works.
+  echo $ac_n "checking if PIC flag ${dll_cflags} really works""... $ac_c" 1>&6
+echo "configure:11961: checking if PIC flag ${dll_cflags} really works" >&5
+  save_CFLAGS="$CFLAGS"
+  CFLAGS="$CFLAGS $dll_cflags -DPIC"
+  cat > conftest.$ac_ext <<EOF
+#line 11965 "configure"
+#include "confdefs.h"
+
+int main() {
+int x=0;
+; return 0; }
+EOF
+if { (eval echo configure:11972: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  
+    # On HP-UX, the stripped-down bundled CC doesn't accept +Z, but also
+    # reports no error.  So, we need to grep stderr for (Bundled).
+    if grep '(Bundled)' config.log >/dev/null; then
+      echo "$ac_t""no" 1>&6
+      can_build_shared=no
+      dll_cflags=
+    else
+      echo "$ac_t""yes" 1>&6
+    fi
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  echo "$ac_t""no" 1>&6
+    can_build_shared=no
+    dll_cflags=
 fi
 rm -f conftest*
-xe_check_libs=""
-
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
-  echo "$ac_t""yes" 1>&6
-  { test "$extra_verbose" = "yes" && cat << \EOF
-    Defining HAVE_SHL_LOAD
-EOF
-cat >> confdefs.h <<\EOF
-#define HAVE_SHL_LOAD 1
-EOF
-}
- DLL_LIB=dld; with_shlib=yes
+  CFLAGS="$save_CFLAGS"
 else
-  echo "$ac_t""no" 1>&6
+  echo "$ac_t""none" 1>&6
 fi
 
- }
-test -z "$with_shlib" && { 
-echo $ac_n "checking for dld_init in -ldld""... $ac_c" 1>&6
-echo "configure:11256: checking for dld_init in -ldld" >&5
-ac_lib_var=`echo dld'_'dld_init | sed 'y%./+-%__p_%'`
+if test "$can_build_shared" = "yes"; then
+cc_produces_so=no
+xldf=
+xcldf=
+echo $ac_n "checking if C compiler can produce shared libraries""... $ac_c" 1>&6
+echo "configure:12003: checking if C compiler can produce shared libraries" >&5
+if test "$XEGCC" = yes; then
+  xcldf="-shared"
+  xldf="-shared"
+else # Not using GCC
+  case "$xehost_os" in
+    aix3* | aix4*)
+      xldf="-bE:ELLSONAME.exp -H512 -T512 -bhalt:4 -bM:SRE -bnoentry -lc"
+      xcldf="${wl}-bE:ELLSONAME.exp ${wl}-H512 ${wl}-T512 ${wl}-bhalt:4 ${wl}-bM:SRE ${wl}-bnoentry ${wl}-lc"
+      ;;
 
-xe_check_libs=" -ldld "
-cat > conftest.$ac_ext <<EOF
-#line 11261 "configure"
+    freebsd2* | netbsd* | openbsd*)
+      xldf="-Bshareable"
+      xcldf="${wl}-Bshareable"
+      ;;
+
+    freebsd3*)
+      xcldf="-shared"
+      ;;
+
+    hpux*)
+      xldf="-b +s"
+      xcldf="${wl}-b ${wl}+s"
+      ;;
+
+    irix5* | irix6* | osf3* | osf4*)
+      xcldf="${wl}-shared"
+      xldf="-shared"
+      ;;
+
+    sco3.2v5* | unixware* | sysv5* | sysv4* | solaris2* | solaris7* | uts4*)
+      xcldf="-G"
+      xldf="-G"
+      ;;
+
+    sunos4*)
+      xcldf="${wl}-assert ${wl}pure-text ${wl}-Bstatic"
+      xldf="-assert pure-text -Bstatic"
+      ;;
+  esac
+fi # End if if we are using gcc
+
+if test -n "$xcldf"; then
+  save_LDFLAGS=$LDFLAGS
+  save_LIBS=$LIBS
+  save_xe_libs=$xe_libs
+  LDFLAGS="$xcldf $LDFLAGS"
+  LIBS=
+  xe_libs=
+  ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
+  cat > conftest.$ac_ext <<EOF
+#line 12054 "configure"
 #include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char dld_init();
 
 int main() {
-dld_init()
+int x=0;
 ; return 0; }
 EOF
-if { (eval echo configure:11272: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:12061: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+  cc_produces_so=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+  cc_produces_so=no
 fi
 rm -f conftest*
-xe_check_libs=""
+  LDFLAGS=$save_LDFLAGS
+  LIBS=$save_LIBS
+  xe_libs=$save_xe_libs
+  ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
+else
+  cc_produces_so=no
+fi
+echo "$ac_t""${cc_produces_so}" 1>&6
 
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
-  echo "$ac_t""yes" 1>&6
-  { test "$extra_verbose" = "yes" && cat << \EOF
-    Defining HAVE_DLD_INIT
-EOF
-cat >> confdefs.h <<\EOF
-#define HAVE_DLD_INIT 1
-EOF
-}
- DLL_LIB=dld; with_shlib=yes
+LTLD=$LD
+if test -z "$LTLD"; then
+  ac_prog=ld
+  if test "$XEGCC" = yes; then
+    # Check if gcc -print-prog-name=ld gives a path.
+    echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
+echo "configure:12086: checking for ld used by GCC" >&5
+    ac_prog=`($CC -print-prog-name=ld) 2>&5`
+    case "$ac_prog" in
+    # Accept absolute paths.
+    /*)
+      if test -z "$LTLD"; then
+        case "$ac_prog" in
+          *gcc-lib*) LTLD="$CC"
+                     ;;
+          *)         LTLD="$ac_prog"
+                     ;;
+        esac
+      fi
+      ;;
+    "")
+      # If it fails, then pretend we aren't using GCC.
+      ac_prog=ld
+      ;;
+    *)
+      # If it is relative, then search for the first ld in PATH.
+      with_gnu_ld=unknown
+      ;;
+    esac
+  else
+    echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
+echo "configure:12111: checking for GNU ld" >&5
+  fi
+
+  if test -z "$LTLD"; then
+    IFS="${IFS=        }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+    for ac_dir in $PATH; do
+      test -z "$ac_dir" && ac_dir=.
+      if test -f "$ac_dir/$ac_prog"; then
+        LTLD="$ac_dir/$ac_prog"
+        # Check to see if the program is GNU ld.  I'd rather use --version,
+        # but apparently some GNU ld's only accept -v.
+        # Break only if it was the GNU/non-GNU ld that we prefer.
+        if "$LTLD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
+          xe_gnu_ld=yes
+        else
+          xe_gnu_ld=no
+        fi
+      fi
+    done
+    IFS="$ac_save_ifs"
+  fi
+
+  if test -n "$LTLD"; then
+    echo "$ac_t""${LTLD}" 1>&6
+  else
+    echo "$ac_t""no" 1>&6
+  fi
+
+  if test -z "$LTLD" -a "$cc_produces_so" = no; then
+    { echo "configure: error: no acceptable linker found in \$PATH" 1>&2; exit 1; }
+    exit 1
+  fi
+fi
+
+ld_dynamic_link_flags=
+
+# Check to see if it really is or isn't GNU ld.
+echo $ac_n "checking if the linker is GNU ld""... $ac_c" 1>&6
+echo "configure:12149: checking if the linker is GNU ld" >&5
+# I'd rather use --version here, but apparently some GNU ld's only accept -v.
+if $LTLD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
+  xe_gnu_ld=yes
 else
-  echo "$ac_t""no" 1>&6
+  xe_gnu_ld=no
 fi
+echo "$ac_t""${xe_gnu_ld}" 1>&6
 
- }
-if test "$with_shlib" = "yes"; then
-  { test "$extra_verbose" = "yes" && cat << \EOF
+case "$xehost_os" in
+  amigaos* | sunos4*)
+    # On these operating systems, we should treat GNU ld like the system ld.
+    gnu_ld_acts_native=yes
+    ;;
+  *)
+    gnu_ld_acts_native=no
+    ;;
+esac
+
+if test "$cc_produces_so" = "yes"; then
+  dll_ld=$CC
+  dll_ldflags=$xcldf
+  can_build_shared=yes
+else
+  # OK - only NOW do we futz about with ld.
+  # See if the linker supports building shared libraries.
+  echo $ac_n "checking whether the linker supports shared libraries""... $ac_c" 1>&6
+echo "configure:12176: checking whether the linker supports shared libraries" >&5
+  dll_ld=$CC
+  dll_ldflags=$LDFLAGS
+  ld_shlibs=yes
+  can_build_shared=yes
+  if test "$xe_gnu_ld" = yes && test "$gnu_ld_acts_native" != yes; then
+    # See if GNU ld supports shared libraries.
+    if $LTLD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
+      dll_ld=$CC
+      dll_ldflags="-shared"
+      ld_shlibs=yes
+    else
+      ld_shlibs=no
+    fi
+  else
+    # PORTME fill in a description of your system's linker (not GNU ld)
+    case "$xehost_os" in
+    aix3*)
+      dll_ld=$LTLD
+      dll_ldflags=$xldf
+      ;;
+
+    aix4*)
+      dll_ldflags=$xcldf
+      ;;
+
+    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+    # support.  Future versions do this automatically, but an explicit c++rt0.o
+    # doesn't break anything, and helps significantly (at the cost of a little
+    # extra space).
+    freebsd2.2*)
+      dll_ld=$LTLD
+      dll_ldflags=$xldf
+      dll_post="/usr/lib/c++rt0.o"
+      ;;
+
+    # Unfortunately, older versions of FreeBSD 2 don't have this feature.
+    freebsd2*)
+      dll_ld=$LTLD
+      dll_ldflags="-Bshareable"
+      ;;
+
+    # FreeBSD 3, at last, uses gcc -shared to do shared libraries.
+    freebsd3*)
+      dll_ldflags="-shared"
+      ;;
+
+    hpux*)
+      dll_ld=$LTLD
+      dll_ldflags=$xldf
+      ;;
+
+    irix5* | irix6*)
+      dll_ld=$LTLD
+      dll_ldflags=$xldf
+      ;;
+
+    netbsd*)
+      # Tested with NetBSD 1.2 ld
+      dll_ld=$LTLD
+      dll_ldflags=$xldf
+      ;;
+
+    openbsd*)
+      dll_ld=$LTLD
+      dll_ldflags=$xldf
+      ;;
+
+    osf3* | osf4*)
+      dll_ld=$LTLD
+      dll_ldflags=$xldf
+      ;;
+
+    # For both SCO and Solaris we MAY want to have LDFLAGS include -z text
+    sco3.2v5* | unixware* | sysv5* | sysv4* | solaris2* | solaris7*)
+      dll_ld=$LTLD
+      case "$dll_ld" in
+        *gcc*) dll_ldflags="-shared"
+               dll_ld=$CC
+               ;;
+        *)     dll_ldflags="-G"
+               ;;
+      esac
+      ;;
+
+    sunos4*)
+      if test "$XEGCC" = yes; then
+        dll_ld=$CC
+      else
+        dll_ld=$LTLD
+      fi
+      dll_ldflags=$xldf
+      ;;
+
+    uts4*)
+      dll_ld=$LTLD
+      dll_ldflags="-G"
+      ;;
+
+    bsdi*)
+      dll_ldflags="-r"
+      dll_ld="shlicc2"
+      ;;
+
+    *)
+      ld_shlibs=no
+      can_build_shared=no
+      ;;
+    esac
+  fi
+  echo "$ac_t""${ld_shlibs}" 1>&6
+  if test "$ld_shlibs" = "no"; then
+    can_build_shared=no
+  fi
+fi # End of if cc_produces_so = no
+
+
+if test "$xe_gnu_ld" = yes; then
+  if test "$ld_shlibs" = yes; then
+    ld_dynamic_link_flags="${wl}-export-dynamic"
+  fi
+fi
+
+if test -z "$ld_dynamic_link_flags"; then
+  case "$xehost_os" in
+  aix3*)
+    ld_dynamic_link_flags=
+    ;;
+
+  aix4*)
+    ld_dynamic_link_flags=
+    ;;
+
+  freebsd2.2*)
+    ld_dynamic_link_flags=
+    ;;
+
+  freebsd2*)
+    ld_dynamic_link_flags=
+    ;;
+
+  freebsd3*)
+    ld_dynamic_link_flags=
+    ;;
+
+  hpux*)
+    ld_dynamic_link_flags="${wl}-E"
+    ;;
+
+  irix5* | irix6*)
+    ld_dynamic_link_flags=
+    ;;
+
+  netbsd*)
+    ld_dynamic_link_flags=
+    ;;
+
+  openbsd*)
+    ld_dynamic_link_flags=
+    ;;
+
+  osf3* | osf4*)
+    ld_dynamic_link_flags=
+    ;;
+
+  solaris2* | solaris7*)
+    ld_dynamic_link_flags="${wl}-Bdynamic"
+    ;;
+
+  sco3.2v5* | unixware* | sysv5* | sysv4*)
+    ld_dynamic_link_flags="${wl}-Bexport"
+    ;;
+
+  sunos4*)
+    ld_dynamic_link_flags=
+    ;;
+
+  uts4*)
+    ld_dynamic_link_flags=
+    ;;
+
+  bsdi*)
+    ld_dynamic_link_flags=
+    ;;
+
+  esac
+fi # End of if -z ld_dynamic_link_flags
+fi # End of if test "$can_build_shared" = "yes"
+
+
+
+
+
+
+
+
+  if test "$can_build_shared" = "yes"; then
+    { test "$extra_verbose" = "yes" && cat << \EOF
     Defining HAVE_SHLIB
 EOF
 cat >> confdefs.h <<\EOF
@@ -11304,115 +12377,21 @@ cat >> confdefs.h <<\EOF
 EOF
 }
 
-  extra_objs="$extra_objs sysdll.o" &&  if test "$extra_verbose" = "yes"; then
+    extra_objs="$extra_objs sysdll.o" &&  if test "$extra_verbose" = "yes"; then
    echo "    xemacs will be linked with \"sysdll.o\""
  fi
-  extra_objs="$extra_objs dll.o" &&  if test "$extra_verbose" = "yes"; then
-   echo "    xemacs will be linked with \"dll.o\""
+    extra_objs="$extra_objs emodules.o" &&  if test "$extra_verbose" = "yes"; then
+   echo "    xemacs will be linked with \"emodules.o\""
  fi
-  test ! -z "$DLL_LIB" && LIBS="-l${DLL_LIB} $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-l${DLL_LIB}\" to \$LIBS"; fi
-  
-dll_ld="ld"
-dll_lflags="-shared"
-dll_cflags="-r"
-dll_oflags="-o "
-
-echo $ac_n "checking how to build a shared library""... $ac_c" 1>&6
-echo "configure:11322: checking how to build a shared library" >&5
-case `uname -rs` in
-       UNIX_SV*|UNIX_System_V*)
-               dll_lflags="-G"
-               dll_cflags=-Kpic
-               dll_ld="ld"
-               ;;
-       BSD/OS*)
-               dll_cflags=
-               dll_lflags="-r"
-               dll_ld="shlicc2"
-               ;;
-       FreeBSD*2*)
-               dll_lflags="-Bshareable"
-               dll_cflags="-fPIC -DPIC"
-               dll_ld=ld
-               ;;
-       SunOS*4.*)
-               dll_cflags="-P"
-               dll_lflags="-dp -assert pure-text -assert nodefinitions"
-               ;;
-       SunOS*5.*)
-               dll_ld="cc"
-               dll_cflags="-KPIC"
-               dll_lflags="-G"
-               dll_oflags="-W0,-y-o -W0,-y"
-               ;;      
-       IRIX*5.*|IRIX*6.*)
-               dll_cflags="-KPIC"
-               ;;
-       OSF1*)
-               ;;
-       HP-UX*)
-               dll_ld="ld"
-               dll_lflags="-b"
-               dll_cflags="+z"
-               ;;
-       SCO_SV*)
-               dll_ld="ld"
-               dll_lflags="-G"
-               dll_cflags="-Kpic"
-               ;;
-       AIX*)
-               dll_lflags="-H512 -T512 -bhalt:4 -bM:SRE -bE:\${@:.ell=.exp} -b noentry -lc"
-               dll_ld="ld"
-               ;;
-       *)
-               ;;
-       esac
-
-       if test "$GCC" = "yes" ; then
-               dll_cflags="-fPIC"
-               case `uname -rs` in
-               SunOS*5.*)
-                       dll_ld="ld"
-                       dll_oflags="-o "
-                       dll_lflags="-G"
-                       ;;
-               SCO_SV*)
-                       dll_ld="ld"
-                       dll_lflags="-G"
-                       dll_cflags="-b elf"
-                       ;;
-               FreeBSD*)
-                       dll_cflags="-DDLSYM_NEEDS_UNDERSCORE -DPIC -fPIC"
-                       dll_lflags="-Bshareable"
-                       dll_ld=ld
-                       ;;
-               BSD/OS*)
-                       dll_cflags=
-                       dll_lflags="-r"
-                       dll_ld="shlicc2"
-                       ;;
-               UNIX_SV*)
-                       dll_cflags="-fPIC"
-                       ;;
-               *)
-                       dll_ld="$CC"
-                       dll_lflags="-shared"
-               esac
-       fi
-
-       echo "$ac_t"""lflags: $dll_lflags cflags: $dll_cflags"" 1>&6
-
-
-
-
-
-  for ac_func in dlerror
+    INSTALL_ARCH_DEP_SUBDIR="$INSTALL_ARCH_DEP_SUBDIR src" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"src\" to \$INSTALL_ARCH_DEP_SUBDIR"; fi
+    test ! -z "$DLL_LIB" && LIBS="-l${DLL_LIB} $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-l${DLL_LIB}\" to \$LIBS"; fi
+    for ac_func in dlerror _dlerror
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:11413: checking for $ac_func" >&5
+echo "configure:12392: checking for $ac_func" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 11416 "configure"
+#line 12395 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -11435,7 +12414,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:11439: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:12418: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -11462,23 +12441,22 @@ else
 fi
 done
 
-  ld_dynamic_link_flags=
-    case "$opsys" in
-  hpux*)  ld_dynamic_link_flags="-Wl,-E" ;;
-  linux*) ld_dynamic_link_flags="-rdynamic" ;;
-  *) ;;
-  esac
+  else
+    echo "configure: warning: disabling shared library support" 1>&2
+    with_shlib=no
+  fi
 fi
 
 cat > conftest.$ac_ext <<EOF
-#line 11475 "configure"
+#line 12452 "configure"
 #include "confdefs.h"
 int main(int c,char *v[]){return 0;}
 EOF
-if { (eval echo configure:11479: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
+if { (eval echo configure:12456: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
 then
   :
 else
+  conftest_rc="$?"
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -fr conftest*
@@ -11501,8 +12479,12 @@ else
 fi
 rm -fr conftest*
 
-
-{ test "$extra_verbose" = "yes" && cat << \EOF
+if test "$win32_processes" = "yes"; then
+  extra_objs="$extra_objs process-nt.o" &&  if test "$extra_verbose" = "yes"; then
+   echo "    xemacs will be linked with \"process-nt.o\""
+ fi
+else
+  { test "$extra_verbose" = "yes" && cat << \EOF
     Defining HAVE_UNIX_PROCESSES
 EOF
 cat >> confdefs.h <<\EOF
@@ -11510,9 +12492,10 @@ cat >> confdefs.h <<\EOF
 EOF
 }
 
-extra_objs="$extra_objs process-unix.o" &&  if test "$extra_verbose" = "yes"; then
+  extra_objs="$extra_objs process-unix.o" &&  if test "$extra_verbose" = "yes"; then
    echo "    xemacs will be linked with \"process-unix.o\""
  fi
+fi
 
 
 
@@ -11573,7 +12556,7 @@ ld_libs_all="$T"
 
 
 MAKE_SUBDIR="$MAKE_SUBDIR src" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"src\" to \$MAKE_SUBDIR"; fi
-internal_makefile_list="Makefile"
+internal_makefile_list="Makefile.in"
 SUBDIR_MAKEFILES=''
 test -d lock || mkdir lock
 for dir in $MAKE_SUBDIR; do
@@ -11584,7 +12567,7 @@ for dir in $MAKE_SUBDIR; do
   esac
   
 T=""
-for W in $SUBDIR_MAKEFILES $dir/Makefile; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
+for W in $SUBDIR_MAKEFILES $dir/Makefile $dir/GNUmakefile; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
 SUBDIR_MAKEFILES="$T"
 
   
@@ -11615,7 +12598,7 @@ if test -f $srcdir/src/gdbinit -a ! -f src/gdbinit ; then
   echo "source $srcdir/src/gdbinit" > src/gdbinit
 fi
 
-if test "$__sunpro_c" = "yes"; then
+if test "$__SUNPRO_C" = "yes"; then
   echo "creating .sbinit"; echo ""
   ( echo "# For use with Sun WorkShop's Source browser."
     echo "# See sbquery(1) and sbinit(4) for more information"
@@ -11705,6 +12688,38 @@ done
 
 
 
+MODULEDIR=$moduledir
+while true; do
+  case "$MODULEDIR" in
+    *\$* ) eval "MODULEDIR=$MODULEDIR" ;;
+    *) break ;;
+  esac
+done
+
+
+
+
+SITELISPDIR=$sitelispdir
+while true; do
+  case "$SITELISPDIR" in
+    *\$* ) eval "SITELISPDIR=$SITELISPDIR" ;;
+    *) break ;;
+  esac
+done
+
+
+
+
+SITEMODULEDIR=$sitemoduledir
+while true; do
+  case "$SITEMODULEDIR" in
+    *\$* ) eval "SITEMODULEDIR=$SITEMODULEDIR" ;;
+    *) break ;;
+  esac
+done
+
+
+
 
 ETCDIR=$etcdir
 while true; do
@@ -11755,7 +12770,6 @@ done
 
 
 
-
 RECURSIVE_MAKE="\$(MAKE) \$(MFLAGS) CC='\$(CC)' CFLAGS='\$(CFLAGS)' LDFLAGS='\$(LDFLAGS)' CPPFLAGS='\$(CPPFLAGS)'"
 
 
@@ -11764,7 +12778,10 @@ RECURSIVE_MAKE="\$(MAKE) \$(MFLAGS) CC='\$(CC)' CFLAGS='\$(CFLAGS)' LDFLAGS='\$(
 
 
 
-# The default is yes
+: ${XEMACS_CC:=$CC}
+
+
+
 if test "$with_site_lisp" = "no"; then
   { test "$extra_verbose" = "yes" && cat << \EOF
     Defining INHIBIT_SITE_LISP
@@ -11775,6 +12792,16 @@ EOF
 }
 
 fi
+if test "$with_site_modules" = "no"; then
+  { test "$extra_verbose" = "yes" && cat << \EOF
+    Defining INHIBIT_SITE_MODULES
+EOF
+cat >> confdefs.h <<\EOF
+#define INHIBIT_SITE_MODULES 1
+EOF
+}
+
+fi
 
 
 T=""
@@ -11858,15 +12885,6 @@ EOF
 
 
 
-test -n "$puresize" && { test "$extra_verbose" = "yes" && cat << EOF
-    Defining RAW_PURESIZE = $puresize
-EOF
-cat >> confdefs.h <<EOF
-#define RAW_PURESIZE $puresize
-EOF
-}
-
-
 if   test "$GNU_MALLOC"         = "yes"; then { test "$extra_verbose" = "yes" && cat << \EOF
     Defining GNU_MALLOC
 EOF
@@ -11924,19 +12942,19 @@ cat >> confdefs.h <<\EOF
 EOF
 }
 
-test "$with_gnu_make"      = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
-    Defining USE_GNU_MAKE
+test "$no_doc_file"        = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
+    Defining NO_DOC_FILE
 EOF
 cat >> confdefs.h <<\EOF
-#define USE_GNU_MAKE 1
+#define NO_DOC_FILE 1
 EOF
 }
 
-test "$no_doc_file"        = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
-    Defining NO_DOC_FILE
+test "$with_purify"        = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
+    Defining PURIFY
 EOF
 cat >> confdefs.h <<\EOF
-#define NO_DOC_FILE 1
+#define PURIFY 1
 EOF
 }
 
@@ -12035,21 +13053,37 @@ if test "$with_xpm" = yes; then
 elif test "$with_x11" = yes; then
   echo "  --------------------------------------------------------------------"
   echo "  WARNING: Compiling without XPM support."
-  echo "  WARNING: You should strongly considering installing XPM."
+  if test "$xpm_problem" != ""; then
+    echo "  Reason: $xpm_problem"
+  fi
+  echo "  WARNING: You should strongly consider installing XPM."
   echo "  WARNING: Otherwise toolbars and other graphics will look suboptimal."
+  echo "  WARNING: (a copy may be found in ftp://ftp.xemacs.org/pub/xemacs/aux)"
+  echo "  --------------------------------------------------------------------"
+fi
+if test "$with_png" = yes; then
+  echo "  Compiling in support for PNG image handling."
+elif test "$window_system" != "none"; then
+  echo "  --------------------------------------------------------------------"
+  echo "  WARNING: Compiling without PNG image support."
+  if test "$png_problem" != ""; then
+    echo "  Reason: $png_problem"
+  fi
+  echo "  WARNING: You should strongly consider installing the PNG libraries."
+  echo "  WARNING: Otherwise certain images and glyphs may not display."
+  echo "  WARNING: (a copy may be found in ftp://ftp.xemacs.org/pub/xemacs/aux)"
   echo "  --------------------------------------------------------------------"
 fi
+test "$with_gif"   = yes && echo "  Compiling in support for (builtin) GIF image handling."
+test "$with_jpeg"  = yes && echo "  Compiling in support for JPEG image handling."
+test "$with_tiff"  = yes && echo "  Compiling in support for TIFF image handling."
 test "$with_xface" = yes && echo "  Compiling in support for X-Face message headers."
-test "$with_gif"   = yes && echo "  Compiling in support for GIF image conversion."
-test "$with_jpeg"  = yes && echo "  Compiling in support for JPEG image conversion."
-test "$with_png"   = yes && echo "  Compiling in support for PNG image conversion."
-test "$with_tiff"  = yes && echo "  Compiling in support for TIFF image conversion."
 case "$with_sound" in
   nas    ) echo "  Compiling in network sound (NAS) support." ;;
   native ) echo "  Compiling in native sound support." ;;
   both   ) echo "  Compiling in both network and native sound support." ;;
 esac
-test "$old_nas" = yes && echo "        nas library lacks error trapping, will play synchronously"
+test "$old_nas" = yes && echo "        nas library lacks error trapping, will play synchronously."
 
 test "$with_database_berkdb" = yes && echo "  Compiling in support for Berkeley DB."
 test "$with_database_dbm"    = yes && echo "  Compiling in support for DBM."
@@ -12095,7 +13129,15 @@ case "$with_scrollbars" in
   athena3d ) echo "  Using Athena-3d scrollbars." ;;
 esac
 case "$with_dialogs" in
-  motif    ) echo "  Using Motif dialog boxes."     ;;
+  motif    )
+    echo "  Using Motif dialog boxes."
+    if test "$unexec" = "unexaix.o"; then if test "`uname -v`" = 4 -a "`uname -r`" -ge 3; then
+      echo "  *WARNING*  The Motif dialog boxes cause problems on AIX 4.3 and higher."
+      echo "             We recommend using the Athena dialog boxes instead."
+      echo "             Install libXaw and re-run configure with --with-dialogs='athena'."
+      echo "             Read the PROBLEMS file for more information."
+    fi; fi
+    ;;
   athena   ) echo "  Using Athena dialog boxes."    ;;
   athena3d ) echo "  Using Athena-3d dialog boxes." ;;
 esac
@@ -12103,14 +13145,11 @@ test "$with_shlib" = "yes" && echo "  Compiling in DLL support."
 test "$with_clash_detection" = yes && \
   echo "  Clash detection will use \"$lockdir\" for locking files."
 echo "  movemail will use \"$mail_locking\" for locking mail spool files."
-test "$with_pop"       = yes && echo "  Using POP for mail access"
-test "$with_kerberos"  = yes && echo "  Using Kerberos for POP authentication"
-test "$with_hesiod"    = yes && echo "  Using Hesiod to get POP server host"
+test "$with_pop"       = yes && echo "  Using POP for mail access."
+test "$with_kerberos"  = yes && echo "  Using Kerberos for POP authentication."
+test "$with_hesiod"    = yes && echo "  Using Hesiod to get POP server host."
 test "$use_union_type"  = yes && echo "  Using the union type for Lisp_Objects."
-test "$use_minimal_tagbits" = yes && echo "  Using Lisp_Objects with minimal tagbits."
-test "$use_indexed_lrecord_implementation" = yes && echo "  Using indexed lrecord implementation."
 test "$debug"              = yes && echo "  Compiling in extra code for debugging."
-test "$memory_usage_stats" = yes && echo "  Compiling in code for checking XEmacs memory usage."
 test "$usage_tracking"     = yes && echo "  Compiling with usage tracking active (Sun internal)."
 if test "$error_check_extents $error_check_typecheck $error_check_bufpos $error_check_gc $error_check_malloc" \
   != "no no no no no"; then
@@ -12124,11 +13163,6 @@ echo ""
 ) | tee -a Installation
 echo ""
 
-echo '(setq Installation-string "' > Installation.el
-sed 's/"/\\"/g' Installation >> Installation.el
-echo '")' >> Installation.el
-
-
 
 # Remove any trailing slashes in these variables.
 test -n "$prefix" &&
@@ -12143,6 +13177,9 @@ for file in $internal_makefile_list; do
   ac_output_files="${ac_output_files+$ac_output_files }$file"
 done
 ac_output_files="$ac_output_files src/paths.h lib-src/config.values"
+if test "$with_shlib" = "yes"; then
+  ac_output_files="$ac_output_files lib-src/ellcc.h"
+fi
 
 trap '' 1 2 15
 
@@ -12254,8 +13291,10 @@ s%@lwlib_objs@%$lwlib_objs%g
 s%@ALLOCA@%$ALLOCA%g
 s%@dll_ld@%$dll_ld%g
 s%@dll_cflags@%$dll_cflags%g
-s%@dll_oflags@%$dll_oflags%g
-s%@dll_lflags@%$dll_lflags%g
+s%@dll_ldflags@%$dll_ldflags%g
+s%@dll_post@%$dll_post%g
+s%@dll_ldo@%$dll_ldo%g
+s%@ld_dynamic_link_flags@%$ld_dynamic_link_flags%g
 s%@SRC_SUBDIR_DEPS@%$SRC_SUBDIR_DEPS%g
 s%@INSTALL_ARCH_DEP_SUBDIR@%$INSTALL_ARCH_DEP_SUBDIR%g
 s%@MAKE_SUBDIR@%$MAKE_SUBDIR%g
@@ -12280,6 +13319,15 @@ s%@PACKAGE_PATH@%$PACKAGE_PATH%g
 s%@lispdir@%$lispdir%g
 s%@LISPDIR_USER_DEFINED@%$LISPDIR_USER_DEFINED%g
 s%@LISPDIR@%$LISPDIR%g
+s%@moduledir@%$moduledir%g
+s%@MODULEDIR_USER_DEFINED@%$MODULEDIR_USER_DEFINED%g
+s%@MODULEDIR@%$MODULEDIR%g
+s%@sitelispdir@%$sitelispdir%g
+s%@SITELISPDIR_USER_DEFINED@%$SITELISPDIR_USER_DEFINED%g
+s%@SITELISPDIR@%$SITELISPDIR%g
+s%@sitemoduledir@%$sitemoduledir%g
+s%@SITEMODULEDIR_USER_DEFINED@%$SITEMODULEDIR_USER_DEFINED%g
+s%@SITEMODULEDIR@%$SITEMODULEDIR%g
 s%@etcdir@%$etcdir%g
 s%@ETCDIR_USER_DEFINED@%$ETCDIR_USER_DEFINED%g
 s%@ETCDIR@%$ETCDIR%g
@@ -12292,7 +13340,6 @@ s%@ARCHLIBDIR@%$ARCHLIBDIR%g
 s%@docdir@%$docdir%g
 s%@bitmapdir@%$bitmapdir%g
 s%@extra_objs@%$extra_objs%g
-s%@ld_dynamic_link_flags@%$ld_dynamic_link_flags%g
 s%@machfile@%$machfile%g
 s%@opsysfile@%$opsysfile%g
 s%@c_switch_general@%$c_switch_general%g
@@ -12308,6 +13355,7 @@ s%@RECURSIVE_MAKE@%$RECURSIVE_MAKE%g
 s%@native_sound_lib@%$native_sound_lib%g
 s%@sound_cflags@%$sound_cflags%g
 s%@dynodump_arch@%$dynodump_arch%g
+s%@XEMACS_CC@%$XEMACS_CC%g
 s%@internal_makefile_list@%$internal_makefile_list%g
 
 CEOF
@@ -12519,14 +13567,12 @@ fi; done
 EOF
 cat >> $CONFIG_STATUS <<EOF
 CPP="$CPP"
- CPPFLAGS="$CPPFLAGS"
  top_srcdir="$srcdir"
  MAKE_SUBDIR="$MAKE_SUBDIR"
 
 EOF
 cat >> $CONFIG_STATUS <<\EOF
-for dir in $MAKE_SUBDIR; do
-  echo creating $dir/Makefile
+for dir in . $MAKE_SUBDIR; do
   (
     cd $dir
     rm -f junk.c
@@ -12538,26 +13584,45 @@ for dir in $MAKE_SUBDIR; do
           -e '/^#/ {
 p
 d
-}'        -e '/./ {
+}'        \
+         -e '/./ {
 s/\([\"]\)/\\\1/g
 s/^/"/
 s/$/"/
 }'  > junk.c;
-    $CPP -I. -I${top_srcdir}/src $CPPFLAGS junk.c > junk.cpp;
-    < junk.cpp                         \
-      sed -e 's/^#.*//'                        \
-       -e 's/^[        ][      ]*$//'  \
-       -e 's/^ /       /'                      \
-       | sed -n -e '/^..*$/p'          \
-       | sed '/^"/ {
-s/\\\([\"]\)/\1/g
-s/^[   ]*"//
-s/"[   ]*$//
-}'     > Makefile.new
+
+
+
+    echo creating $dir/Makefile
+$CPP -I. -I${top_srcdir}/src  junk.c \
+  | sed -e 's/^\#.*//'         \
+       -e 's/^[        ][      ]*$//'\
+       -e 's/^ /       /'              \
+  | sed -n -e '/^..*$/p'       \
+  | sed '/^\"/ {
+       s/\\\([\"]\)/\1/g
+       s/^[    ]*\"//
+       s/\"[   ]*$//
+}' > Makefile.new
     chmod 444 Makefile.new
     mv -f Makefile.new Makefile
-    rm -f junk.c junk.cpp
-)
+
+    echo creating $dir/GNUmakefile
+$CPP -I. -I${top_srcdir}/src -DUSE_GNU_MAKE junk.c \
+  | sed -e 's/^\#.*//'         \
+       -e 's/^[        ][      ]*$//'\
+       -e 's/^ /       /'              \
+  | sed -n -e '/^..*$/p'       \
+  | sed '/^\"/ {
+       s/\\\([\"]\)/\1/g
+       s/^[    ]*\"//
+       s/\"[   ]*$//
+}' > Makefile.new
+    chmod 444 Makefile.new
+    mv -f Makefile.new GNUmakefile
+
+    rm -f junk.c
+  )
 done
 
 sed < config.status >> lib-src/config.values \
@@ -12572,4 +13637,3 @@ EOF
 chmod +x $CONFIG_STATUS
 rm -fr confdefs* $ac_clean_files
 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
-