]> git.sur5r.net Git - openldap/blobdiff - build/openldap.m4
A couple of minor fixes to LDAPv3 referral chasing
[openldap] / build / openldap.m4
index 1135be94855f8fb49abce04e32d4e8d7f9e2d225..1ce490ff12a9098205349429ccba2387d4fe942c 100644 (file)
@@ -265,7 +265,9 @@ AC_DEFUN([OL_BERKELEY_DB_TRY],
 #define NULL ((void*)0)
 #endif
 ],[
-#if DB_VERSION_MAJOR > 1
+#if DB_VERSION_MAJOR > 2
+       db_env_create( NULL, 0 );
+#elif DB_VERSION_MAJOR > 1
        db_appexit( NULL );
 #else
        (void) dbopen( NULL, 0, 0, 0, NULL);
@@ -313,9 +315,20 @@ AC_DEFUN([OL_BERKELEY_DB_THREAD],
 main()
 {
        int rc;
-       DB_ENV env;
        u_int32_t flags = DB_CREATE | DB_THREAD;
 
+
+#if DB_VERSION_MAJOR > 2
+       DB_ENV *env = NULL;
+
+       rc = db_env_create( &env, 0 );
+
+       if( rc == 0 ) {
+               rc = env->open( env, NULL, NULL, flags, 0 );
+       }
+
+#else
+       DB_ENV env;
        memset( &env, '\0', sizeof(env) );
 
        rc = db_appinit( NULL, NULL, &env, flags );
@@ -323,6 +336,7 @@ main()
        if( rc == 0 ) {
                db_appexit( &env );
        }
+#endif
 
        return rc;
 }],