[evolution-data-server] I#99 - Fails to build against git master of OpenLDAP (vendor version check)



commit 5931df88c61e0b0250212e94d8be013c21481ba7
Author: Дилян Палаузов <dilyan palauzov aegee org>
Date:   Fri Apr 12 12:25:36 2019 +0200

    I#99 - Fails to build against git master of OpenLDAP (vendor version check)
    
    Closes https://gitlab.gnome.org/GNOME/evolution-data-server/issues/99

 cmake/modules/FindLDAP.cmake                        | 3 ++-
 src/addressbook/backends/ldap/e-book-backend-ldap.c | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/cmake/modules/FindLDAP.cmake b/cmake/modules/FindLDAP.cmake
index abbc3280d..a98bbba76 100644
--- a/cmake/modules/FindLDAP.cmake
+++ b/cmake/modules/FindLDAP.cmake
@@ -86,7 +86,8 @@ set(CMAKE_REQUIRED_LIBRARIES "${LDAP_LIBS}")
 if(WITH_OPENLDAP)
        CHECK_C_SOURCE_COMPILES("#include \"ldap.h\"
                                int main(void) {
-                                       #if !defined(LDAP_VENDOR_VERSION) || LDAP_VENDOR_VERSION < 20000
+                                       /* LDAP_VENDOR_VERSION is 0 if OpenLDAP is built from git/master */
+                                       #if !defined(LDAP_VENDOR_VERSION) || (LDAP_VENDOR_VERSION != 0 && 
LDAP_VENDOR_VERSION < 20000)
                                        #error OpenLDAP version not at least 2.0
                                        #endif
                                        return 0; }" openldap_2_x)
diff --git a/src/addressbook/backends/ldap/e-book-backend-ldap.c 
b/src/addressbook/backends/ldap/e-book-backend-ldap.c
index 5d6a0b72c..0156a5caf 100644
--- a/src/addressbook/backends/ldap/e-book-backend-ldap.c
+++ b/src/addressbook/backends/ldap/e-book-backend-ldap.c
@@ -42,7 +42,8 @@
 
 #define d(x)
 
-#if LDAP_VENDOR_VERSION > 20000
+/* LDAP_VENDOR_VERSION is 0 if OpenLDAP is built from git/master */
+#if !defined(LDAP_VENDOR_VERSION) || LDAP_VENDOR_VERSION == 0 || LDAP_VENDOR_VERSION > 20000
 #define OPENLDAP2
 #else
 #define OPENLDAP1


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]