build/meson: cleanup libnm-glib-aux dependencies

Avoid dependencies but explicitly link the static library where it is
used.

This also fixes that we linked libnm-log-core into
libnm-settings-plugin-ifcfg-rh.so, which duplicated the symbols
while it should used them from NetworkManager.
This commit is contained in:
Thomas Haller
2021-02-24 11:52:51 +01:00
parent 2665b91288
commit 309dccf5f9
23 changed files with 131 additions and 60 deletions

View File

@@ -28,9 +28,14 @@ executable(
libnm_core_aux_extern_dep_link,
libnm_core_aux_intern_dep_link,
libnm_base_dep_link,
libnm_glib_aux_dep_link,
glib_dep,
readline_dep,
],
link_with: [
libnm_glib_aux,
libnm_std_aux,
libc_siphash,
],
link_args: ldflags_linker_script_binary,
link_depends: linker_script_binary,
install: true,
@@ -50,7 +55,12 @@ generate_docs_nm_settings_nmcli = executable(
libnm_core_aux_extern_dep_link,
libnm_core_aux_intern_dep_link,
libnm_base_dep_link,
libnm_glib_aux_dep_link,
glib_dep,
],
link_with: [
libnm_glib_aux,
libnm_std_aux,
libc_siphash,
],
link_args: ldflags_linker_script_binary,
link_depends: linker_script_binary,

View File

@@ -55,10 +55,15 @@ executable(
libnmc_dep,
libnm_core_aux_intern_dep_link,
libnm_core_aux_extern_dep_link,
libnm_glib_aux_dep_link,
libcurl_dep,
glib_dep,
],
link_with: [
libnm_log_null,
libnm_glib_aux,
libnm_std_aux,
libc_siphash,
],
link_with: libnm_log_null,
link_args: ldflags_linker_script_binary,
link_depends: linker_script_binary,
install: true,

View File

@@ -7,7 +7,12 @@ exe = executable(
libnm_cloud_setup_core_dep,
libnmc_base_dep,
libnmc_dep,
libnm_glib_aux_dep_link,
glib_dep,
],
link_with: [
libnm_glib_aux,
libnm_std_aux,
libc_siphash,
],
)

View File

