From baea185ea9b4f416047413e1a913bc930c8f12ed Mon Sep 17 00:00:00 2001 From: Andrei Pavel Date: Fri, 14 Mar 2025 09:39:50 +0200 Subject: [PATCH] [#3731] Fix some compiler checks and some fallbacks on old systems --- meson.build | 4 ++-- subprojects/mysql/meson.build | 6 +++--- subprojects/netconf/meson.build | 2 +- subprojects/postgresql/meson.build | 9 ++++++--- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/meson.build b/meson.build index d1c3cd3211..08b59dac29 100644 --- a/meson.build +++ b/meson.build @@ -301,7 +301,7 @@ endif result = cpp.run( fs.read('compiler-checks/have-generic-tls-method.cc'), name: 'HAVE_GENERIC_TLS_METHOD', - dependencies: [CRYPTO_DEP], + dependencies: [boost_dep, CRYPTO_DEP, threads_dep], ) conf_data.set('HAVE_GENERIC_TLS_METHOD', result.returncode() == 0) @@ -340,7 +340,7 @@ endif result = cpp.run( fs.read('compiler-checks/stream-truncated-error.cc'), name: 'HAVE_STREAM_TRUNCATED_ERROR', - dependencies: [CRYPTO_DEP], + dependencies: [boost_dep, CRYPTO_DEP, threads_dep], ) conf_data.set('HAVE_STREAM_TRUNCATED_ERROR', result.returncode() == 0) diff --git a/subprojects/mysql/meson.build b/subprojects/mysql/meson.build index e8b0518114..705d1014e0 100644 --- a/subprojects/mysql/meson.build +++ b/subprojects/mysql/meson.build @@ -8,12 +8,12 @@ foreach mysql_config_file : ['mariadb_config', 'mysql_config'] if not mysql_config.found() continue endif - cflags = run_command([mysql_config, '--cflags'], check: false) + cxxflags = run_command([mysql_config, '--cxxflags'], check: false) libs = run_command([mysql_config, '--libs'], check: false) version = run_command([mysql_config, '--version'], check: false) - if cflags.returncode() == 0 and libs.returncode() == 0 and version.returncode() == 0 - mysql_compile_args = cflags.stdout().split() + if cxxflags.returncode() == 0 and libs.returncode() == 0 and version.returncode() == 0 + mysql_compile_args = cxxflags.stdout().split() mysql_link_args = libs.stdout().split() mysql_version = version.stdout().strip() mysql = declare_dependency( diff --git a/subprojects/netconf/meson.build b/subprojects/netconf/meson.build index 5df3229178..e81fdd2388 100644 --- a/subprojects/netconf/meson.build +++ b/subprojects/netconf/meson.build @@ -78,6 +78,6 @@ if all_deps_found ) else # Can't use a disabler here? - netconf = declare_dependency('', required: false) + netconf = declare_dependency('') endif diff --git a/subprojects/postgresql/meson.build b/subprojects/postgresql/meson.build index 2d65a8595f..9ca8b88aae 100644 --- a/subprojects/postgresql/meson.build +++ b/subprojects/postgresql/meson.build @@ -2,15 +2,18 @@ project('postgresql') postgresql = disabler() pg_config = find_program('pg_config', required: false) if pg_config.found() - cflags = run_command([pg_config, '--cflags'], check: false) + cppflags = run_command([pg_config, '--cppflags'], check: false) + includedir = run(command[pg_config, '--includedir'], check: false) libs = run_command([pg_config, '--libs'], check: false) version = run_command([pg_config, '--version'], check: false) - if cflags.returncode() == 0 and libs.returncode() == 0 and version.returncode() == 0 - pgsql_compile_args = cflags.stdout().split() + if cppflags.returncode() == 0 and includedir.returncode() == 0 and libs.returncode() == 0 and version.returncode() == 0 + pgsql_compile_args = cppflags.stdout().split() + pgsql_includedir_args = includedir.stdout().split() pgsql_link_args = libs.stdout().split() pgsql_version = version.stdout().strip() postgresql = declare_dependency( compile_args: pgsql_compile_args, + include_directories: pgsql_includedir_args, link_args: pgsql_link_args, version: pgsql_version, ) -- 2.47.3