2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-22 01:49:48 +00:00

[#3553] Added botan check

This commit is contained in:
Francis Dupont 2025-03-26 10:30:04 +01:00
parent de6059ebf3
commit 88d1fb4207
2 changed files with 29 additions and 9 deletions

View File

@ -0,0 +1,7 @@
#include <botan/hash.h>
using namespace Botan;
auto h = HashFunction::create("MD5");
int main() {
return 0;
}

View File

@ -223,16 +223,10 @@ LOG4CPLUS_DEP = dependency('log4cplus', fallback: ['log4cplus', 'log4cplus'])
CRYPTO_DEP = disabler()
botan = disabler()
foreach dep : ['botan-3', 'botan']
botan = dependency(dep, required: false)
botan = dependency(dep, version: '>=3.4.0', required: false)
if botan.found()
version = botan.version()
if version.version_compare('<3.4.0')
message(f'Rejecting too old Botan (@version@ < 3.4.0)')
botan = disabler()
else
break
endif
endif
endforeach
openssl = dependency('openssl', required: false)
@ -411,7 +405,6 @@ if cpp_standard.version_compare('<201400')
error('\n'.join(msgs))
endif
endif
# Add Botan 3 to this.
if NETCONF_DEP.found() and cpp_standard.version_compare('<202000')
msgs = ['NETCONF dependency requires at least C++20.']
if cpp_std_opt == 'none'
@ -427,6 +420,15 @@ if NETCONF_DEP.found() and cpp_standard.version_compare('<202000')
NETCONF_DEP = disabler()
endif
endif
if CRYPTO_DEP.name() == botan.name() and cpp_standard.version_compare('<202000')
msgs = ['Botan dependency requires at least C++20.']
if cpp_std_opt == 'none'
msgs += no_cpp_std_opt_msg
else
msgs += cpp_std_opt_msg
endif
error('\n'.join(msgs))
endif
result = cpp.run(
fs.read('compiler-checks/boost-has-threads.cc'),
@ -470,6 +472,17 @@ if CRYPTO_DEP.name() == openssl.name()
endif
endif
if CRYPTO_DEP.name() == botan.name()
result = cpp.run(
fs.read('compiler-checks/botan-hash.cc'),
name: 'CHECK_BOTAN_LIBRARY',
dependencies: [boost_dep, CRYPTO_DEP, threads_dep],
)
if result.returncode() != 0
error('Botan library does not work.')
endif
endif
result = cpp.run(
fs.read('compiler-checks/have-optreset.cc'),
name: 'HAVE_OPTRESET',