@@ -8,8 +8,13 @@ exe = executable(
libnmc_dep,
libnm_core_aux_intern_dep_link,
libnm_core_aux_extern_dep_link,
libnm_glib_aux_dep_link,
libnm_base_dep_link,
glib_dep,
],
link_with: [
libnm_glib_aux,
libnm_std_aux,
libc_siphash,
],
)
@@ -26,9 +31,14 @@ exe = executable(
libnm_dep,
libnm_core_aux_extern_dep_link,
libnm_nm_default_dep,
libnm_glib_aux_dep_link,
glib_dep,
],
link_with: [
libnm_log_null,
libnm_glib_aux,
libnm_std_aux,
libc_siphash,
],
link_with: libnm_log_null,
)
test(

View File

@@ -7,7 +7,12 @@ executable(
libnm_dep,
libnm_nm_default_dep,
libnm_client_aux_extern_dep,
libnm_glib_aux_dep_link,
glib_dep,
],
link_with: [
libnm_glib_aux,
libnm_std_aux,
libc_siphash,
],
link_args: ldflags_linker_script_binary,
link_depends: linker_script_binary,

View File

@@ -54,9 +54,14 @@ executable(
libnm_core_aux_extern_dep_link,
libnm_core_aux_intern_dep_link,
libnm_base_dep_link,
libnm_glib_aux_dep_link,
glib_dep,
],
link_with: [
libnm_log_null,
libnm_glib_aux,
libnm_std_aux,
libc_siphash,
],
link_with: libnm_log_null,
link_args: ldflags_linker_script_binary,
link_depends: linker_script_binary,
install: true,

View File

@@ -38,9 +38,14 @@ executable(
libnm_dep,
libnm_nm_default_dep,
libnm_core_aux_extern_dep_link,
libnm_glib_aux_dep_link,
glib_dep,
],
link_with: [
libnm_dispatcher_core,
libnm_glib_aux,
libnm_std_aux,
libc_siphash,
],
link_with: libnm_dispatcher_core,
link_args: ldflags_linker_script_binary,
link_depends: linker_script_binary,
install: true,

View File

@@ -6,13 +6,18 @@ exe = executable(
'test-dispatcher-envp.c',
nmdbus_dispatcher_sources,
],
include_directories: dispatcher_inc,
dependencies: [
libnm_nm_default_dep,
libnm_glib_aux_dep_link,
glib_dep,
],
include_directories: dispatcher_inc,
c_args: introspection_extra_cflags,
link_with: libnm_dispatcher_core,
link_with: [
libnm_dispatcher_core,
libnm_glib_aux,
libnm_std_aux,
libc_siphash,
],
)
test(

View File

@@ -19,6 +19,9 @@ executable(
libnmi_core,
libnm_core_impl,
libnm_base,
libnm_glib_aux,
libnm_std_aux,
libc_siphash,
],
link_args: ldflags_linker_script_binary,
link_depends: linker_script_binary,

View File

@@ -208,8 +208,8 @@ executable(
dl_dep,
libndp_dep,
libudev_dep,
libnm_glib_aux_dep_link,
libnm_core_impl_dep_link,
glib_dep,
],
link_with: [
libNetworkManagerBase,
@@ -217,6 +217,7 @@ executable(
libnm_systemd_shared,
libnm_base,
libnm_glib_aux,
libnm_std_aux,
libn_acd,
libn_dhcp4,
libc_rbtree,
@@ -252,6 +253,8 @@ if enable_tests
libNetworkManagerTest,
libnm_base,
libnm_core_impl,
libnm_glib_aux,
libnm_std_aux,
libn_acd,
libn_dhcp4,
libc_siphash,
@@ -293,6 +296,8 @@ NetworkManager_all_sym = executable(
libNetworkManagerBase,
libnm_core_impl,
libnm_base,
libnm_glib_aux,
libnm_std_aux,
libn_acd,
libn_dhcp4,
libc_rbtree,
@@ -323,6 +328,8 @@ NetworkManager = executable(
libNetworkManagerBase,
libnm_core_impl,
libnm_base,
libnm_glib_aux,
libnm_std_aux,
libn_acd,
libn_dhcp4,
libc_rbtree,

View File

@@ -6,9 +6,13 @@ nm_pppd_plugin = shared_module(
sources: 'nm-pppd-plugin.c',
dependencies: [
libnm_core_impl_dep_link,
libnm_glib_aux_dep_link,
glib_dep,
],
link_with: [
libnm_glib_aux,
libnm_std_aux,
libc_siphash,
],
install: true,
install_dir: pppd_plugin_dir,
)

View File

@@ -9,14 +9,19 @@ libnm_base = static_library(
sources: files(
'nm-ethtool-base.c',
),
dependencies: libnm_glib_aux_dep_link,
dependencies: glib_dep,
)
libnm_base_dep = declare_dependency(
dependencies: libnm_glib_aux_dep,
dependencies: glib_dep,
)
libnm_base_dep_link = declare_dependency(
dependencies: libnm_glib_aux_dep_link,
link_with: libnm_base,
dependencies: glib_dep,
link_with: [
libnm_base,
libnm_glib_aux,
libnm_std_aux,
libc_siphash,
],
)

View File

@@ -89,10 +89,12 @@ libnm = shared_library(
link_whole: [
libnm_client_impl,
libnm_core_impl,
libnmdbus,
libnm_base,
libnm_log_null,
libnm_glib_aux,
libnm_base,
libnm_std_aux,
libnmdbus,
libc_siphash,
],
link_args: '-Wl,--version-script,@0@'.format(linker_script),
link_depends: linker_script,

View File

@@ -17,11 +17,15 @@ foreach test_unit: test_units
dependencies: [
libnm_core_impl_dep_link,
libnm_nm_default_dep,
glib_dep,
],
link_with: [
libnm_client_impl,
libnm_client_test,
libnm_base,
libnm_glib_aux,
libnm_std_aux,
libc_siphash,
libnmdbus,
],
)

View File

@@ -14,7 +14,6 @@ libnm_client_test = static_library(
dependencies: [
libnm_core_aux_intern_dep,
libnm_core_public_dep,
libnm_glib_aux_dep,
glib_dep,
],
)

View File

@@ -8,7 +8,6 @@ libnm_core_aux_extern = static_library(
dependencies: [
libnm_core_aux_intern_dep,
libnm_core_public_dep,
libnm_glib_aux_dep,
glib_dep,
],
)
@@ -20,7 +19,6 @@ libnm_core_aux_extern_dep = declare_dependency(
dependencies: [
libnm_core_aux_intern_dep,
libnm_core_public_dep,
libnm_glib_aux_dep,
glib_dep,
],
)

View File

@@ -8,7 +8,6 @@ libnm_core_aux_intern = static_library(
),
dependencies: [
libnm_core_public_dep,
libnm_glib_aux_dep,
glib_dep,
],
)

View File

@@ -7,7 +7,6 @@ libnm_crypto_nss = static_library(
sources: 'nm-crypto-nss.c',
dependencies: [
libnm_core_public_dep,
libnm_glib_aux_dep_link,
crypto_nss_dep,
],
)
@@ -17,7 +16,6 @@ libnm_crypto_gnutls = static_library(
sources: 'nm-crypto-gnutls.c',
dependencies: [
libnm_core_public_dep,
libnm_glib_aux_dep_link,
crypto_gnutls_dep,
],
)
@@ -114,7 +112,6 @@ libnm_core_impl = static_library(
libnm_systemd_shared_dep,
libnm_core_public_dep,
libnm_core_intern_dep,
libnm_glib_aux_dep_link,
uuid_dep,
],
link_with: [

View File

@@ -23,23 +23,4 @@ libnm_glib_aux = static_library(
top_inc,
],
dependencies: glib_dep,
link_with: [
libc_siphash,
libnm_std_aux,
],
)
libnm_glib_aux_dep = declare_dependency(
include_directories: [
src_inc,
top_inc,
],
dependencies: [
glib_dep,
],
)
libnm_glib_aux_dep_link = declare_dependency(
dependencies: libnm_glib_aux_dep,
link_with: libnm_glib_aux,
)

View File

@@ -3,8 +3,17 @@
exe = executable(
'test-shared-general',
'test-shared-general.c',
dependencies: libnm_glib_aux_dep_link,
link_with: libnm_log_null,
dependencies: glib_dep,
include_directories: [
src_inc,
top_inc,
],
link_with: [
libnm_log_null,
libnm_glib_aux,
libnm_std_aux,
libc_siphash,
],
)
test(
@@ -19,11 +28,20 @@ if jansson_dep.found()
'test-json-aux',
'test-json-aux.c',
dependencies: [
libnm_glib_aux_dep_link,
glib_dep,
jansson_dep,
dl_dep,
],
link_with: libnm_log_null,
include_directories: [
src_inc,
top_inc,
],
link_with: [
libnm_log_null,
libnm_glib_aux,
libnm_std_aux,
libc_siphash,
],
)
test(

View File

@@ -14,8 +14,5 @@ libnm_log_core = static_library(
)
libnm_log_core_dep = declare_dependency(
dependencies: [
libnm_glib_aux_dep_link,
],
link_with: libnm_log_core,
)

View File

@@ -20,8 +20,5 @@ libnm_platform_dep = declare_dependency(
include_directories: [
src_inc,
],
dependencies: [
libnm_glib_aux_dep_link,
],
link_with: libnm_platform,
)

View File

@@ -6,6 +6,16 @@ exe = executable(
dependencies: [
libnm_log_core_dep,
libnm_platform_dep,
glib_dep,
],
include_directories: [
src_inc,
top_inc,
],
link_with: [
libnm_glib_aux,
libnm_std_aux,
libc_siphash,
],
)