More changes to let BDB build without LDBM.

This commit is contained in:
Kurt Zeilenga 2001-10-04 06:34:03 +00:00
parent 9a34ebabd2
commit 3120d37951
14 changed files with 727 additions and 715 deletions

1361
configure vendored

File diff suppressed because it is too large Load diff

View file

@ -468,6 +468,7 @@ dnl ----------------------------------------------------------------
dnl Initialize vars
LDAP_LIBS=
LDIF_LIBS=
LDBM_LIB=
LDBM_LIBS=
LTHREAD_LIBS=
LUTIL_LIBS=
@ -2396,6 +2397,7 @@ if test "$ol_link_ldbm" != no -a $ol_enable_ldbm != no; then
AC_DEFINE(SLAPD_LDBM,1,[define to support LDBM backend])
BUILD_SLAPD=yes
BUILD_LDBM=yes
LDBM_LIB="-ldbm"
if test "$ol_with_ldbm_module" != static ; then
AC_DEFINE(SLAPD_LDBM_DYNAMIC,1,
[define to support dynamic LDBM backend])
@ -2563,6 +2565,8 @@ AC_SUBST(BUILD_SLAPD)
AC_SUBST(BUILD_TCL_DYNAMIC)
AC_SUBST(BUILD_SLURPD)
AC_SUBST(LDBM_LIB)
AC_SUBST(LDAP_LIBS)
AC_SUBST(LDIF_LIBS)
AC_SUBST(SLAPD_LIBS)

View file

@ -45,7 +45,7 @@ XDEFS = $(MODULES_CPPFLAGS)
XLDFLAGS = $(MODULES_LDFLAGS) $(SLAPD_MODULES)
# $(LTHREAD_LIBS) must be last
XLIBS = libbackends.a -lavl -lldbm -lldif -llutil -llunicode -lldap_r -llber
XLIBS = libbackends.a -lavl @LDBM_LIB@ -lldif -llutil -llunicode -lldap_r -llber
XXLIBS = $(LDBM_LIBS) $(SLAPD_LIBS) \
$(SECURITY_LIBS) \
$(LDIF_LIBS) $(LUTIL_LIBS)

View file

