From: Fred Morcos Date: Fri, 7 Jul 2023 10:07:24 +0000 (+0200) Subject: Meson: PKCS11 X-Git-Tag: rec-5.1.0-alpha1~80^2~342 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6b6581ea7e32580aa74820157439ed37b71b5580;p=thirdparty%2Fpdns.git Meson: PKCS11 --- diff --git a/meson.build b/meson.build index 63f0557360..3ba5f5cce5 100644 --- a/meson.build +++ b/meson.build @@ -51,6 +51,7 @@ subdir('meson/python-venv') # Python Venv subdir('meson/from-git') # From Git subdir('meson/dlopen') # dlopen subdir('meson/verbose-logging') # Verbose Logging +subdir('meson/pkcs11') # PKCS11 # Find or generate pdns/dnslabeltext.cc if not ragel.found() and not fs.exists('pdns/dnslabeltext.cc') diff --git a/meson/pkcs11/meson.build b/meson/pkcs11/meson.build new file mode 100644 index 0000000000..8f899b262c --- /dev/null +++ b/meson/pkcs11/meson.build @@ -0,0 +1,28 @@ +# PKCS11 +# Inputs: conf deps + +prog = ''' +#include + +int main() { + void *foo = p11_kit_module_for_name(0, 0); + return 0; +} +''' + +opt_pkcs11 = get_option('pkcs11') +conf.set10('PKCS11', opt_pkcs11, description: 'Whether to enable PKCS11 support (experimental)') + +if opt_pkcs11 + dep_pkcs11 = dependency('p11-kit-1', required: opt_pkcs11) + conf.set10('HAVE_P11KIT1', dep_pkcs11.found(), description: 'Whether we have p11-kit-1') + + has = cxx.links(prog, dependencies: dep_pkcs11, name: 'we can link to p11kit1') + conf.set10('HAVE_P11KIT1_V2', has, description: 'Whether we have p11-kit-1 0.20 or newer') + + if not has + warning('Could not find p11-kit-1') + endif + + deps += dep_pkcs11 +endif diff --git a/meson_options.txt b/meson_options.txt index 21db1d8a3f..c0706472e8 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -15,3 +15,4 @@ option('reproducible', type: 'boolean', value: false, description: 'Create repro option('fuzz-targets', type: 'boolean', value: false, description: 'Enable fuzzing targets') option('sqlite3', type: 'boolean', value: false, description: 'Include the sqlite3 driver') option('verbose-logging', type: 'boolean', value: false, description: 'Enable verbose logging') +option('pkcs11', type: 'boolean', value: false, description: 'Enable PKCS11 support (experimental)')