diff --git a/Makefile.am b/Makefile.am index c487ae01a..c7348cb0c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -398,6 +398,7 @@ shared_nm_glib_aux_libnm_glib_aux_la_SOURCES = \ shared/nm-glib-aux/nm-dedup-multi.c \ shared/nm-glib-aux/nm-dedup-multi.h \ shared/nm-glib-aux/nm-default-glib-i18n-lib.h \ + shared/nm-glib-aux/nm-default-glib-i18n-prog.h \ shared/nm-glib-aux/nm-default-glib.h \ shared/nm-glib-aux/nm-enum-utils.c \ shared/nm-glib-aux/nm-enum-utils.h \ @@ -552,8 +553,7 @@ check_programs += shared/nm-platform/tests/test-nm-platform shared_nm_platform_tests_test_nm_platform_CPPFLAGS = \ $(dflt_cppflags) \ -I$(srcdir)/shared \ - -DNETWORKMANAGER_COMPILATION_TEST \ - -DNETWORKMANAGER_COMPILATION='(NM_NETWORKMANAGER_COMPILATION_GLIB|NM_NETWORKMANAGER_COMPILATION_WITH_GLIB_I18N_PROG)' \ + -DG_LOG_DOMAIN=\""test"\" \ $(CODE_COVERAGE_CFLAGS) \ $(SYSTEMD_JOURNAL_CFLAGS) \ $(GLIB_CFLAGS) \ @@ -740,8 +740,7 @@ check_programs += shared/nm-glib-aux/tests/test-shared-general shared_nm_glib_aux_tests_test_shared_general_CPPFLAGS = \ $(dflt_cppflags) \ -I$(srcdir)/shared \ - -DNETWORKMANAGER_COMPILATION_TEST \ - -DNETWORKMANAGER_COMPILATION='(NM_NETWORKMANAGER_COMPILATION_GLIB|NM_NETWORKMANAGER_COMPILATION_WITH_GLIB_I18N_PROG)' \ + -DG_LOG_DOMAIN=\""test"\" \ $(CODE_COVERAGE_CFLAGS) \ $(GLIB_CFLAGS) \ $(SANITIZER_LIB_CFLAGS) \ @@ -769,8 +768,7 @@ check_programs += shared/nm-glib-aux/tests/test-json-aux shared_nm_glib_aux_tests_test_json_aux_CPPFLAGS = \ $(dflt_cppflags) \ -I$(srcdir)/shared \ - -DNETWORKMANAGER_COMPILATION_TEST \ - -DNETWORKMANAGER_COMPILATION='(NM_NETWORKMANAGER_COMPILATION_GLIB|NM_NETWORKMANAGER_COMPILATION_WITH_GLIB_I18N_PROG)' \ + -DG_LOG_DOMAIN=\""test"\" \ $(CODE_COVERAGE_CFLAGS) \ $(GLIB_CFLAGS) \ $(JANSSON_CFLAGS) \ diff --git a/shared/nm-default.h b/shared/nm-default.h index 689c946b1..44428b237 100644 --- a/shared/nm-default.h +++ b/shared/nm-default.h @@ -22,8 +22,7 @@ #error Define NETWORKMANAGER_COMPILATION accordingly #endif -#if NETWORKMANAGER_COMPILATION \ - < (NM_NETWORKMANAGER_COMPILATION_GLIB | NM_NETWORKMANAGER_COMPILATION_WITH_GLIB_I18N_PROG) +#if NETWORKMANAGER_COMPILATION < NM_NETWORKMANAGER_COMPILATION_CLIENT #error Dont include this header with such NETWORKMANAGER_COMPILATION #endif diff --git a/shared/nm-glib-aux/nm-default-glib-i18n-prog.h b/shared/nm-glib-aux/nm-default-glib-i18n-prog.h new file mode 100644 index 000000000..0abe807b9 --- /dev/null +++ b/shared/nm-glib-aux/nm-default-glib-i18n-prog.h @@ -0,0 +1,21 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ +/* + * Copyright (C) 2015 Red Hat, Inc. + */ + +#ifndef __NM_DEFAULT_GLIB_I18N_PROG_H__ +#define __NM_DEFAULT_GLIB_I18N_PROG_H__ + +/*****************************************************************************/ + +#define _NETWORKMANAGER_COMPILATION_GLIB_I18N_PROG + +#include "nm-glib-aux/nm-default-glib.h" + +#undef NETWORKMANAGER_COMPILATION +#define NETWORKMANAGER_COMPILATION \ + (NM_NETWORKMANAGER_COMPILATION_GLIB | NM_NETWORKMANAGER_COMPILATION_WITH_GLIB_I18N_PROG) + +/*****************************************************************************/ + +#endif /* __NM_DEFAULT_GLIB_I18N_PROG_H__ */ diff --git a/shared/nm-glib-aux/tests/meson.build b/shared/nm-glib-aux/tests/meson.build index d1f23eedc..464f4e7c8 100644 --- a/shared/nm-glib-aux/tests/meson.build +++ b/shared/nm-glib-aux/tests/meson.build @@ -4,8 +4,7 @@ exe = executable( 'test-shared-general', 'test-shared-general.c', c_args: [ - '-DNETWORKMANAGER_COMPILATION_TEST', - '-DNETWORKMANAGER_COMPILATION=(NM_NETWORKMANAGER_COMPILATION_GLIB|NM_NETWORKMANAGER_COMPILATION_WITH_GLIB_I18N_PROG)', + '-DG_LOG_DOMAIN="test"', ], dependencies: libnm_glib_aux_dep, link_with: libnm_systemd_logging_stub, @@ -23,8 +22,7 @@ if jansson_dep.found() 'test-json-aux', 'test-json-aux.c', c_args: [ - '-DNETWORKMANAGER_COMPILATION_TEST', - '-DNETWORKMANAGER_COMPILATION=(NM_NETWORKMANAGER_COMPILATION_GLIB|NM_NETWORKMANAGER_COMPILATION_WITH_GLIB_I18N_PROG)', + '-DG_LOG_DOMAIN="test"', ], dependencies: [ libnm_glib_aux_dep, diff --git a/shared/nm-glib-aux/tests/test-json-aux.c b/shared/nm-glib-aux/tests/test-json-aux.c index 9275e6713..efbeec48c 100644 --- a/shared/nm-glib-aux/tests/test-json-aux.c +++ b/shared/nm-glib-aux/tests/test-json-aux.c @@ -2,7 +2,7 @@ #define NM_TEST_UTILS_NO_LIBNM 1 -#include "nm-default.h" +#include "nm-glib-aux/nm-default-glib-i18n-prog.h" #include diff --git a/shared/nm-glib-aux/tests/test-shared-general.c b/shared/nm-glib-aux/tests/test-shared-general.c index d0fdedd51..8fa861772 100644 --- a/shared/nm-glib-aux/tests/test-shared-general.c +++ b/shared/nm-glib-aux/tests/test-shared-general.c @@ -5,7 +5,7 @@ #define NM_TEST_UTILS_NO_LIBNM 1 -#include "nm-default.h" +#include "nm-glib-aux/nm-default-glib-i18n-prog.h" #include "nm-std-aux/unaligned.h" #include "nm-glib-aux/nm-random-utils.h" diff --git a/shared/nm-platform/tests/meson.build b/shared/nm-platform/tests/meson.build index 8d2b9c0f6..a8fcdbca8 100644 --- a/shared/nm-platform/tests/meson.build +++ b/shared/nm-platform/tests/meson.build @@ -4,8 +4,7 @@ exe = executable( 'test-nm-platform', 'test-nm-platform.c', c_args: [ - '-DNETWORKMANAGER_COMPILATION_TEST', - '-DNETWORKMANAGER_COMPILATION=(NM_NETWORKMANAGER_COMPILATION_GLIB|NM_NETWORKMANAGER_COMPILATION_WITH_GLIB_I18N_PROG)', + '-DG_LOG_DOMAIN="test"', ], dependencies: [ libnm_log_core_dep, diff --git a/shared/nm-platform/tests/test-nm-platform.c b/shared/nm-platform/tests/test-nm-platform.c index 0386a3a54..3c5e41f0f 100644 --- a/shared/nm-platform/tests/test-nm-platform.c +++ b/shared/nm-platform/tests/test-nm-platform.c @@ -2,7 +2,7 @@ #define NM_TEST_UTILS_NO_LIBNM 1 -#include "nm-default.h" +#include "nm-glib-aux/nm-default-glib-i18n-prog.h" #include "nm-log-core/nm-logging.h" #include "nm-platform/nm-netlink.h"