build: merge branch 'th/build-meson-cleanup'

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/763
This commit is contained in:
Thomas Haller
2021-03-01 12:07:06 +01:00
58 changed files with 423 additions and 396 deletions

15
.gitignore vendored
View File

@@ -62,11 +62,11 @@ test-*.trs
/contrib/fedora/rpm/latest0 /contrib/fedora/rpm/latest0
/contrib/fedora/rpm/latest /contrib/fedora/rpm/latest
/dispatcher/nm-avahi-autoipd.action /src/nm-dispatcher/nm-avahi-autoipd.action
/dispatcher/nm-dispatcher /src/nm-dispatcher/nm-dispatcher
/dispatcher/nmdbus-dispatcher.* /src/nm-dispatcher/nmdbus-dispatcher.*
/dispatcher/org.freedesktop.nm_dispatcher.service /src/nm-dispatcher/org.freedesktop.nm_dispatcher.service
/dispatcher/tests/test-dispatcher-envp /src/nm-dispatcher/tests/test-dispatcher-envp
/clients/cli/nmcli /clients/cli/nmcli
/clients/cloud-setup/nm-cloud-setup /clients/cloud-setup/nm-cloud-setup
@@ -286,6 +286,11 @@ test-*.trs
/clients/cli/settings-docs.c /clients/cli/settings-docs.c
/clients/common/settings-docs.c /clients/common/settings-docs.c
/clients/common/tests/test-general /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/*.stamp
/docs/libnm-glib/html/ /docs/libnm-glib/html/
/docs/libnm-glib/libnm-glib-*.txt /docs/libnm-glib/libnm-glib-*.txt

View File

@@ -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.h.stamp: src/libnm-core-public/.dirstamp
src/libnm-core-public/nm-core-enum-types.c.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) $(src_nm_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_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_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_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) $(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_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' 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) $(src_nm_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_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_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) $(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 src/core/tests/meson.build
############################################################################### ###############################################################################
# dispatcher # src/nm-dispatcher
############################################################################### ###############################################################################
dispatcher_nmdbus_dispatcher_sources = \ dispatcher_nmdbus_dispatcher_sources = \
dispatcher/nmdbus-dispatcher.h \ src/nm-dispatcher/nmdbus-dispatcher.h \
dispatcher/nmdbus-dispatcher.c \ src/nm-dispatcher/nmdbus-dispatcher.c \
$(NULL) $(NULL)
dispatcher/nmdbus-dispatcher.h: dispatcher/nm-dispatcher.xml src/nm-dispatcher/nmdbus-dispatcher.h: src/nm-dispatcher/nm-dispatcher.xml
@$(MKDIR_P) dispatcher/ @$(MKDIR_P) src/nm-dispatcher/
$(AM_V_GEN) gdbus-codegen \ $(AM_V_GEN) gdbus-codegen \
--generate-c-code $(basename $@) \ --generate-c-code $(basename $@) \
--c-namespace NMDBus \ --c-namespace NMDBus \
--interface-prefix org.freedesktop \ --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) CLEANFILES += $(dispatcher_nmdbus_dispatcher_sources)
############################################################################### ###############################################################################
libexec_PROGRAMS += dispatcher/nm-dispatcher libexec_PROGRAMS += src/nm-dispatcher/nm-dispatcher
noinst_LTLIBRARIES += \ noinst_LTLIBRARIES += src/nm-dispatcher/libnm-dispatcher-core.la
dispatcher/libnm-dispatcher-core.la
dispatcher_cppflags = \ dispatcher_cppflags = \
$(dflt_cppflags) \ $(dflt_cppflags) \
-I$(builddir)/dispatcher \
-I$(srcdir)/dispatcher \
-I$(builddir)/src/libnm-core-public \ -I$(builddir)/src/libnm-core-public \
-I$(srcdir)/src/libnm-core-public \ -I$(srcdir)/src/libnm-core-public \
-I$(builddir)/src/libnm-client-public \ -I$(builddir)/src/libnm-client-public \
-I$(srcdir)/src/libnm-client-public \ -I$(srcdir)/src/libnm-client-public \
-I$(srcdir)/src \ -I$(srcdir)/src \
-I$(builddir)/src \
$(GLIB_CFLAGS) \ $(GLIB_CFLAGS) \
$(NULL) $(NULL)
dispatcher_libnm_dispatcher_core_la_SOURCES = \ src_nm_dispatcher_libnm_dispatcher_core_la_SOURCES = \
dispatcher/nm-dispatcher-utils.c \ src/nm-dispatcher/nm-dispatcher-utils.c \
dispatcher/nm-dispatcher-utils.h \ src/nm-dispatcher/nm-dispatcher-utils.h \
$(NULL) $(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 \ src/libnm-client-impl/libnm.la \
$(GLIB_LIBS) $(GLIB_LIBS)
dispatcher_nm_dispatcher_SOURCES = \ src_nm_dispatcher_nm_dispatcher_SOURCES = \
dispatcher/nm-dispatcher.c \ src/nm-dispatcher/nm-dispatcher.c \
$(NULL) $(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" \ -Wl,--version-script="$(srcdir)/linker-script-binary.ver" \
$(SANITIZER_EXEC_LDFLAGS) \ $(SANITIZER_EXEC_LDFLAGS) \
$(NULL) $(NULL)
dispatcher_nm_dispatcher_LDADD = \ src_nm_dispatcher_nm_dispatcher_LDADD = \
dispatcher/libnm-dispatcher-core.la \ src/nm-dispatcher/libnm-dispatcher-core.la \
src/libnm-client-impl/libnm.la \ src/libnm-client-impl/libnm.la \
src/libnm-glib-aux/libnm-glib-aux.la \ src/libnm-glib-aux/libnm-glib-aux.la \
src/libnm-std-aux/libnm-std-aux.la \ src/libnm-std-aux/libnm-std-aux.la \
src/c-siphash/libc-siphash.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 \ @sed \
-e 's|@sbindir[@]|$(sbindir)|g' \ -e 's|@sbindir[@]|$(sbindir)|g' \
-e 's|@sysconfdir[@]|$(sysconfdir)|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' \ -e 's|@libexecdir[@]|$(libexecdir)|g' \
$< >$@ $< >$@
dbusactivation_DATA += dispatcher/org.freedesktop.nm_dispatcher.service dbusactivation_DATA += src/nm-dispatcher/org.freedesktop.nm_dispatcher.service
CLEANFILES += dispatcher/org.freedesktop.nm_dispatcher.service CLEANFILES += src/nm-dispatcher/org.freedesktop.nm_dispatcher.service
install-data-hook-dispatcher: install-data-hook-dispatcher:
$(mkinstalldirs) -m 0755 $(DESTDIR)$(nmconfdir)/dispatcher.d $(mkinstalldirs) -m 0755 $(DESTDIR)$(nmconfdir)/dispatcher.d
@@ -4475,51 +4474,50 @@ install-data-hook-dispatcher:
install_data_hook += install-data-hook-dispatcher install_data_hook += install-data-hook-dispatcher
dbusservice_DATA += src/nm-dispatcher/nm-dispatcher.conf
dbusservice_DATA += dispatcher/nm-dispatcher.conf
EXTRA_DIST += \ EXTRA_DIST += \
dispatcher/nm-dispatcher.conf \ src/nm-dispatcher/nm-dispatcher.conf \
dispatcher/org.freedesktop.nm_dispatcher.service.in \ src/nm-dispatcher/org.freedesktop.nm_dispatcher.service.in \
dispatcher/nm-dispatcher.xml \ src/nm-dispatcher/nm-dispatcher.xml \
dispatcher/meson.build 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) \ $(dflt_cppflags) \
-I$(srcdir)/dispatcher \
-I$(builddir)/dispatcher \
-I$(builddir)/src/libnm-core-public \ -I$(builddir)/src/libnm-core-public \
-I$(srcdir)/src/libnm-core-public \ -I$(srcdir)/src/libnm-core-public \
-I$(srcdir)/src/libnm-client-public \ -I$(srcdir)/src/libnm-client-public \
-I$(builddir)/src/libnm-client-public \ -I$(builddir)/src/libnm-client-public \
-I$(srcdir)/src \ -I$(srcdir)/src \
-I$(builddir)/src \
$(GLIB_CFLAGS) \ $(GLIB_CFLAGS) \
$(SANITIZER_EXEC_CFLAGS) \ $(SANITIZER_EXEC_CFLAGS) \
$(INTROSPECTION_EXTRA_CFLAGS) \ $(INTROSPECTION_EXTRA_CFLAGS) \
$(NULL) $(NULL)
dispatcher_tests_test_dispatcher_envp_SOURCES = \ src_nm_dispatcher_tests_test_dispatcher_envp_SOURCES = \
dispatcher/tests/test-dispatcher-envp.c \ src/nm-dispatcher/tests/test-dispatcher-envp.c \
$(NULL) $(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) $(src_nm_dispatcher_tests_test_dispatcher_envp_OBJECTS): $(dispatcher_nmdbus_dispatcher_sources)
$(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)
$(dispatcher_tests_test_dispatcher_envp_OBJECTS): $(src_libnm_client_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) \ $(SANITIZER_EXEC_LDFLAGS) \
$(NULL) $(NULL)
dispatcher_tests_test_dispatcher_envp_LDADD = \ src_nm_dispatcher_tests_test_dispatcher_envp_LDADD = \
dispatcher/libnm-dispatcher-core.la \ src/nm-dispatcher/libnm-dispatcher-core.la \
src/libnm-glib-aux/libnm-glib-aux.la \ src/libnm-glib-aux/libnm-glib-aux.la \
src/libnm-std-aux/libnm-std-aux.la \ src/libnm-std-aux/libnm-std-aux.la \
src/c-siphash/libc-siphash.la \ src/c-siphash/libc-siphash.la \
@@ -4527,17 +4525,17 @@ dispatcher_tests_test_dispatcher_envp_LDADD = \
$(GLIB_LIBS) \ $(GLIB_LIBS) \
$(NULL) $(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 += \ EXTRA_DIST += \
dispatcher/tests/dispatcher-connectivity-full \ src/nm-dispatcher/tests/dispatcher-connectivity-full \
dispatcher/tests/dispatcher-connectivity-unknown \ src/nm-dispatcher/tests/dispatcher-connectivity-unknown \
dispatcher/tests/dispatcher-down \ src/nm-dispatcher/tests/dispatcher-down \
dispatcher/tests/dispatcher-external \ src/nm-dispatcher/tests/dispatcher-external \
dispatcher/tests/dispatcher-up \ src/nm-dispatcher/tests/dispatcher-up \
dispatcher/tests/dispatcher-vpn-down \ src/nm-dispatcher/tests/dispatcher-vpn-down \
dispatcher/tests/dispatcher-vpn-up \ src/nm-dispatcher/tests/dispatcher-vpn-up \
dispatcher/tests/meson.build \ src/nm-dispatcher/tests/meson.build \
$(NULL) $(NULL)
############################################################################### ###############################################################################

View File

@@ -24,13 +24,19 @@ executable(
dependencies: [ dependencies: [
libnmc_base_dep, libnmc_base_dep,
libnmc_dep, libnmc_dep,
libnm_client_aux_extern_dep, libnm_dep,
libnm_core_aux_extern_dep_link, glib_dep,
libnm_core_aux_intern_dep_link,
libnm_base_dep_link,
libnm_glib_aux_dep_link,
readline_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_args: ldflags_linker_script_binary,
link_depends: linker_script_binary, link_depends: linker_script_binary,
install: true, install: true,
@@ -46,11 +52,16 @@ generate_docs_nm_settings_nmcli = executable(
dependencies: [ dependencies: [
libnmc_base_dep, libnmc_base_dep,
libnmc_dep, libnmc_dep,
libnm_client_aux_extern_dep, libnm_dep,
libnm_core_aux_extern_dep_link, glib_dep,
libnm_core_aux_intern_dep_link, ],
libnm_base_dep_link, link_with: [
libnm_glib_aux_dep_link, 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_args: ldflags_linker_script_binary,
link_depends: linker_script_binary, link_depends: linker_script_binary,

View File

@@ -34,8 +34,8 @@ libnm_cloud_setup_core = static_library(
dependencies: [ dependencies: [
libnmc_base_dep, libnmc_base_dep,
libnmc_dep, libnmc_dep,
libnm_dep,
libcurl_dep, libcurl_dep,
libnm_client_aux_extern_dep,
], ],
) )
@@ -53,12 +53,18 @@ executable(
libnm_cloud_setup_core_dep, libnm_cloud_setup_core_dep,
libnmc_base_dep, libnmc_base_dep,
libnmc_dep, libnmc_dep,
libnm_core_aux_intern_dep_link,
libnm_core_aux_extern_dep_link,
libnm_glib_aux_dep_link,
libcurl_dep, 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_args: ldflags_linker_script_binary,
link_depends: linker_script_binary, link_depends: linker_script_binary,
install: true, install: true,

View File

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

View File

@@ -12,7 +12,6 @@ libnmc_base = static_library(
), ),
dependencies: [ dependencies: [
libnm_dep, libnm_dep,
libnm_nm_default_dep,
], ],
) )
@@ -20,7 +19,6 @@ libnmc_base_dep = declare_dependency(
include_directories: common_inc, include_directories: common_inc,
dependencies: [ dependencies: [
libnm_dep, libnm_dep,
libnm_nm_default_dep,
], ],
link_with: libnmc_base, link_with: libnmc_base,
) )
@@ -72,8 +70,6 @@ libnmc = static_library(
), ),
dependencies: [ dependencies: [
libnm_dep, libnm_dep,
libnm_nm_default_dep,
libnm_core_aux_extern_dep,
], ],
link_depends: settings_docs_source, link_depends: settings_docs_source,
) )
@@ -82,7 +78,6 @@ libnmc_dep = declare_dependency(
include_directories: common_inc, include_directories: common_inc,
dependencies: [ dependencies: [
libnm_dep, libnm_dep,
libnm_nm_default_dep,
], ],
link_with: libnmc, link_with: libnmc,
) )

View File

@@ -6,10 +6,15 @@ exe = executable(
dependencies: [ dependencies: [
libnmc_base_dep, libnmc_base_dep,
libnmc_dep, libnmc_dep,
libnm_core_aux_intern_dep_link, glib_dep,
libnm_core_aux_extern_dep_link, ],
libnm_glib_aux_dep_link, link_with: [
libnm_base_dep_link, 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', 'test-libnm-core-aux.c',
dependencies: [ dependencies: [
libnm_dep, libnm_dep,
libnm_core_aux_extern_dep_link, glib_dep,
libnm_nm_default_dep, ],
libnm_glib_aux_dep_link, link_with: [
libnm_core_aux_extern,
libnm_log_null,
libnm_glib_aux,
libnm_std_aux,
libc_siphash,
], ],
link_with: libnm_log_null,
) )
test( test(

View File

@@ -5,9 +5,13 @@ executable(
'nm-online' + '.c', 'nm-online' + '.c',
dependencies: [ dependencies: [
libnm_dep, libnm_dep,
libnm_nm_default_dep, glib_dep,
libnm_client_aux_extern_dep, ],
libnm_glib_aux_dep_link, link_with: [
libnm_client_aux_extern,
libnm_glib_aux,
libnm_std_aux,
libc_siphash,
], ],
link_args: ldflags_linker_script_binary, link_args: ldflags_linker_script_binary,
link_depends: linker_script_binary, link_depends: linker_script_binary,

View File

@@ -50,13 +50,19 @@ executable(
libnmc_base_dep, libnmc_base_dep,
libnmc_dep, libnmc_dep,
libnmt_newt_dep, libnmt_newt_dep,
libnm_client_aux_extern_dep, libnm_dep,
libnm_core_aux_extern_dep_link, glib_dep,
libnm_core_aux_intern_dep_link, ],
libnm_base_dep_link, link_with: [
libnm_glib_aux_dep_link, 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_args: ldflags_linker_script_binary,
link_depends: linker_script_binary, link_depends: linker_script_binary,
install: true, install: true,

View File

@@ -24,9 +24,14 @@ libnmt_newt = static_library(
'nmt-newt-utils.c', 'nmt-newt-utils.c',
'nmt-newt-widget.c', 'nmt-newt-widget.c',
), ),
include_directories: [
src_inc,
top_inc,
],
dependencies: [ dependencies: [
libnm_nm_default_dep, libnm_dep,
newt_dep, newt_dep,
glib_dep,
], ],
) )

View File

@@ -1,20 +1,22 @@
# SPDX-License-Identifier: LGPL-2.1-or-later # SPDX-License-Identifier: LGPL-2.1-or-later
examples = [ examples = [
['add-connection-gdbus', [libnm_client_public_enum_sources[1]], [uuid_dep]], ['add-connection-gdbus', [uuid_dep]],
['add-connection-libnm', [], [libnm_dep]], ['add-connection-libnm', []],
['get-active-connections-gdbus', [libnm_client_public_enum_sources[1]], []], ['get-active-connections-gdbus', []],
['get-ap-info-libnm', [], [libnm_dep]], ['get-ap-info-libnm', []],
['list-connections-gdbus', [], []], ['list-connections-gdbus', []],
['list-connections-libnm', [], [libnm_dep]], ['list-connections-libnm', []],
['monitor-nm-running-gdbus', [], []], ['monitor-nm-running-gdbus', []],
['monitor-nm-state-gdbus', [], []], ['monitor-nm-state-gdbus', []],
] ]
foreach example: examples foreach example: examples
executable( executable(
example[0], example[0],
[example[0] + '.c'] + example[1], [example[0] + '.c'],
dependencies: [libnm_nm_default_dep] + example[2], dependencies: [
libnm_dep,
] + example[1],
) )
endforeach endforeach

View File

@@ -57,8 +57,6 @@ sources = []
introspection_files = [] introspection_files = []
headers = [] headers = []
# FIXME?: DBUS_INTERFACE_DOCS/docbook files are generated in
# "meson.current_build_dir()" instead of "meson.source_root()/docs/api"
foreach iface: ifaces foreach iface: ifaces
iface_xml = iface + '.xml' iface_xml = iface + '.xml'
ifaces_xmls += files(iface_xml) ifaces_xmls += files(iface_xml)
@@ -99,12 +97,12 @@ libnmdbus = static_library(
'nmdbus', 'nmdbus',
sources: sources, sources: sources,
include_directories: top_inc, include_directories: top_inc,
dependencies: glib_dep,
c_args: introspection_extra_cflags, c_args: introspection_extra_cflags,
dependencies: glib_dep,
) )
libnmdbus_dep = declare_dependency( libnmdbus_dep = declare_dependency(
sources: headers, sources: headers,
include_directories: include_directories('.'), include_directories: top_inc,
link_with: libnmdbus, dependencies: glib_dep,
) )

View File

@@ -920,7 +920,6 @@ content_files = []
subdir('introspection') subdir('introspection')
subdir('src') subdir('src')
subdir('dispatcher')
subdir('clients') subdir('clients')
subdir('data') subdir('data')
subdir('po') subdir('po')

View File

@@ -5,7 +5,7 @@ static_library(
'nm-vpn-plugin-utils-test', 'nm-vpn-plugin-utils-test',
sources: nm_vpn_plugin_utils_source, sources: nm_vpn_plugin_utils_source,
dependencies: [ dependencies: [
libnm_client_public_dep, libnm_dep,
glib_dep, glib_dep,
], ],
) )

View File

@@ -9,7 +9,6 @@ libnm_device_plugin_bluetooth_static = static_library(
) + (enable_bluez5_dun ? files('nm-bluez5-dun.c') : files()), ) + (enable_bluez5_dun ? files('nm-bluez5-dun.c') : files()),
dependencies: [ dependencies: [
libnm_core_public_dep, libnm_core_public_dep,
libnm_core_intern_dep,
core_default_dep, core_default_dep,
libnm_wwan_dep, libnm_wwan_dep,
bluez5_dep, bluez5_dep,

View File

@@ -17,8 +17,17 @@ executable(
link_with: [ link_with: [
libNetworkManagerBase, libNetworkManagerBase,
libnmi_core, libnmi_core,
libnm_core_aux_intern,
libnm_core_impl, libnm_core_impl,
libnm_crypto,
libnm_platform,
libnm_base, 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_args: ldflags_linker_script_binary,
link_depends: linker_script_binary, link_depends: linker_script_binary,

View File

@@ -9,7 +9,6 @@ core_plugin_dep = declare_dependency(
libnm_core_public_inc, libnm_core_public_inc,
], ],
dependencies: [ dependencies: [
libnm_core_intern_dep,
libnm_core_public_dep, libnm_core_public_dep,
glib_dep, glib_dep,
], ],
@@ -23,9 +22,6 @@ core_default_dep = declare_dependency(
], ],
dependencies: [ dependencies: [
libnm_core_public_dep, 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, ) + platform_wifi_wext_source,
dependencies: [ dependencies: [
core_default_dep, core_default_dep,
libn_dhcp4_dep, libnm_core_public_dep,
libnm_core_impl_dep,
libnm_systemd_shared_dep,
libnm_udev_aux_dep,
libsystemd_dep, libsystemd_dep,
libudev_dep, libudev_dep,
], ],
@@ -87,10 +80,8 @@ libNetworkManagerBase = static_library(
nm_deps = [ nm_deps = [
libnm_core_public_dep, libnm_core_public_dep,
libnm_core_impl_dep,
core_default_dep, core_default_dep,
dl_dep, dl_dep,
libn_acd_dep,
libndp_dep, libndp_dep,
libudev_dep, libudev_dep,
logind_dep, logind_dep,
@@ -207,19 +198,28 @@ executable(
'nm-iface-helper.c', 'nm-iface-helper.c',
dependencies: [ dependencies: [
core_default_dep, core_default_dep,
dl_dep, glib_dep,
libndp_dep,
libudev_dep, libudev_dep,
libn_acd_dep, libndp_dep,
libnm_glib_aux_dep_link, dl_dep,
libnm_core_impl_dep_link,
], ],
link_with: [ link_with: [
libNetworkManagerBase, libNetworkManagerBase,
libnm_core_aux_intern,
libnm_core_impl,
libnm_crypto,
libnm_systemd_core, libnm_systemd_core,
libnm_platform,
libnm_systemd_shared, libnm_systemd_shared,
libnm_base, libnm_base,
libnm_udev_aux,
libnm_log_core,
libnm_glib_aux, libnm_glib_aux,
libnm_std_aux,
libn_acd,
libn_dhcp4,
libc_rbtree,
libc_siphash,
], ],
link_args: ldflags_linker_script_binary, link_args: ldflags_linker_script_binary,
link_depends: linker_script_binary, link_depends: linker_script_binary,
@@ -249,8 +249,20 @@ if enable_tests
dependencies: core_default_dep, dependencies: core_default_dep,
link_with: [ link_with: [
libNetworkManagerTest, libNetworkManagerTest,
libnm_base, libnm_core_aux_intern,
libnm_core_impl, 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 = executable(
'NetworkManager-all-sym', 'NetworkManager-all-sym',
'main.c', 'main.c',
dependencies: nm_deps, dependencies: [
nm_deps,
libudev_dep,
],
link_args: '-Wl,--no-gc-sections', link_args: '-Wl,--no-gc-sections',
link_whole: [ link_whole: [
libNetworkManager, libNetworkManager,
libNetworkManagerBase, libNetworkManagerBase,
libnm_core_aux_intern,
libnm_core_impl, libnm_core_impl,
libnm_crypto,
libnm_platform,
libnm_base, 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 = executable(
'NetworkManager', 'NetworkManager',
'main.c', 'main.c',
dependencies: nm_deps, dependencies: [
nm_deps,
libudev_dep,
],
link_with: [ link_with: [
libNetworkManager, libNetworkManager,
libNetworkManagerBase, libNetworkManagerBase,
libnm_core_aux_intern,
libnm_core_impl, libnm_core_impl,
libnm_crypto,
libnm_platform,
libnm_base, libnm_base,
libnm_udev_aux,
libnm_log_core,
libnm_glib_aux,
libnm_std_aux,
libn_acd,
libn_dhcp4,
libc_rbtree,
libc_siphash,
], ],
link_args: [ link_args: [
'-rdynamic', '-rdynamic',

View File

@@ -4,11 +4,20 @@ nm_pppd_plugin = shared_module(
'nm-pppd-plugin', 'nm-pppd-plugin',
name_prefix: '', name_prefix: '',
sources: 'nm-pppd-plugin.c', sources: 'nm-pppd-plugin.c',
include_directories: [
src_inc,
top_inc,
],
dependencies: [ dependencies: [
libnm_core_impl_dep_link, libnm_core_public_dep,
libnm_glib_aux_dep_link,
glib_dep, glib_dep,
], ],
link_with: [
libnm_core_impl,
libnm_glib_aux,
libnm_std_aux,
libc_siphash,
],
install: true, install: true,
install_dir: pppd_plugin_dir, install_dir: pppd_plugin_dir,
) )

View File

@@ -43,11 +43,10 @@ libnm_systemd_core = static_library(
src_core_inc, src_core_inc,
], ],
dependencies: [ dependencies: [
libnm_core_impl_dep, libnm_core_public_dep,
libnm_systemd_shared_dep, libnm_systemd_shared_dep_inc,
glib_dep, glib_dep,
], ],
link_with: libc_siphash,
) )
libnm_systemd_core_dep = declare_dependency( libnm_systemd_core_dep = declare_dependency(
@@ -56,8 +55,10 @@ libnm_systemd_core_dep = declare_dependency(
], ],
dependencies: [ dependencies: [
glib_dep, 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,
],
) )

View File

@@ -38,8 +38,12 @@ exe = executable(
src_core_inc, src_core_inc,
], ],
dependencies: [ dependencies: [
libnm_core_public_dep,
libnm_systemd_core_dep, libnm_systemd_core_dep,
libnm_systemd_shared_dep, ],
link_with: [
libnm_systemd_shared,
libc_siphash,
], ],
) )

View File

@@ -2,21 +2,12 @@
libnm_base = static_library( libnm_base = static_library(
'nm-base', 'nm-base',
sources: files(
'nm-ethtool-base.c',
),
include_directories: [ include_directories: [
src_inc, src_inc,
top_inc, top_inc,
], ],
sources: files( dependencies: glib_dep,
'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,
) )

View File

@@ -6,11 +6,6 @@ libnm_client_aux_extern = static_library(
'nm-libnm-aux.c', 'nm-libnm-aux.c',
), ),
dependencies: [ dependencies: [
libnm_core_aux_intern_dep,
libnm_dep, libnm_dep,
], ],
) )
libnm_client_aux_extern_dep = declare_dependency(
link_with: [libnm_client_aux_extern],
)

View File

@@ -1,17 +1,5 @@
# SPDX-License-Identifier: LGPL-2.1-or-later # 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( libnm_client_impl_sources = files(
'nm-access-point.c', 'nm-access-point.c',
'nm-active-connection.c', 'nm-active-connection.c',
@@ -72,12 +60,11 @@ libnm_client_impl = static_library(
sources: libnm_client_impl_sources + libnm_client_public_enum_sources, sources: libnm_client_impl_sources + libnm_client_public_enum_sources,
dependencies: [ dependencies: [
libnmdbus_dep, libnmdbus_dep,
libnm_core_aux_intern_dep, libnm_core_public_dep,
libnm_nm_default_dep, libnm_client_public_dep,
libnm_udev_aux_dep,
libudev_dep, libudev_dep,
glib_dep,
], ],
link_with: libnm_log_null,
) )
linker_script = join_paths(meson.current_source_dir(), 'libnm.ver') 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( libnm = shared_library(
'nm', 'nm',
version: libnm_version, version: libnm_version,
dependencies: libnm_nm_default_dep, dependencies: [
libnm_core_public_dep,
libnm_client_public_dep,
libudev_dep,
glib_dep,
],
link_whole: [ link_whole: [
libnm_client_impl, libnm_client_impl,
libnm_core_aux_intern,
libnm_core_impl, libnm_core_impl,
libnmdbus, libnm_crypto,
libnm_base,
libnm_udev_aux,
libnm_systemd_shared,
libnm_log_null, libnm_log_null,
libnm_glib_aux, libnm_glib_aux,
libnm_base, libnm_std_aux,
libnmdbus,
libc_siphash,
], ],
link_args: '-Wl,--version-script,@0@'.format(linker_script), link_args: '-Wl,--version-script,@0@'.format(linker_script),
link_depends: linker_script, link_depends: linker_script,
@@ -100,8 +98,11 @@ libnm = shared_library(
) )
libnm_dep = declare_dependency( libnm_dep = declare_dependency(
sources: libnm_client_public_enum_sources[1], dependencies: [
include_directories: libnm_client_public_inc, libnm_core_public_dep,
libnm_client_public_dep,
glib_dep,
],
link_with: libnm, link_with: libnm,
) )
@@ -135,6 +136,9 @@ if enable_introspection
includes: 'Gio-2.0', includes: 'Gio-2.0',
include_directories: [ include_directories: [
libnm_core_public_inc, libnm_core_public_inc,
libnm_client_public_inc,
src_inc,
top_inc,
], ],
nsversion: nm_gir_version, nsversion: nm_gir_version,
namespace: 'NM', namespace: 'NM',
@@ -207,18 +211,14 @@ if enable_introspection
endif endif
ld_library_path = meson.current_build_dir() + ld_library_path 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_xml_gir = custom_target(
'nm-settings-docs-gir.xml', 'nm-settings-docs-gir.xml',
input: libnm_gir[0], input: libnm_gir[0],
output: 'nm-settings-docs-gir.xml', output: 'nm-settings-docs-gir.xml',
command: [ command: [
generate_setting_docs_env, 'env',
'GI_TYPELIB_PATH=' + gi_typelib_path,
'LD_LIBRARY_PATH=' + ld_library_path,
python.path(), python.path(),
join_paths(meson.source_root(), 'tools', 'generate-docs-nm-settings-docs-gir.py'), join_paths(meson.source_root(), 'tools', 'generate-docs-nm-settings-docs-gir.py'),
'--lib-path', meson.current_build_dir(), '--lib-path', meson.current_build_dir(),

View File

@@ -15,18 +15,30 @@ foreach test_unit: test_units
libnm_client_public_inc, libnm_client_public_inc,
], ],
dependencies: [ dependencies: [
libnm_core_impl_dep_link, libnm_core_public_dep,
libnm_nm_default_dep, libnm_client_public_dep,
glib_dep,
libudev_dep,
], ],
link_with: [ link_with: [
libnm_client_impl, libnm_client_impl,
libnm_client_test, libnm_client_test,
libnm_core_aux_intern,
libnm_core_impl,
libnm_crypto,
libnm_base, libnm_base,
libnm_udev_aux,
libnm_systemd_shared,
libnm_log_null,
libnm_glib_aux,
libnm_std_aux,
libc_siphash,
libnmdbus,
], ],
) )
test( test(
test_unit, 'src/libnm-client-impl/tests/' + test_unit,
test_script, test_script,
timeout: 90, timeout: 90,
args: test_args + [exe.full_path()], args: test_args + [exe.full_path()],

View File

@@ -56,7 +56,7 @@ libnm_client_headers = files(
libnm_client_public_enum_sources = gnome.mkenums( libnm_client_public_enum_sources = gnome.mkenums(
'nm-enum-types', 'nm-enum-types',
sources: libnm_client_headers + [nm_version_macro_header], sources: libnm_client_headers,
identifier_prefix: nm_id_prefix, identifier_prefix: nm_id_prefix,
c_template: 'nm-enum-types.c.template', c_template: 'nm-enum-types.c.template',
h_template: 'nm-enum-types.h.template', h_template: 'nm-enum-types.h.template',

View File

@@ -12,9 +12,7 @@ libnm_client_test = static_library(
top_inc, top_inc,
], ],
dependencies: [ dependencies: [
libnm_core_aux_intern_dep,
libnm_core_public_dep, libnm_core_public_dep,
libnm_glib_aux_dep,
glib_dep, glib_dep,
], ],
) )

View File

@@ -6,26 +6,7 @@ libnm_core_aux_extern = static_library(
'nm-libnm-core-aux.c', 'nm-libnm-core-aux.c',
), ),
dependencies: [ dependencies: [
libnm_core_aux_intern_dep,
libnm_core_public_dep, libnm_core_public_dep,
libnm_glib_aux_dep,
glib_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,
)

View File

@@ -8,23 +8,6 @@ libnm_core_aux_intern = static_library(
), ),
dependencies: [ dependencies: [
libnm_core_public_dep, libnm_core_public_dep,
libnm_glib_aux_dep,
glib_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,
)

View File

@@ -7,7 +7,6 @@ libnm_crypto_nss = static_library(
sources: 'nm-crypto-nss.c', sources: 'nm-crypto-nss.c',
dependencies: [ dependencies: [
libnm_core_public_dep, libnm_core_public_dep,
libnm_glib_aux_dep_link,
crypto_nss_dep, crypto_nss_dep,
], ],
) )
@@ -17,7 +16,6 @@ libnm_crypto_gnutls = static_library(
sources: 'nm-crypto-gnutls.c', sources: 'nm-crypto-gnutls.c',
dependencies: [ dependencies: [
libnm_core_public_dep, libnm_core_public_dep,
libnm_glib_aux_dep_link,
crypto_gnutls_dep, crypto_gnutls_dep,
], ],
) )
@@ -111,28 +109,7 @@ libnm_core_impl = static_library(
], ],
dependencies: [ dependencies: [
dl_dep, dl_dep,
libnm_systemd_shared_dep,
libnm_core_public_dep, libnm_core_public_dep,
libnm_core_intern_dep,
libnm_glib_aux_dep_link,
uuid_dep, 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,
) )

View File

@@ -26,15 +26,22 @@ foreach test_unit: test_units
], ],
dependencies: [ dependencies: [
libnm_core_public_dep, 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( test(
'libnm-core/' + test_unit, 'src/libnm-core-impl/tests/' + test_unit,
test_script, test_script,
args: test_args + [exe.full_path()], args: test_args + [exe.full_path()],
timeout: default_test_timeout, timeout: default_test_timeout,

View File

@@ -1,10 +1,3 @@
# SPDX-License-Identifier: LGPL-2.1-or-later # SPDX-License-Identifier: LGPL-2.1-or-later
libnm_core_intern_inc = include_directories('.') libnm_core_intern_inc = include_directories('.')
libnm_core_intern_dep = declare_dependency(
dependencies: [
libnm_core_public_dep,
glib_dep,
],
)

View File

@@ -23,23 +23,4 @@ libnm_glib_aux = static_library(
top_inc, top_inc,
], ],
dependencies: glib_dep, 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

@@ -8,7 +8,7 @@
/*****************************************************************************/ /*****************************************************************************/
const LogLevelDesc level_desc[_LOGL_N] = { const LogLevelDesc nm_log_level_desc[_LOGL_N] = {
[LOGL_TRACE] = [LOGL_TRACE] =
{ {
"TRACE", "TRACE",
@@ -68,8 +68,8 @@ _nm_log_parse_level(const char *level, NMLogLevel *out_level)
if (!level) if (!level)
return FALSE; return FALSE;
for (i = 0; i < (int) G_N_ELEMENTS(level_desc); i++) { for (i = 0; i < (int) G_N_ELEMENTS(nm_log_level_desc); i++) {
if (!g_ascii_strcasecmp(level_desc[i].name, level)) { if (!g_ascii_strcasecmp(nm_log_level_desc[i].name, level)) {
NM_SET_OUT(out_level, i); NM_SET_OUT(out_level, i);
return TRUE; return TRUE;
} }

View File

@@ -21,7 +21,7 @@ typedef struct {
GLogLevelFlags g_log_level; GLogLevelFlags g_log_level;
} LogLevelDesc; } 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); gboolean _nm_log_parse_level(const char *level, NMLogLevel *out_level);

View File

@@ -3,12 +3,23 @@
exe = executable( exe = executable(
'test-shared-general', 'test-shared-general',
'test-shared-general.c', 'test-shared-general.c',
dependencies: libnm_glib_aux_dep_link, include_directories: [
link_with: libnm_log_null, src_inc,
top_inc,
],
dependencies: [
glib_dep,
],
link_with: [
libnm_log_null,
libnm_glib_aux,
libnm_std_aux,
libc_siphash,
],
) )
test( test(
'shared/nm-glib-aux/test-shared-general', 'src/libnm-glib-aux/tests/test-shared-general',
test_script, test_script,
args: test_args + [exe.full_path()], args: test_args + [exe.full_path()],
timeout: default_test_timeout, timeout: default_test_timeout,
@@ -19,15 +30,24 @@ if jansson_dep.found()
'test-json-aux', 'test-json-aux',
'test-json-aux.c', 'test-json-aux.c',
dependencies: [ dependencies: [
libnm_glib_aux_dep_link, glib_dep,
jansson_dep, jansson_dep,
dl_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( test(
'shared/nm-glib-aux/test-json-aux', 'src/libnm-glib-aux/tests/test-json-aux',
test_script, test_script,
args: test_args + [exe.full_path()], args: test_args + [exe.full_path()],
timeout: default_test_timeout, timeout: default_test_timeout,

View File

@@ -12,10 +12,3 @@ libnm_log_core = static_library(
glib_dep, glib_dep,
], ],
) )
libnm_log_core_dep = declare_dependency(
dependencies: [
libnm_glib_aux_dep_link,
],
link_with: libnm_log_core,
)

View File

@@ -416,7 +416,7 @@ nm_logging_level_to_string(void)
{ {
NM_ASSERT_ON_MAIN_THREAD(); 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 * const char *
@@ -428,10 +428,10 @@ nm_logging_all_levels_to_string(void)
int i; int i;
str = g_string_new(NULL); 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) if (str->len)
g_string_append_c(str, ','); 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. */ /* Check if it's logging at a lower level than the default. */
for (i = 0; i < log_level; i++) { for (i = 0; i < log_level; i++) {
if (diter->num & log_state[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; break;
} }
} }
@@ -488,7 +488,7 @@ _domains_to_string(gboolean include_level_override,
if (!(diter->num & log_state[log_level])) { if (!(diter->num & log_state[log_level])) {
for (i = log_level + 1; i < _LOGL_N_REAL; i++) { for (i = log_level + 1; i < _LOGL_N_REAL; i++) {
if (diter->num & log_state[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; break;
} }
} }
@@ -704,7 +704,7 @@ _nm_log_impl(const char *file,
#define MESSAGE_FMT "%s%-7s [%ld.%04ld] %s" #define MESSAGE_FMT "%s%-7s [%ld.%04ld] %s"
#define MESSAGE_ARG(prefix, tv, msg) \ #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); g_get_current_time(&tv);
@@ -729,7 +729,7 @@ _nm_log_impl(const char *file,
now = nm_utils_get_monotonic_timestamp_nsec(); now = nm_utils_get_monotonic_timestamp_nsec();
boottime = nm_utils_monotonic_timestamp_as_boottime(now, 1); 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++, _iovec_set_format(iov++,
iov_free++, iov_free++,
"MESSAGE=" MESSAGE_FMT, "MESSAGE=" MESSAGE_FMT,
@@ -755,7 +755,7 @@ _nm_log_impl(const char *file,
G_STATIC_ASSERT_EXPR(LOG_FAC(LOG_DAEMON) == 3); G_STATIC_ASSERT_EXPR(LOG_FAC(LOG_DAEMON) == 3);
_iovec_set_string_literal(iov++, "SYSLOG_FACILITY=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) if (func)
_iovec_set_format(iov++, iov_free++, "CODE_FUNC=%s", func); _iovec_set_format(iov++, iov_free++, "CODE_FUNC=%s", func);
_iovec_set_format(iov++, iov_free++, "CODE_FILE=%s", file ?: ""); _iovec_set_format(iov++, iov_free++, "CODE_FILE=%s", file ?: "");
@@ -787,11 +787,11 @@ _nm_log_impl(const char *file,
} break; } break;
#endif #endif
case LOG_BACKEND_SYSLOG: 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; break;
default: default:
g_log(syslog_identifier_domain(g->syslog_identifier), 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_FMT,
MESSAGE_ARG(g->prefix, tv, msg)); MESSAGE_ARG(g->prefix, tv, msg));
break; break;

View File

@@ -2,26 +2,17 @@
libnm_platform = static_library( libnm_platform = static_library(
'nm-platform', 'nm-platform',
include_directories: [
src_inc,
top_inc,
],
sources: [ sources: [
'nm-netlink.c', 'nm-netlink.c',
'nm-platform-utils.c', 'nm-platform-utils.c',
'nmp-netns.c', 'nmp-netns.c',
], ],
dependencies: [
glib_dep,
],
)
libnm_platform_dep = declare_dependency(
include_directories: [ include_directories: [
src_inc, src_inc,
top_inc,
], ],
dependencies: [ dependencies: [
libnm_glib_aux_dep_link, glib_dep,
libudev_dep,
], ],
link_with: libnm_platform,
) )

View File

@@ -3,14 +3,27 @@
exe = executable( exe = executable(
'test-nm-platform', 'test-nm-platform',
'test-nm-platform.c', 'test-nm-platform.c',
include_directories: [
src_inc,
top_inc,
],
dependencies: [ dependencies: [
libnm_log_core_dep, glib_dep,
libnm_platform_dep, libudev_dep,
],
link_with: [
libnm_platform,
libnm_base,
libnm_udev_aux,
libnm_log_core,
libnm_glib_aux,
libnm_std_aux,
libc_siphash,
], ],
) )
test( test(
'shared/nm-glib-aux/test-nm-platform', 'src/libnm-platform/tests/test-nm-platform',
test_script, test_script,
args: test_args + [exe.full_path()], args: test_args + [exe.full_path()],
timeout: default_test_timeout, timeout: default_test_timeout,

View File

@@ -54,12 +54,10 @@ libnm_systemd_shared = static_library(
dependencies: glib_dep, dependencies: glib_dep,
) )
libnm_systemd_shared_dep = declare_dependency( libnm_systemd_shared_dep_inc = declare_dependency(
include_directories: include_directories( include_directories: include_directories(
'sd-adapt-shared', 'sd-adapt-shared',
'src/basic', 'src/basic',
'src/shared', 'src/shared',
), ),
dependencies: glib_dep,
link_with: libnm_systemd_shared,
) )

View File

@@ -12,7 +12,3 @@ libnm_udev_aux = static_library(
libudev_dep, libudev_dep,
], ],
) )
libnm_udev_aux_dep = declare_dependency(
link_with: libnm_udev_aux,
)

View File

@@ -18,19 +18,13 @@ libc_rbtree = static_library(
c_args: '-std=c11', 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( libn_acd = static_library(
'n-acd', 'n-acd',
sources: files( sources: files(
'n-acd/src/n-acd.c', 'n-acd/src/n-acd.c',
'n-acd/src/n-acd-probe.c', 'n-acd/src/n-acd-probe.c',
'n-acd/src/util/timer.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( include_directories: include_directories(
'c-list/src', 'c-list/src',
@@ -45,14 +39,6 @@ libn_acd = static_library(
'-Wno-pointer-arith', '-Wno-pointer-arith',
'-Wno-vla', '-Wno-vla',
], ],
link_with: [
libc_rbtree,
libc_siphash,
],
)
libn_acd_dep = declare_dependency(
link_with: libn_acd,
) )
libn_dhcp4 = static_library( libn_dhcp4 = static_library(
@@ -68,22 +54,17 @@ libn_dhcp4 = static_library(
'n-dhcp4/src/util/packet.c', 'n-dhcp4/src/util/packet.c',
'n-dhcp4/src/util/socket.c', 'n-dhcp4/src/util/socket.c',
), ),
include_directories: include_directories(
'c-list/src',
'c-siphash/src',
'c-stdaux/src',
),
c_args: [ c_args: [
'-std=c11', '-std=c11',
'-D_GNU_SOURCE', '-D_GNU_SOURCE',
'-Wno-declaration-after-statement', '-Wno-declaration-after-statement',
'-Wno-pointer-arith', '-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-impl')
subdir('libnm-client-aux-extern') subdir('libnm-client-aux-extern')
subdir('core') subdir('core')
subdir('nm-dispatcher')
subdir('contrib') subdir('contrib')
if enable_tests if enable_tests
@@ -113,5 +95,6 @@ if enable_tests
subdir('libnm-platform/tests') subdir('libnm-platform/tests')
subdir('libnm-core-impl/tests') subdir('libnm-core-impl/tests')
subdir('libnm-client-impl/tests') subdir('libnm-client-impl/tests')
subdir('nm-dispatcher/tests')
subdir('contrib/tests') subdir('contrib/tests')
endif endif

View File

@@ -14,39 +14,37 @@ install_data(
install_dir: dbus_conf_dir, 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( libnm_dispatcher_core = static_library(
'nm-dispatcher-core', 'nm-dispatcher-core',
sources: 'nm-dispatcher-utils.c', sources: 'nm-dispatcher-utils.c',
dependencies: [ dependencies: [
libnm_dep, 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( executable(
'nm-dispatcher', 'nm-dispatcher',
'nm-dispatcher.c', 'nm-dispatcher.c',
dependencies: [ dependencies: [
libnm_dep, libnm_dep,
libnm_nm_default_dep, glib_dep,
libnm_core_aux_extern_dep_link, ],
libnm_glib_aux_dep_link, 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_args: ldflags_linker_script_binary,
link_depends: linker_script_binary, link_depends: linker_script_binary,
install: true, install: true,
install_dir: nm_libexecdir, install_dir: nm_libexecdir,
) )
if enable_tests
subdir('tests')
endif

View File

@@ -17,7 +17,7 @@ NM_DISPATCHER_ACTION=down
CONNECTION_UUID=3fd2a33a-d81b-423f-ae99-e6baba742311 CONNECTION_UUID=3fd2a33a-d81b-423f-ae99-e6baba742311
CONNECTION_DBUS_PATH=/org/freedesktop/NetworkManager/Connections/5 CONNECTION_DBUS_PATH=/org/freedesktop/NetworkManager/Connections/5
CONNECTION_ID=Random Connection CONNECTION_ID=Random Connection
CONNECTION_FILENAME=/dispatcher/tests/dispatcher-down CONNECTION_FILENAME=/src/nm-dispatcher/tests/dispatcher-down
DEVICE_IFACE=wlan0 DEVICE_IFACE=wlan0
DEVICE_IP_IFACE=wlan0 DEVICE_IP_IFACE=wlan0

View File

@@ -26,7 +26,7 @@ PATH=
NM_DISPATCHER_ACTION=up NM_DISPATCHER_ACTION=up
CONNECTION_UUID=92bbc2fb-7304-46be-8ebb-6093dbe19a6a CONNECTION_UUID=92bbc2fb-7304-46be-8ebb-6093dbe19a6a
CONNECTION_DBUS_PATH=/org/freedesktop/NetworkManager/Connections/5 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_ID=virbr0
CONNECTION_EXTERNAL=1 CONNECTION_EXTERNAL=1
DEVICE_IFACE=virbr0 DEVICE_IFACE=virbr0

View File

@@ -40,7 +40,7 @@ NM_DISPATCHER_ACTION=up
CONNECTION_UUID=3fd2a33a-d81b-423f-ae99-e6baba742311 CONNECTION_UUID=3fd2a33a-d81b-423f-ae99-e6baba742311
CONNECTION_DBUS_PATH=/org/freedesktop/NetworkManager/Connections/5 CONNECTION_DBUS_PATH=/org/freedesktop/NetworkManager/Connections/5
CONNECTION_ID=Random Connection CONNECTION_ID=Random Connection
CONNECTION_FILENAME=/dispatcher/tests/dispatcher-up CONNECTION_FILENAME=/src/nm-dispatcher/tests/dispatcher-up
DEVICE_IFACE=wlan0 DEVICE_IFACE=wlan0
DEVICE_IP_IFACE=wlan0 DEVICE_IP_IFACE=wlan0
PROXY_PAC_URL=http://networkmanager.com/proxy.pac PROXY_PAC_URL=http://networkmanager.com/proxy.pac

View File

@@ -40,7 +40,7 @@ NM_DISPATCHER_ACTION=vpn-down
CONNECTION_UUID=355653c0-34d3-4777-ad25-f9a498b7ef8e CONNECTION_UUID=355653c0-34d3-4777-ad25-f9a498b7ef8e
CONNECTION_DBUS_PATH=/org/freedesktop/NetworkManager/Connections/5 CONNECTION_DBUS_PATH=/org/freedesktop/NetworkManager/Connections/5
CONNECTION_ID=Random Connection CONNECTION_ID=Random Connection
CONNECTION_FILENAME=/dispatcher/tests/dispatcher-vpn-down CONNECTION_FILENAME=/src/nm-dispatcher/tests/dispatcher-vpn-down
DEVICE_IFACE=wlan0 DEVICE_IFACE=wlan0
DEVICE_IP_IFACE=tun0 DEVICE_IP_IFACE=tun0
PROXY_PAC_URL=http://networkmanager.com/proxy.pac PROXY_PAC_URL=http://networkmanager.com/proxy.pac

View File

@@ -40,7 +40,7 @@ NM_DISPATCHER_ACTION=vpn-up
CONNECTION_UUID=355653c0-34d3-4777-ad25-f9a498b7ef8e CONNECTION_UUID=355653c0-34d3-4777-ad25-f9a498b7ef8e
CONNECTION_DBUS_PATH=/org/freedesktop/NetworkManager/Connections/5 CONNECTION_DBUS_PATH=/org/freedesktop/NetworkManager/Connections/5
CONNECTION_ID=Random Connection CONNECTION_ID=Random Connection
CONNECTION_FILENAME=/dispatcher/tests/dispatcher-vpn-up CONNECTION_FILENAME=/src/nm-dispatcher/tests/dispatcher-vpn-up
DEVICE_IFACE=wlan0 DEVICE_IFACE=wlan0
DEVICE_IP_IFACE=tun0 DEVICE_IP_IFACE=tun0
PROXY_PAC_URL=http://networkmanager.com/proxy.pac PROXY_PAC_URL=http://networkmanager.com/proxy.pac

View File

@@ -4,19 +4,23 @@ exe = executable(
'test-dispatcher-envp', 'test-dispatcher-envp',
[ [
'test-dispatcher-envp.c', 'test-dispatcher-envp.c',
nmdbus_dispatcher_sources, dispatcher_nmdbus_dispatcher_sources,
], ],
include_directories: dispatcher_inc,
dependencies: [ dependencies: [
libnm_nm_default_dep, libnm_dep,
libnm_glib_aux_dep_link, glib_dep,
], ],
c_args: introspection_extra_cflags, c_args: introspection_extra_cflags,
link_with: libnm_dispatcher_core, link_with: [
libnm_dispatcher_core,
libnm_glib_aux,
libnm_std_aux,
libc_siphash,
],
) )
test( test(
'dispatcher/test-dispatcher-envp', 'src/nm-ddispatcher/test/test-dispatcher-envp',
test_script, test_script,
args: test_args + [exe.full_path()], args: test_args + [exe.full_path()],
) )

View File

@@ -8,14 +8,14 @@
#include <arpa/inet.h> #include <arpa/inet.h>
#include <stdlib.h> #include <stdlib.h>
#include "nm-dispatcher-utils.h" #include "nm-dispatcher/nm-dispatcher-utils.h"
#include "libnm-core-aux-extern/nm-dispatcher-api.h" #include "libnm-core-aux-extern/nm-dispatcher-api.h"
#include "libnm-glib-aux/nm-test-utils.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_free char * id = NULL;
gs_unref_object NMConnection *connection = NULL; gs_unref_object NMConnection *connection = NULL;
NMSettingConnection * s_con; NMSettingConnection * s_con;
const char * s;
*out_expected_iface = g_key_file_get_string(kf, "main", "expected-iface", NULL); *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")); g_variant_new_object_path("/org/freedesktop/NetworkManager/Connections/5"));
/* Strip out the non-fixed portion of the filename */ /* 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)); g_variant_builder_add(&props, "{sv}", "filename", g_variant_new_string(filename));
if (g_key_file_get_boolean(kf, "main", "external", NULL)) { if (g_key_file_get_boolean(kf, "main", "external", NULL)) {