Commit 80db06f7 authored by Thomas Haller's avatar Thomas Haller

shared: move most of "shared/nm-utils" to "shared/nm-glib-aux"

From the files under "shared/nm-utils" we build an internal library
that provides glib-based helper utilities.

Move the files of that basic library to a new subdirectory
"shared/nm-glib-aux" and rename the helper library "libnm-core-base.la"
to "libnm-glib-aux.la".

Reasons:

 - the name "utils" is overused in our code-base. Everything's an
   "utils". Give this thing a more distinct name.

 - there were additional files under "shared/nm-utils", which are not
   part of this internal library "libnm-utils-base.la". All the files
   that are part of this library should be together in the same
   directory, but files that are not, should not be there.

 - the new name should better convey what this library is and what is isn't:
   it's a set of utilities and helper functions that extend glib with
   funcitonality that we commonly need.

There are still some files left under "shared/nm-utils". They have less
a unifying propose to be in their own directory, so I leave them there
for now. But at least they are separate from "shared/nm-glib-aux",
which has a very clear purpose.
parent 2973d682
...@@ -316,7 +316,7 @@ shared_nm_std_aux_libnm_std_aux_la_LIBADD = \ ...@@ -316,7 +316,7 @@ shared_nm_std_aux_libnm_std_aux_la_LIBADD = \
############################################################################### ###############################################################################
shared_nm_utils_libnm_utils_cppflags = \ shared_nm_glib_aux_cppflags = \
$(dflt_cppflags) \ $(dflt_cppflags) \
-I$(srcdir)/shared \ -I$(srcdir)/shared \
$(CODE_COVERAGE_CFLAGS) \ $(CODE_COVERAGE_CFLAGS) \
...@@ -326,44 +326,45 @@ shared_nm_utils_libnm_utils_cppflags = \ ...@@ -326,44 +326,45 @@ shared_nm_utils_libnm_utils_cppflags = \
-DNETWORKMANAGER_COMPILATION='(NM_NETWORKMANAGER_COMPILATION_GLIB|NM_NETWORKMANAGER_COMPILATION_WITH_GLIB_I18N_LIB)' \ -DNETWORKMANAGER_COMPILATION='(NM_NETWORKMANAGER_COMPILATION_GLIB|NM_NETWORKMANAGER_COMPILATION_WITH_GLIB_I18N_LIB)' \
$(NULL) $(NULL)
noinst_LTLIBRARIES += shared/nm-utils/libnm-utils-base.la noinst_LTLIBRARIES += shared/nm-glib-aux/libnm-glib-aux.la
shared_nm_utils_libnm_utils_base_la_CPPFLAGS = \ shared_nm_glib_aux_libnm_glib_aux_la_CPPFLAGS = \
$(shared_nm_utils_libnm_utils_cppflags) \ $(shared_nm_glib_aux_cppflags) \
$(NULL) $(NULL)
shared_nm_utils_libnm_utils_base_la_SOURCES = \ shared_nm_glib_aux_libnm_glib_aux_la_SOURCES = \
shared/nm-utils/nm-c-list.h \ shared/nm-glib-aux/nm-c-list.h \
shared/nm-utils/nm-dedup-multi.c \ shared/nm-glib-aux/nm-dedup-multi.c \
shared/nm-utils/nm-dedup-multi.h \ shared/nm-glib-aux/nm-dedup-multi.h \
shared/nm-utils/nm-enum-utils.c \ shared/nm-glib-aux/nm-enum-utils.c \
shared/nm-utils/nm-enum-utils.h \ shared/nm-glib-aux/nm-enum-utils.h \
shared/nm-utils/nm-errno.c \ shared/nm-glib-aux/nm-errno.c \
shared/nm-utils/nm-errno.h \ shared/nm-glib-aux/nm-errno.h \
shared/nm-utils/nm-glib.h \ shared/nm-glib-aux/nm-glib.h \
shared/nm-utils/nm-hash-utils.c \ shared/nm-glib-aux/nm-hash-utils.c \
shared/nm-utils/nm-hash-utils.h \ shared/nm-glib-aux/nm-hash-utils.h \
shared/nm-utils/nm-io-utils.c \ shared/nm-glib-aux/nm-io-utils.c \
shared/nm-utils/nm-io-utils.h \ shared/nm-glib-aux/nm-io-utils.h \
shared/nm-utils/nm-logging-fwd.h \ shared/nm-glib-aux/nm-jansson.h \
shared/nm-utils/nm-macros-internal.h \ shared/nm-glib-aux/nm-logging-fwd.h \
shared/nm-utils/nm-obj.h \ shared/nm-glib-aux/nm-macros-internal.h \
shared/nm-utils/nm-random-utils.c \ shared/nm-glib-aux/nm-obj.h \
shared/nm-utils/nm-random-utils.h \ shared/nm-glib-aux/nm-random-utils.c \
shared/nm-utils/nm-secret-utils.c \ shared/nm-glib-aux/nm-random-utils.h \
shared/nm-utils/nm-secret-utils.h \ shared/nm-glib-aux/nm-secret-utils.c \
shared/nm-utils/nm-shared-utils.c \ shared/nm-glib-aux/nm-secret-utils.h \
shared/nm-utils/nm-shared-utils.h \ shared/nm-glib-aux/nm-shared-utils.c \
shared/nm-utils/nm-time-utils.c \ shared/nm-glib-aux/nm-shared-utils.h \
shared/nm-utils/nm-time-utils.h \ shared/nm-glib-aux/nm-time-utils.c \
shared/nm-glib-aux/nm-time-utils.h \
$(NULL) $(NULL)
shared_nm_utils_libnm_utils_base_la_LDFLAGS = \ shared_nm_glib_aux_libnm_glib_aux_la_LDFLAGS = \
$(CODE_COVERAGE_LDFLAGS) \ $(CODE_COVERAGE_LDFLAGS) \
$(SANITIZER_LIB_LDFLAGS) \ $(SANITIZER_LIB_LDFLAGS) \
$(NULL) $(NULL)
shared_nm_utils_libnm_utils_base_la_LIBADD = \ shared_nm_glib_aux_libnm_glib_aux_la_LIBADD = \
shared/nm-std-aux/libnm-std-aux.la \ shared/nm-std-aux/libnm-std-aux.la \
$(GLIB_LIBS) \ $(GLIB_LIBS) \
$(NULL) $(NULL)
...@@ -373,7 +374,7 @@ shared_nm_utils_libnm_utils_base_la_LIBADD = \ ...@@ -373,7 +374,7 @@ shared_nm_utils_libnm_utils_base_la_LIBADD = \
noinst_LTLIBRARIES += shared/nm-udev-aux/libnm-udev-aux.la noinst_LTLIBRARIES += shared/nm-udev-aux/libnm-udev-aux.la
shared_nm_udev_aux_libnm_udev_aux_la_CPPFLAGS = \ shared_nm_udev_aux_libnm_udev_aux_la_CPPFLAGS = \
$(shared_nm_utils_libnm_utils_cppflags) \ $(shared_nm_glib_aux_cppflags) \
$(LIBUDEV_CFLAGS) \ $(LIBUDEV_CFLAGS) \
$(NULL) $(NULL)
...@@ -412,7 +413,7 @@ shared_nm_utils_tests_test_shared_general_LDFLAGS = \ ...@@ -412,7 +413,7 @@ shared_nm_utils_tests_test_shared_general_LDFLAGS = \
$(NULL) $(NULL)
shared_nm_utils_tests_test_shared_general_LDADD = \ shared_nm_utils_tests_test_shared_general_LDADD = \
shared/nm-utils/libnm-utils-base.la \ shared/nm-glib-aux/libnm-glib-aux.la \
$(GLIB_LIBS) \ $(GLIB_LIBS) \
$(NULL) $(NULL)
...@@ -996,7 +997,7 @@ libnm_core_tests_ldadd = \ ...@@ -996,7 +997,7 @@ libnm_core_tests_ldadd = \
libnm-core/libnm-core.la \ libnm-core/libnm-core.la \
shared/systemd/libnm-systemd-shared.la \ shared/systemd/libnm-systemd-shared.la \
shared/systemd/libnm-systemd-logging-stub.la \ shared/systemd/libnm-systemd-logging-stub.la \
shared/nm-utils/libnm-utils-base.la \ shared/nm-glib-aux/libnm-glib-aux.la \
$(libnm_crypto_lib) \ $(libnm_crypto_lib) \
$(GLIB_LIBS) $(GLIB_LIBS)
...@@ -1208,7 +1209,7 @@ libnm_libnm_utils_la_LIBADD = \ ...@@ -1208,7 +1209,7 @@ libnm_libnm_utils_la_LIBADD = \
libnm-core/libnm-core.la \ libnm-core/libnm-core.la \
$(libnm_crypto_lib) \ $(libnm_crypto_lib) \
introspection/libnmdbus.la \ introspection/libnmdbus.la \
shared/nm-utils/libnm-utils-base.la \ shared/nm-glib-aux/libnm-glib-aux.la \
$(GLIB_LIBS) \ $(GLIB_LIBS) \
$(NULL) $(NULL)
...@@ -1864,7 +1865,7 @@ src_libNetworkManagerBase_la_LIBADD = \ ...@@ -1864,7 +1865,7 @@ src_libNetworkManagerBase_la_LIBADD = \
libnm-core/libnm-core.la \ libnm-core/libnm-core.la \
$(libnm_crypto_lib) \ $(libnm_crypto_lib) \
shared/nm-udev-aux/libnm-udev-aux.la \ shared/nm-udev-aux/libnm-udev-aux.la \
shared/nm-utils/libnm-utils-base.la \ shared/nm-glib-aux/libnm-glib-aux.la \
$(GLIB_LIBS) \ $(GLIB_LIBS) \
$(SYSTEMD_JOURNAL_LIBS) \ $(SYSTEMD_JOURNAL_LIBS) \
$(LIBUDEV_LIBS) \ $(LIBUDEV_LIBS) \
...@@ -2171,7 +2172,7 @@ src_initrd_nm_initrd_generator_LDADD = \ ...@@ -2171,7 +2172,7 @@ src_initrd_nm_initrd_generator_LDADD = \
src/initrd/libnmi-core.la \ src/initrd/libnmi-core.la \
src/libNetworkManagerBase.la \ src/libNetworkManagerBase.la \
shared/systemd/libnm-systemd-shared.la \ shared/systemd/libnm-systemd-shared.la \
shared/nm-utils/libnm-utils-base.la \ shared/nm-glib-aux/libnm-glib-aux.la \
$(GLIB_LIBS) \ $(GLIB_LIBS) \
$(NULL) $(NULL)
...@@ -2194,7 +2195,7 @@ src_initrd_tests_test_ibft_reader_LDADD = \ ...@@ -2194,7 +2195,7 @@ src_initrd_tests_test_ibft_reader_LDADD = \
libnm-core/libnm-core.la \ libnm-core/libnm-core.la \
src/initrd/libnmi-core.la \ src/initrd/libnmi-core.la \
src/libNetworkManagerTest.la \ src/libNetworkManagerTest.la \
shared/nm-utils/libnm-utils-base.la \ shared/nm-glib-aux/libnm-glib-aux.la \
$(GLIB_LIBS) \ $(GLIB_LIBS) \
$(NULL) $(NULL)
...@@ -2410,7 +2411,7 @@ src_initrd_tests_test_cmdline_reader_LDADD = \ ...@@ -2410,7 +2411,7 @@ src_initrd_tests_test_cmdline_reader_LDADD = \
libnm-core/libnm-core.la \ libnm-core/libnm-core.la \
src/initrd/libnmi-core.la \ src/initrd/libnmi-core.la \
src/libNetworkManagerTest.la \ src/libNetworkManagerTest.la \
shared/nm-utils/libnm-utils-base.la \ shared/nm-glib-aux/libnm-glib-aux.la \
$(GLIB_LIBS) \ $(GLIB_LIBS) \
$(NULL) $(NULL)
...@@ -3866,7 +3867,7 @@ dispatcher_tests_test_dispatcher_envp_LDFLAGS = \ ...@@ -3866,7 +3867,7 @@ dispatcher_tests_test_dispatcher_envp_LDFLAGS = \
dispatcher_tests_test_dispatcher_envp_LDADD = \ dispatcher_tests_test_dispatcher_envp_LDADD = \
dispatcher/libnm-dispatcher-core.la \ dispatcher/libnm-dispatcher-core.la \
libnm/libnm.la \ libnm/libnm.la \
shared/nm-utils/libnm-utils-base.la \ shared/nm-glib-aux/libnm-glib-aux.la \
$(GLIB_LIBS) $(GLIB_LIBS)
$(dispatcher_tests_test_dispatcher_envp_OBJECTS): $(libnm_core_lib_h_pub_mkenums) $(dispatcher_tests_test_dispatcher_envp_OBJECTS): $(libnm_core_lib_h_pub_mkenums)
...@@ -3949,7 +3950,7 @@ clients_common_libnmc_base_la_CPPFLAGS = \ ...@@ -3949,7 +3950,7 @@ clients_common_libnmc_base_la_CPPFLAGS = \
clients_common_libnmc_base_la_LIBADD = \ clients_common_libnmc_base_la_LIBADD = \
libnm/libnm.la \ libnm/libnm.la \
shared/nm-utils/libnm-utils-base.la \ shared/nm-glib-aux/libnm-glib-aux.la \
$(GLIB_LIBS) \ $(GLIB_LIBS) \
$(NULL) $(NULL)
...@@ -4610,7 +4611,6 @@ EXTRA_DIST += \ ...@@ -4610,7 +4611,6 @@ EXTRA_DIST += \
shared/nm-test-utils-impl.c \ shared/nm-test-utils-impl.c \
shared/nm-utils/nm-compat.c \ shared/nm-utils/nm-compat.c \
shared/nm-utils/nm-compat.h \ shared/nm-utils/nm-compat.h \
shared/nm-utils/nm-jansson.h \
shared/nm-utils/nm-test-utils.h \ shared/nm-utils/nm-test-utils.h \
shared/nm-utils/nm-vpn-editor-plugin-call.h \ shared/nm-utils/nm-vpn-editor-plugin-call.h \
shared/nm-utils/nm-vpn-plugin-macros.h \ shared/nm-utils/nm-vpn-plugin-macros.h \
......
...@@ -25,8 +25,8 @@ ...@@ -25,8 +25,8 @@
#include <arpa/inet.h> #include <arpa/inet.h>
#include "nm-common-macros.h" #include "nm-common-macros.h"
#include "nm-utils/nm-enum-utils.h" #include "nm-glib-aux/nm-enum-utils.h"
#include "nm-utils/nm-secret-utils.h" #include "nm-glib-aux/nm-secret-utils.h"
#include "nm-libnm-core-utils.h" #include "nm-libnm-core-utils.h"
#include "nm-vpn-helpers.h" #include "nm-vpn-helpers.h"
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
#ifndef __NM_META_SETTING_DESC_H__ #ifndef __NM_META_SETTING_DESC_H__
#define __NM_META_SETTING_DESC_H__ #define __NM_META_SETTING_DESC_H__
#include "nm-utils/nm-obj.h" #include "nm-glib-aux/nm-obj.h"
#include "nm-meta-setting.h" #include "nm-meta-setting.h"
#include "nm-ethtool-utils.h" #include "nm-ethtool-utils.h"
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
#include "nm-vpn-service-plugin.h" #include "nm-vpn-service-plugin.h"
#include "nm-vpn-helpers.h" #include "nm-vpn-helpers.h"
#include "nm-utils/nm-secret-utils.h" #include "nm-glib-aux/nm-secret-utils.h"
/*****************************************************************************/ /*****************************************************************************/
......
...@@ -30,8 +30,8 @@ ...@@ -30,8 +30,8 @@
#include "nm-client-utils.h" #include "nm-client-utils.h"
#include "nm-utils.h" #include "nm-utils.h"
#include "nm-utils/nm-io-utils.h" #include "nm-glib-aux/nm-io-utils.h"
#include "nm-utils/nm-secret-utils.h" #include "nm-glib-aux/nm-secret-utils.h"
/*****************************************************************************/ /*****************************************************************************/
......
...@@ -145,7 +145,7 @@ deps = [ ...@@ -145,7 +145,7 @@ deps = [
uuid_dep, uuid_dep,
glib_dep, glib_dep,
shared_c_siphash_dep, shared_c_siphash_dep,
shared_nm_utils_base_dep, shared_nm_glib_aux_dep,
shared_nm_udev_aux_dep, shared_nm_udev_aux_dep,
] ]
...@@ -204,7 +204,7 @@ nm_core_dep = declare_dependency( ...@@ -204,7 +204,7 @@ nm_core_dep = declare_dependency(
sources: libnm_core_enum[1], sources: libnm_core_enum[1],
include_directories: libnm_core_inc, include_directories: libnm_core_inc,
dependencies: [ dependencies: [
shared_nm_utils_base_dep, shared_nm_glib_aux_dep,
shared_c_siphash_dep, shared_c_siphash_dep,
libnm_systemd_shared_dep, libnm_systemd_shared_dep,
], ],
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
#include <gnutls/x509.h> #include <gnutls/x509.h>
#include <gnutls/pkcs12.h> #include <gnutls/pkcs12.h>
#include "nm-utils/nm-secret-utils.h" #include "nm-glib-aux/nm-secret-utils.h"
#include "nm-errors.h" #include "nm-errors.h"
/*****************************************************************************/ /*****************************************************************************/
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
#include <ciferfam.h> #include <ciferfam.h>
#include <p12plcy.h> #include <p12plcy.h>
#include "nm-utils/nm-secret-utils.h" #include "nm-glib-aux/nm-secret-utils.h"
#include "nm-errors.h" #include "nm-errors.h"
/*****************************************************************************/ /*****************************************************************************/
......
...@@ -29,8 +29,8 @@ ...@@ -29,8 +29,8 @@
#include <unistd.h> #include <unistd.h>
#include <stdlib.h> #include <stdlib.h>
#include "nm-utils/nm-secret-utils.h" #include "nm-glib-aux/nm-secret-utils.h"
#include "nm-utils/nm-io-utils.h" #include "nm-glib-aux/nm-io-utils.h"
#include "nm-crypto-impl.h" #include "nm-crypto-impl.h"
#include "nm-utils.h" #include "nm-utils.h"
......
...@@ -45,7 +45,7 @@ gboolean nm_jansson_load (void); ...@@ -45,7 +45,7 @@ gboolean nm_jansson_load (void);
#define json_integer_value (*_nm_jansson_json_integer_value) #define json_integer_value (*_nm_jansson_json_integer_value)
#define json_string_value (*_nm_jansson_json_string_value) #define json_string_value (*_nm_jansson_json_string_value)
#include "nm-utils/nm-jansson.h" #include "nm-glib-aux/nm-jansson.h"
#endif #endif
#endif /* __NM_JSON_H__ */ #endif /* __NM_JSON_H__ */
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
#include <arpa/inet.h> #include <arpa/inet.h>
#include <linux/pkt_sched.h> #include <linux/pkt_sched.h>
#include "nm-utils/nm-secret-utils.h" #include "nm-glib-aux/nm-secret-utils.h"
#include "systemd/nm-sd-utils-shared.h" #include "systemd/nm-sd-utils-shared.h"
#include "nm-common-macros.h" #include "nm-common-macros.h"
#include "nm-core-internal.h" #include "nm-core-internal.h"
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
#include "nm-setting-8021x.h" #include "nm-setting-8021x.h"
#include "nm-utils/nm-secret-utils.h" #include "nm-glib-aux/nm-secret-utils.h"
#include "nm-utils.h" #include "nm-utils.h"
#include "nm-crypto.h" #include "nm-crypto.h"
#include "nm-utils-private.h" #include "nm-utils-private.h"
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
#include <stdlib.h> #include <stdlib.h>
#include "nm-utils/nm-secret-utils.h" #include "nm-glib-aux/nm-secret-utils.h"
#include "nm-utils.h" #include "nm-utils.h"
#include "nm-core-types-internal.h" #include "nm-core-types-internal.h"
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
#include <stdlib.h> #include <stdlib.h>
#include "nm-utils/nm-secret-utils.h" #include "nm-glib-aux/nm-secret-utils.h"
#include "nm-utils.h" #include "nm-utils.h"
#include "nm-utils-private.h" #include "nm-utils-private.h"
#include "nm-setting-private.h" #include "nm-setting-private.h"
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
#include "nm-setting-private.h" #include "nm-setting-private.h"
#include "nm-utils-private.h" #include "nm-utils-private.h"
#include "nm-connection-private.h" #include "nm-connection-private.h"
#include "nm-utils/nm-secret-utils.h" #include "nm-glib-aux/nm-secret-utils.h"
/*****************************************************************************/ /*****************************************************************************/
......
...@@ -37,8 +37,8 @@ ...@@ -37,8 +37,8 @@
#include "nm-json.h" #include "nm-json.h"
#endif #endif
#include "nm-utils/nm-enum-utils.h" #include "nm-glib-aux/nm-enum-utils.h"
#include "nm-utils/nm-secret-utils.h" #include "nm-glib-aux/nm-secret-utils.h"
#include "systemd/nm-sd-utils-shared.h" #include "systemd/nm-sd-utils-shared.h"
#include "nm-common-macros.h" #include "nm-common-macros.h"
#include "nm-utils-private.h" #include "nm-utils-private.h"
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
#include "nm-default.h" #include "nm-default.h"
#include "nm-std-aux/c-list-util.h" #include "nm-std-aux/c-list-util.h"
#include "nm-utils/nm-enum-utils.h" #include "nm-glib-aux/nm-enum-utils.h"
#include "nm-utils.h" #include "nm-utils.h"
#include "nm-setting-private.h" #include "nm-setting-private.h"
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
#include "nm-setting-wpan.h" #include "nm-setting-wpan.h"
#include "nm-simple-connection.h" #include "nm-simple-connection.h"
#include "nm-keyfile-internal.h" #include "nm-keyfile-internal.h"
#include "nm-utils/nm-dedup-multi.h" #include "nm-glib-aux/nm-dedup-multi.h"
#include "nm-ethtool-utils.h" #include "nm-ethtool-utils.h"
#include "test-general-enums.h" #include "test-general-enums.h"
......
...@@ -9,7 +9,7 @@ libnm_utils_sources = files('nm-libnm-utils.c') ...@@ -9,7 +9,7 @@ libnm_utils_sources = files('nm-libnm-utils.c')
deps = [ deps = [
libnmdbus_dep, libnmdbus_dep,
shared_nm_utils_base_dep, shared_nm_glib_aux_dep,
nm_core_dep, nm_core_dep,
] ]
...@@ -153,7 +153,7 @@ libnm = shared_library( ...@@ -153,7 +153,7 @@ libnm = shared_library(
dependencies: [ dependencies: [
dl_dep, dl_dep,
libudev_dep, libudev_dep,
shared_nm_utils_base_dep, shared_nm_glib_aux_dep,
nm_core_dep, nm_core_dep,
uuid_dep, uuid_dep,
libnm_systemd_shared_no_logging_dep, libnm_systemd_shared_no_logging_dep,
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
#include <signal.h> #include <signal.h>
#include <stdlib.h> #include <stdlib.h>
#include "nm-utils/nm-secret-utils.h" #include "nm-glib-aux/nm-secret-utils.h"
#include "nm-enum-types.h" #include "nm-enum-types.h"
#include "nm-utils.h" #include "nm-utils.h"
#include "nm-connection.h" #include "nm-connection.h"
......
...@@ -137,7 +137,7 @@ libnm/nm-remote-settings.c ...@@ -137,7 +137,7 @@ libnm/nm-remote-settings.c
libnm/nm-vpn-plugin-old.c libnm/nm-vpn-plugin-old.c
libnm/nm-vpn-service-plugin.c libnm/nm-vpn-service-plugin.c
data/org.freedesktop.NetworkManager.policy.in.in data/org.freedesktop.NetworkManager.policy.in.in
shared/nm-utils/nm-shared-utils.c shared/nm-glib-aux/nm-shared-utils.c
src/NetworkManagerUtils.c src/NetworkManagerUtils.c
src/main.c src/main.c
src/main-utils.c src/main-utils.c
......
shared_inc = include_directories('.') shared_inc = include_directories('.')
###############################################################################
shared_c_stdaux = static_library( shared_c_stdaux = static_library(
'c-stdaux', 'c-stdaux',
c_args: '-std=c11', c_args: '-std=c11',
...@@ -10,6 +12,8 @@ shared_c_stdaux_dep = declare_dependency( ...@@ -10,6 +12,8 @@ shared_c_stdaux_dep = declare_dependency(
include_directories: shared_inc, include_directories: shared_inc,
) )
###############################################################################
shared_c_siphash = static_library( shared_c_siphash = static_library(
'c-siphash', 'c-siphash',
include_directories: [ include_directories: [
...@@ -23,6 +27,8 @@ shared_c_siphash_dep = declare_dependency( ...@@ -23,6 +27,8 @@ shared_c_siphash_dep = declare_dependency(
link_with: shared_c_siphash, link_with: shared_c_siphash,
) )
###############################################################################
shared_c_rbtree = static_library( shared_c_rbtree = static_library(
'c-rbtree', 'c-rbtree',
c_args: '-std=c11', c_args: '-std=c11',
...@@ -39,6 +45,7 @@ shared_c_rbtree_dep = declare_dependency( ...@@ -39,6 +45,7 @@ shared_c_rbtree_dep = declare_dependency(
link_with: shared_c_rbtree, link_with: shared_c_rbtree,
) )
###############################################################################
if enable_ebpf if enable_ebpf
shared_n_acd_bpf_files = files('n-acd/src/n-acd-bpf.c') shared_n_acd_bpf_files = files('n-acd/src/n-acd-bpf.c')
...@@ -79,6 +86,8 @@ shared_n_acd_dep = declare_dependency( ...@@ -79,6 +86,8 @@ shared_n_acd_dep = declare_dependency(
link_with: shared_n_acd, link_with: shared_n_acd,
) )
###############################################################################
version_conf = configuration_data() version_conf = configuration_data()
version_conf.set('NM_MAJOR_VERSION', nm_major_version) version_conf.set('NM_MAJOR_VERSION', nm_major_version)
version_conf.set('NM_MINOR_VERSION', nm_minor_version) version_conf.set('NM_MINOR_VERSION', nm_minor_version)
...@@ -125,23 +134,25 @@ shared_nm_std_aux_dep = declare_dependency( ...@@ -125,23 +134,25 @@ shared_nm_std_aux_dep = declare_dependency(
], ],
) )
shared_nm_utils_c_args = [ ###############################################################################
shared_nm_glib_aux_c_args = [
'-DG_LOG_DOMAIN="@0@"'.format(libnm_name), '-DG_LOG_DOMAIN="@0@"'.format(libnm_name),
'-DNETWORKMANAGER_COMPILATION=(NM_NETWORKMANAGER_COMPILATION_GLIB|NM_NETWORKMANAGER_COMPILATION_WITH_GLIB_I18N_LIB)', '-DNETWORKMANAGER_COMPILATION=(NM_NETWORKMANAGER_COMPILATION_GLIB|NM_NETWORKMANAGER_COMPILATION_WITH_GLIB_I18N_LIB)',
] ]
shared_nm_utils_base = static_library( shared_nm_glib_aux = static_library(
'nm-utils-base', 'nm-utils-base',
sources: files('nm-utils/nm-dedup-multi.c', sources: files('nm-glib-aux/nm-dedup-multi.c',
'nm-utils/nm-enum-utils.c', 'nm-glib-aux/nm-enum-utils.c',
'nm-utils/nm-errno.c', 'nm-glib-aux/nm-errno.c',
'nm-utils/nm-hash-utils.c', 'nm-glib-aux/nm-hash-utils.c',
'nm-utils/nm-io-utils.c', 'nm-glib-aux/nm-io-utils.c',
'nm-utils/nm-random-utils.c', 'nm-glib-aux/nm-random-utils.c',
'nm-utils/nm-secret-utils.c', 'nm-glib-aux/nm-secret-utils.c',
'nm-utils/nm-shared-utils.c', 'nm-glib-aux/nm-shared-utils.c',
'nm-utils/nm-time-utils.c'), 'nm-glib-aux/nm-time-utils.c'),
c_args: shared_nm_utils_c_args, c_args: shared_nm_glib_aux_c_args,
include_directories: [ include_directories: [
top_inc, top_inc,
shared_inc, shared_inc,
...@@ -152,8 +163,8 @@ shared_nm_utils_base = static_library( ...@@ -152,8 +163,8 @@ shared_nm_utils_base = static_library(
], ],
) )
shared_nm_utils_base_dep = declare_dependency( shared_nm_glib_aux_dep = declare_dependency(
link_with: shared_nm_utils_base, link_with: shared_nm_glib_aux,
include_directories: [ include_directories: [
top_inc, top_inc,
shared_inc, shared_inc,
...@@ -161,17 +172,19 @@ shared_nm_utils_base_dep = declare_dependency( ...@@ -161,17 +172,19 @@ shared_nm_utils_base_dep = declare_dependency(
dependencies: glib_dep, dependencies: glib_dep,
) )
###############################################################################
shared_nm_udev_aux = static_library( shared_nm_udev_aux = static_library(
'nm-udev-aux', 'nm-udev-aux',
sources: files('nm-udev-aux/nm-udev-utils.c'), sources: files('nm-udev-aux/nm-udev-utils.c'),
c_args: shared_nm_utils_c_args, c_args: shared_nm_glib_aux_c_args,
include_directories: [ include_directories: [
top_inc, top_inc,
shared_inc, shared_inc,
], ],
dependencies: [ dependencies: [
glib_dep, glib_dep,
shared_nm_utils_base_dep, shared_nm_glib_aux_dep,
libudev_dep, libudev_dep,
], ],
) )
...@@ -184,7 +197,7 @@ shared_nm_udev_aux_dep = declare_dependency( ...@@ -184,7 +197,7 @@ shared_nm_udev_aux_dep = declare_dependency(
], ],
dependencies: [ dependencies: [
glib_dep, glib_dep,
shared_nm_utils_base_dep, shared_nm_glib_aux_dep,
libudev_dep, libudev_dep,
], ],
) )
...@@ -198,7 +211,7 @@ test_shared_general = executable( ...@@ -198,7 +211,7 @@ test_shared_general = executable(
'-DNETWORKMANAGER_COMPILATION_TEST', '-DNETWORKMANAGER_COMPILATION_TEST',
'-DNETWORKMANAGER_COMPILATION=(NM_NETWORKMANAGER_COMPILATION_GLIB|NM_NETWORKMANAGER_COMPILATION_WITH_GLIB_I18N_PROG)', '-DNETWORKMANAGER_COMPILATION=(NM_NETWORKMANAGER_COMPILATION_GLIB|NM_NETWORKMANAGER_COMPILATION_WITH_GLIB_I18N_PROG)',
], ],
dependencies: shared_nm_utils_base_dep, dependencies: shared_nm_glib_aux_dep,
link_with: shared_c_siphash, link_with: shared_c_siphash,
) )
test( test(
...@@ -249,7 +262,7 @@ libnm_systemd_shared = static_library( ...@@ -249,7 +262,7 @@ libnm_systemd_shared = static_library(
'systemd/sd-adapt-shared', 'systemd/sd-adapt-shared',
'systemd/src/basic', 'systemd/src/basic',
), ),
dependencies: shared_nm_utils_base_dep, dependencies: shared_nm_glib_aux_dep,
c_args: [ c_args: [
'-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_SYSTEMD_SHARED', '-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_SYSTEMD_SHARED',