]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
meson: modules/dnstap - build as a separate component
authorTomas Krizek <tomas.krizek@nic.cz>
Tue, 5 Mar 2019 17:05:50 +0000 (18:05 +0100)
committerTomas Krizek <tomas.krizek@nic.cz>
Tue, 12 Mar 2019 09:44:50 +0000 (10:44 +0100)
meson.build
meson_options.txt
modules/dnstap/meson.build

index 87fb993a61085c2ba4aa9af61a07b2aed19ec7fa..33ce9c3f85512270c01dd9b6be0efdef9a2614ad 100644 (file)
@@ -231,11 +231,11 @@ run_target(
 s_managed_ta = managed_ta ? 'enabled' : 'disabled'
 s_systemd_socket = libsystemd.found() ? 'enabled' : 'disabled'
 s_build_client = build_client ? 'enabled' : 'disabled'
+s_build_dnstap = build_dnstap ? 'enabled' : 'disabled'
 s_build_unit_tests = build_unit_tests ? 'enabled' : 'disabled'
 s_build_config_tests = build_config_tests ? 'enabled' : 'disabled'
 s_build_extra_tests = build_extra_tests ? 'enabled' : 'disabled'
 s_install_kresd_conf = install_kresd_conf ? 'enabled' : 'disabled'
-# TODO mention dnstap installation?
 message('''
 
 ======================= SUMMARY =======================
@@ -258,6 +258,7 @@ message('''
 
   optional components
     client:             @0@'''.format(s_build_client) + '''
+    dnstap:             @0@'''.format(s_build_dnstap) + '''
     unit_tests:         @0@'''.format(s_build_unit_tests) + '''
     config_tests:       @0@'''.format(s_build_config_tests) + '''
     extra_tests:        @0@'''.format(s_build_extra_tests) + '''
index 3d52602968589e3bb63799344be5a591db9df5b3..5a08e1b847c2a9a30b2dc322740268faf877e6d4 100644 (file)
@@ -102,6 +102,18 @@ option(
   description: 'build kresc client binary',
 )
 
+option(
+  'dnstap',
+  type: 'combo',
+  choices: [
+    'auto',
+    'enabled',
+    'disabled',
+  ],
+  value: 'auto',
+  description: 'build dnstap module',
+)
+
 option(
   'doc',
   type: 'combo',
index af5dd357997dd582a1022ef61e6c44a0337d4dd9..f629ca2e43157ee7dc2a05b99fc705d602efab22 100644 (file)
@@ -5,15 +5,21 @@ dnstap_src = files([
 ])
 
 ## dnstap dependencies
-message('--- dnstap module dependencies ---')
-libprotobuf_c = dependency('libprotobuf-c', version: '>=1', required: false)
-libfstrm = dependency('libfstrm', version: '>=0.2', required: false)
-protoc_c = find_program('protoc-c', required: false)
-message('----------------------------------')
+build_dnstap = false
+if get_option('dnstap') != 'disabled'
+  dnstap_required = get_option('dnstap') == 'enabled'
+  message('--- dnstap module dependencies ---')
+  libprotobuf_c = dependency('libprotobuf-c', version: '>=1', required: dnstap_required)
+  libfstrm = dependency('libfstrm', version: '>=0.2', required: dnstap_required)
+  protoc_c = find_program('protoc-c', required: dnstap_required)
+  message('----------------------------------')
+  if libprotobuf_c.found() and libfstrm.found() and protoc_c.found()
+    build_dnstap = true
+  endif
+endif
 
 
-# build dnstap if deps are found
-if libprotobuf_c.found() and libfstrm.found() and protoc_c.found()
+if build_dnstap
   c_src_lint += dnstap_src
 
   # generate protobuf-c sources using protoc-c