diff --git a/.gitignore b/.gitignore index 2a0a1d2a4..b72eabb29 100644 --- a/.gitignore +++ b/.gitignore @@ -62,11 +62,11 @@ test-*.trs /contrib/fedora/rpm/latest0 /contrib/fedora/rpm/latest -/dispatcher/nm-avahi-autoipd.action -/dispatcher/nm-dispatcher -/dispatcher/nmdbus-dispatcher.* -/dispatcher/org.freedesktop.nm_dispatcher.service -/dispatcher/tests/test-dispatcher-envp +/src/nm-dispatcher/nm-avahi-autoipd.action +/src/nm-dispatcher/nm-dispatcher +/src/nm-dispatcher/nmdbus-dispatcher.* +/src/nm-dispatcher/org.freedesktop.nm_dispatcher.service +/src/nm-dispatcher/tests/test-dispatcher-envp /clients/cli/nmcli /clients/cloud-setup/nm-cloud-setup @@ -286,6 +286,11 @@ test-*.trs /clients/cli/settings-docs.c /clients/common/settings-docs.c /clients/common/tests/test-general +/dispatcher/nm-avahi-autoipd.action +/dispatcher/nm-dispatcher +/dispatcher/nmdbus-dispatcher.* +/dispatcher/org.freedesktop.nm_dispatcher.service +/dispatcher/tests/test-dispatcher-envp /docs/libnm-glib/*.stamp /docs/libnm-glib/html/ /docs/libnm-glib/libnm-glib-*.txt diff --git a/Makefile.am b/Makefile.am index 036628ec4..4b2f780b5 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1292,8 +1292,8 @@ nm_core_enum_types_MKENUMS_C_FLAGS = --fhead '\#undef G_LOG_DOMAIN\n\#include "s src/libnm-core-public/nm-core-enum-types.h.stamp: src/libnm-core-public/.dirstamp src/libnm-core-public/nm-core-enum-types.c.stamp: src/libnm-core-public/.dirstamp -$(dispatcher_libnm_dispatcher_core_la_OBJECTS): $(src_libnm_core_public_mkenums_h) -$(dispatcher_nm_dispatcher_OBJECTS): $(src_libnm_core_public_mkenums_h) +$(src_nm_dispatcher_libnm_dispatcher_core_la_OBJECTS): $(src_libnm_core_public_mkenums_h) +$(src_nm_dispatcher_nm_dispatcher_OBJECTS): $(src_libnm_core_public_mkenums_h) $(src_libnm_core_impl_libnm_core_impl_la_OBJECTS): $(src_libnm_core_public_mkenums_h) $(src_libnm_client_impl_libnm_la_OBJECTS): $(src_libnm_core_public_mkenums_h) $(src_contrib_tests_libnm_vpn_plugin_utils_test_la_OBJECTS): $(src_libnm_core_public_mkenums_h) @@ -1708,8 +1708,8 @@ nm_enum_types_sources = \ nm_enum_types_MKENUMS_H_FLAGS = --fhead '\#include "nm-core-enum-types.h"\n' nm_enum_types_MKENUMS_C_FLAGS = --fhead '\#undef G_LOG_DOMAIN\n\#include "libnm-client-impl/nm-default-libnm.h"\n' -$(dispatcher_nm_dispatcher_OBJECTS): $(src_libnm_client_public_mkenums_h) -$(dispatcher_libnm_dispatcher_core_la_OBJECTS): $(src_libnm_client_public_mkenums_h) +$(src_nm_dispatcher_nm_dispatcher_OBJECTS): $(src_libnm_client_public_mkenums_h) +$(src_nm_dispatcher_libnm_dispatcher_core_la_OBJECTS): $(src_libnm_client_public_mkenums_h) $(src_libnm_client_impl_libnm_la_OBJECTS): $(src_libnm_client_public_mkenums_h) $(src_contrib_tests_libnm_vpn_plugin_utils_test_la_OBJECTS): $(src_libnm_client_public_mkenums_h) @@ -4383,76 +4383,75 @@ EXTRA_DIST += \ src/core/tests/meson.build ############################################################################### -# dispatcher +# src/nm-dispatcher ############################################################################### dispatcher_nmdbus_dispatcher_sources = \ - dispatcher/nmdbus-dispatcher.h \ - dispatcher/nmdbus-dispatcher.c \ + src/nm-dispatcher/nmdbus-dispatcher.h \ + src/nm-dispatcher/nmdbus-dispatcher.c \ $(NULL) -dispatcher/nmdbus-dispatcher.h: dispatcher/nm-dispatcher.xml - @$(MKDIR_P) dispatcher/ +src/nm-dispatcher/nmdbus-dispatcher.h: src/nm-dispatcher/nm-dispatcher.xml + @$(MKDIR_P) src/nm-dispatcher/ $(AM_V_GEN) gdbus-codegen \ --generate-c-code $(basename $@) \ --c-namespace NMDBus \ --interface-prefix org.freedesktop \ $< -dispatcher/nmdbus-dispatcher.c: dispatcher/nmdbus-dispatcher.h +src/nm-dispatcher/nmdbus-dispatcher.c: src/nm-dispatcher/nmdbus-dispatcher.h CLEANFILES += $(dispatcher_nmdbus_dispatcher_sources) ############################################################################### -libexec_PROGRAMS += dispatcher/nm-dispatcher +libexec_PROGRAMS += src/nm-dispatcher/nm-dispatcher -noinst_LTLIBRARIES += \ - dispatcher/libnm-dispatcher-core.la +noinst_LTLIBRARIES += src/nm-dispatcher/libnm-dispatcher-core.la dispatcher_cppflags = \ $(dflt_cppflags) \ - -I$(builddir)/dispatcher \ - -I$(srcdir)/dispatcher \ -I$(builddir)/src/libnm-core-public \ -I$(srcdir)/src/libnm-core-public \ -I$(builddir)/src/libnm-client-public \ -I$(srcdir)/src/libnm-client-public \ -I$(srcdir)/src \ + -I$(builddir)/src \ $(GLIB_CFLAGS) \ $(NULL) -dispatcher_libnm_dispatcher_core_la_SOURCES = \ - dispatcher/nm-dispatcher-utils.c \ - dispatcher/nm-dispatcher-utils.h \ +src_nm_dispatcher_libnm_dispatcher_core_la_SOURCES = \ + src/nm-dispatcher/nm-dispatcher-utils.c \ + src/nm-dispatcher/nm-dispatcher-utils.h \ $(NULL) -dispatcher_libnm_dispatcher_core_la_CPPFLAGS = $(dispatcher_cppflags) +src_nm_dispatcher_libnm_dispatcher_core_la_CPPFLAGS = $(dispatcher_cppflags) -dispatcher_libnm_dispatcher_core_la_LIBADD = \ +src_nm_dispatcher_libnm_dispatcher_core_la_LIBADD = \ src/libnm-client-impl/libnm.la \ $(GLIB_LIBS) -dispatcher_nm_dispatcher_SOURCES = \ - dispatcher/nm-dispatcher.c \ +src_nm_dispatcher_nm_dispatcher_SOURCES = \ + src/nm-dispatcher/nm-dispatcher.c \ $(NULL) -dispatcher_nm_dispatcher_CPPFLAGS = $(dispatcher_cppflags) +src_nm_dispatcher_nm_dispatcher_CPPFLAGS = $(dispatcher_cppflags) -dispatcher_nm_dispatcher_LDFLAGS = \ +src_nm_dispatcher_nm_dispatcher_LDFLAGS = \ -Wl,--version-script="$(srcdir)/linker-script-binary.ver" \ $(SANITIZER_EXEC_LDFLAGS) \ $(NULL) -dispatcher_nm_dispatcher_LDADD = \ - dispatcher/libnm-dispatcher-core.la \ +src_nm_dispatcher_nm_dispatcher_LDADD = \ + src/nm-dispatcher/libnm-dispatcher-core.la \ src/libnm-client-impl/libnm.la \ src/libnm-glib-aux/libnm-glib-aux.la \ src/libnm-std-aux/libnm-std-aux.la \ src/c-siphash/libc-siphash.la \ - $(GLIB_LIBS) + $(GLIB_LIBS) \ + $(NULL) -dispatcher/org.freedesktop.nm_dispatcher.service: $(srcdir)/dispatcher/org.freedesktop.nm_dispatcher.service.in +src/nm-dispatcher/org.freedesktop.nm_dispatcher.service: $(srcdir)/src/nm-dispatcher/org.freedesktop.nm_dispatcher.service.in @sed \ -e 's|@sbindir[@]|$(sbindir)|g' \ -e 's|@sysconfdir[@]|$(sysconfdir)|g' \ @@ -4460,8 +4459,8 @@ dispatcher/org.freedesktop.nm_dispatcher.service: $(srcdir)/dispatcher/org.freed -e 's|@libexecdir[@]|$(libexecdir)|g' \ $< >$@ -dbusactivation_DATA += dispatcher/org.freedesktop.nm_dispatcher.service -CLEANFILES += dispatcher/org.freedesktop.nm_dispatcher.service +dbusactivation_DATA += src/nm-dispatcher/org.freedesktop.nm_dispatcher.service +CLEANFILES += src/nm-dispatcher/org.freedesktop.nm_dispatcher.service install-data-hook-dispatcher: $(mkinstalldirs) -m 0755 $(DESTDIR)$(nmconfdir)/dispatcher.d @@ -4475,51 +4474,50 @@ install-data-hook-dispatcher: install_data_hook += install-data-hook-dispatcher - -dbusservice_DATA += dispatcher/nm-dispatcher.conf +dbusservice_DATA += src/nm-dispatcher/nm-dispatcher.conf EXTRA_DIST += \ - dispatcher/nm-dispatcher.conf \ - dispatcher/org.freedesktop.nm_dispatcher.service.in \ - dispatcher/nm-dispatcher.xml \ - dispatcher/meson.build + src/nm-dispatcher/nm-dispatcher.conf \ + src/nm-dispatcher/org.freedesktop.nm_dispatcher.service.in \ + src/nm-dispatcher/nm-dispatcher.xml \ + src/nm-dispatcher/meson.build \ + $(NULL) ############################################################################### -# dispatcher/tests +# src/nm-dispatcher/tests ############################################################################### -check_programs += dispatcher/tests/test-dispatcher-envp +check_programs += src/nm-dispatcher/tests/test-dispatcher-envp -dispatcher_tests_test_dispatcher_envp_CPPFLAGS = \ +src_nm_dispatcher_tests_test_dispatcher_envp_CPPFLAGS = \ $(dflt_cppflags) \ - -I$(srcdir)/dispatcher \ - -I$(builddir)/dispatcher \ -I$(builddir)/src/libnm-core-public \ -I$(srcdir)/src/libnm-core-public \ -I$(srcdir)/src/libnm-client-public \ -I$(builddir)/src/libnm-client-public \ -I$(srcdir)/src \ + -I$(builddir)/src \ $(GLIB_CFLAGS) \ $(SANITIZER_EXEC_CFLAGS) \ $(INTROSPECTION_EXTRA_CFLAGS) \ $(NULL) -dispatcher_tests_test_dispatcher_envp_SOURCES = \ - dispatcher/tests/test-dispatcher-envp.c \ +src_nm_dispatcher_tests_test_dispatcher_envp_SOURCES = \ + src/nm-dispatcher/tests/test-dispatcher-envp.c \ $(NULL) -nodist_dispatcher_tests_test_dispatcher_envp_SOURCES = $(dispatcher_nmdbus_dispatcher_sources) +nodist_src_nm_dispatcher_tests_test_dispatcher_envp_SOURCES = $(dispatcher_nmdbus_dispatcher_sources) -$(dispatcher_tests_test_dispatcher_envp_OBJECTS): $(dispatcher_nmdbus_dispatcher_sources) -$(dispatcher_tests_test_dispatcher_envp_OBJECTS): $(src_libnm_core_public_mkenums_h) -$(dispatcher_tests_test_dispatcher_envp_OBJECTS): $(src_libnm_client_public_mkenums_h) +$(src_nm_dispatcher_tests_test_dispatcher_envp_OBJECTS): $(dispatcher_nmdbus_dispatcher_sources) +$(src_nm_dispatcher_tests_test_dispatcher_envp_OBJECTS): $(src_libnm_core_public_mkenums_h) +$(src_nm_dispatcher_tests_test_dispatcher_envp_OBJECTS): $(src_libnm_client_public_mkenums_h) -dispatcher_tests_test_dispatcher_envp_LDFLAGS = \ +src_nm_dispatcher_tests_test_dispatcher_envp_LDFLAGS = \ $(SANITIZER_EXEC_LDFLAGS) \ $(NULL) -dispatcher_tests_test_dispatcher_envp_LDADD = \ - dispatcher/libnm-dispatcher-core.la \ +src_nm_dispatcher_tests_test_dispatcher_envp_LDADD = \ + src/nm-dispatcher/libnm-dispatcher-core.la \ src/libnm-glib-aux/libnm-glib-aux.la \ src/libnm-std-aux/libnm-std-aux.la \ src/c-siphash/libc-siphash.la \ @@ -4527,17 +4525,17 @@ dispatcher_tests_test_dispatcher_envp_LDADD = \ $(GLIB_LIBS) \ $(NULL) -$(dispatcher_tests_test_dispatcher_envp_OBJECTS): $(src_libnm_core_public_mkenums_h) +$(src_nm_dispatcher_tests_test_dispatcher_envp_OBJECTS): $(src_libnm_core_public_mkenums_h) EXTRA_DIST += \ - dispatcher/tests/dispatcher-connectivity-full \ - dispatcher/tests/dispatcher-connectivity-unknown \ - dispatcher/tests/dispatcher-down \ - dispatcher/tests/dispatcher-external \ - dispatcher/tests/dispatcher-up \ - dispatcher/tests/dispatcher-vpn-down \ - dispatcher/tests/dispatcher-vpn-up \ - dispatcher/tests/meson.build \ + src/nm-dispatcher/tests/dispatcher-connectivity-full \ + src/nm-dispatcher/tests/dispatcher-connectivity-unknown \ + src/nm-dispatcher/tests/dispatcher-down \ + src/nm-dispatcher/tests/dispatcher-external \ + src/nm-dispatcher/tests/dispatcher-up \ + src/nm-dispatcher/tests/dispatcher-vpn-down \ + src/nm-dispatcher/tests/dispatcher-vpn-up \ + src/nm-dispatcher/tests/meson.build \ $(NULL) ############################################################################### diff --git a/clients/cli/meson.build b/clients/cli/meson.build index 8feaefd8e..59ef4e14a 100644 --- a/clients/cli/meson.build +++ b/clients/cli/meson.build @@ -24,13 +24,19 @@ executable( dependencies: [ libnmc_base_dep, libnmc_dep, - libnm_client_aux_extern_dep, - libnm_core_aux_extern_dep_link, - libnm_core_aux_intern_dep_link, - libnm_base_dep_link, - libnm_glib_aux_dep_link, + libnm_dep, + glib_dep, readline_dep, ], + link_with: [ + libnm_client_aux_extern, + libnm_core_aux_extern, + libnm_core_aux_intern, + libnm_base, + libnm_glib_aux, + libnm_std_aux, + libc_siphash, + ], link_args: ldflags_linker_script_binary, link_depends: linker_script_binary, install: true, @@ -46,11 +52,16 @@ generate_docs_nm_settings_nmcli = executable( dependencies: [ libnmc_base_dep, libnmc_dep, - libnm_client_aux_extern_dep, - libnm_core_aux_extern_dep_link, - libnm_core_aux_intern_dep_link, - libnm_base_dep_link, - libnm_glib_aux_dep_link, + libnm_dep, + glib_dep, + ], + link_with: [ + libnm_core_aux_extern, + libnm_core_aux_intern, + libnm_base, + libnm_glib_aux, + libnm_std_aux, + libc_siphash, ], link_args: ldflags_linker_script_binary, link_depends: linker_script_binary, diff --git a/clients/cloud-setup/meson.build b/clients/cloud-setup/meson.build index e8b74b7a0..894c43daf 100644 --- a/clients/cloud-setup/meson.build +++ b/clients/cloud-setup/meson.build @@ -34,8 +34,8 @@ libnm_cloud_setup_core = static_library( dependencies: [ libnmc_base_dep, libnmc_dep, + libnm_dep, libcurl_dep, - libnm_client_aux_extern_dep, ], ) @@ -53,12 +53,18 @@ executable( libnm_cloud_setup_core_dep, libnmc_base_dep, 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_client_aux_extern, + libnm_core_aux_extern, + libnm_core_aux_intern, + 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, diff --git a/clients/cloud-setup/tests/meson.build b/clients/cloud-setup/tests/meson.build index 2f7255401..65d8d48f9 100644 --- a/clients/cloud-setup/tests/meson.build +++ b/clients/cloud-setup/tests/meson.build @@ -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, ], ) diff --git a/clients/common/meson.build b/clients/common/meson.build index 1afe11a72..6f53d877a 100644 --- a/clients/common/meson.build +++ b/clients/common/meson.build @@ -12,7 +12,6 @@ libnmc_base = static_library( ), dependencies: [ libnm_dep, - libnm_nm_default_dep, ], ) @@ -20,7 +19,6 @@ libnmc_base_dep = declare_dependency( include_directories: common_inc, dependencies: [ libnm_dep, - libnm_nm_default_dep, ], link_with: libnmc_base, ) @@ -72,8 +70,6 @@ libnmc = static_library( ), dependencies: [ libnm_dep, - libnm_nm_default_dep, - libnm_core_aux_extern_dep, ], link_depends: settings_docs_source, ) @@ -82,7 +78,6 @@ libnmc_dep = declare_dependency( include_directories: common_inc, dependencies: [ libnm_dep, - libnm_nm_default_dep, ], link_with: libnmc, ) diff --git a/clients/common/tests/meson.build b/clients/common/tests/meson.build index ef74e97df..4a7a2ffb3 100644 --- a/clients/common/tests/meson.build +++ b/clients/common/tests/meson.build @@ -6,10 +6,15 @@ exe = executable( dependencies: [ libnmc_base_dep, 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_core_aux_extern, + libnm_core_aux_intern, + libnm_base, + libnm_glib_aux, + libnm_std_aux, + libc_siphash, ], ) @@ -24,11 +29,15 @@ exe = executable( 'test-libnm-core-aux.c', dependencies: [ libnm_dep, - libnm_core_aux_extern_dep_link, - libnm_nm_default_dep, - libnm_glib_aux_dep_link, + glib_dep, + ], + link_with: [ + libnm_core_aux_extern, + libnm_log_null, + libnm_glib_aux, + libnm_std_aux, + libc_siphash, ], - link_with: libnm_log_null, ) test( diff --git a/clients/meson.build b/clients/meson.build index 3d360e0f1..60c5668e8 100644 --- a/clients/meson.build +++ b/clients/meson.build @@ -5,9 +5,13 @@ executable( 'nm-online' + '.c', dependencies: [ libnm_dep, - libnm_nm_default_dep, - libnm_client_aux_extern_dep, - libnm_glib_aux_dep_link, + glib_dep, + ], + link_with: [ + libnm_client_aux_extern, + libnm_glib_aux, + libnm_std_aux, + libc_siphash, ], link_args: ldflags_linker_script_binary, link_depends: linker_script_binary, diff --git a/clients/tui/meson.build b/clients/tui/meson.build index d42123886..04eeba595 100644 --- a/clients/tui/meson.build +++ b/clients/tui/meson.build @@ -50,13 +50,19 @@ executable( libnmc_base_dep, libnmc_dep, libnmt_newt_dep, - libnm_client_aux_extern_dep, - libnm_core_aux_extern_dep_link, - libnm_core_aux_intern_dep_link, - libnm_base_dep_link, - libnm_glib_aux_dep_link, + libnm_dep, + glib_dep, + ], + link_with: [ + libnm_client_aux_extern, + libnm_core_aux_extern, + libnm_core_aux_intern, + libnm_base, + 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, diff --git a/clients/tui/newt/meson.build b/clients/tui/newt/meson.build index 16c06eb0b..acca1e914 100644 --- a/clients/tui/newt/meson.build +++ b/clients/tui/newt/meson.build @@ -24,9 +24,14 @@ libnmt_newt = static_library( 'nmt-newt-utils.c', 'nmt-newt-widget.c', ), + include_directories: [ + src_inc, + top_inc, + ], dependencies: [ - libnm_nm_default_dep, + libnm_dep, newt_dep, + glib_dep, ], ) diff --git a/examples/C/glib/meson.build b/examples/C/glib/meson.build index cf26fdf4b..5bee13c1d 100644 --- a/examples/C/glib/meson.build +++ b/examples/C/glib/meson.build @@ -1,20 +1,22 @@ # SPDX-License-Identifier: LGPL-2.1-or-later examples = [ - ['add-connection-gdbus', [libnm_client_public_enum_sources[1]], [uuid_dep]], - ['add-connection-libnm', [], [libnm_dep]], - ['get-active-connections-gdbus', [libnm_client_public_enum_sources[1]], []], - ['get-ap-info-libnm', [], [libnm_dep]], - ['list-connections-gdbus', [], []], - ['list-connections-libnm', [], [libnm_dep]], - ['monitor-nm-running-gdbus', [], []], - ['monitor-nm-state-gdbus', [], []], + ['add-connection-gdbus', [uuid_dep]], + ['add-connection-libnm', []], + ['get-active-connections-gdbus', []], + ['get-ap-info-libnm', []], + ['list-connections-gdbus', []], + ['list-connections-libnm', []], + ['monitor-nm-running-gdbus', []], + ['monitor-nm-state-gdbus', []], ] foreach example: examples executable( example[0], - [example[0] + '.c'] + example[1], - dependencies: [libnm_nm_default_dep] + example[2], + [example[0] + '.c'], + dependencies: [ + libnm_dep, + ] + example[1], ) endforeach diff --git a/introspection/meson.build b/introspection/meson.build index 82c1dd6bb..7d495f7af 100644 --- a/introspection/meson.build +++ b/introspection/meson.build @@ -57,8 +57,6 @@ sources = [] introspection_files = [] headers = [] -# FIXME?: DBUS_INTERFACE_DOCS/docbook files are generated in -# "meson.current_build_dir()" instead of "meson.source_root()/docs/api" foreach iface: ifaces iface_xml = iface + '.xml' ifaces_xmls += files(iface_xml) @@ -99,12 +97,12 @@ libnmdbus = static_library( 'nmdbus', sources: sources, include_directories: top_inc, - dependencies: glib_dep, c_args: introspection_extra_cflags, + dependencies: glib_dep, ) libnmdbus_dep = declare_dependency( sources: headers, - include_directories: include_directories('.'), - link_with: libnmdbus, + include_directories: top_inc, + dependencies: glib_dep, ) diff --git a/meson.build b/meson.build index 856919fdd..36641b5eb 100644 --- a/meson.build +++ b/meson.build @@ -920,7 +920,6 @@ content_files = [] subdir('introspection') subdir('src') -subdir('dispatcher') subdir('clients') subdir('data') subdir('po') diff --git a/src/contrib/tests/meson.build b/src/contrib/tests/meson.build index 0356a03f8..b9b22ca88 100644 --- a/src/contrib/tests/meson.build +++ b/src/contrib/tests/meson.build @@ -5,7 +5,7 @@ static_library( 'nm-vpn-plugin-utils-test', sources: nm_vpn_plugin_utils_source, dependencies: [ - libnm_client_public_dep, + libnm_dep, glib_dep, ], ) diff --git a/src/core/devices/bluetooth/meson.build b/src/core/devices/bluetooth/meson.build index 32168b0c2..5b196d08d 100644 --- a/src/core/devices/bluetooth/meson.build +++ b/src/core/devices/bluetooth/meson.build @@ -9,7 +9,6 @@ libnm_device_plugin_bluetooth_static = static_library( ) + (enable_bluez5_dun ? files('nm-bluez5-dun.c') : files()), dependencies: [ libnm_core_public_dep, - libnm_core_intern_dep, core_default_dep, libnm_wwan_dep, bluez5_dep, diff --git a/src/core/initrd/meson.build b/src/core/initrd/meson.build index 6544fe8e2..748000e00 100644 --- a/src/core/initrd/meson.build +++ b/src/core/initrd/meson.build @@ -17,8 +17,17 @@ executable( link_with: [ libNetworkManagerBase, libnmi_core, + libnm_core_aux_intern, libnm_core_impl, + libnm_crypto, + libnm_platform, libnm_base, + libnm_systemd_shared, + libnm_log_core, + libnm_udev_aux, + libnm_glib_aux, + libnm_std_aux, + libc_siphash, ], link_args: ldflags_linker_script_binary, link_depends: linker_script_binary, diff --git a/src/core/meson.build b/src/core/meson.build index 6a9ff34fa..ea23e17f5 100644 --- a/src/core/meson.build +++ b/src/core/meson.build @@ -9,7 +9,6 @@ core_plugin_dep = declare_dependency( libnm_core_public_inc, ], dependencies: [ - libnm_core_intern_dep, libnm_core_public_dep, glib_dep, ], @@ -23,9 +22,6 @@ core_default_dep = declare_dependency( ], dependencies: [ libnm_core_public_dep, - libnm_core_intern_dep, - libnm_log_core_dep, - libnm_platform_dep, ], ) @@ -76,10 +72,7 @@ libNetworkManagerBase = static_library( ) + platform_wifi_wext_source, dependencies: [ core_default_dep, - libn_dhcp4_dep, - libnm_core_impl_dep, - libnm_systemd_shared_dep, - libnm_udev_aux_dep, + libnm_core_public_dep, libsystemd_dep, libudev_dep, ], @@ -87,10 +80,8 @@ libNetworkManagerBase = static_library( nm_deps = [ libnm_core_public_dep, - libnm_core_impl_dep, core_default_dep, dl_dep, - libn_acd_dep, libndp_dep, libudev_dep, logind_dep, @@ -207,19 +198,28 @@ executable( 'nm-iface-helper.c', dependencies: [ core_default_dep, - dl_dep, - libndp_dep, + glib_dep, libudev_dep, - libn_acd_dep, - libnm_glib_aux_dep_link, - libnm_core_impl_dep_link, + libndp_dep, + dl_dep, ], link_with: [ libNetworkManagerBase, + libnm_core_aux_intern, + libnm_core_impl, + libnm_crypto, libnm_systemd_core, + libnm_platform, libnm_systemd_shared, libnm_base, + libnm_udev_aux, + libnm_log_core, libnm_glib_aux, + libnm_std_aux, + libn_acd, + libn_dhcp4, + libc_rbtree, + libc_siphash, ], link_args: ldflags_linker_script_binary, link_depends: linker_script_binary, @@ -249,8 +249,20 @@ if enable_tests dependencies: core_default_dep, link_with: [ libNetworkManagerTest, - libnm_base, + libnm_core_aux_intern, libnm_core_impl, + libnm_crypto, + libnm_platform, + libnm_base, + libnm_systemd_shared, + libnm_udev_aux, + libnm_log_core, + libnm_glib_aux, + libnm_std_aux, + libn_acd, + libn_dhcp4, + libc_siphash, + libc_rbtree, ], ) @@ -281,13 +293,27 @@ subdir('settings/plugins') NetworkManager_all_sym = executable( 'NetworkManager-all-sym', 'main.c', - dependencies: nm_deps, + dependencies: [ + nm_deps, + libudev_dep, + ], link_args: '-Wl,--no-gc-sections', link_whole: [ libNetworkManager, libNetworkManagerBase, + libnm_core_aux_intern, libnm_core_impl, + libnm_crypto, + libnm_platform, libnm_base, + libnm_log_core, + libnm_udev_aux, + libnm_glib_aux, + libnm_std_aux, + libn_acd, + libn_dhcp4, + libc_rbtree, + libc_siphash, ], ) @@ -308,12 +334,26 @@ ver_script = custom_target( NetworkManager = executable( 'NetworkManager', 'main.c', - dependencies: nm_deps, + dependencies: [ + nm_deps, + libudev_dep, + ], link_with: [ libNetworkManager, libNetworkManagerBase, + libnm_core_aux_intern, libnm_core_impl, + libnm_crypto, + libnm_platform, libnm_base, + libnm_udev_aux, + libnm_log_core, + libnm_glib_aux, + libnm_std_aux, + libn_acd, + libn_dhcp4, + libc_rbtree, + libc_siphash, ], link_args: [ '-rdynamic', diff --git a/src/core/ppp/meson.build b/src/core/ppp/meson.build index 348d056ab..ffeb0eba9 100644 --- a/src/core/ppp/meson.build +++ b/src/core/ppp/meson.build @@ -4,11 +4,20 @@ nm_pppd_plugin = shared_module( 'nm-pppd-plugin', name_prefix: '', sources: 'nm-pppd-plugin.c', + include_directories: [ + src_inc, + top_inc, + ], dependencies: [ - libnm_core_impl_dep_link, - libnm_glib_aux_dep_link, + libnm_core_public_dep, glib_dep, ], + link_with: [ + libnm_core_impl, + libnm_glib_aux, + libnm_std_aux, + libc_siphash, + ], install: true, install_dir: pppd_plugin_dir, ) diff --git a/src/core/systemd/meson.build b/src/core/systemd/meson.build index ec4b935de..2de60776c 100644 --- a/src/core/systemd/meson.build +++ b/src/core/systemd/meson.build @@ -43,11 +43,10 @@ libnm_systemd_core = static_library( src_core_inc, ], dependencies: [ - libnm_core_impl_dep, - libnm_systemd_shared_dep, + libnm_core_public_dep, + libnm_systemd_shared_dep_inc, glib_dep, ], - link_with: libc_siphash, ) libnm_systemd_core_dep = declare_dependency( @@ -56,8 +55,10 @@ libnm_systemd_core_dep = declare_dependency( ], dependencies: [ glib_dep, - libnm_core_impl_dep, - libnm_systemd_shared_dep, ], - link_with: libnm_systemd_core, + link_with: [ + libnm_core_impl, + libnm_systemd_shared, + libnm_systemd_core, + ], ) diff --git a/src/core/tests/meson.build b/src/core/tests/meson.build index 62351f931..5415bb2ae 100644 --- a/src/core/tests/meson.build +++ b/src/core/tests/meson.build @@ -38,8 +38,12 @@ exe = executable( src_core_inc, ], dependencies: [ + libnm_core_public_dep, libnm_systemd_core_dep, - libnm_systemd_shared_dep, + ], + link_with: [ + libnm_systemd_shared, + libc_siphash, ], ) diff --git a/src/libnm-base/meson.build b/src/libnm-base/meson.build index 3bcaa781c..ed11e0a6d 100644 --- a/src/libnm-base/meson.build +++ b/src/libnm-base/meson.build @@ -2,21 +2,12 @@ libnm_base = static_library( 'nm-base', + sources: files( + 'nm-ethtool-base.c', + ), include_directories: [ src_inc, top_inc, ], - sources: files( - 'nm-ethtool-base.c', - ), - dependencies: libnm_glib_aux_dep_link, -) - -libnm_base_dep = declare_dependency( - dependencies: libnm_glib_aux_dep, -) - -libnm_base_dep_link = declare_dependency( - dependencies: libnm_glib_aux_dep_link, - link_with: libnm_base, + dependencies: glib_dep, ) diff --git a/src/libnm-client-aux-extern/meson.build b/src/libnm-client-aux-extern/meson.build index 767c6ef59..a2b465435 100644 --- a/src/libnm-client-aux-extern/meson.build +++ b/src/libnm-client-aux-extern/meson.build @@ -6,11 +6,6 @@ libnm_client_aux_extern = static_library( 'nm-libnm-aux.c', ), dependencies: [ - libnm_core_aux_intern_dep, libnm_dep, ], ) - -libnm_client_aux_extern_dep = declare_dependency( - link_with: [libnm_client_aux_extern], -) diff --git a/src/libnm-client-impl/meson.build b/src/libnm-client-impl/meson.build index 000f19db3..4682e2baf 100644 --- a/src/libnm-client-impl/meson.build +++ b/src/libnm-client-impl/meson.build @@ -1,17 +1,5 @@ # SPDX-License-Identifier: LGPL-2.1-or-later -libnm_nm_default_dep = declare_dependency( - include_directories: [ - libnm_client_public_inc, - libnm_core_public_inc, - top_inc, - src_inc, - ], - dependencies: [ - libnm_core_public_dep, - ], -) - libnm_client_impl_sources = files( 'nm-access-point.c', 'nm-active-connection.c', @@ -72,12 +60,11 @@ libnm_client_impl = static_library( sources: libnm_client_impl_sources + libnm_client_public_enum_sources, dependencies: [ libnmdbus_dep, - libnm_core_aux_intern_dep, - libnm_nm_default_dep, - libnm_udev_aux_dep, + libnm_core_public_dep, + libnm_client_public_dep, libudev_dep, + glib_dep, ], - link_with: libnm_log_null, ) linker_script = join_paths(meson.current_source_dir(), 'libnm.ver') @@ -85,14 +72,25 @@ linker_script = join_paths(meson.current_source_dir(), 'libnm.ver') libnm = shared_library( 'nm', version: libnm_version, - dependencies: libnm_nm_default_dep, + dependencies: [ + libnm_core_public_dep, + libnm_client_public_dep, + libudev_dep, + glib_dep, + ], link_whole: [ libnm_client_impl, + libnm_core_aux_intern, libnm_core_impl, - libnmdbus, + libnm_crypto, + libnm_base, + libnm_udev_aux, + libnm_systemd_shared, 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, @@ -100,8 +98,11 @@ libnm = shared_library( ) libnm_dep = declare_dependency( - sources: libnm_client_public_enum_sources[1], - include_directories: libnm_client_public_inc, + dependencies: [ + libnm_core_public_dep, + libnm_client_public_dep, + glib_dep, + ], link_with: libnm, ) @@ -135,6 +136,9 @@ if enable_introspection includes: 'Gio-2.0', include_directories: [ libnm_core_public_inc, + libnm_client_public_inc, + src_inc, + top_inc, ], nsversion: nm_gir_version, namespace: 'NM', @@ -207,18 +211,14 @@ if enable_introspection endif ld_library_path = meson.current_build_dir() + ld_library_path - generate_setting_docs_env = [ - 'env', - 'GI_TYPELIB_PATH=' + gi_typelib_path, - 'LD_LIBRARY_PATH=' + ld_library_path, - ] - nm_settings_docs_xml_gir = custom_target( 'nm-settings-docs-gir.xml', input: libnm_gir[0], output: 'nm-settings-docs-gir.xml', command: [ - generate_setting_docs_env, + 'env', + 'GI_TYPELIB_PATH=' + gi_typelib_path, + 'LD_LIBRARY_PATH=' + ld_library_path, python.path(), join_paths(meson.source_root(), 'tools', 'generate-docs-nm-settings-docs-gir.py'), '--lib-path', meson.current_build_dir(), diff --git a/src/libnm-client-impl/tests/meson.build b/src/libnm-client-impl/tests/meson.build index 3f7bf3a06..3f2e78a74 100644 --- a/src/libnm-client-impl/tests/meson.build +++ b/src/libnm-client-impl/tests/meson.build @@ -15,18 +15,30 @@ foreach test_unit: test_units libnm_client_public_inc, ], dependencies: [ - libnm_core_impl_dep_link, - libnm_nm_default_dep, + libnm_core_public_dep, + libnm_client_public_dep, + glib_dep, + libudev_dep, ], link_with: [ libnm_client_impl, libnm_client_test, + libnm_core_aux_intern, + libnm_core_impl, + libnm_crypto, libnm_base, + libnm_udev_aux, + libnm_systemd_shared, + libnm_log_null, + libnm_glib_aux, + libnm_std_aux, + libc_siphash, + libnmdbus, ], ) test( - test_unit, + 'src/libnm-client-impl/tests/' + test_unit, test_script, timeout: 90, args: test_args + [exe.full_path()], diff --git a/src/libnm-client-public/meson.build b/src/libnm-client-public/meson.build index 1a1e61225..3ae4e8d83 100644 --- a/src/libnm-client-public/meson.build +++ b/src/libnm-client-public/meson.build @@ -56,7 +56,7 @@ libnm_client_headers = files( libnm_client_public_enum_sources = gnome.mkenums( 'nm-enum-types', - sources: libnm_client_headers + [nm_version_macro_header], + sources: libnm_client_headers, identifier_prefix: nm_id_prefix, c_template: 'nm-enum-types.c.template', h_template: 'nm-enum-types.h.template', diff --git a/src/libnm-client-test/meson.build b/src/libnm-client-test/meson.build index acf7c39e9..8e2fba113 100644 --- a/src/libnm-client-test/meson.build +++ b/src/libnm-client-test/meson.build @@ -12,9 +12,7 @@ libnm_client_test = static_library( top_inc, ], dependencies: [ - libnm_core_aux_intern_dep, libnm_core_public_dep, - libnm_glib_aux_dep, glib_dep, ], ) diff --git a/src/libnm-core-aux-extern/meson.build b/src/libnm-core-aux-extern/meson.build index 89a030f9f..b48670b52 100644 --- a/src/libnm-core-aux-extern/meson.build +++ b/src/libnm-core-aux-extern/meson.build @@ -6,26 +6,7 @@ libnm_core_aux_extern = static_library( 'nm-libnm-core-aux.c', ), dependencies: [ - libnm_core_aux_intern_dep, libnm_core_public_dep, - libnm_glib_aux_dep, glib_dep, ], ) - -libnm_core_aux_extern_dep = declare_dependency( - include_directories: [ - src_inc, - ], - dependencies: [ - libnm_core_aux_intern_dep, - libnm_core_public_dep, - libnm_glib_aux_dep, - glib_dep, - ], -) - -libnm_core_aux_extern_dep_link = declare_dependency( - dependencies: libnm_core_aux_extern_dep, - link_with: libnm_core_aux_extern, -) diff --git a/src/libnm-core-aux-intern/meson.build b/src/libnm-core-aux-intern/meson.build index 37baa61ef..a58921e30 100644 --- a/src/libnm-core-aux-intern/meson.build +++ b/src/libnm-core-aux-intern/meson.build @@ -8,23 +8,6 @@ libnm_core_aux_intern = static_library( ), dependencies: [ libnm_core_public_dep, - libnm_glib_aux_dep, glib_dep, ], ) - -libnm_core_aux_intern_dep = declare_dependency( - include_directories: [ - src_inc, - top_inc, - ], - dependencies: [ - libnm_core_public_dep, - glib_dep, - ], -) - -libnm_core_aux_intern_dep_link = declare_dependency( - dependencies: libnm_core_aux_intern_dep, - link_with: libnm_core_aux_intern, -) diff --git a/src/libnm-core-impl/meson.build b/src/libnm-core-impl/meson.build index df283dd60..2b7696165 100644 --- a/src/libnm-core-impl/meson.build +++ b/src/libnm-core-impl/meson.build @@ -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, ], ) @@ -111,28 +109,7 @@ libnm_core_impl = static_library( ], dependencies: [ dl_dep, - libnm_systemd_shared_dep, libnm_core_public_dep, - libnm_core_intern_dep, - libnm_glib_aux_dep_link, uuid_dep, ], - link_with: [ - libnm_crypto, - libnm_core_aux_intern, - ], -) - -libnm_core_impl_dep = declare_dependency( - dependencies: [ - libnm_core_public_dep, - glib_dep, - ], -) - -libnm_core_impl_dep_link = declare_dependency( - dependencies: [ - libnm_core_impl_dep, - ], - link_with: libnm_core_impl, ) diff --git a/src/libnm-core-impl/tests/meson.build b/src/libnm-core-impl/tests/meson.build index 406baa42c..ca1d1c1aa 100644 --- a/src/libnm-core-impl/tests/meson.build +++ b/src/libnm-core-impl/tests/meson.build @@ -26,15 +26,22 @@ foreach test_unit: test_units ], dependencies: [ libnm_core_public_dep, - libnm_core_intern_dep, - libnm_core_impl_dep_link, - libnm_base_dep_link, ], - link_with: libnm_log_null, + link_with: [ + libnm_core_aux_intern, + libnm_core_impl, + libnm_crypto, + libnm_base, + libnm_log_null, + libnm_systemd_shared, + libnm_glib_aux, + libnm_std_aux, + libc_siphash, + ], ) test( - 'libnm-core/' + test_unit, + 'src/libnm-core-impl/tests/' + test_unit, test_script, args: test_args + [exe.full_path()], timeout: default_test_timeout, diff --git a/src/libnm-core-intern/meson.build b/src/libnm-core-intern/meson.build index 0373452c2..841a0aebb 100644 --- a/src/libnm-core-intern/meson.build +++ b/src/libnm-core-intern/meson.build @@ -1,10 +1,3 @@ # SPDX-License-Identifier: LGPL-2.1-or-later libnm_core_intern_inc = include_directories('.') - -libnm_core_intern_dep = declare_dependency( - dependencies: [ - libnm_core_public_dep, - glib_dep, - ], -) diff --git a/src/libnm-glib-aux/meson.build b/src/libnm-glib-aux/meson.build index e9c8544c3..39eccbdfc 100644 --- a/src/libnm-glib-aux/meson.build +++ b/src/libnm-glib-aux/meson.build @@ -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, ) diff --git a/src/libnm-glib-aux/nm-logging-base.c b/src/libnm-glib-aux/nm-logging-base.c index 24d97adc8..e11bd9f35 100644 --- a/src/libnm-glib-aux/nm-logging-base.c +++ b/src/libnm-glib-aux/nm-logging-base.c @@ -8,7 +8,7 @@ /*****************************************************************************/ -const LogLevelDesc level_desc[_LOGL_N] = { +const LogLevelDesc nm_log_level_desc[_LOGL_N] = { [LOGL_TRACE] = { "TRACE", @@ -68,8 +68,8 @@ _nm_log_parse_level(const char *level, NMLogLevel *out_level) if (!level) return FALSE; - for (i = 0; i < (int) G_N_ELEMENTS(level_desc); i++) { - if (!g_ascii_strcasecmp(level_desc[i].name, level)) { + for (i = 0; i < (int) G_N_ELEMENTS(nm_log_level_desc); i++) { + if (!g_ascii_strcasecmp(nm_log_level_desc[i].name, level)) { NM_SET_OUT(out_level, i); return TRUE; } diff --git a/src/libnm-glib-aux/nm-logging-base.h b/src/libnm-glib-aux/nm-logging-base.h index d9ac03c79..136f0c042 100644 --- a/src/libnm-glib-aux/nm-logging-base.h +++ b/src/libnm-glib-aux/nm-logging-base.h @@ -21,7 +21,7 @@ typedef struct { GLogLevelFlags g_log_level; } LogLevelDesc; -extern const LogLevelDesc level_desc[_LOGL_N]; +extern const LogLevelDesc nm_log_level_desc[_LOGL_N]; gboolean _nm_log_parse_level(const char *level, NMLogLevel *out_level); diff --git a/src/libnm-glib-aux/tests/meson.build b/src/libnm-glib-aux/tests/meson.build index 38dfff0c6..0ec4ad301 100644 --- a/src/libnm-glib-aux/tests/meson.build +++ b/src/libnm-glib-aux/tests/meson.build @@ -3,12 +3,23 @@ exe = executable( 'test-shared-general', 'test-shared-general.c', - dependencies: libnm_glib_aux_dep_link, - link_with: libnm_log_null, + include_directories: [ + src_inc, + top_inc, + ], + dependencies: [ + glib_dep, + ], + link_with: [ + libnm_log_null, + libnm_glib_aux, + libnm_std_aux, + libc_siphash, + ], ) test( - 'shared/nm-glib-aux/test-shared-general', + 'src/libnm-glib-aux/tests/test-shared-general', test_script, args: test_args + [exe.full_path()], timeout: default_test_timeout, @@ -19,15 +30,24 @@ 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( - 'shared/nm-glib-aux/test-json-aux', + 'src/libnm-glib-aux/tests/test-json-aux', test_script, args: test_args + [exe.full_path()], timeout: default_test_timeout, diff --git a/src/libnm-log-core/meson.build b/src/libnm-log-core/meson.build index 3eb914570..e1b30ba9b 100644 --- a/src/libnm-log-core/meson.build +++ b/src/libnm-log-core/meson.build @@ -12,10 +12,3 @@ libnm_log_core = static_library( glib_dep, ], ) - -libnm_log_core_dep = declare_dependency( - dependencies: [ - libnm_glib_aux_dep_link, - ], - link_with: libnm_log_core, -) diff --git a/src/libnm-log-core/nm-logging.c b/src/libnm-log-core/nm-logging.c index 7a23344b9..b9b339129 100644 --- a/src/libnm-log-core/nm-logging.c +++ b/src/libnm-log-core/nm-logging.c @@ -416,7 +416,7 @@ nm_logging_level_to_string(void) { NM_ASSERT_ON_MAIN_THREAD(); - return level_desc[gl.imm.log_level].name; + return nm_log_level_desc[gl.imm.log_level].name; } const char * @@ -428,10 +428,10 @@ nm_logging_all_levels_to_string(void) int i; str = g_string_new(NULL); - for (i = 0; i < G_N_ELEMENTS(level_desc); i++) { + for (i = 0; i < G_N_ELEMENTS(nm_log_level_desc); i++) { if (str->len) g_string_append_c(str, ','); - g_string_append(str, level_desc[i].name); + g_string_append(str, nm_log_level_desc[i].name); } } @@ -480,7 +480,7 @@ _domains_to_string(gboolean include_level_override, /* Check if it's logging at a lower level than the default. */ for (i = 0; i < log_level; i++) { if (diter->num & log_state[i]) { - g_string_append_printf(str, ":%s", level_desc[i].name); + g_string_append_printf(str, ":%s", nm_log_level_desc[i].name); break; } } @@ -488,7 +488,7 @@ _domains_to_string(gboolean include_level_override, if (!(diter->num & log_state[log_level])) { for (i = log_level + 1; i < _LOGL_N_REAL; i++) { if (diter->num & log_state[i]) { - g_string_append_printf(str, ":%s", level_desc[i].name); + g_string_append_printf(str, ":%s", nm_log_level_desc[i].name); break; } } @@ -704,7 +704,7 @@ _nm_log_impl(const char *file, #define MESSAGE_FMT "%s%-7s [%ld.%04ld] %s" #define MESSAGE_ARG(prefix, tv, msg) \ - prefix, level_desc[level].level_str, (tv).tv_sec, ((tv).tv_usec / 100), (msg) + prefix, nm_log_level_desc[level].level_str, (tv).tv_sec, ((tv).tv_usec / 100), (msg) g_get_current_time(&tv); @@ -729,7 +729,7 @@ _nm_log_impl(const char *file, now = nm_utils_get_monotonic_timestamp_nsec(); boottime = nm_utils_monotonic_timestamp_as_boottime(now, 1); - _iovec_set_format_a(iov++, 30, "PRIORITY=%d", level_desc[level].syslog_level); + _iovec_set_format_a(iov++, 30, "PRIORITY=%d", nm_log_level_desc[level].syslog_level); _iovec_set_format(iov++, iov_free++, "MESSAGE=" MESSAGE_FMT, @@ -755,7 +755,7 @@ _nm_log_impl(const char *file, G_STATIC_ASSERT_EXPR(LOG_FAC(LOG_DAEMON) == 3); _iovec_set_string_literal(iov++, "SYSLOG_FACILITY=3"); - _iovec_set_format_str_a(iov++, 15, "NM_LOG_LEVEL=%s", level_desc[level].name); + _iovec_set_format_str_a(iov++, 15, "NM_LOG_LEVEL=%s", nm_log_level_desc[level].name); if (func) _iovec_set_format(iov++, iov_free++, "CODE_FUNC=%s", func); _iovec_set_format(iov++, iov_free++, "CODE_FILE=%s", file ?: ""); @@ -787,11 +787,11 @@ _nm_log_impl(const char *file, } break; #endif case LOG_BACKEND_SYSLOG: - syslog(level_desc[level].syslog_level, MESSAGE_FMT, MESSAGE_ARG(g->prefix, tv, msg)); + syslog(nm_log_level_desc[level].syslog_level, MESSAGE_FMT, MESSAGE_ARG(g->prefix, tv, msg)); break; default: g_log(syslog_identifier_domain(g->syslog_identifier), - level_desc[level].g_log_level, + nm_log_level_desc[level].g_log_level, MESSAGE_FMT, MESSAGE_ARG(g->prefix, tv, msg)); break; diff --git a/src/libnm-platform/meson.build b/src/libnm-platform/meson.build index 3300e8f67..c2a8b2e7c 100644 --- a/src/libnm-platform/meson.build +++ b/src/libnm-platform/meson.build @@ -2,26 +2,17 @@ libnm_platform = static_library( 'nm-platform', - include_directories: [ - src_inc, - top_inc, - ], sources: [ 'nm-netlink.c', 'nm-platform-utils.c', 'nmp-netns.c', ], - dependencies: [ - glib_dep, - ], -) - -libnm_platform_dep = declare_dependency( include_directories: [ src_inc, + top_inc, ], dependencies: [ - libnm_glib_aux_dep_link, + glib_dep, + libudev_dep, ], - link_with: libnm_platform, ) diff --git a/src/libnm-platform/tests/meson.build b/src/libnm-platform/tests/meson.build index dd9c3f58e..bec385eb4 100644 --- a/src/libnm-platform/tests/meson.build +++ b/src/libnm-platform/tests/meson.build @@ -3,14 +3,27 @@ exe = executable( 'test-nm-platform', 'test-nm-platform.c', + include_directories: [ + src_inc, + top_inc, + ], dependencies: [ - libnm_log_core_dep, - libnm_platform_dep, + glib_dep, + libudev_dep, + ], + link_with: [ + libnm_platform, + libnm_base, + libnm_udev_aux, + libnm_log_core, + libnm_glib_aux, + libnm_std_aux, + libc_siphash, ], ) test( - 'shared/nm-glib-aux/test-nm-platform', + 'src/libnm-platform/tests/test-nm-platform', test_script, args: test_args + [exe.full_path()], timeout: default_test_timeout, diff --git a/src/libnm-systemd-shared/meson.build b/src/libnm-systemd-shared/meson.build index 68512c62c..42d6e5f04 100644 --- a/src/libnm-systemd-shared/meson.build +++ b/src/libnm-systemd-shared/meson.build @@ -54,12 +54,10 @@ libnm_systemd_shared = static_library( dependencies: glib_dep, ) -libnm_systemd_shared_dep = declare_dependency( +libnm_systemd_shared_dep_inc = declare_dependency( include_directories: include_directories( 'sd-adapt-shared', 'src/basic', 'src/shared', ), - dependencies: glib_dep, - link_with: libnm_systemd_shared, ) diff --git a/src/libnm-udev-aux/meson.build b/src/libnm-udev-aux/meson.build index f0e7a7fa4..8ba124859 100644 --- a/src/libnm-udev-aux/meson.build +++ b/src/libnm-udev-aux/meson.build @@ -12,7 +12,3 @@ libnm_udev_aux = static_library( libudev_dep, ], ) - -libnm_udev_aux_dep = declare_dependency( - link_with: libnm_udev_aux, -) diff --git a/src/meson.build b/src/meson.build index e560053e4..8301d8c68 100644 --- a/src/meson.build +++ b/src/meson.build @@ -18,19 +18,13 @@ libc_rbtree = static_library( c_args: '-std=c11', ) -if enable_ebpf - n_acd_bpf_source = 'n-acd/src/n-acd-bpf.c' -else - n_acd_bpf_source = 'n-acd/src/n-acd-bpf-fallback.c' -endif - libn_acd = static_library( 'n-acd', sources: files( 'n-acd/src/n-acd.c', 'n-acd/src/n-acd-probe.c', 'n-acd/src/util/timer.c', - n_acd_bpf_source, + enable_ebpf ? 'n-acd/src/n-acd-bpf.c' : 'n-acd/src/n-acd-bpf-fallback.c', ), include_directories: include_directories( 'c-list/src', @@ -45,14 +39,6 @@ libn_acd = static_library( '-Wno-pointer-arith', '-Wno-vla', ], - link_with: [ - libc_rbtree, - libc_siphash, - ], -) - -libn_acd_dep = declare_dependency( - link_with: libn_acd, ) libn_dhcp4 = static_library( @@ -68,22 +54,17 @@ libn_dhcp4 = static_library( 'n-dhcp4/src/util/packet.c', 'n-dhcp4/src/util/socket.c', ), + include_directories: include_directories( + 'c-list/src', + 'c-siphash/src', + 'c-stdaux/src', + ), c_args: [ '-std=c11', '-D_GNU_SOURCE', '-Wno-declaration-after-statement', '-Wno-pointer-arith', ], - include_directories: include_directories( - 'c-list/src', - 'c-siphash/src', - 'c-stdaux/src', - ), - link_with: libc_siphash, -) - -libn_dhcp4_dep = declare_dependency( - link_with: libn_dhcp4, ) ############################################################################### @@ -105,6 +86,7 @@ subdir('libnm-client-public') subdir('libnm-client-impl') subdir('libnm-client-aux-extern') subdir('core') +subdir('nm-dispatcher') subdir('contrib') if enable_tests @@ -113,5 +95,6 @@ if enable_tests subdir('libnm-platform/tests') subdir('libnm-core-impl/tests') subdir('libnm-client-impl/tests') + subdir('nm-dispatcher/tests') subdir('contrib/tests') endif diff --git a/dispatcher/meson.build b/src/nm-dispatcher/meson.build similarity index 74% rename from dispatcher/meson.build rename to src/nm-dispatcher/meson.build index 0bfa4590a..37ae9e822 100644 --- a/dispatcher/meson.build +++ b/src/nm-dispatcher/meson.build @@ -14,39 +14,37 @@ install_data( install_dir: dbus_conf_dir, ) +dispatcher_nmdbus_dispatcher_sources = gnome.gdbus_codegen( + 'nmdbus-dispatcher', + 'nm-dispatcher.xml', + interface_prefix: 'org.freedesktop', + namespace: 'NMDBus', +) + libnm_dispatcher_core = static_library( 'nm-dispatcher-core', sources: 'nm-dispatcher-utils.c', dependencies: [ libnm_dep, - libnm_nm_default_dep, - libnm_client_aux_extern_dep, ], ) -nmdbus_dispatcher_sources = gnome.gdbus_codegen( - 'nmdbus-dispatcher', - 'nm-dispatcher.xml', - interface_prefix: 'org.freedesktop', - namespace: 'NMDBus', -) - executable( 'nm-dispatcher', 'nm-dispatcher.c', dependencies: [ libnm_dep, - libnm_nm_default_dep, - libnm_core_aux_extern_dep_link, - libnm_glib_aux_dep_link, + glib_dep, + ], + link_with: [ + libnm_core_aux_extern, + 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, install_dir: nm_libexecdir, ) - -if enable_tests - subdir('tests') -endif diff --git a/dispatcher/nm-dispatcher-utils.c b/src/nm-dispatcher/nm-dispatcher-utils.c similarity index 100% rename from dispatcher/nm-dispatcher-utils.c rename to src/nm-dispatcher/nm-dispatcher-utils.c diff --git a/dispatcher/nm-dispatcher-utils.h b/src/nm-dispatcher/nm-dispatcher-utils.h similarity index 100% rename from dispatcher/nm-dispatcher-utils.h rename to src/nm-dispatcher/nm-dispatcher-utils.h diff --git a/dispatcher/nm-dispatcher.c b/src/nm-dispatcher/nm-dispatcher.c similarity index 100% rename from dispatcher/nm-dispatcher.c rename to src/nm-dispatcher/nm-dispatcher.c diff --git a/dispatcher/nm-dispatcher.conf b/src/nm-dispatcher/nm-dispatcher.conf similarity index 100% rename from dispatcher/nm-dispatcher.conf rename to src/nm-dispatcher/nm-dispatcher.conf diff --git a/dispatcher/nm-dispatcher.xml b/src/nm-dispatcher/nm-dispatcher.xml similarity index 100% rename from dispatcher/nm-dispatcher.xml rename to src/nm-dispatcher/nm-dispatcher.xml diff --git a/dispatcher/org.freedesktop.nm_dispatcher.service.in b/src/nm-dispatcher/org.freedesktop.nm_dispatcher.service.in similarity index 100% rename from dispatcher/org.freedesktop.nm_dispatcher.service.in rename to src/nm-dispatcher/org.freedesktop.nm_dispatcher.service.in diff --git a/dispatcher/tests/dispatcher-connectivity-full b/src/nm-dispatcher/tests/dispatcher-connectivity-full similarity index 100% rename from dispatcher/tests/dispatcher-connectivity-full rename to src/nm-dispatcher/tests/dispatcher-connectivity-full diff --git a/dispatcher/tests/dispatcher-connectivity-unknown b/src/nm-dispatcher/tests/dispatcher-connectivity-unknown similarity index 100% rename from dispatcher/tests/dispatcher-connectivity-unknown rename to src/nm-dispatcher/tests/dispatcher-connectivity-unknown diff --git a/dispatcher/tests/dispatcher-down b/src/nm-dispatcher/tests/dispatcher-down similarity index 87% rename from dispatcher/tests/dispatcher-down rename to src/nm-dispatcher/tests/dispatcher-down index 8e2a28187..bd7460ae1 100644 --- a/dispatcher/tests/dispatcher-down +++ b/src/nm-dispatcher/tests/dispatcher-down @@ -17,7 +17,7 @@ NM_DISPATCHER_ACTION=down CONNECTION_UUID=3fd2a33a-d81b-423f-ae99-e6baba742311 CONNECTION_DBUS_PATH=/org/freedesktop/NetworkManager/Connections/5 CONNECTION_ID=Random Connection -CONNECTION_FILENAME=/dispatcher/tests/dispatcher-down +CONNECTION_FILENAME=/src/nm-dispatcher/tests/dispatcher-down DEVICE_IFACE=wlan0 DEVICE_IP_IFACE=wlan0 diff --git a/dispatcher/tests/dispatcher-external b/src/nm-dispatcher/tests/dispatcher-external similarity index 92% rename from dispatcher/tests/dispatcher-external rename to src/nm-dispatcher/tests/dispatcher-external index 46d6c7971..382ff706f 100644 --- a/dispatcher/tests/dispatcher-external +++ b/src/nm-dispatcher/tests/dispatcher-external @@ -26,7 +26,7 @@ PATH= NM_DISPATCHER_ACTION=up CONNECTION_UUID=92bbc2fb-7304-46be-8ebb-6093dbe19a6a CONNECTION_DBUS_PATH=/org/freedesktop/NetworkManager/Connections/5 -CONNECTION_FILENAME=/dispatcher/tests/dispatcher-external +CONNECTION_FILENAME=/src/nm-dispatcher/tests/dispatcher-external CONNECTION_ID=virbr0 CONNECTION_EXTERNAL=1 DEVICE_IFACE=virbr0 diff --git a/dispatcher/tests/dispatcher-up b/src/nm-dispatcher/tests/dispatcher-up similarity index 96% rename from dispatcher/tests/dispatcher-up rename to src/nm-dispatcher/tests/dispatcher-up index 0a27e3de5..cd6c0fadc 100644 --- a/dispatcher/tests/dispatcher-up +++ b/src/nm-dispatcher/tests/dispatcher-up @@ -40,7 +40,7 @@ NM_DISPATCHER_ACTION=up CONNECTION_UUID=3fd2a33a-d81b-423f-ae99-e6baba742311 CONNECTION_DBUS_PATH=/org/freedesktop/NetworkManager/Connections/5 CONNECTION_ID=Random Connection -CONNECTION_FILENAME=/dispatcher/tests/dispatcher-up +CONNECTION_FILENAME=/src/nm-dispatcher/tests/dispatcher-up DEVICE_IFACE=wlan0 DEVICE_IP_IFACE=wlan0 PROXY_PAC_URL=http://networkmanager.com/proxy.pac diff --git a/dispatcher/tests/dispatcher-vpn-down b/src/nm-dispatcher/tests/dispatcher-vpn-down similarity index 96% rename from dispatcher/tests/dispatcher-vpn-down rename to src/nm-dispatcher/tests/dispatcher-vpn-down index e439668fe..e99c6142d 100644 --- a/dispatcher/tests/dispatcher-vpn-down +++ b/src/nm-dispatcher/tests/dispatcher-vpn-down @@ -40,7 +40,7 @@ NM_DISPATCHER_ACTION=vpn-down CONNECTION_UUID=355653c0-34d3-4777-ad25-f9a498b7ef8e CONNECTION_DBUS_PATH=/org/freedesktop/NetworkManager/Connections/5 CONNECTION_ID=Random Connection -CONNECTION_FILENAME=/dispatcher/tests/dispatcher-vpn-down +CONNECTION_FILENAME=/src/nm-dispatcher/tests/dispatcher-vpn-down DEVICE_IFACE=wlan0 DEVICE_IP_IFACE=tun0 PROXY_PAC_URL=http://networkmanager.com/proxy.pac diff --git a/dispatcher/tests/dispatcher-vpn-up b/src/nm-dispatcher/tests/dispatcher-vpn-up similarity index 96% rename from dispatcher/tests/dispatcher-vpn-up rename to src/nm-dispatcher/tests/dispatcher-vpn-up index 09c94c1c9..a24147901 100644 --- a/dispatcher/tests/dispatcher-vpn-up +++ b/src/nm-dispatcher/tests/dispatcher-vpn-up @@ -40,7 +40,7 @@ NM_DISPATCHER_ACTION=vpn-up CONNECTION_UUID=355653c0-34d3-4777-ad25-f9a498b7ef8e CONNECTION_DBUS_PATH=/org/freedesktop/NetworkManager/Connections/5 CONNECTION_ID=Random Connection -CONNECTION_FILENAME=/dispatcher/tests/dispatcher-vpn-up +CONNECTION_FILENAME=/src/nm-dispatcher/tests/dispatcher-vpn-up DEVICE_IFACE=wlan0 DEVICE_IP_IFACE=tun0 PROXY_PAC_URL=http://networkmanager.com/proxy.pac diff --git a/dispatcher/tests/meson.build b/src/nm-dispatcher/tests/meson.build similarity index 53% rename from dispatcher/tests/meson.build rename to src/nm-dispatcher/tests/meson.build index 29ef65788..ea60c7a2b 100644 --- a/dispatcher/tests/meson.build +++ b/src/nm-dispatcher/tests/meson.build @@ -4,19 +4,23 @@ exe = executable( 'test-dispatcher-envp', [ 'test-dispatcher-envp.c', - nmdbus_dispatcher_sources, + dispatcher_nmdbus_dispatcher_sources, ], - include_directories: dispatcher_inc, dependencies: [ - libnm_nm_default_dep, - libnm_glib_aux_dep_link, + libnm_dep, + glib_dep, ], c_args: introspection_extra_cflags, - link_with: libnm_dispatcher_core, + link_with: [ + libnm_dispatcher_core, + libnm_glib_aux, + libnm_std_aux, + libc_siphash, + ], ) test( - 'dispatcher/test-dispatcher-envp', + 'src/nm-ddispatcher/test/test-dispatcher-envp', test_script, args: test_args + [exe.full_path()], ) diff --git a/dispatcher/tests/test-dispatcher-envp.c b/src/nm-dispatcher/tests/test-dispatcher-envp.c similarity index 98% rename from dispatcher/tests/test-dispatcher-envp.c rename to src/nm-dispatcher/tests/test-dispatcher-envp.c index a25e92174..297cfbbdc 100644 --- a/dispatcher/tests/test-dispatcher-envp.c +++ b/src/nm-dispatcher/tests/test-dispatcher-envp.c @@ -8,14 +8,14 @@ #include #include -#include "nm-dispatcher-utils.h" +#include "nm-dispatcher/nm-dispatcher-utils.h" #include "libnm-core-aux-extern/nm-dispatcher-api.h" #include "libnm-glib-aux/nm-test-utils.h" -#include "nmdbus-dispatcher.h" +#include "nm-dispatcher/nmdbus-dispatcher.h" -#define TEST_DIR NM_BUILD_SRCDIR "/dispatcher/tests" +#define TEST_DIR NM_BUILD_SRCDIR "/src/nm-dispatcher/tests" /*****************************************************************************/ @@ -52,6 +52,7 @@ parse_main(GKeyFile * kf, gs_free char * id = NULL; gs_unref_object NMConnection *connection = NULL; NMSettingConnection * s_con; + const char * s; *out_expected_iface = g_key_file_get_string(kf, "main", "expected-iface", NULL); @@ -84,7 +85,14 @@ parse_main(GKeyFile * kf, g_variant_new_object_path("/org/freedesktop/NetworkManager/Connections/5")); /* Strip out the non-fixed portion of the filename */ - filename = strstr(filename, "/dispatcher"); + s = filename; + filename = NULL; + while ((s = strstr(s, "/src/nm-dispatcher"))) { + filename = s; + s += 1; + } + g_assert(filename); + g_assert(g_str_has_prefix(filename, "/src/nm-dispatcher")); g_variant_builder_add(&props, "{sv}", "filename", g_variant_new_string(filename)); if (g_key_file_get_boolean(kf, "main", "external", NULL)) {