@ -238,7 +238,7 @@ retry: rc = txn_abort( ltid );
goto return_results;
}
#if BDB_INDEX
#ifdef BDB_INDEX
/* attribute indexes */
if ( bdb_index_entry_add( be, ltid, e, e->e_attrs ) != LDAP_SUCCESS ) {
Debug( LDAP_DEBUG_TRACE, "bdb_add: index_entry_add failed\n",

View file

@ -15,7 +15,7 @@
#include "slap.h"
#include "back-bdb.h"
#if BDB_INDEX
#ifdef BDB_INDEX
static slap_mask_t index_mask(
Backend *be,
@ -173,7 +173,7 @@ static int indexer(
}
if( IS_SLAP_INDEX( mask, SLAP_INDEX_PRESENT ) ) {
key_change( be, db, &prefix, id, op );
rc = bdb_key_change( be, db, txn, &prefix, id, op );
}
if( IS_SLAP_INDEX( mask, SLAP_INDEX_EQUALITY ) ) {
@ -186,7 +186,7 @@ static int indexer(
if( rc == LDAP_SUCCESS && keys != NULL ) {
for( i=0; keys[i] != NULL; i++ ) {
key_change( be, db, keys[i], id, op );
rc = bdb_key_change( be, db, txn, keys[i], id, op );
}
ber_bvecfree( keys );
}
@ -202,7 +202,7 @@ static int indexer(
if( rc == LDAP_SUCCESS && keys != NULL ) {
for( i=0; keys[i] != NULL; i++ ) {
key_change( be, db, keys[i], id, op );
rc = bdb_key_change( be, db, txn, keys[i], id, op );
}
ber_bvecfree( keys );
}
@ -218,7 +218,7 @@ static int indexer(
if( rc == LDAP_SUCCESS && keys != NULL ) {
for( i=0; keys[i] != NULL; i++ ) {
key_change( be, db, keys[i], id, op );
bdb_key_change( be, db, txn, keys[i], id, op );
}
ber_bvecfree( keys );
}
@ -327,8 +327,7 @@ bdb_index_entry(
DB_TXN *txn,
int op,
Entry *e,
Attribute *ap
)
Attribute *ap )
{
int rc;
@ -345,7 +344,7 @@ bdb_index_entry(
/* add each attribute to the indexes */
for ( ; ap != NULL; ap = ap->a_next ) {
rc = index_values( be, txn,
rc = bdb_index_values( be, txn,
ap->a_desc, ap->a_vals, e->e_id, op );
if( rc != LDAP_SUCCESS ) {

View file

@ -220,10 +220,8 @@ bdb_db_open( BackendDB *be )
return rc;
}
/* <insert> open (and create) index databases */
#ifndef NO_THREADS
if( bdb->bi_lock_detect != DB_LOCK_NORUN ) {
/* listener as a separate THREAD */
@ -324,6 +322,7 @@ bdb_initialize(
db_env_set_func_realloc( ch_realloc );
db_env_set_func_free( ch_free );
#endif
db_env_set_func_yield( ldap_pvt_thread_yield );
bi->bi_controls = controls;

View file

@ -127,7 +127,7 @@ int bdb_modify_internal(
return rc;
}
#if BDB_INDEX
#ifdef BDB_INDEX
/* delete indices for old attributes */
rc = bdb_index_entry_del( be, tid, e, save_attrs);
if ( rc != LDAP_SUCCESS ) {

View file

@ -194,9 +194,9 @@ int bdb_index_entry LDAP_P(( Backend *be, DB_TXN *t,
int r, Entry *e, Attribute *ap ));
#define bdb_index_entry_add(be,t,e,ap) \
index_entry((be),(t),SLAP_INDEX_ADD_OP,(e),(ap))
bdb_index_entry((be),(t),SLAP_INDEX_ADD_OP,(e),(ap))
#define bdb_index_entry_del(be,t,e,ap) \
index_entry((be),(t),SLAP_INDEX_DELETE_OP,(e),(ap))
bdb_index_entry((be),(t),SLAP_INDEX_DELETE_OP,(e),(ap))
/*
* key.c

View file

@ -156,7 +156,7 @@ ID bdb_tool_entry_put(
goto done;
}
#if BDB_INDEX
#ifdef BDB_INDEX
rc = bdb_index_entry_add( be, tid, e, e->e_attrs );
if( rc != 0 ) {
Debug( LDAP_DEBUG_ANY,

View file

@ -48,7 +48,7 @@ int ldbm_modify_internal(
LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY,
"ldbm_modify_internal: %s\n", dn ));
#else
Debug(LDAP_DEBUG_TRACE, "ldbm_modify_internal:\n", 0, 0, 0);
Debug(LDAP_DEBUG_TRACE, "ldbm_modify_internal: %s\n", dn, 0, 0);
#endif

View file

@ -127,12 +127,12 @@ int backend_init(void)
if(rc != 0) {
#ifdef NEW_LOGGING
LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
"backend_init: initialized for type \"%s\"\n",
binfo[nBackendInfo].bi_type ));
"backend_init: initialized for type \"%s\"\n",
binfo[nBackendInfo].bi_type ));
#else
Debug( LDAP_DEBUG_ANY,
"backend_init: initialized for type \"%s\"\n",
binfo[nBackendInfo].bi_type, 0, 0 );
binfo[nBackendInfo].bi_type, 0, 0 );
#endif
/* destroy those we've already inited */
for( nBackendInfo--;
@ -158,10 +158,10 @@ int backend_init(void)
#else
#ifdef NEW_LOGGING
LDAP_LOG(( "backend", LDAP_LEVEL_ERR,
"backend_init: failed\n" ));
LDAP_LOG(( "backend", LDAP_LEVEL_ERR,
"backend_init: failed\n" ));
#else
Debug( LDAP_DEBUG_ANY,
Debug( LDAP_DEBUG_ANY,
"backend_init: failed\n",
0, 0, 0 );
#endif

View file

@ -377,21 +377,20 @@ entry_id_cmp( Entry *e1, Entry *e2 )
return( e1->e_id < e2->e_id ? -1 : (e1->e_id > e2->e_id ? 1 : 0) );
}
#define SLAPD_SLEEPY 1
#ifdef SLAPD_SLEEPY
#ifdef SLAPD_BDB
/* a DER encoded entry looks like:
/* a LBER encoded entry looks like:
*
* entry :== SEQUENCE {
* dn DistinguishedName,
* ndn NormalizedDistinguishedName,
* attrs SEQUENCE OF SEQUENCE {
* type AttributeType,
* values SET OF AttributeValue
* }
* }
* entry :== SEQUENCE {
* dn DistinguishedName,
* ndn NormalizedDistinguishedName,
* attrs SEQUENCE OF SEQUENCE {
* type AttributeType,
* values SET OF AttributeValue
* }
* }
*
* Encoding/Decoding of DER should be much faster than LDIF
* Encoding/Decoding of LBER should be much faster than LDIF
*/
int entry_decode( struct berval *bv, Entry **entry )
@ -403,8 +402,13 @@ int entry_decode( struct berval *bv, Entry **entry )
ber_len_t len;
char *last;
assert( bv != NULL );
assert( entry != NULL );
ber = ber_init( bv );
if( ber == NULL ) {
assert( 0 ); /* XXYYZ: Temporary assert */
#ifdef NEW_LOGGING
LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
"entry_decode: ber_init failed\n" ));

View file

@ -25,7 +25,7 @@ SLAPD_MODULES = @SLAPD_MODULES_LIST@
XDEFS = $(MODULES_CPPFLAGS)
XLDFLAGS = $(MODULES_LDFLAGS) $(SLAPD_MODULES)
XLIBS = -lavl -lldif -lldbm -llutil -llunicode -lldap_r -llber
XLIBS = -lavl -lldif @LDBM_LIB@ -llutil -llunicode -lldap_r -llber
XXLIBS = $(SLAPD_LIBS) \
$(LDBM_LIBS) $(SECURITY_LIBS) \
$(LDIF_LIBS) $(LUTIL_LIBS)

View file

@ -5,6 +5,7 @@
## tests Makefile.in for OpenLDAP
SUBDIRS= progs
BUILD_LDBM=@BUILD_LDBM@
BUILD_BDB=@BUILD_BDB@
test: tests
tests: ldbm
@ -14,7 +15,7 @@ test-bdb: FORCE
@-$(LN_S) $(srcdir)/data .
@-$(LN_S) $(top_srcdir)/servers/slapd/schema .
@-$(LN_S) ../libraries/liblunicode ucdata
@if test "$(BUILD_LDBM)" = "yes" ; then \
@if test "$(BUILD_BDB)" = "yes" ; then \
echo "Initiating LDAP tests for BDB..." ; \
$(MKDIR) test-db test-repl || true; \
$(srcdir)/scripts/all $(srcdir) bdb ; \