[libgda] Meson: remove configure warnings



commit 36a39a429ed134a190713ad99a1fc734b10fbfb4
Author: Daniel Espinosa <esodan gmail com>
Date:   Wed Jul 18 23:53:56 2018 -0500

    Meson: remove configure warnings

 libgda-ui/data-entries/meson.build               | 10 ++++---
 libgda/meson.build                               | 35 ++++++++++++------------
 meson.build                                      | 25 ++++++-----------
 providers/ldap/meson.build                       | 17 ++++++------
 providers/postgres/meson.build                   | 17 ++++++------
 providers/reuseable/postgres/meson.build         |  2 +-
 providers/skel-implementation/capi/meson.build   | 12 ++++----
 providers/skel-implementation/models/meson.build | 20 ++++++--------
 providers/sqlite/meson.build                     | 27 ++++++++----------
 tools/meson.build                                | 18 ++++++++++--
 10 files changed, 90 insertions(+), 93 deletions(-)
---
diff --git a/libgda-ui/data-entries/meson.build b/libgda-ui/data-entries/meson.build
index 89d92666e..85ee96595 100644
--- a/libgda-ui/data-entries/meson.build
+++ b/libgda-ui/data-entries/meson.build
@@ -92,10 +92,12 @@ endforeach
 data_entries_xml_inf = files(data_entries_xmlin_namesext)
 
 foreach xf : data_entries_xmlin_names
