From: Tomas Krizek Date: Tue, 5 Mar 2019 17:05:50 +0000 (+0100) Subject: meson: modules/dnstap - build as a separate component X-Git-Tag: v4.0.0~24^2~16 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7387b0dda06d4d615a0bf96cd279efb486063bfb;p=thirdparty%2Fknot-resolver.git meson: modules/dnstap - build as a separate component --- diff --git a/meson.build b/meson.build index 87fb993a6..33ce9c3f8 100644 --- a/meson.build +++ b/meson.build @@ -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) + ''' diff --git a/meson_options.txt b/meson_options.txt index 3d5260296..5a08e1b84 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -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', diff --git a/modules/dnstap/meson.build b/modules/dnstap/meson.build index af5dd3579..f629ca2e4 100644 --- a/modules/dnstap/meson.build +++ b/modules/dnstap/meson.build @@ -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