[libgda] Meson: added LDAP dependency detection



commit a9c55054ac7671fa921fbf032c78fcaacce6fbea
Author: Daniel Espinosa <esodan gmail com>
Date:   Thu Jul 12 23:09:19 2018 -0500

    Meson: added LDAP dependency detection
    
    Used LDAP includes for file configuration

 doc/C/meson.build                 |  9 +++++++++
 doc/meson.build                   |  1 +
 libgda/meson.build                |  5 ++---
 libgda/sqlite/virtual/meson.build |  3 +--
 meson.build                       | 27 +++++++++++++++++++++++----
 providers/ldap/meson.build        |  0
 providers/meson.build             |  4 ++++
 7 files changed, 40 insertions(+), 9 deletions(-)
---
diff --git a/doc/C/meson.build b/doc/C/meson.build
new file mode 100644
index 000000000..499d1d7df
--- /dev/null
+++ b/doc/C/meson.build
@@ -0,0 +1,9 @@
+docconf = configuration_data()
+docconf.set('LIBGDA_LDAP_TYPE',LIBGDA_LDAP_TYPE)
+docconf.set('LIBGDA_LDAP_TYPE2',LIBGDA_LDAP_TYPE2)
+docconf.set('LIBGDA_LDAP_TYPE3',LIBGDA_LDAP_TYPE3)
+
+libgda_typesdoc = configure_file(
+               input: 'libgda.types.in',
+               output : 'libgda.types',
+               configuration : docconf)
\ No newline at end of file
diff --git a/doc/meson.build b/doc/meson.build
new file mode 100644
index 000000000..ed6c93a55
--- /dev/null
+++ b/doc/meson.build
@@ -0,0 +1 @@
+subdir('C')
\ No newline at end of file
diff --git a/libgda/meson.build b/libgda/meson.build
index 21e81c8c8..5ad97f6d7 100644
--- a/libgda/meson.build
+++ b/libgda/meson.build
@@ -21,10 +21,9 @@ install_data(dtdf,
        )
 
 conf = configuration_data()
-# FIXME: Set this variables
 # conf.set_quoted('LIBGDA_BDB_INC','')
-# conf.set_quoted('LIBGDA_LDAP_INC','')
-# conf.set_quoted('LIBGDA_LDAP_INC2','')
+conf.set('LIBGDA_LDAP_INC',LIBGDA_LDAP_INC)
+conf.set('LIBGDA_LDAP_INC2',LIBGDA_LDAP_INC2)
 libgda_virtualh = configure_file(
                input: 'libgda.h.in',
                output : 'libgda.h',
diff --git a/libgda/sqlite/virtual/meson.build b/libgda/sqlite/virtual/meson.build
index 3feb50f9d..bf43d09ef 100644
--- a/libgda/sqlite/virtual/meson.build
+++ b/libgda/sqlite/virtual/meson.build
@@ -1,6 +1,5 @@
 conf = configuration_data()
-# FIXME: define LIBGDA_LDAP_VINC
-# conf.set_quoted('LIBGDA_LDAP_VINC','')
+conf.set('LIBGDA_LDAP_VINC',LIBGDA_LDAP_VINC)
 libgda_virtualh = configure_file(
                input: 'libgda-virtual.h.in',
                output : 'libgda-virtual.h',
diff --git a/meson.build b/meson.build
index 9a3b825b5..6273d815f 100644
--- a/meson.build
+++ b/meson.build
@@ -30,8 +30,9 @@ conf.set_quoted('PACKAGE_LOCALE_DIR', join_paths(get_option('prefix'), get_optio
 conf.set_quoted('GETTEXT_PACKAGE', project_package)
 conf.set_quoted('PACKAGE_VERSION', project_version)
 
+compiler = meson.get_compiler('c')
 
-if meson.get_compiler('c').has_header('locale.h')
+if compiler.has_header('locale.h')
        conf.set ('HAVE_LOCALE_H', '1')
 endif
 
@@ -69,11 +70,28 @@ graphviz_dep = dependency('libgvc', required : false)
 libxslt_dep = dependency('libxslt', required: false)
 jsonglib_dep = dependency('json-glib-1.0',required : false)
 postgres_dep = dependency ('libpq', required: false)
+# LDAP
+ldap_found = false
+ldap_lib_dep = compiler.find_library('ldap', required: false)
+if ldap_lib_dep.found()
+       ldapber_dep = compiler.find_library('lber')
+       if ldapber_dep.found()
+               if compiler.has_header('ldap.h')
+                       ldap_found = true
+                       LIBGDA_LDAP_INC='#include <libgda/gda-data-model-ldap.h>'
+                       LIBGDA_LDAP_INC2='#include <libgda/gda-tree-mgr-ldap.h>'
+                       LIBGDA_LDAP_VINC='#include <virtual/gda-ldap-connection.h>'
+                       LIBGDA_LDAP_TYPE='gda_data_model_ldap_get_type'
+                       LIBGDA_LDAP_TYPE2='gda_ldap_connection_get_type'
+                       LIBGDA_LDAP_TYPE3='gda_tree_mgr_ldap_get_type'
+               endif
+       endif
+endif
 
 sqlite_dep = dependency ('sqlite3', version: '>= 3.6.11', required: false)
 sqlite_internal = true
 if sqlite_dep.found()
-       sqlite3_table_column_metadata = meson.get_compiler('c').find_library('sqlite3_table_column_metadata',
+       sqlite3_table_column_metadata = compiler.find_library('sqlite3_table_column_metadata',
                                                                                                              
                          required: false
                                                                                                              
                          )
        if sqlite3_table_column_metadata.found()
@@ -82,7 +100,7 @@ if sqlite_dep.found()
 endif
 
 if sqlite_internal
-       ldl = meson.get_compiler('c').find_library('dl')
+       ldl = compiler.find_library('dl')
 endif
 
 sed = find_program('sed')
@@ -182,7 +200,7 @@ if enable_ui
        glade_dep = dependency('gladeui-2.0', required : false)
        goocanvas_dep = dependency('goocanvas-2.0', required: false)
        if goocanvas_dep.found()
-               math_dep = meson.get_compiler('c').find_library('m')
+               math_dep = compiler.find_library('m')
        endif
        gtksourceview_dep = dependency('gtksourceview-3.0')
        graphviz_dep = dependency('libgvc', required: false)
@@ -267,6 +285,7 @@ libgda_report_pc = configure_file(
        )
 endif
 
+subdir('doc')
 subdir('tools')
 subdir('tests')
 subdir('testing')
diff --git a/providers/ldap/meson.build b/providers/ldap/meson.build
new file mode 100644
index 000000000..e69de29bb
diff --git a/providers/meson.build b/providers/meson.build
index 9fa1f17db..3e29ad470 100644
--- a/providers/meson.build
+++ b/providers/meson.build
@@ -6,4 +6,8 @@ subdir('skel-implementation')
 
 if postgres_dep.found()
 subdir('postgres')
+endif
+
+if ldap_found
+subdir('ldap')
 endif
\ No newline at end of file


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