Subject: databases/openldap - BerkeleyDB version incompatible
To: None <tech-pkg@netbsd.org>
From: MLH <mlh@goathill.org>
List: tech-pkg
Date: 11/14/2004 09:47:03
/usr/pkgsrc/databases/openldap

===> Configuring for openldap-2.2.13nb4
...
checking for db.h... yes
checking for Berkeley DB link (default)... yes
checking for Berkeley DB thread support... no
checking Berkeley DB version for BDB backend... no
configure: error: BDB: BerkeleyDB version incompatible
*** Error code 1

Stop.
make: stopped in /usr/pkgsrc/databases/openldap

$ pkg_info | grep Berkeley
db3-3.11.2nb3       Sleepycat Software's Berkeley DB version 3
db4-4.2.52nb6       Berkeley DB version 4 from Sleepycat Software

config.log:
...
configure:17693: checking for db.h
configure:17703: gcc -E -I/usr/include conftest.c >/dev/null 2>conftest.out
configure:17733: checking for Berkeley DB link (default)
configure:17790: gcc -o conftest -O2 -pthread -I/usr/include -I/usr/include
-L/usr/lib -Wl,-R/usr
/lib -pthread -Wl,-R/usr/pkg/lib conftest.c     1>&5
configure:19193: checking for Berkeley DB thread support
configure:19275: gcc -o conftest -O2 -pthread -I/usr/include -I/usr/include
-L/usr/lib -Wl,-R/usr
/lib -pthread -Wl,-R/usr/pkg/lib conftest.c    1>&5
configure: In function `main':
configure:19221: error: `DB_CREATE' undeclared (first use in this function)
configure:19221: error: (Each undeclared identifier is reported only once
configure:19221: error: for each function it appears in.)
configure:19225: error: `DB_THREAD' undeclared (first use in this function)
configure:19258: error: `DB_ENV' undeclared (first use in this function)
configure:19258: error: parse error before "env"
configure:19259: error: `env' undeclared (first use in this function)
configure: failed program was:
#line 19208 "configure"
#include "confdefs.h"

#ifdef HAVE_DB_185_H
        choke me;
#else
#include <db.h>
#endif
#ifndef NULL
#define NULL ((void *)0)
#endif
main()
{
        int rc;
        u_int32_t flags = DB_CREATE |
#ifdef DB_PRIVATE
                DB_PRIVATE |
#endif
                DB_THREAD;

#if DB_VERSION_MAJOR > 2
        DB_ENV *env = NULL;

        rc = db_env_create( &env, 0 );

        flags |= DB_INIT_MPOOL;
#ifdef DB_MPOOL_PRIVATE
        flags |= DB_MPOOL_PRIVATE;
#endif

        if( rc ) {
                printf("BerkeleyDB: %s\n", db_strerror(rc) );
                return rc;
        }

#if (DB_VERSION_MAJOR > 3) || (DB_VERSION_MINOR >= 1)
        rc = env->open( env, NULL, flags, 0 );
#else
        rc = env->open( env, NULL, NULL, flags, 0 );
#endif

        if ( rc == 0 ) {
                rc = env->close( env, 0 );
        }

        if( rc ) {
                printf("BerkeleyDB: %s\n", db_strerror(rc) );
                return rc;
        }

#else
        DB_ENV env;
        memset( &env, '\0', sizeof(env) );

        rc = db_appinit( NULL, NULL, &env, flags );

        if( rc == 0 ) {
                db_appexit( &env );
        }

        unlink("__db_mpool.share");
        unlink("__db_lock.share");
#endif

        return rc;
}
configure:19337: checking Berkeley DB version for BDB backend