-# PKCS11
-# Inputs: conf deps
+opt = get_option('experimental-pkcs11')
-prog = '''
-#include <p11-kit/p11-kit.h>
+dep_pkcs11 = dependency('p11-kit-1', required: opt)
+conf.set('HAVE_P11KIT1', dep_pkcs11.found(), description: 'Have p11-kit-1')
-int main() {
- void *foo = p11_kit_module_for_name(0, 0);
- return 0;
-}
-'''
+prog = fs.read('p11_kit_module_for_name.cc')
+have = cxx.links(prog, dependencies: dep_pkcs11, name: 'we can link to p11kit1')
+conf.set('HAVE_P11KIT1_V2', have, description: 'Have p11-kit-1 0.20 or newer')
-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
+if not have
+ warning('Could not find p11-kit-1')
endif
--- /dev/null
+#include <p11-kit/p11-kit.h>
+
+int main() {
+ void *foo = p11_kit_module_for_name(0, 0);
+ return 0;
+}
option('reproducible', type: 'boolean', value: false, description: 'Create reproducible builds (for distribution maintainers, makes debugging more difficult)')
option('fuzz-targets', type: 'boolean', value: false, description: 'Enable fuzzing targets')
option('verbose-logging', type: 'boolean', value: false, description: 'Enable verbose logging')
-option('pkcs11', type: 'boolean', value: false, description: 'Enable PKCS11 support (experimental)')
option('gss-tsig', type: 'boolean', value: false, description: 'Enable GSS-TSIG support (experimental)')
+option('experimental-pkcs11', type: 'feature', value: 'disabled', description: 'PKCS11 support')
option('socket-dir', type: 'string', value: '/var/run', description: 'Where the control socket lives')
option('module-bind', type: 'boolean', value: true, description: 'Bind backend')
option('module-bind-dyn', type: 'boolean', value: false, description: 'Bind backend (dynamically loadable)')
)
endif
+libpdns_pkcs11 = dependency('', required: false)
+if dep_pkcs11.found()
+ libpdns_pkcs11 = static_library(
+ 'libpdns-pkcs11',
+ 'pkcs11signers.cc',
+ 'pkcs11signers.hh',
+ include_directories: toplevel_includes,
+ dependencies: dep_pkcs11,
+ )
+
+ libpdns_pkcs11 = declare_dependency(
+ link_with: libpdns_pkcs11,
+ )
+endif
+
libpdns_ws = declare_dependency(
link_with: static_library(
'libpdns-ws',
ragel_generator.process('dnslabeltext.rl'),
include_directories: toplevel_includes,
dependencies: [
- dep_pkcs11,
dep_gss_tsig,
dep_json11,
dep_yahttp,
libpdns_lua,
libpdns_lua_records,
libpdns_tsig,
+ libpdns_pkcs11,
libpdns_ws,
],
)