From b55710d6a6d6aa1ee6cd735d9c2aee7e2a947c10 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Thu, 18 Feb 2021 07:57:46 +0100 Subject: [PATCH] shared: rename "libnm-systemd-logging-stub.la" to "libnm-log-null.la" This is really just a different implementation of "nm-glib-aux/nm-logging-fwd.h", that parallels libnm-log-core. It's also not only useful to shared/systemd, but also share/nm-platform, which also requires linking with a logging backend. --- Makefile.am | 42 ++++++++++--------- clients/cloud-setup/meson.build | 2 +- clients/common/tests/meson.build | 2 +- clients/tui/meson.build | 2 +- libnm/meson.build | 4 +- shared/meson.build | 12 +++--- shared/nm-glib-aux/tests/meson.build | 4 +- .../nm-logging-null.c} | 2 +- src/libnm-core-impl/tests/meson.build | 2 +- 9 files changed, 38 insertions(+), 34 deletions(-) rename shared/{systemd/nm-logging-stub.c => nm-log-null/nm-logging-null.c} (94%) diff --git a/Makefile.am b/Makefile.am index 082721234c..e1ba7834bf 100644 --- a/Makefile.am +++ b/Makefile.am @@ -519,6 +519,25 @@ shared_nm_log_core_libnm_log_core_la_LIBADD = \ $(SYSTEMD_JOURNAL_LIBS) \ $(NULL) +noinst_LTLIBRARIES += shared/nm-log-null/libnm-log-null.la + +shared_nm_log_null_libnm_log_null_la_CPPFLAGS = \ + $(dflt_cppflags) \ + -I$(srcdir)/shared \ + $(CODE_COVERAGE_CFLAGS) \ + $(SANITIZER_LIB_CFLAGS) \ + $(GLIB_CFLAGS) \ + $(NULL) + +shared_nm_log_null_libnm_log_null_la_SOURCES = \ + shared/nm-log-null/nm-logging-null.c \ + $(NULL) + +shared_nm_log_null_libnm_log_null_la_LIBADD = \ + $(GLIB_LIBS) \ + $(CODE_COVERAGE_LDFLAGS) \ + $(NULL) + ############################################################################### noinst_LTLIBRARIES += shared/nm-platform/libnm-platform.la @@ -718,7 +737,7 @@ shared_nm_glib_aux_tests_test_shared_general_LDFLAGS = \ shared_nm_glib_aux_tests_test_shared_general_LDADD = \ shared/nm-glib-aux/libnm-glib-aux.la \ - shared/systemd/libnm-systemd-logging-stub.la \ + shared/nm-log-null/libnm-log-null.la \ shared/nm-std-aux/libnm-std-aux.la \ shared/libcsiphash.la \ $(GLIB_LIBS) \ @@ -747,7 +766,7 @@ shared_nm_glib_aux_tests_test_json_aux_LDFLAGS = \ shared_nm_glib_aux_tests_test_json_aux_LDADD = \ $(JANSSON_LIBS) \ shared/nm-glib-aux/libnm-glib-aux.la \ - shared/systemd/libnm-systemd-logging-stub.la \ + shared/nm-log-null/libnm-log-null.la \ shared/nm-std-aux/libnm-std-aux.la \ shared/libcsiphash.la \ $(GLIB_LIBS) \ @@ -1362,7 +1381,7 @@ src_libnm_core_impl_tests_ldadd = \ src/libnm-core-aux-intern/libnm-core-aux-intern.la \ shared/nm-base/libnm-base.la \ shared/systemd/libnm-systemd-shared.la \ - shared/systemd/libnm-systemd-logging-stub.la \ + shared/nm-log-null/libnm-log-null.la \ shared/nm-glib-aux/libnm-glib-aux.la \ shared/nm-std-aux/libnm-std-aux.la \ shared/libcsiphash.la \ @@ -1592,7 +1611,7 @@ libnm_libnm_static_la_LIBADD = \ introspection/libnmdbus.la \ shared/nm-glib-aux/libnm-glib-aux.la \ shared/systemd/libnm-systemd-shared.la \ - shared/systemd/libnm-systemd-logging-stub.la \ + shared/nm-log-null/libnm-log-null.la \ shared/nm-udev-aux/libnm-udev-aux.la \ shared/nm-std-aux/libnm-std-aux.la \ shared/libcsiphash.la \ @@ -1939,21 +1958,6 @@ libsystemd_cppflags = \ $(CODE_COVERAGE_CFLAGS) \ $(NULL) -noinst_LTLIBRARIES += shared/systemd/libnm-systemd-logging-stub.la - -shared_systemd_libnm_systemd_logging_stub_la_CPPFLAGS = \ - $(libsystemd_cppflags) \ - $(NULL) - -shared_systemd_libnm_systemd_logging_stub_la_SOURCES = \ - shared/systemd/nm-logging-stub.c \ - $(NULL) - -shared_systemd_libnm_systemd_logging_stub_la_LIBADD = \ - $(GLIB_LIBS) \ - $(CODE_COVERAGE_LDFLAGS) \ - $(NULL) - noinst_LTLIBRARIES += shared/systemd/libnm-systemd-shared.la shared_systemd_libnm_systemd_shared_la_CPPFLAGS = \ diff --git a/clients/cloud-setup/meson.build b/clients/cloud-setup/meson.build index 853fa4394e..a013bade78 100644 --- a/clients/cloud-setup/meson.build +++ b/clients/cloud-setup/meson.build @@ -58,7 +58,7 @@ executable( libnm_glib_aux_dep_link, libcurl_dep, ], - link_with: libnm_systemd_logging_stub, + link_with: libnm_log_null, link_args: ldflags_linker_script_binary, link_depends: linker_script_binary, install: true, diff --git a/clients/common/tests/meson.build b/clients/common/tests/meson.build index b95dffeb8c..ef74e97dff 100644 --- a/clients/common/tests/meson.build +++ b/clients/common/tests/meson.build @@ -28,7 +28,7 @@ exe = executable( libnm_nm_default_dep, libnm_glib_aux_dep_link, ], - link_with: libnm_systemd_logging_stub, + link_with: libnm_log_null, ) test( diff --git a/clients/tui/meson.build b/clients/tui/meson.build index ccda1f0c5f..603d0eb4ea 100644 --- a/clients/tui/meson.build +++ b/clients/tui/meson.build @@ -56,7 +56,7 @@ executable( libnm_base_dep_link, libnm_glib_aux_dep_link, ], - link_with: libnm_systemd_logging_stub, + link_with: libnm_log_null, link_args: ldflags_linker_script_binary, link_depends: linker_script_binary, install: true, diff --git a/libnm/meson.build b/libnm/meson.build index 8c07663cbb..deb57b8dcb 100644 --- a/libnm/meson.build +++ b/libnm/meson.build @@ -147,7 +147,7 @@ libnm_static = static_library( libnm_udev_aux_dep, libudev_dep, ], - link_with: libnm_systemd_logging_stub, + link_with: libnm_log_null, ) linker_script = join_paths(meson.current_source_dir(), 'libnm.ver') @@ -160,7 +160,7 @@ libnm = shared_library( libnm_static, libnm_core_impl, libnmdbus, - libnm_systemd_logging_stub, + libnm_log_null, libnm_glib_aux, libnm_base, ], diff --git a/shared/meson.build b/shared/meson.build index 6d680beb1a..7462216fb2 100644 --- a/shared/meson.build +++ b/shared/meson.build @@ -196,6 +196,12 @@ libnm_log_core_dep = declare_dependency( link_with: libnm_log_core, ) +libnm_log_null = static_library( + 'nm-log-null', + sources: 'nm-log-null/nm-logging-null.c', + dependencies: glib_nm_default_dep, +) + libnm_platform = static_library( 'nm-platform', sources: [ @@ -276,12 +282,6 @@ libnm_systemd_shared_dep = declare_dependency( link_with: libnm_systemd_shared, ) -libnm_systemd_logging_stub = static_library( - 'nm-systemd-logging-stub', - sources: 'systemd/nm-logging-stub.c', - dependencies: glib_nm_default_dep, -) - if enable_tests subdir('nm-glib-aux/tests') subdir('nm-platform/tests') diff --git a/shared/nm-glib-aux/tests/meson.build b/shared/nm-glib-aux/tests/meson.build index 1ee3380e31..38dfff0c6c 100644 --- a/shared/nm-glib-aux/tests/meson.build +++ b/shared/nm-glib-aux/tests/meson.build @@ -4,7 +4,7 @@ exe = executable( 'test-shared-general', 'test-shared-general.c', dependencies: libnm_glib_aux_dep_link, - link_with: libnm_systemd_logging_stub, + link_with: libnm_log_null, ) test( @@ -23,7 +23,7 @@ if jansson_dep.found() jansson_dep, dl_dep, ], - link_with: libnm_systemd_logging_stub, + link_with: libnm_log_null, ) test( diff --git a/shared/systemd/nm-logging-stub.c b/shared/nm-log-null/nm-logging-null.c similarity index 94% rename from shared/systemd/nm-logging-stub.c rename to shared/nm-log-null/nm-logging-null.c index 8db90cd9eb..63f1a82f44 100644 --- a/shared/systemd/nm-logging-stub.c +++ b/shared/nm-log-null/nm-logging-null.c @@ -3,7 +3,7 @@ * Copyright (C) 2018 Red Hat, Inc. */ -#include "shared/systemd/nm-default-systemd-shared.h" +#include "nm-glib-aux/nm-default-glib-i18n-lib.h" #include "nm-glib-aux/nm-logging-fwd.h" diff --git a/src/libnm-core-impl/tests/meson.build b/src/libnm-core-impl/tests/meson.build index eafea9c040..406baa42ca 100644 --- a/src/libnm-core-impl/tests/meson.build +++ b/src/libnm-core-impl/tests/meson.build @@ -30,7 +30,7 @@ foreach test_unit: test_units libnm_core_impl_dep_link, libnm_base_dep_link, ], - link_with: libnm_systemd_logging_stub, + link_with: libnm_log_null, ) test(