--- configure.in.orig	Tue Feb 10 12:58:57 1998
+++ configure.in	Fri Oct  9 22:42:15 1998
@@ -335,6 +335,7 @@
 lispdir='${datadir}/xemacs-${version}/lisp'
 lispdir_user_defined='no'
 sitelispdir='${datadir}/xemacs/site-lisp'
+sitelispdir_user_defined='no'
 etcdir='${datadir}/xemacs-${version}/etc'
 etcdir_user_defined='no'
 lockdir='${statedir}/xemacs/lock'
@@ -682,6 +683,7 @@
            dnl of etcdir and lispdir.  Changing statedir will change the
            dnl default value of lockdir.
            case "$opt" in
+             sitelispdir ) sitelispdir_user_defined=yes ;;
              lispdir ) lispdir_user_defined=yes ;;
              etcdir  )  etcdir_user_defined=yes ;;
              infodir ) infodir_user_defined=yes ;;
@@ -2573,7 +2575,9 @@
     AC_DEFINE(HAVE_WNN)
     XE_PREPEND(-lwnn, libs_x)
     XE_ADD_OBJS(mule-wnnfns.o)
-    AC_CHECK_LIB(wnn, jl_fi_dic_list, with_wnn6=yes)
+    if test "$with_wnn6" != "no"; then
+      AC_CHECK_LIB(wnn, jl_fi_dic_list, with_wnn6=yes)
+    fi
     test "$with_wnn6" = "yes" && AC_DEFINE(WNN6)
   fi
 
@@ -3037,6 +3041,11 @@
   if test "$need_libdb" != "no"; then
     AC_CHECK_LIB(db, dbopen, with_database_berkdb=yes need_libdb=yes)
     fi
+  dnl try to figure out if Berkeley DB 2 (db_open) had been installed.
+  dnl or do we better to check (#if DB_VERSION_MAJOR == 2)?
+  if test "$with_database_berkdb" = "yes"; then
+    AC_CHECK_LIB(db, db_open, with_database_berkdb=yes need_libdb=yes)
+  fi
   if test "$with_database_berkdb" = "yes"; then
     for path in "db/db.h" "db.h"; do
 AC_TRY_COMPILE([#ifdef HAVE_INTTYPES_H
@@ -3180,6 +3189,7 @@
 AC_SUBST(lispdir)
 AC_SUBST(lispdir_user_defined)
 AC_SUBST(sitelispdir)
+AC_SUBST(sitelispdir_user_defined)
 AC_SUBST(etcdir)
 AC_SUBST(etcdir_user_defined)
 AC_SUBST(lockdir)
