Skip to content

Commit 7ddd626

Browse files
fxdupontandrei-pavel
authored andcommitted
[#3443] Meson fixes
* Removed unsupported botan-3 * Fixed CHRONO_SAME_DURATION * Updated crypto selection * Updated botan config * Removed pgsql server dependency * Added header install to src/lib/util * Added ALLOW_KEATEST * Added TEST_CA_DIR * Fixed again a typo * Fixed gtest dependency * Added log interprocess tests * Added asiolink tests * Added mysql tests * Added mysql tests * Changed hook suffix to so * Reverted gtest dependency * Removed testutils install
1 parent a846e64 commit 7ddd626

File tree

70 files changed

+209
-75
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+209
-75
lines changed

compiler-checks/chrono-same-duration.cc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
#include <type_traits>
33

44
int main() {
5-
static_assert(std::is_same<std::chrono::system_clock::duration,
6-
std::chrono::steady_clock::duration>::value,
7-
"");
5+
return(std::is_same<std::chrono::system_clock::duration,
6+
std::chrono::steady_clock::duration>::value ? 0 : 1);
87
}

meson-config.h.in

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,9 +196,6 @@
196196
/* Whether you have the <unistd.h> header file. */
197197
#mesondefine HAVE_UNISTD_H
198198

199-
/* Whether you have the <utils/errcodes.h> header file. */
200-
#mesondefine HAVE_UTILS_ERRCODES_H
201-
202199
/* Check valgrind headers */
203200
#mesondefine HAVE_VALGRIND_HEADERS
204201

meson.build

Lines changed: 13 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ TOP_BUILD_DIR = meson.current_build_dir()
1818
TOP_SOURCE_DIR = meson.current_source_dir()
1919
KEA_ADMIN = f'@TOP_BUILD_DIR@/src/bin/admin/kea-admin'
2020
KEA_LFC = f'@TOP_BUILD_DIR@/src/bin/lfc/kea-lfc'
21+
TEST_CA_DIR = f'@TOP_SOURCE_DIR@/src/lib/asiolink/testutils/ca'
2122

2223
#### Configuration Data
2324

@@ -82,7 +83,6 @@ conf_data = configuration_data(
8283
# 'HAVE_SYS_TYPES_H': false,
8384
# 'HAVE_TLS_': false,
8485
# 'HAVE_UNISTD_H': false,
85-
# 'HAVE_UTILS_ERRCODES_H': false,
8686
# 'HAVE_VALGRIND_HEADERS': false,
8787
# 'HAVE_VALGRIND_VALGRIND_H': false,
8888
# 'HAVE__BOOL': false,
@@ -119,21 +119,26 @@ log4cplus = dependency('log4cplus')
119119
# Cryptography
120120
crypto = disabler()
121121
botan = disabler()
122-
foreach dep : ['botan-2', 'botan', 'botan-3']
122+
foreach dep : ['botan-2', 'botan']
123123
botan = dependency(dep, required: false)
124124
if botan.found()
125125
break
126126
endif
127127
endforeach
128128
openssl = dependency('openssl', required: false)
129-
if botan.found() and false # remove "or flase" when botan+mariadb gets fixes
130-
crypto = botan
131-
conf_data.set('WITH_BOTAN', true)
132-
message('Using Botan.')
133-
elif openssl.found()
129+
if openssl.found()
134130
crypto = openssl
135131
conf_data.set('WITH_OPENSSL', true)
136132
message('Using OpenSSL.')
133+
elif botan.found()
134+
crypto = botan
135+
conf_data.set('WITH_BOTAN', true)
136+
message('Using Botan.')
137+
message('Checking Botan Boost support.')
138+
cpp.has_header(
139+
'botan/asio_stream.h',
140+
dependencies: botan,
141+
required: true)
137142
endif
138143
if not crypto.found()
139144
error('Build failed: Could not find neither botan nor openssl libraries.')
@@ -187,27 +192,12 @@ if not postgresql.found()
187192
cflags = run_command([pg_config, '--cflags'], check: false)
188193
libs = run_command([pg_config, '--libs'], check: false)
189194
if cflags.returncode() == 0 and libs.returncode() == 0
190-
krb5 = declare_dependency(
195+
postgresql = declare_dependency(
191196
compile_args: cflags.stdout().split(),
192197
link_args: libs.stdout().split(),
193198
)
194199
endif
195200
endif
196-
postgresql_server_header = disabler()
197-
foreach dir : ['/usr/include/pgsql/server', '/usr/include/postgresql/server']
198-
if not fs.is_dir(dir)
199-
continue
200-
endif
201-
exists = cpp.has_header(
202-
'utils/errcodes.h',
203-
include_directories: [include_directories(dir)],
204-
required: false,
205-
)
206-
if exists
207-
postgresql_server_header = declare_dependency(include_directories: dir)
208-
break
209-
endif
210-
endforeach
211201
if postgresql.found()
212202
conf_data.set('HAVE_PGSQL', true)
213203
endif

src/bin/admin/admin-utils.sh.in

100644100755
File mode changed.

src/bin/admin/kea-admin.in

100644100755
File mode changed.

src/bin/admin/meson.build

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
kea_admin_conf_data = configuration_data()
2+
kea_admin_conf_data.set('prefix', get_option('prefix'))
3+
kea_admin_conf_data.set('exec_prefix', '${prefix}')
4+
kea_admin_conf_data.set('datarootdir', '${prefix}/' + get_option('datadir'))
5+
kea_admin_conf_data.set('PACKAGE', 'kea')
6+
kea_admin_conf_data.set('PACKAGE_NAME', 'kea')
7+
kea_admin_conf_data.set('PACKAGE_VERSION', project_version)
8+
kea_admin_conf_data.set('EXTENDED_VERSION', project_version + ' (tarball)')
9+
kea_admin_conf_data.set('abs_top_builddir', TOP_BUILD_DIR)
10+
kea_admin_conf_data.set('abs_top_srcdir', TOP_SOURCE_DIR)
11+
kea_admin_conf_data.set('sbindir', '${prefix}/' + get_option('sbindir'))
12+
kea_admin_conf_data.set('variables', 'variables')
13+
configure_file(
14+
input: 'kea-admin.in',
15+
output: 'kea-admin',
16+
configuration: kea_admin_conf_data
17+
)
18+
configure_file(
19+
input: 'admin-utils.sh.in',
20+
output: 'admin-utils.sh',
21+
copy: true
22+
)
23+
# install?

src/bin/meson.build

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1+
subdir('lfc')
12
subdir('dhcp4')
23
subdir('dhcp6')
3-
subdir('lfc')
4+
# subdir('d2')
5+
# subdir('agent')
6+
subdir('admin')
7+
# subdir('keactrl')
48
subdir('perfdhcp')
9+
# subdir('shell')
10+
# subdir('netconf')

src/hooks/dhcp/bootp/meson.build

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@ dhcp_bootp_lib = library(
1010
install: true,
1111
install_dir: 'lib/kea/hooks',
1212
link_with: LIBS_BUILT_SO_FAR,
13+
name_suffix: 'so'
1314
)

src/hooks/dhcp/pgsql/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
if not postgresql.found() or not postgresql_server_header.found()
1+
if not postgresql.found()
22
subdir_done()
33
endif
44

src/lib/asiolink/meson.build

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,5 @@ kea_asiolink_lib = library(
5252
link_with: LIBS_BUILT_SO_FAR,
5353
)
5454
LIBS_BUILT_SO_FAR = [kea_asiolink_lib] + LIBS_BUILT_SO_FAR
55+
subdir('testutils')
56+
subdir('tests')

src/lib/asiolink/tests/meson.build

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
CURRENT_BUILD_DIR = meson.current_build_dir()
2+
configure_file(
3+
input: 'process_spawn_app.sh.in',
4+
output: 'process_spawn_app.sh',
5+
copy: true
6+
)
7+
kea_asiolink_tests = executable(
8+
'kea-asiolink-tests',
9+
'addr_utilities_unittest.cc',
10+
'dummy_io_callback_unittest.cc',
11+
'hash_address_unittest.cc',
12+
'interval_timer_unittest.cc',
13+
'io_address_unittest.cc',
14+
'io_endpoint_unittest.cc',
15+
'io_service_mgr_unittest.cc',
16+
'io_service_signal_unittests.cc',
17+
'io_service_thread_pool_unittests.cc',
18+
'io_service_unittest.cc',
19+
'io_socket_unittest.cc',
20+
'process_spawn_unittest.cc',
21+
'run_unittests.cc',
22+
'tcp_acceptor_unittest.cc',
23+
'tcp_endpoint_unittest.cc',
24+
'tcp_socket_unittest.cc',
25+
'tls_acceptor_unittest.cc',
26+
'tls_socket_unittest.cc',
27+
'tls_unittest.cc',
28+
'udp_endpoint_unittest.cc',
29+
'udp_socket_unittest.cc',
30+
'unix_domain_socket_unittest.cc',
31+
cpp_args: [f'-DTEST_SCRIPT_SH="@CURRENT_BUILD_DIR@/process_spawn_app.sh"',
32+
f'-DINVALID_TEST_SCRIPT_SH="@TOP_SOURCE_DIR@/README"',
33+
f'-DTEST_CA_DIR="@TEST_CA_DIR@"'],
34+
dependencies: [gtest, crypto],
35+
include_directories: [include_directories('.')] + INCLUDES,
36+
link_with: LIBS_BUILT_SO_FAR + [kea_asiolink_testutils_lib, kea_util_unittests_lib]
37+
)
38+
test('kea_asiolink_tests', kea_asiolink_tests, protocol: 'gtest')

src/lib/asiolink/tests/process_spawn_app.sh.in

100644100755
File mode changed.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
kea_asiolink_testutils_lib = static_library(
2+
'kea-asiolink-testutils',
3+
'test_tls.cc',
4+
'test_server_unix_socket.cc',
5+
'timed_signal.cc',
6+
cpp_args: [f'-DTEST_CA_DIR="@TEST_CA_DIR@"'],
7+
dependencies: [gtest, crypto],
8+
include_directories: [include_directories('.')] + INCLUDES,
9+
link_with: LIBS_BUILT_SO_FAR
10+
)

src/lib/cc/meson.build

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
kea_cc_lib_cpp_args = []
2+
if gtest.found()
3+
kea_cc_lib_cpp_args = ['-DALLOW_KEATEST']
4+
endif
15
kea_cc_lib = library(
26
'kea-cc',
37
'base_stamped_element.cc',
@@ -23,6 +27,7 @@ kea_cc_lib = library(
2327
'stamped_value.h',
2428
'user_context.cc',
2529
'user_context.h',
30+
cpp_args: kea_cc_lib_cpp_args,
2631
include_directories: [include_directories('.')] + INCLUDES,
2732
install: true,
2833
install_dir: 'lib',

src/lib/database/meson.build

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,5 @@ kea_database_lib = library(
2525
link_with: LIBS_BUILT_SO_FAR,
2626
)
2727
LIBS_BUILT_SO_FAR = [kea_database_lib] + LIBS_BUILT_SO_FAR
28+
subdir('testutils')
2829
subdir('tests')
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
kea_database_testutils_lib = static_library(
2+
'kea-database-testutils',
3+
'schema.cc',
4+
cpp_args: [f'-DTEST_CA_DIR="@TEST_CA_DIR@"'],
5+
include_directories: [include_directories('.')] + INCLUDES,
6+
link_with: LIBS_BUILT_SO_FAR
7+
)

src/lib/dhcp_ddns/tests/meson.build

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ kea_dhcp_ddns_tests = executable(
44
'ncr_unittests.cc',
55
'run_unittests.cc',
66
'test_utils.cc',
7-
'test_utils.h',
87
dependencies: [gtest],
98
include_directories: [include_directories('.')] + INCLUDES,
109
link_with: LIBS_BUILT_SO_FAR + [kea_testutils_lib, kea_util_unittests_lib],

src/lib/dns/tests/meson.build

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ kea_dns_tests = executable(
4343
'tsigrecord_unittest.cc',
4444
'tsig_unittest.cc',
4545
'unittest_util.cc',
46-
'unittest_util.h',
4746
cpp_args: [
4847
f'-DTEST_DATA_BUILDDIR="@TOP_BUILD_DIR@/src/lib/dns/tests/testdata"',
4948
f'-DTEST_DATA_SRCDIR="@TOP_SOURCE_DIR@/src/lib/dns/tests/testdata"',

src/lib/log/interprocess/meson.build

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ kea_log_interprocess_lib = library(
1212
link_with: LIBS_BUILT_SO_FAR,
1313
)
1414
LIBS_BUILT_SO_FAR = [kea_log_interprocess_lib] + LIBS_BUILT_SO_FAR
15+
subdir('tests')
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
kea_log_interprocess_tests = executable(
2+
'kea-log-interprocess-tests',
3+
'interprocess_sync_file_unittest.cc',
4+
'interprocess_sync_null_unittest.cc',
5+
'run_unittests.cc',
6+
cpp_args: [f'-DTEST_DATA_TOPBUILDDIR="@TOP_BUILD_DIR@"'],
7+
dependencies: [gtest],
8+
include_directories: [include_directories('.')] + INCLUDES,
9+
link_with: LIBS_BUILT_SO_FAR + [kea_util_unittests_lib],
10+
)
11+
test('kea_log_interprocess_tests', kea_log_interprocess_tests, protocol: 'gtest')

src/lib/mysql/meson.build

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,5 @@ kea_mysql_lib = library(
1717
link_with: LIBS_BUILT_SO_FAR,
1818
)
1919
LIBS_BUILT_SO_FAR = [kea_mysql_lib] + LIBS_BUILT_SO_FAR
20+
subdir('testutils')
21+
subdir('tests')

src/lib/mysql/tests/meson.build

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
LIBS_TESTUTILS = [
2+
kea_mysql_testutils_lib,
3+
kea_database_testutils_lib,
4+
kea_testutils_lib
5+
]
6+
kea_mysql_tests = executable(
7+
'kea-mysql-tests',
8+
'mysql_binding_unittest.cc',
9+
'mysql_connection_unittest.cc',
10+
'run_unittests.cc',
11+
cpp_args: [f'-DTEST_CA_DIR="@TEST_CA_DIR@"',
12+
f'-DKEA_ADMIN="@KEA_ADMIN@"'],
13+
dependencies: [gtest, mysql],
14+
include_directories: [include_directories('.')] + INCLUDES,
15+
link_with: LIBS_BUILT_SO_FAR + LIBS_TESTUTILS + [kea_util_unittests_lib],
16+
)
17+
test('kea_mysql_tests', kea_mysql_tests, protocol: 'gtest')

src/lib/mysql/testutils/meson.build

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
DATABASE_SCRIPTS_DIR = f'@TOP_BUILD_DIR@/src/share/database/scripts'
2+
kea_mysql_testutils_lib = static_library(
3+
'kea-mysql-testutils',
4+
'mysql_schema.cc',
5+
cpp_args: [f'-DDATABASE_SCRIPTS_DIR="@DATABASE_SCRIPTS_DIR@"',
6+
f'-DDATABASE_WIPE_DIR="@DATABASE_SCRIPTS_DIR@"'],
7+
dependencies: [mysql],
8+
include_directories: [include_directories('.')] + INCLUDES,
9+
link_with: LIBS_BUILT_SO_FAR + [kea_database_testutils_lib]
10+
)

src/lib/pgsql/meson.build

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
if not postgresql.found() or not postgresql_server_header.found()
1+
if not postgresql.found()
22
subdir_done()
33
endif
44

@@ -9,7 +9,7 @@ kea_pgsql_lib = library(
99
'pgsql_exchange.cc',
1010
'pgsql_exchange.h',
1111
cpp_args: [f'-DKEA_ADMIN="@KEA_ADMIN@"'],
12-
dependencies: [postgresql, postgresql_server_header],
12+
dependencies: [postgresql],
1313
include_directories: [include_directories('.')] + INCLUDES,
1414
install: true,
1515
install_dir: 'lib',

src/lib/testutils/meson.build

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,12 @@
1-
kea_testutils_lib = library(
1+
kea_testutils_lib = static_library(
22
'kea-testutils',
3-
'gtest_utils.h',
43
'io_utils.cc',
5-
'io_utils.h',
64
'log_utils.cc',
7-
'log_utils.h',
8-
'multi_threading_utils.h',
9-
'sandbox.h',
105
'test_to_element.cc',
11-
'test_to_element.h',
126
'threaded_test.cc',
13-
'threaded_test.h',
147
'unix_control_client.cc',
15-
'unix_control_client.h',
168
'user_context_utils.cc',
17-
'user_context_utils.h',
189
dependencies: [gtest],
1910
include_directories: [include_directories('.')] + INCLUDES,
20-
install: true,
21-
install_dir: 'lib',
22-
link_with: LIBS_BUILT_SO_FAR,
11+
link_with: LIBS_BUILT_SO_FAR + [kea_util_unittests_lib]
2312
)

0 commit comments

Comments
 (0)