-       install_data(xf+'.xml.in',
-               rename: [
-                       xf+'.xml'
-                       ],
+       oxf = configure_file(
+               input: xf+'.xml.in',
+               output: xf+'.xml',
+               configuration: tconf
+               )
+       install_data(oxf,
                install_dir: join_paths(get_option('datadir'), project_package,'ui')
                )
 endforeach
diff --git a/libgda/meson.build b/libgda/meson.build
index d8cbea45a..8d0f233b2 100644
--- a/libgda/meson.build
+++ b/libgda/meson.build
@@ -273,6 +273,7 @@ libgda = library(
        )
 
 # GObject Introspection
+if girscanner.found()
 gi_sources = [
        libgda_sources,
        libgda_headers,
@@ -303,23 +304,23 @@ libgda_gir = gnome_module.generate_gir(libgda,
        install_dir_gir: join_paths(get_option('datadir'), 'gir-1.0'),
        install_dir_typelib: join_paths(get_option('libdir'), 'girepository-1.0'),
        )
-
-if vapigen.found()
-libgda_vapi = custom_target(project_package,
-       command: [vapigen,
-               '--girdir='+meson.current_source_dir(),
-               '--metadatadir='+meson.current_source_dir(),
-               '--library='+project_package,
-               '--directory='+meson.current_build_dir(),
-               '--pkg=libxml-2.0',
-               '--pkg=gio-2.0',
-               '@INPUT0@', '@INPUT1@'
-               ],
-       input: [libgda_gir[0],'Gda-'+project_api_version+'-custom.vala'],
-       output: project_package+'.vapi',
-       install: true,
-       install_dir: join_paths(get_option('datadir'),'vala','vapi')
-       )
+       if vapigen.found()
+       libgda_vapi = custom_target(project_package,
+               command: [vapigen,
+                       '--girdir='+meson.current_source_dir(),
+                       '--metadatadir='+meson.current_source_dir(),
+                       '--library='+project_package,
+                       '--directory='+meson.current_build_dir(),
+                       '--pkg=libxml-2.0',
+                       '--pkg=gio-2.0',
+                       '@INPUT0@', '@INPUT1@'
+                       ],
+               input: [libgda_gir[0],'Gda-'+project_api_version+'-custom.vala'],
+               output: project_package+'.vapi',
+               install: true,
+               install_dir: join_paths(get_option('datadir'),'vala','vapi')
+               )
+       endif
 endif
 
 # Tests
diff --git a/meson.build b/meson.build
index dbb48ba9d..30fdcbf62 100644
--- a/meson.build
+++ b/meson.build
@@ -30,6 +30,8 @@ glib_genmarshal = find_program('glib-genmarshal', required : true)
 
 glib_mkenums = find_program('glib-mkenums', required : true)
 
+girscanner = find_program('g-ir-scanner', required:false)
+
 inc_rooth = include_directories ('.')
 inc_rooth_dep = declare_dependency (include_directories : inc_rooth)
 
@@ -95,16 +97,7 @@ if ldap_lib_dep.found()
        endif
 endif
 
-datec = compiler.run('''
-#include <glib.h>
-
-gint main (void) {
-       GDateTime *dt = g_date_time_new_now_utc ();
-       g_print (g_date_time_format (dt, "%F"));
-}
-''',
-       dependencies: glib_dep
-       )
+tconf = configuration_data() # Empty configuration
 
 conf = configuration_data()
 if glib_genmarshal.found()
@@ -120,13 +113,13 @@ endif
 conf.set('GDA_ABI_MAJOR_VERSION', MAJOR_VERSION)
 conf.set('GDA_ABI_MINOR_VERSION', MINOR_VERSION)
 conf.set('VERSION', project_version)
-conf.set('GDA_VERSION', project_version)
-conf.set('GDA_ABI_VERSION', project_version)
 conf.set('prefix', get_option('prefix'))
 conf.set('exec_prefix', get_option('libexecdir'))
 conf.set('libdir', get_option('libdir'))
 conf.set('includedir', get_option('includedir'))
 conf.set('GDA_DEBUG_FLAGS', '')
+conf.set('LIBGDA_BDB_INC', '')
+conf.set('LIBGDA_BDB_TYPE', '')
 if ldap_found
        conf.set('LIBGDA_LDAP_VINC',LIBGDA_LDAP_VINC)
        conf.set('LIBGDA_LDAP_INC',LIBGDA_LDAP_INC)
@@ -135,16 +128,14 @@ if ldap_found
        conf.set('LIBGDA_LDAP_TYPE2',LIBGDA_LDAP_TYPE2)
        conf.set('LIBGDA_LDAP_TYPE3',LIBGDA_LDAP_TYPE3)
 endif
-conf.set('LIBGDA_BDB_INC','')
-conf.set_quoted('LIBGDA_BDB_TYPE','')
 
 confh = configuration_data()
-if compiler.has_header('locale.h')
-       confh.set ('HAVE_LOCALE_H', '1')
-endif
 confh.set_quoted('PACKAGE_LOCALE_DIR', join_paths(get_option('prefix'), get_option('datadir'), 'locale'))
 confh.set_quoted('GETTEXT_PACKAGE', project_package)
 confh.set_quoted('PACKAGE_VERSION', project_version)
+if compiler.has_header('locale.h')
+       confh.set ('HAVE_LOCALE_H', '1')
+endif
 configh = configure_file(output : 'config.h',
                        configuration : confh)
 
diff --git a/providers/ldap/meson.build b/providers/ldap/meson.build
index a8ffa3e30..e9d391166 100644
--- a/providers/ldap/meson.build
+++ b/providers/ldap/meson.build
@@ -25,15 +25,6 @@ endforeach
 
 ldap_xml_inf = files(ldap_xml_fnamesext)
 
-foreach xf : ldap_xml_fnames
-       install_data(xf+'.xml.in',
-               rename: [
-                       xf+'.xml'
-                       ],
-               install_dir: join_paths(get_option('datadir'), project_package)
-               )
-endforeach
-
 foreach xt : ldap_xml_fnames
        i18n.merge_file(
                input: xt+'.xml.in',
@@ -41,6 +32,14 @@ foreach xt : ldap_xml_fnames
                type: 'xml',
                po_dir: join_paths(meson.build_root(),'po')
                )
+       osf = configure_file(
+               input: xt+'.xml.in',
+               output: xt+'.xml',
+               configuration: tconf
+               )
+       install_data(osf,
+               install_dir: join_paths(get_option('datadir'), project_package)
+               )
 endforeach
 
 ldap_xml_res = []
diff --git a/providers/postgres/meson.build b/providers/postgres/meson.build
index 96154b914..75480b32b 100644
--- a/providers/postgres/meson.build
+++ b/providers/postgres/meson.build
@@ -27,15 +27,6 @@ endforeach
 
 postgres_xml_inf = files(postgres_xml_fnamesext)
 
-foreach xf : postgres_xml_fnames
-       install_data(xf+'.xml.in',
-               rename: [
-                       xf+'.xml'
-                       ],
-               install_dir: join_paths(get_option('datadir'), project_package)
-               )
-endforeach
-
 foreach xt : postgres_xml_fnames
        i18n.merge_file(
                input: xt+'.xml.in',
@@ -43,6 +34,14 @@ foreach xt : postgres_xml_fnames
                type: 'xml',
                po_dir: join_paths(meson.build_root(),'po')
                )
+       osf = configure_file(
+               input: xt+'.xml.in',
+               output: xt+'.xml',
+               configuration: tconf
+               )
+       install_data(osf,
+               install_dir: join_paths(get_option('datadir'), project_package)
+               )
 endforeach
 
 postgres_xml_res = []
diff --git a/providers/reuseable/postgres/meson.build b/providers/reuseable/postgres/meson.build
index 6afef29dd..479aa7eff 100644
--- a/providers/reuseable/postgres/meson.build
+++ b/providers/reuseable/postgres/meson.build
@@ -56,7 +56,7 @@ pg_lemon_parserh = custom_target('pg_lemon-parser_h',
 
 pg_lemon_parserh_dep = declare_dependency(sources: pg_lemon_parserh)
 
-postgres_gendef = executable('gen_def', 'gen_def.c',
+postgres_gendef = executable('pg_gen_def', 'gen_def.c',
        c_args: [
                '-DIMPOSED_HEADER="'+join_paths (meson.build_root(), 'libgda', 
'sql-parser','token_types.h')+'"',
                '-DPARSER_HEADER_PATH="'+join_paths(meson.current_build_dir(),'parser.h')+'"'
diff --git a/providers/skel-implementation/capi/meson.build b/providers/skel-implementation/capi/meson.build
index cefcae1b4..4f5064d95 100644
--- a/providers/skel-implementation/capi/meson.build
+++ b/providers/skel-implementation/capi/meson.build
@@ -14,10 +14,12 @@ endforeach
 capi_xml_inf = files(capi_xml_fnamesext)
 
 foreach xf : capi_xml_fnames
-       install_data(xf+'.xml.in',
-               rename: [
-                       xf+'.xml'
-                       ],
+       oxf = configure_file(
+               input: xf+'.xml.in',
+               output: xf+'.xml',
+               configuration: tconf
+               )
+       install_data(oxf,
                install_dir: join_paths(get_option('datadir'), project_package)
                )
 endforeach
@@ -138,7 +140,7 @@ capi_lemon_parserh = custom_target('capi_lemon-parser_h',
 
 capi_lemon_parserh_dep = declare_dependency(sources: capi_lemon_parserh)
 
-capi_gendef = executable('gen_def', 'gen_def.c',
+capi_gendef = executable('capi_gen_def', 'gen_def.c',
        c_args: [
                '-DIMPOSED_HEADER="'+join_paths (meson.build_root(), 'libgda', 
'sql-parser','token_types.h')+'"',
                '-DPARSER_HEADER_PATH="'+join_paths(meson.current_build_dir(),'parser.h')+'"'
diff --git a/providers/skel-implementation/models/meson.build 
b/providers/skel-implementation/models/meson.build
index 59438532f..7b058e44d 100644
--- a/providers/skel-implementation/models/meson.build
+++ b/providers/skel-implementation/models/meson.build
@@ -5,19 +5,7 @@ inc_libgda_modelsh_dep = declare_dependency (include_directories : inc_libgda_mo
 models_xml_fnames = [
        'models_specs_dsn',
        ]
-models_xml_fnamesext = []
-foreach fn : models_xml_fnames
-       models_xml_fnamesext += [fn+'.xml.in']
-endforeach
-
-models_xml_inf = files(models_xml_fnamesext)
 
-install_data(models_xml_fnamesext,
-       rename: [
-               'sqlite_specs_dsn.xml',
-               ],
-       install_dir: join_paths(get_option('datadir'), project_package)
-       )
 foreach xt : models_xml_fnames
        i18n.merge_file(
                input: xt+'.xml.in',
@@ -25,6 +13,14 @@ foreach xt : models_xml_fnames
                type: 'xml',
                po_dir: join_paths(meson.build_root(),'po')
                )
+       # osf = configure_file(
+       #       input: xt+'.xml.in',
+       #       output: xt+'.xml',
+       #       configuration: tconf
+       #       )
+       # install_data(osf,
+       #       install_dir: join_paths(get_option('datadir'), project_package)
+       #       )
 endforeach
 
 foreach xr : models_xml_fnames
diff --git a/providers/sqlite/meson.build b/providers/sqlite/meson.build
index 90a6a2225..9187bb887 100644
--- a/providers/sqlite/meson.build
+++ b/providers/sqlite/meson.build
@@ -6,22 +6,17 @@ foreach fn : sqlite_xml_fnames
        sqlite_xml_fnamesextf += [fn+'.xml.in']
 endforeach
 
-install_data(sqlite_xml_fnamesextf,
-       rename: [
-               'sqlite_specs_dsn.xml',
-               'sqlite_specs_create_db.xml',
-               'sqlite_specs_drop_db.xml',
-               'sqlite_specs_create_table.xml',
-               'sqlite_specs_drop_table.xml',
-               'sqlite_specs_create_index.xml',
-               'sqlite_specs_drop_index.xml',
-               'sqlite_specs_rename_table.xml',
-               'sqlite_specs_add_column.xml',
-               'sqlite_specs_create_view.xml',
-               'sqlite_specs_drop_view.xml'
-               ],
-       install_dir: join_paths(get_option('datadir'), project_package)
-       )
+foreach cfn : sqlite_xml_fnames
+       ocfn = configure_file(
+               input: cfn+'.xml.in',
+               output: cfn+'.xml',
+               configuration: tconf
+               )
+       install_data(ocfn,
+               install_dir: join_paths(get_option('datadir'), project_package)
+               )
+endforeach
+
 foreach xt : sqlite_xml_fnames
        i18n.merge_file(
                input: xt+'.xml.in',
diff --git a/tools/meson.build b/tools/meson.build
index 374aa0f1e..4d458f57b 100644
--- a/tools/meson.build
+++ b/tools/meson.build
@@ -6,6 +6,19 @@ subdir('common')
 subdir('base')
 subdir('help')
 
+dates = compiler.run('''
+#include<glib.h>
+#include <glib/gprintf.h>
+
+void main (void) {
+  GDateTime *dt;
+  dt = g_date_time_new_now_local ();
+  g_print (g_date_time_format(dt, "%F"));
+}
+''',
+dependencies: glib_dep
+)
+
 gda_sql_sources = files([
        'tools-main.c'
        ])
@@ -41,10 +54,9 @@ gda_sql = executable('gda-sql-'+project_api_version,
 
 manconf = configuration_data()
 manconf.set('GDA_ABI_VERSION', project_api_version)
-manconf.set('PACKAGE_VERSION', project_version)
+manconf.set('PACKAGE_VERSION', project_package)
 manconf.set('gdasysconfdir', get_option('sysconfdir'))
-manconf.set('GDA_BUILDDATE', datec.stdout())
-
+manconf.set('GDA_BUILDDATE', dates.stdout())
 gda_sql_man = configure_file(
        input: 'gda-sql.1.in',
        output: 'gda-sql.1',


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