diff --git a/build/openldap.m4 b/build/openldap.m4
index acb9f142e5..d11cc4f30b 100644
--- a/build/openldap.m4
+++ b/build/openldap.m4
@@ -312,12 +312,17 @@ dnl Try to locate appropriate library
AC_DEFUN([OL_BERKELEY_DB_LINK],
[ol_cv_lib_db=no
OL_BERKELEY_DB_TRY(ol_cv_db_none)
+OL_BERKELEY_DB_TRY(ol_cv_db_db42,[-ldb42])
+OL_BERKELEY_DB_TRY(ol_cv_db_db_42,[-ldb-42])
+OL_BERKELEY_DB_TRY(ol_cv_db_db_4_dot_2,[-ldb-4.2])
+OL_BERKELEY_DB_TRY(ol_cv_db_db_4_2,[-ldb-4-2])
+OL_BERKELEY_DB_TRY(ol_cv_db_db_4,[-ldb-4])
+OL_BERKELEY_DB_TRY(ol_cv_db_db4,[-ldb4])
OL_BERKELEY_DB_TRY(ol_cv_db_db41,[-ldb41])
OL_BERKELEY_DB_TRY(ol_cv_db_db_41,[-ldb-41])
OL_BERKELEY_DB_TRY(ol_cv_db_db_4_dot_1,[-ldb-4.1])
OL_BERKELEY_DB_TRY(ol_cv_db_db_4_1,[-ldb-4-1])
OL_BERKELEY_DB_TRY(ol_cv_db_db_4,[-ldb-4])
-OL_BERKELEY_DB_TRY(ol_cv_db_db4,[-ldb4])
OL_BERKELEY_DB_TRY(ol_cv_db_db,[-ldb])
OL_BERKELEY_DB_TRY(ol_cv_db_db3,[-ldb3])
OL_BERKELEY_DB_TRY(ol_cv_db_db_3,[-ldb-3])
@@ -442,8 +447,8 @@ AC_DEFUN([OL_BDB_COMPAT],
# define DB_VERSION_MINOR 0
#endif
-/* require 4.1 or later */
-#if (DB_VERSION_MAJOR >= 4) && (DB_VERSION_MINOR >= 1)
+/* require 4.2 or later */
+#if (DB_VERSION_MAJOR >= 4) && (DB_VERSION_MINOR >= 2)
__db_version_compat
#endif
], [ol_cv_bdb_compat=yes], [ol_cv_bdb_compat=no])])
diff --git a/build/top.mk b/build/top.mk
index 5495b79b00..647aa531b0 100644
--- a/build/top.mk
+++ b/build/top.mk
@@ -140,7 +140,6 @@ LDAP_INCPATH= -I$(LDAP_INCDIR) -I$(INCLUDEDIR)
LDAP_LIBDIR= $(top_builddir)/libraries
LUTIL_LIBS = @LUTIL_LIBS@
-LDIF_LIBS = @LDIF_LIBS@
LDBM_LIBS = @LDBM_LIBS@
LTHREAD_LIBS = @LTHREAD_LIBS@
@@ -153,14 +152,13 @@ LDAP_LIBLDBM_A_yes = $(LDAP_LIBDIR)/libldbm/libldbm.a
LDAP_LIBAVL_A = $(LDAP_LIBDIR)/libavl/libavl.a
LDAP_LIBLDBM_A = $(LDAP_LIBLDBM_A_@BUILD_LDBM@)
-LDAP_LIBLDIF_A = $(LDAP_LIBDIR)/libldif/libldif.a
LDAP_LIBREWRITE_A = $(LDAP_LIBDIR)/librewrite/librewrite.a
LDAP_LIBLUNICODE_A = $(LDAP_LIBDIR)/liblunicode/liblunicode.a
LDAP_LIBLUTIL_A = $(LDAP_LIBDIR)/liblutil/liblutil.a
-LDAP_L = $(LDAP_LIBLUTIL_A) $(LDAP_LIBLDIF_A) \
+LDAP_L = $(LDAP_LIBLUTIL_A) \
$(LDAP_LIBLDAP_LA) $(LDAP_LIBLBER_LA)
-SLURPD_L = $(LDAP_LIBLDIF_A) $(LDAP_LIBLUTIL_A) \
+SLURPD_L = $(LDAP_LIBLUTIL_A) \
$(LDAP_LIBLDAP_R_LA) $(LDAP_LIBLBER_LA)
SLAPD_L = $(LDAP_LIBAVL_A) $(LDAP_LIBLDBM_A) \
$(LDAP_LIBLUNICODE_A) $(LDAP_LIBREWRITE_A) \
diff --git a/clients/tools/Makefile.in b/clients/tools/Makefile.in
index 4106c7f5ed..0b81a2dec1 100644
--- a/clients/tools/Makefile.in
+++ b/clients/tools/Makefile.in
@@ -12,8 +12,8 @@ LDAP_LIBDIR= ../../libraries
MKVOPTS = -s
-XLIBS = $(LDAP_LIBLDIF_A) $(LDAP_L)
-XXLIBS = $(SECURITY_LIBS) $(LDIF_LIBS) $(LUTIL_LIBS)
+XLIBS = $(LDAP_L)
+XXLIBS = $(SECURITY_LIBS) $(LUTIL_LIBS)
XSRCS = ldsversion.c ldmversion.c lddversion.c ldrversion.c \
ldpversion.c ldwversion.c ldcversion.c
diff --git a/clients/tools/common.c b/clients/tools/common.c
index bc74e28459..01075c30ac 100644
--- a/clients/tools/common.c
+++ b/clients/tools/common.c
@@ -1,9 +1,25 @@
-/* $OpenLDAP$ */
-/*
- * Copyright 1998-2003 The OpenLDAP Foundation, All Rights Reserved.
- * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
- */
/* common.c - common routines for the ldap client tools */
+/* $OpenLDAP$ */
+/* This work is part of OpenLDAP Software .
+ *
+ * Copyright 1998-2003 The OpenLDAP Foundation.
+ * Portions Copyright 2003 Kurt D. Zeilenga.
+ * Portions Copyright 2003 IBM Corporation.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted only as authorized by the OpenLDAP
+ * Public License.
+ *
+ * A copy of this license is available in the file LICENSE in the
+ * top-level directory of the distribution or, alternatively, at
+ * .
+ */
+/* This file was initially created by Hallvard B. Furuseth based (in
+ * part) upon argument parsing code for individual tools located in
+ * this directory. Additional contributors include:
+ * Kurt D. Zeilenga (additional common argument and control support)
+ */
#include "portable.h"
diff --git a/clients/tools/common.h b/clients/tools/common.h
index dba31d251c..8ca3244e2f 100644
--- a/clients/tools/common.h
+++ b/clients/tools/common.h
@@ -1,12 +1,25 @@
-/* $OpenLDAP$ */
-/*
- * Copyright 2002-2003 The OpenLDAP Foundation, All Rights Reserved.
- * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
- */
/* common.h - common definitions for the ldap client tools */
+/* $OpenLDAP$ */
+/* This work is part of OpenLDAP Software .
+ *
+ * Copyright 1998-2003 The OpenLDAP Foundation.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted only as authorized by the OpenLDAP
+ * Public License.
+ *
+ * A copy of this license is available in the file LICENSE in the
+ * top-level directory of the distribution or, alternatively, at
+ * .
+ */
+/* This file was initially created by Hallvard B. Furuseth based (in
+ * part) upon argument parsing code for individual tools located in
+ * this directory.
+ */
-#ifndef _COMMON_H_
-#define _COMMON_H_
+#ifndef _CLIENT_TOOLS_COMMON_H_
+#define _CLIENT_TOOLS_COMMON_H_
LDAP_BEGIN_DECL
@@ -63,4 +76,4 @@ void tool_server_controls LDAP_P(( LDAP *, LDAPControl *, int ));
LDAP_END_DECL
-#endif /* _COMMON_H_ */
+#endif /* _CLIENT_TOOLS_COMMON_H_ */
diff --git a/servers/slapd/Makefile.in b/servers/slapd/Makefile.in
index 2ece47608f..14d3a50660 100644
--- a/servers/slapd/Makefile.in
+++ b/servers/slapd/Makefile.in
@@ -53,7 +53,7 @@ XDEFS = $(MODULES_CPPFLAGS)
XLDFLAGS = $(MODULES_LDFLAGS)
XLIBS = $(SLAPD_STATIC_DEPENDS) $(SLAPD_L)
-XXLIBS = $(LDBM_LIBS) $(SLAPD_LIBS) $(SECURITY_LIBS) $(LDIF_LIBS) $(LUTIL_LIBS)
+XXLIBS = $(LDBM_LIBS) $(SLAPD_LIBS) $(SECURITY_LIBS) $(LUTIL_LIBS)
XXXLIBS = $(LTHREAD_LIBS) $(SLAPI_LIBS) $(MODULES_LIBS)
BUILD_OPT = "--enable-slapd"
@@ -83,7 +83,7 @@ SLAPD_OBJECTS = $(@PLAT@_SLAPD_OBJECTS)
# we want to export EVERY global symbol that it knows about (NOT including
# symbols that are imported from other DLLs). The set of symbols to
# export INCLUDES symbols from all static libraries that slapd gets
-# linked with, e.g. avl, ldbm, ldif, lunicode, lutil, etc. This list
+# linked with, e.g. avl, ldbm, lunicode, lutil, etc. This list
# will also include liblber and libldap_r if they were built as static
# libraries. ALSO included will be symbols from other STATIC libraries
# outside the domain of the OpenLDAP source tree, e.g. regex, ltdl,
diff --git a/servers/slurpd/Makefile.in b/servers/slurpd/Makefile.in
index 78844afe00..47e1f1792e 100644
--- a/servers/slurpd/Makefile.in
+++ b/servers/slurpd/Makefile.in
@@ -32,8 +32,7 @@ all-local-srv: $(PROGRAMS)
# $(LTHREAD_LIBS) must be last!
XLIBS = $(SLURPD_L)
-XXLIBS = $(SLURPD_LIBS) $(SECURITY_LIBS) \
- $(LDIF_LIBS) $(LUTIL_LIBS)
+XXLIBS = $(SLURPD_LIBS) $(SECURITY_LIBS) $(LUTIL_LIBS)
XXXLIBS = $(LTHREAD_LIBS)
slurpd: version.o