From 20c793865086a068b267f7bb0b99fa634e779fed Mon Sep 17 00:00:00 2001 From: Ayoub Zaki Date: Wed, 22 Jan 2025 16:03:33 +0100 Subject: [PATCH] meson: add option to allow override default default_pkcs11_module Signed-off-by: Ayoub Zaki --- meson.build | 10 ++++++++-- meson_options.txt | 5 +++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index b3912cb4..790d979c 100644 --- a/meson.build +++ b/meson.build @@ -67,11 +67,17 @@ if host_machine.endian() == 'big' endif p11_kit = dependency('p11-kit-1', required: false) -if p11_kit.found() +default_pkcs11_module = get_option('default_pkcs11_module') +if default_pkcs11_module == '' and p11_kit.found() default_pkcs11_module = p11_kit.get_variable(pkgconfig: 'proxy_module') - conf.set_quoted('DEFAULT_PKCS11_MODULE', default_pkcs11_module) endif +if default_pkcs11_module == '' + error('default_pkcs11_module is empty') +endif + +conf.set_quoted('DEFAULT_PKCS11_MODULE', default_pkcs11_module) + headers = [ 'dlfcn.h', ] diff --git a/meson_options.txt b/meson_options.txt index 20ce4bdf..9f38a093 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -7,3 +7,8 @@ option('enable_explicit_EC_test', type: 'boolean', value: false, description: 'Enable explicit EC tests') + +option('default_pkcs11_module', + type : 'string', + value : '', + description : 'Path to the default PKCS11 module')