]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
sysrepo: meson configuration
authorAles Mrazek <ales.mrazek@nic.cz>
Wed, 8 Jan 2020 11:43:47 +0000 (12:43 +0100)
committerAleš <ales.mrazek@nic.cz>
Mon, 20 Jul 2020 14:52:29 +0000 (16:52 +0200)
meson.build
meson_options.txt
modules/meson.build
modules/sysrepo-lua/meson.build [new file with mode: 0644]
modules/sysrepo/meson.build [new file with mode: 0644]
utils/kres_watcher/meson.build [new file with mode: 0644]
utils/kresc/meson.build [new file with mode: 0644]
utils/meson.build

index b3d56e22ddfc6db8e94b91ea9cef7eba2ac8e7fd..db50bc6c2ec956ce2efa0862dce7cadcb31f64b3 100644 (file)
@@ -112,6 +112,20 @@ systemd_files = get_option('systemd_files')
 libsystemd = dependency('libsystemd', required: systemd_files == 'enabled')
 message('---------------------------')
 
+### Sysrepo
+message('--- sysrepo dependencies ---')
+libsysrepo = dependency('libsysrepo', version: '>=1', required: false)
+libyang = dependency('libyang', version: '>=1', required: false)
+sysrepo_build = get_option('sysrepo')
+if (sysrepo_build == 'auto' or sysrepo_build == 'enabled') and libsysrepo.found() and libyang.found()
+  enable_sysrepo = true
+elif sysrepo_build == 'enabled' and not libsysrepo.found() and not libyang.found()
+  error('sysrepo=enabled requires libsysrepo and libyang')
+else
+  enable_sysrepo = false
+endif
+message('---------------------------')
+
 ## Compiler args
 add_project_arguments(
   '-D_GNU_SOURCE',
@@ -169,6 +183,7 @@ conf_data.set('SYSTEMD_VERSION',
   libsystemd.found() ? libsystemd.version().to_int() : -1)
 conf_data.set('NOVERBOSELOG', not verbose_log)
 conf_data.set('ENABLE_SENDMMSG', sendmmsg.to_int())
+conf_data.set('ENABLE_SYSREPO', enable_sysrepo.to_int())
 conf_data.set('ENABLE_CAP_NG', capng.found())
 
 kresconfig = configure_file(
@@ -275,6 +290,8 @@ run_target(
 # https://github.com/mesonbuild/meson/issues/2404
 s_managed_ta = managed_ta ? 'enabled' : 'disabled'
 s_install_root_keys = install_root_keys ? 'enabled' : 'disabled'
+s_systemd_socket = libsystemd.found() ? 'enabled' : 'disabled'
+s_enable_sysrepo = enable_sysrepo ? 'enabled' : 'disabled'
 s_build_client = build_client ? 'enabled' : 'disabled'
 s_build_utils = build_utils ? 'enabled' : 'disabled'
 s_build_dnstap = build_dnstap ? 'enabled' : 'disabled'
@@ -307,6 +324,7 @@ message('''
     cache_dir:          @0@'''.format(systemd_cache_dir) + '''
 
   optional components
+    sysrepo:            @0@'''.format(s_enable_sysrepo) + '''
     client:             @0@'''.format(s_build_client) + '''
     utils:              @0@'''.format(s_build_utils) + '''
     dnstap:             @0@'''.format(s_build_dnstap) + '''
index f7ca06aabdca3fda2aff1ed43a52859137b3c96f..0d7f8ccbb16e85763bd41ba94e53af315d212b97 100644 (file)
@@ -135,10 +135,22 @@ option(
     'enabled',
     'disabled',
   ],
-  value: 'auto',
+  value: 'disabled',
   description: 'build kresc client binary',
 )
 
+option(
+  'sysrepo',
+  type: 'combo',
+  choices: [
+    'auto',
+    'enabled',
+    'disabled',
+  ],
+  value: 'auto',
+  description: 'build with sysrepo integration',
+)
+
 option(
   'utils',
   type: 'combo',
index 472c29513262e70cee692038f2bb99c108422bee..9cc707effdc9d3b76e43ae226175c93919ac3400 100644 (file)
@@ -50,6 +50,8 @@ subdir('nsid')
 subdir('policy')
 subdir('refuse_nord')
 subdir('stats')
+subdir('sysrepo')
+subdir('sysrepo-lua')
 subdir('view')
 
 # install lua modules
diff --git a/modules/sysrepo-lua/meson.build b/modules/sysrepo-lua/meson.build
new file mode 100644 (file)
index 0000000..5da9ea8
--- /dev/null
@@ -0,0 +1,8 @@
+# lua module: sysrepo-lua
+
+sysrepo_lua_src = files([
+])
+
+if enable_sysrepo
+
+endif
diff --git a/modules/sysrepo/meson.build b/modules/sysrepo/meson.build
new file mode 100644 (file)
index 0000000..041db3d
--- /dev/null
@@ -0,0 +1,8 @@
+# C module: sysrepo
+
+sysrepo_src = files([
+])
+
+if enable_sysrepo
+
+endif
\ No newline at end of file
diff --git a/utils/kres_watcher/meson.build b/utils/kres_watcher/meson.build
new file mode 100644 (file)
index 0000000..7267c64
--- /dev/null
@@ -0,0 +1,6 @@
+kres_watcher_src = files([
+])
+
+if enable_sysrepo
+
+endif
\ No newline at end of file
diff --git a/utils/kresc/meson.build b/utils/kresc/meson.build
new file mode 100644 (file)
index 0000000..0cc1283
--- /dev/null
@@ -0,0 +1,6 @@
+kresc_src = files([
+])
+
+if enable_sysrepo
+
+endif
\ No newline at end of file
index 0487538460452804aa49ff931fa82045f5701440..96dffb0ab4306d2263b050f84c872a7999b95928 100644 (file)
@@ -3,6 +3,8 @@
 
 build_utils = get_option('utils') != 'disabled'
 
+subdir('kresc')
+subdir('kres_watcher')
 subdir('client')
 subdir('cache_gc')
 subdir('upgrade')