]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#3443] Meson fixes
authorFrancis Dupont <fdupont@isc.org>
Fri, 31 Jan 2025 18:13:55 +0000 (19:13 +0100)
committerAndrei Pavel <andrei@isc.org>
Tue, 4 Feb 2025 14:29:03 +0000 (16:29 +0200)
* 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

70 files changed:
compiler-checks/chrono-same-duration.cc
meson-config.h.in
meson.build
src/bin/admin/admin-utils.sh.in [changed mode: 0644->0755]
src/bin/admin/kea-admin.in [changed mode: 0644->0755]
src/bin/admin/meson.build [new file with mode: 0644]
src/bin/meson.build
src/hooks/dhcp/bootp/meson.build
src/hooks/dhcp/pgsql/meson.build
src/lib/asiolink/meson.build
src/lib/asiolink/tests/meson.build [new file with mode: 0644]
src/lib/asiolink/tests/process_spawn_app.sh.in [changed mode: 0644->0755]
src/lib/asiolink/testutils/meson.build [new file with mode: 0644]
src/lib/cc/meson.build
src/lib/database/meson.build
src/lib/database/testutils/meson.build [new file with mode: 0644]
src/lib/dhcp_ddns/tests/meson.build
src/lib/dns/tests/meson.build
src/lib/log/interprocess/meson.build
src/lib/log/interprocess/tests/meson.build [new file with mode: 0644]
src/lib/mysql/meson.build
src/lib/mysql/tests/meson.build [new file with mode: 0644]
src/lib/mysql/testutils/meson.build [new file with mode: 0644]
src/lib/pgsql/meson.build
src/lib/testutils/meson.build
src/lib/util/meson.build
src/lib/util/tests/meson.build [changed mode: 0755->0644]
src/lib/util/unittests/meson.build
src/share/database/meson.build
src/share/database/scripts/meson.build [new file with mode: 0644]
src/share/database/scripts/mysql/meson.build [new file with mode: 0644]
src/share/database/scripts/mysql/upgrade_001.0_to_002.0.sh.in [changed mode: 0644->0755]
src/share/database/scripts/mysql/upgrade_002.0_to_003.0.sh.in [changed mode: 0644->0755]
src/share/database/scripts/mysql/upgrade_003.0_to_004.0.sh.in [changed mode: 0644->0755]
src/share/database/scripts/mysql/upgrade_004.0_to_004.1.sh.in [changed mode: 0644->0755]
src/share/database/scripts/mysql/upgrade_004.1_to_005.0.sh.in [changed mode: 0644->0755]
src/share/database/scripts/mysql/upgrade_005.0_to_005.1.sh.in [changed mode: 0644->0755]
src/share/database/scripts/mysql/upgrade_005.1_to_005.2.sh.in [changed mode: 0644->0755]
src/share/database/scripts/mysql/upgrade_005.2_to_006.0.sh.in [changed mode: 0644->0755]
src/share/database/scripts/mysql/upgrade_006.0_to_007.0.sh.in [changed mode: 0644->0755]
src/share/database/scripts/mysql/upgrade_007.0_to_008.0.sh.in [changed mode: 0644->0755]
src/share/database/scripts/mysql/upgrade_008.0_to_008.1.sh.in [changed mode: 0644->0755]
src/share/database/scripts/mysql/upgrade_008.1_to_008.2.sh.in [changed mode: 0644->0755]
src/share/database/scripts/mysql/upgrade_008.2_to_009.0.sh.in [changed mode: 0644->0755]
src/share/database/scripts/mysql/upgrade_009.0_to_009.1.sh.in [changed mode: 0644->0755]
src/share/database/scripts/mysql/upgrade_009.1_to_009.2.sh.in [changed mode: 0644->0755]
src/share/database/scripts/mysql/upgrade_009.2_to_009.3.sh.in [changed mode: 0644->0755]
src/share/database/scripts/mysql/upgrade_009.3_to_009.4.sh.in [changed mode: 0644->0755]
src/share/database/scripts/mysql/upgrade_009.4_to_009.5.sh.in [changed mode: 0644->0755]
src/share/database/scripts/mysql/upgrade_009.5_to_009.6.sh.in [changed mode: 0644->0755]
src/share/database/scripts/mysql/upgrade_009.6_to_010.0.sh.in [changed mode: 0644->0755]
src/share/database/scripts/mysql/upgrade_010_to_011.sh.in [changed mode: 0644->0755]
src/share/database/scripts/mysql/upgrade_011_to_012.sh.in [changed mode: 0644->0755]
src/share/database/scripts/mysql/upgrade_012_to_013.sh.in [changed mode: 0644->0755]
src/share/database/scripts/mysql/upgrade_013_to_014.sh.in [changed mode: 0644->0755]
src/share/database/scripts/mysql/upgrade_014_to_015.sh.in [changed mode: 0644->0755]
src/share/database/scripts/mysql/upgrade_015_to_016.sh.in [changed mode: 0644->0755]
src/share/database/scripts/mysql/upgrade_016_to_017.sh.in [changed mode: 0644->0755]
src/share/database/scripts/mysql/upgrade_017_to_018.sh.in [changed mode: 0644->0755]
src/share/database/scripts/mysql/upgrade_018_to_019.sh.in [changed mode: 0644->0755]
src/share/database/scripts/mysql/upgrade_019_to_020.sh.in [changed mode: 0644->0755]
src/share/database/scripts/mysql/upgrade_020_to_021.sh.in [changed mode: 0644->0755]
src/share/database/scripts/mysql/upgrade_021_to_022.sh.in [changed mode: 0644->0755]
src/share/database/scripts/mysql/upgrade_022_to_023.sh.in [changed mode: 0644->0755]
src/share/database/scripts/mysql/upgrade_023_to_024.sh.in [changed mode: 0644->0755]
src/share/database/scripts/mysql/upgrade_024_to_025.sh.in [changed mode: 0644->0755]
src/share/database/scripts/mysql/upgrade_025_to_026.sh.in [changed mode: 0644->0755]
src/share/database/scripts/mysql/upgrade_026_to_027.sh.in [changed mode: 0644->0755]
src/share/database/scripts/mysql/upgrade_027_to_028.sh.in [changed mode: 0644->0755]
src/share/database/scripts/mysql/wipe_data.sh.in [changed mode: 0644->0755]

index 1e58f1e68a7c1a661af939891fe3a42a74f79aa6..f2727ebdbed6fc0d112fd8e1e145caf16a4838ed 100644 (file)
@@ -2,7 +2,6 @@
 #include <type_traits>
 
 int main() {
-    static_assert(std::is_same<std::chrono::system_clock::duration,
-                               std::chrono::steady_clock::duration>::value,
-                  "");
+    return(std::is_same<std::chrono::system_clock::duration,
+                        std::chrono::steady_clock::duration>::value ? 0 : 1);
 }
index a43b9f4035ffefdc538bf86bd20fd4df02606069..6daed8200adaf7ca6315f8e499b9ebd602728143 100644 (file)
 /* Whether you have the <unistd.h> header file. */
 #mesondefine HAVE_UNISTD_H
 
-/* Whether you have the <utils/errcodes.h> header file. */
-#mesondefine HAVE_UTILS_ERRCODES_H
-
 /* Check valgrind headers */
 #mesondefine HAVE_VALGRIND_HEADERS
 
index 7089f6c9f95c4403fd3080b561ba7a6a2c75d3eb..9ec21de3b7d557a46b231852059fde1efc64cd02 100644 (file)
@@ -18,6 +18,7 @@ TOP_BUILD_DIR = meson.current_build_dir()
 TOP_SOURCE_DIR = meson.current_source_dir()
 KEA_ADMIN = f'@TOP_BUILD_DIR@/src/bin/admin/kea-admin'
 KEA_LFC = f'@TOP_BUILD_DIR@/src/bin/lfc/kea-lfc'
+TEST_CA_DIR = f'@TOP_SOURCE_DIR@/src/lib/asiolink/testutils/ca'
 
 #### Configuration Data
 
@@ -82,7 +83,6 @@ conf_data = configuration_data(
         # 'HAVE_SYS_TYPES_H': false,
         # 'HAVE_TLS_': false,
         # 'HAVE_UNISTD_H': false,
-        # 'HAVE_UTILS_ERRCODES_H': false,
         # 'HAVE_VALGRIND_HEADERS': false,
         # 'HAVE_VALGRIND_VALGRIND_H': false,
         # 'HAVE__BOOL': false,
@@ -119,21 +119,26 @@ log4cplus = dependency('log4cplus')
 # Cryptography
 crypto = disabler()
 botan = disabler()
-foreach dep : ['botan-2', 'botan', 'botan-3']
+foreach dep : ['botan-2', 'botan']
     botan = dependency(dep, required: false)
     if botan.found()
         break
     endif
 endforeach
 openssl = dependency('openssl', required: false)
-if botan.found() and false  # remove "or flase" when botan+mariadb gets fixes
-    crypto = botan
-    conf_data.set('WITH_BOTAN', true)
-    message('Using Botan.')
-elif openssl.found()
+if openssl.found()
     crypto = openssl
     conf_data.set('WITH_OPENSSL', true)
     message('Using OpenSSL.')
+elif botan.found()
+    crypto = botan
+    conf_data.set('WITH_BOTAN', true)
+    message('Using Botan.')
+    message('Checking Botan Boost support.')
+    cpp.has_header(
+        'botan/asio_stream.h',
+        dependencies: botan,
+        required: true)
 endif
 if not crypto.found()
     error('Build failed: Could not find neither botan nor openssl libraries.')
@@ -187,27 +192,12 @@ if not postgresql.found()
     cflags = run_command([pg_config, '--cflags'], check: false)
     libs = run_command([pg_config, '--libs'], check: false)
     if cflags.returncode() == 0 and libs.returncode() == 0
-        krb5 = declare_dependency(
+        postgresql = declare_dependency(
             compile_args: cflags.stdout().split(),
             link_args: libs.stdout().split(),
         )
     endif
 endif
-postgresql_server_header = disabler()
-foreach dir : ['/usr/include/pgsql/server', '/usr/include/postgresql/server']
-    if not fs.is_dir(dir)
-        continue
-    endif
-    exists = cpp.has_header(
-        'utils/errcodes.h',
-        include_directories: [include_directories(dir)],
-        required: false,
-    )
-    if exists
-        postgresql_server_header = declare_dependency(include_directories: dir)
-        break
-    endif
-endforeach
 if postgresql.found()
     conf_data.set('HAVE_PGSQL', true)
 endif
old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)
diff --git a/src/bin/admin/meson.build b/src/bin/admin/meson.build
new file mode 100644 (file)
index 0000000..3576c8d
--- /dev/null
@@ -0,0 +1,23 @@
+kea_admin_conf_data = configuration_data()
+kea_admin_conf_data.set('prefix', get_option('prefix'))
+kea_admin_conf_data.set('exec_prefix', '${prefix}')
+kea_admin_conf_data.set('datarootdir', '${prefix}/' + get_option('datadir'))
+kea_admin_conf_data.set('PACKAGE', 'kea')
+kea_admin_conf_data.set('PACKAGE_NAME', 'kea')
+kea_admin_conf_data.set('PACKAGE_VERSION', project_version)
+kea_admin_conf_data.set('EXTENDED_VERSION', project_version + ' (tarball)')
+kea_admin_conf_data.set('abs_top_builddir', TOP_BUILD_DIR)
+kea_admin_conf_data.set('abs_top_srcdir', TOP_SOURCE_DIR)
+kea_admin_conf_data.set('sbindir', '${prefix}/' + get_option('sbindir'))
+kea_admin_conf_data.set('variables', 'variables')
+configure_file(
+    input: 'kea-admin.in',
+    output: 'kea-admin',
+    configuration: kea_admin_conf_data
+)
+configure_file(
+    input: 'admin-utils.sh.in',
+    output: 'admin-utils.sh',
+    copy: true
+)
+# install?
index 14838e62bc066454f655a97e47dbbf5fd8b0d8c9..7a3c6fcf6e9f5348d205cbf22f40b215bed78001 100644 (file)
@@ -1,4 +1,10 @@
+subdir('lfc')
 subdir('dhcp4')
 subdir('dhcp6')
-subdir('lfc')
+# subdir('d2')
+# subdir('agent')
+subdir('admin')
+# subdir('keactrl')
 subdir('perfdhcp')
+# subdir('shell')
+# subdir('netconf')
index efcd23effa3983667756a5f15c5a3cc806fa0347..2e821d6951281f176bf15628a14b4a03cf1ddcae 100644 (file)
@@ -10,4 +10,5 @@ dhcp_bootp_lib = library(
     install: true,
     install_dir: 'lib/kea/hooks',
     link_with: LIBS_BUILT_SO_FAR,
+    name_suffix: 'so'
 )
index 6c5cc25904c6588379c60d70f3d56f5b40274e14..a23a5a00259ca55fd871a2dcc143e0065c16a8ea 100644 (file)
@@ -1,4 +1,4 @@
-if not postgresql.found() or not postgresql_server_header.found()
+if not postgresql.found()
     subdir_done()
 endif
 
index 72e49c917b42892cfc8bf99f5fcb85af650535a8..6169eec1ddd5f50136e346804445886ccff5f8e2 100644 (file)
@@ -52,3 +52,5 @@ kea_asiolink_lib = library(
     link_with: LIBS_BUILT_SO_FAR,
 )
 LIBS_BUILT_SO_FAR = [kea_asiolink_lib] + LIBS_BUILT_SO_FAR
+subdir('testutils')
+subdir('tests')
diff --git a/src/lib/asiolink/tests/meson.build b/src/lib/asiolink/tests/meson.build
new file mode 100644 (file)
index 0000000..4ea0369
--- /dev/null
@@ -0,0 +1,38 @@
+CURRENT_BUILD_DIR = meson.current_build_dir()
+configure_file(
+    input: 'process_spawn_app.sh.in',
+    output: 'process_spawn_app.sh',
+    copy: true
+)
+kea_asiolink_tests = executable(
+    'kea-asiolink-tests',
+    'addr_utilities_unittest.cc',
+    'dummy_io_callback_unittest.cc',
+    'hash_address_unittest.cc',
+    'interval_timer_unittest.cc',
+    'io_address_unittest.cc',
+    'io_endpoint_unittest.cc',
+    'io_service_mgr_unittest.cc',
+    'io_service_signal_unittests.cc',
+    'io_service_thread_pool_unittests.cc',
+    'io_service_unittest.cc',
+    'io_socket_unittest.cc',
+    'process_spawn_unittest.cc',
+    'run_unittests.cc',
+    'tcp_acceptor_unittest.cc',
+    'tcp_endpoint_unittest.cc',
+    'tcp_socket_unittest.cc',
+    'tls_acceptor_unittest.cc',
+    'tls_socket_unittest.cc',
+    'tls_unittest.cc',
+    'udp_endpoint_unittest.cc',
+    'udp_socket_unittest.cc',
+    'unix_domain_socket_unittest.cc',
+    cpp_args: [f'-DTEST_SCRIPT_SH="@CURRENT_BUILD_DIR@/process_spawn_app.sh"',
+               f'-DINVALID_TEST_SCRIPT_SH="@TOP_SOURCE_DIR@/README"',
+               f'-DTEST_CA_DIR="@TEST_CA_DIR@"'],
+    dependencies: [gtest, crypto],
+    include_directories: [include_directories('.')] + INCLUDES,
+    link_with: LIBS_BUILT_SO_FAR + [kea_asiolink_testutils_lib, kea_util_unittests_lib]
+)
+test('kea_asiolink_tests', kea_asiolink_tests, protocol: 'gtest')
old mode 100644 (file)
new mode 100755 (executable)
diff --git a/src/lib/asiolink/testutils/meson.build b/src/lib/asiolink/testutils/meson.build
new file mode 100644 (file)
index 0000000..b1ed072
--- /dev/null
@@ -0,0 +1,10 @@
+kea_asiolink_testutils_lib = static_library(
+    'kea-asiolink-testutils',
+    'test_tls.cc',
+    'test_server_unix_socket.cc',
+    'timed_signal.cc',
+    cpp_args: [f'-DTEST_CA_DIR="@TEST_CA_DIR@"'],
+    dependencies: [gtest, crypto],
+    include_directories: [include_directories('.')] + INCLUDES,
+    link_with: LIBS_BUILT_SO_FAR
+)
index 50d5dd3794bdbf7fdc7ba0de63fc68d66ca1223e..3e44a00272e5533734ab76729a44215219c402b1 100644 (file)
@@ -1,3 +1,7 @@
+kea_cc_lib_cpp_args = []
+if gtest.found()
+    kea_cc_lib_cpp_args = ['-DALLOW_KEATEST']
+endif
 kea_cc_lib = library(
     'kea-cc',
     'base_stamped_element.cc',
@@ -23,6 +27,7 @@ kea_cc_lib = library(
     'stamped_value.h',
     'user_context.cc',
     'user_context.h',
+    cpp_args: kea_cc_lib_cpp_args,
     include_directories: [include_directories('.')] + INCLUDES,
     install: true,
     install_dir: 'lib',
index cd70f1eb77947fc31011af163386a42ce218b696..c7fce96d65fbd63e0ecabebbfa500a1957f69269 100644 (file)
@@ -25,4 +25,5 @@ kea_database_lib = library(
     link_with: LIBS_BUILT_SO_FAR,
 )
 LIBS_BUILT_SO_FAR = [kea_database_lib] + LIBS_BUILT_SO_FAR
+subdir('testutils')
 subdir('tests')
diff --git a/src/lib/database/testutils/meson.build b/src/lib/database/testutils/meson.build
new file mode 100644 (file)
index 0000000..7459bbd
--- /dev/null
@@ -0,0 +1,7 @@
+kea_database_testutils_lib = static_library(
+    'kea-database-testutils',
+    'schema.cc',
+    cpp_args: [f'-DTEST_CA_DIR="@TEST_CA_DIR@"'],
+    include_directories: [include_directories('.')] + INCLUDES,
+    link_with: LIBS_BUILT_SO_FAR
+)
index e513818d926916d0ec14ec5c97a4ef2bf899b571..a8aefc11eee6412c9b5e9d1c0b2374886a391b2a 100644 (file)
@@ -4,7 +4,6 @@ kea_dhcp_ddns_tests = executable(
     'ncr_unittests.cc',
     'run_unittests.cc',
     'test_utils.cc',
-    'test_utils.h',
     dependencies: [gtest],
     include_directories: [include_directories('.')] + INCLUDES,
     link_with: LIBS_BUILT_SO_FAR + [kea_testutils_lib, kea_util_unittests_lib],
index 980220911b647a0e64bffdb5d223593a515e81ce..6080c3507669b356fd788e5fde0a29a75c3c1d20 100644 (file)
@@ -43,7 +43,6 @@ kea_dns_tests = executable(
     'tsigrecord_unittest.cc',
     'tsig_unittest.cc',
     'unittest_util.cc',
-    'unittest_util.h',
     cpp_args: [
         f'-DTEST_DATA_BUILDDIR="@TOP_BUILD_DIR@/src/lib/dns/tests/testdata"',
         f'-DTEST_DATA_SRCDIR="@TOP_SOURCE_DIR@/src/lib/dns/tests/testdata"',
index 4106038820ff9e6862059e4a8477bc6ff998693f..1fa32b335bcbbde738269e6addfc3c57f5dce52a 100644 (file)
@@ -12,3 +12,4 @@ kea_log_interprocess_lib = library(
     link_with: LIBS_BUILT_SO_FAR,
 )
 LIBS_BUILT_SO_FAR = [kea_log_interprocess_lib] + LIBS_BUILT_SO_FAR
+subdir('tests')
diff --git a/src/lib/log/interprocess/tests/meson.build b/src/lib/log/interprocess/tests/meson.build
new file mode 100644 (file)
index 0000000..79d7ae7
--- /dev/null
@@ -0,0 +1,11 @@
+kea_log_interprocess_tests = executable(
+    'kea-log-interprocess-tests',
+    'interprocess_sync_file_unittest.cc',
+    'interprocess_sync_null_unittest.cc',
+    'run_unittests.cc',
+    cpp_args: [f'-DTEST_DATA_TOPBUILDDIR="@TOP_BUILD_DIR@"'],
+    dependencies: [gtest],
+    include_directories: [include_directories('.')] + INCLUDES,
+    link_with: LIBS_BUILT_SO_FAR + [kea_util_unittests_lib],
+)
+test('kea_log_interprocess_tests', kea_log_interprocess_tests, protocol: 'gtest')
index ae722cf76e0fcd61ebd10839b5fe131ab645a5c1..2ca42531b31cd0619ad11fb1a354cdd01f7a3326 100644 (file)
@@ -17,3 +17,5 @@ kea_mysql_lib = library(
     link_with: LIBS_BUILT_SO_FAR,
 )
 LIBS_BUILT_SO_FAR = [kea_mysql_lib] + LIBS_BUILT_SO_FAR
+subdir('testutils')
+subdir('tests')
diff --git a/src/lib/mysql/tests/meson.build b/src/lib/mysql/tests/meson.build
new file mode 100644 (file)
index 0000000..eb467af
--- /dev/null
@@ -0,0 +1,17 @@
+LIBS_TESTUTILS = [
+    kea_mysql_testutils_lib,
+    kea_database_testutils_lib,
+    kea_testutils_lib
+]
+kea_mysql_tests = executable(
+    'kea-mysql-tests',
+    'mysql_binding_unittest.cc',
+    'mysql_connection_unittest.cc',
+    'run_unittests.cc',
+    cpp_args: [f'-DTEST_CA_DIR="@TEST_CA_DIR@"',
+               f'-DKEA_ADMIN="@KEA_ADMIN@"'],
+    dependencies: [gtest, mysql],
+    include_directories: [include_directories('.')] + INCLUDES,
+    link_with: LIBS_BUILT_SO_FAR + LIBS_TESTUTILS + [kea_util_unittests_lib],
+)
+test('kea_mysql_tests', kea_mysql_tests, protocol: 'gtest')
diff --git a/src/lib/mysql/testutils/meson.build b/src/lib/mysql/testutils/meson.build
new file mode 100644 (file)
index 0000000..e60db49
--- /dev/null
@@ -0,0 +1,10 @@
+DATABASE_SCRIPTS_DIR = f'@TOP_BUILD_DIR@/src/share/database/scripts'
+kea_mysql_testutils_lib = static_library(
+    'kea-mysql-testutils',
+    'mysql_schema.cc',
+    cpp_args: [f'-DDATABASE_SCRIPTS_DIR="@DATABASE_SCRIPTS_DIR@"',
+               f'-DDATABASE_WIPE_DIR="@DATABASE_SCRIPTS_DIR@"'],
+    dependencies: [mysql],
+    include_directories: [include_directories('.')] + INCLUDES,
+    link_with: LIBS_BUILT_SO_FAR + [kea_database_testutils_lib]
+)
index e4575d4ff5b5ddafeb55d424138c2be8bee84530..5beab0dfdc8a1639dfe5b6d87b5af7a586c675b8 100644 (file)
@@ -1,4 +1,4 @@
-if not postgresql.found() or not postgresql_server_header.found()
+if not postgresql.found()
     subdir_done()
 endif
 
@@ -9,7 +9,7 @@ kea_pgsql_lib = library(
     'pgsql_exchange.cc',
     'pgsql_exchange.h',
     cpp_args: [f'-DKEA_ADMIN="@KEA_ADMIN@"'],
-    dependencies: [postgresql, postgresql_server_header],
+    dependencies: [postgresql],
     include_directories: [include_directories('.')] + INCLUDES,
     install: true,
     install_dir: 'lib',
index 6d7ba3093998c9099a210b05cbe810b41489f979..bfda8255507f803d61ddd6c6f8492ddecabc0311 100644 (file)
@@ -1,23 +1,12 @@
-kea_testutils_lib = library(
+kea_testutils_lib = static_library(
     'kea-testutils',
-    'gtest_utils.h',
     'io_utils.cc',
-    'io_utils.h',
     'log_utils.cc',
-    'log_utils.h',
-    'multi_threading_utils.h',
-    'sandbox.h',
     'test_to_element.cc',
-    'test_to_element.h',
     'threaded_test.cc',
-    'threaded_test.h',
     'unix_control_client.cc',
-    'unix_control_client.h',
     'user_context_utils.cc',
-    'user_context_utils.h',
     dependencies: [gtest],
     include_directories: [include_directories('.')] + INCLUDES,
-    install: true,
-    install_dir: 'lib',
-    link_with: LIBS_BUILT_SO_FAR,
+    link_with: LIBS_BUILT_SO_FAR + [kea_util_unittests_lib]
 )
index 1e817895a9068c3be3f2fd156ec46c7ddb5ced03..3ad08252d5c345487cddb45f89f86df588ef3d05 100644 (file)
@@ -1,62 +1,65 @@
 kea_util_lib = library(
     'kea-util',
-    'bigints.h',
     'boost_time_utils.cc',
+    'chrono_time_utils.cc',
+    'csv_file.cc',
+    'dhcp_space.cc',
+    'encode/encode.cc',
+    'encode/utf8.cc',
+    'filesystem.cc',
+    'labeled_value.cc',
+    'memory_segment_local.cc',
+    'multi_threading_mgr.cc',
+    'pid_file.cc',
+    'reconnect_ctl.cc',
+    'state_model.cc',
+    'stopwatch.cc',
+    'stopwatch_impl.cc',
+    'str.cc',
+    'versioned_csv_file.cc',
+    'watched_thread.cc',
+    'watch_socket.cc',
+    include_directories: [include_directories('.')] + INCLUDES,
+    install: true,
+    install_dir: 'lib',
+    link_with: LIBS_BUILT_SO_FAR,
+)
+kea_util_headers = [
+    'bigints.h',
     'boost_time_utils.h',
     'buffer.h',
-    'chrono_time_utils.cc',
     'chrono_time_utils.h',
-    'csv_file.cc',
     'csv_file.h',
-    'dhcp_space.cc',
     'dhcp_space.h',
     'doubles.h',
-    'encode/encode.cc',
     'encode/encode.h',
-    'encode/utf8.cc',
     'encode/utf8.h',
-    'filesystem.cc',
     'filesystem.h',
     'hash.h',
     'io.h',
-    'labeled_value.cc',
     'labeled_value.h',
     'memory_segment.h',
-    'memory_segment_local.cc',
     'memory_segment_local.h',
-    'multi_threading_mgr.cc',
     'multi_threading_mgr.h',
     'optional.h',
-    'pid_file.cc',
     'pid_file.h',
     'pointer_util.h',
     'range_utilities.h',
     'readwrite_mutex.h',
-    'reconnect_ctl.cc',
     'reconnect_ctl.h',
     'staged_value.h',
-    'state_model.cc',
     'state_model.h',
-    'stopwatch.cc',
     'stopwatch.h',
-    'stopwatch_impl.cc',
     'stopwatch_impl.h',
-    'str.cc',
     'str.h',
     'thread_pool.h',
     'triplet.h',
     'unlock_guard.h',
-    'versioned_csv_file.cc',
     'versioned_csv_file.h',
-    'watched_thread.cc',
     'watched_thread.h',
-    'watch_socket.cc',
-    'watch_socket.h',
-    include_directories: [include_directories('.')] + INCLUDES,
-    install: true,
-    install_dir: 'lib',
-    link_with: LIBS_BUILT_SO_FAR,
-)
+    'watch_socket.h'
+]
+install_headers(kea_util_headers, preserve_path: true, subdir: 'kea/util')
 subdir('io')
 subdir('unittests')
 LIBS_BUILT_SO_FAR = [kea_util_lib] + LIBS_BUILT_SO_FAR
old mode 100755 (executable)
new mode 100644 (file)
index 58ca2df1b7e306322b2587514a436c2cd78b6ae7..8c9c721e901ffd45dde1c586060a5c3817175e42 100644 (file)
@@ -1,4 +1,4 @@
-kea_util_unittests_lib = library(
+kea_util_unittests_lib = static_library(
     'kea-util-unittests',
     'check_valgrind.cc',
     'check_valgrind.h',
index 8b137891791fe96927ad78e64b0aad7bded08bdc..3d3591cecd42a3ad17a93f2d6e734b0ee66f29e5 100644 (file)
@@ -1 +1 @@
-
+subdir('scripts')
diff --git a/src/share/database/scripts/meson.build b/src/share/database/scripts/meson.build
new file mode 100644 (file)
index 0000000..68c0f72
--- /dev/null
@@ -0,0 +1,2 @@
+subdir('mysql')
+# subdir('pgsql')
diff --git a/src/share/database/scripts/mysql/meson.build b/src/share/database/scripts/mysql/meson.build
new file mode 100644 (file)
index 0000000..18a43b8
--- /dev/null
@@ -0,0 +1,22 @@
+mysql_script_conf_data = configuration_data()
+mysql_script_conf_data.set('prefix', get_option('prefix'))
+mysql_script_conf_data.set('abs_top_builddir', TOP_BUILD_DIR)
+mysql_script_conf_data.set('datarootdir', '${prefix}/' + get_option('datadir'))
+mysql_script_conf_data.set('PACKAGE_NAME', 'kea')
+configure_file(
+    input: 'wipe_data.sh.in',
+    output: 'wipe_data.sh',
+    configuration: mysql_script_conf_data
+)
+configure_file(
+    input: 'dhcpdb_create.mysql',
+    output: 'dhcpdb_create.mysql',
+    copy: true
+)
+configure_file(
+    input: 'dhcpdb_drop.mysql',
+    output: 'dhcpdb_drop.mysql',
+    copy: true
+)
+# configure upgrade scripts
+# install