Commit 0a6f21fb authored by Thomas Haller's avatar Thomas Haller

shared: split C-only helper "shared/nm-std-aux" utils out of "shared/nm-utils"

"shared/nm-utils" contains general purpose utility functions that only
depend on glib (and extend glib with some helper functions).

We will also add code that does not use glib, hence it would be good
if the part of "shared/nm-utils" that does not depend on glib, could be
used by these future projects.

Also, we use the term "utils" everywhere. While that covers the purpose
and content well, having everything called "nm-something-utils" is not
great. Instead, call this "nm-std-aux", inspired by "c-util/c-stdaux".

(cherry picked from commit b434b9ec)
parent e63f835d
......@@ -289,6 +289,35 @@ shared_libnacd_la_LIBADD = \
###############################################################################
noinst_LTLIBRARIES += shared/nm-std-aux/libnm-std-aux.la
shared_nm_std_aux_libnm_std_aux_la_CPPFLAGS = \
$(dflt_cppflags) \
-I$(srcdir)/shared \
$(CODE_COVERAGE_CFLAGS) \
$(SANITIZER_LIB_CFLAGS) \
-DG_LOG_DOMAIN=\""libnm"\" \
-DNETWORKMANAGER_COMPILATION='0' \
$(NULL)
shared_nm_std_aux_libnm_std_aux_la_SOURCES = \
shared/c-list/src/c-list.h \
shared/nm-std-aux/c-list-util.c \
shared/nm-std-aux/c-list-util.h \
shared/nm-std-aux/unaligned.h \
$(NULL)
shared_nm_std_aux_libnm_std_aux_la_LDFLAGS = \
$(CODE_COVERAGE_LDFLAGS) \
$(SANITIZER_LIB_LDFLAGS) \
$(NULL)
shared_nm_std_aux_libnm_std_aux_la_LIBADD = \
shared/libcsiphash.la \
$(NULL)
###############################################################################
shared_nm_utils_libnm_utils_cppflags = \
$(dflt_cppflags) \
-I$(srcdir)/shared \
......@@ -306,9 +335,6 @@ shared_nm_utils_libnm_utils_base_la_CPPFLAGS = \
$(NULL)
shared_nm_utils_libnm_utils_base_la_SOURCES = \
shared/c-list/src/c-list.h \
shared/nm-utils/c-list-util.c \
shared/nm-utils/c-list-util.h \
shared/nm-utils/nm-c-list.h \
shared/nm-utils/nm-dedup-multi.c \
shared/nm-utils/nm-dedup-multi.h \
......@@ -332,7 +358,6 @@ shared_nm_utils_libnm_utils_base_la_SOURCES = \
shared/nm-utils/nm-shared-utils.h \
shared/nm-utils/nm-time-utils.c \
shared/nm-utils/nm-time-utils.h \
shared/nm-utils/unaligned.h \
$(NULL)
shared_nm_utils_libnm_utils_base_la_LDFLAGS = \
......@@ -341,7 +366,7 @@ shared_nm_utils_libnm_utils_base_la_LDFLAGS = \
$(NULL)
shared_nm_utils_libnm_utils_base_la_LIBADD = \
shared/libcsiphash.la \
shared/nm-std-aux/libnm-std-aux.la \
$(GLIB_LIBS) \
$(NULL)
......
......@@ -23,7 +23,7 @@
#include "nm-default.h"
#include "nm-utils/c-list-util.h"
#include "nm-std-aux/c-list-util.h"
#include "nm-utils/nm-enum-utils.h"
#include "nm-utils.h"
......
......@@ -85,6 +85,29 @@ shared_nm_utils_nm_vpn_plugin_utils_c = files('nm-utils/nm-vpn-plugin-utils.c')
###############################################################################
shared_nm_std_aux = static_library(
'nm-std-aux',
sources: files('nm-std-aux/c-list-util.c'),
c_args: [
'-DG_LOG_DOMAIN="@0@"'.format(libnm_name),
'-DNETWORKMANAGER_COMPILATION=0',
],
include_directories: [
top_inc,
shared_inc,
],
dependencies: [
],
)
shared_nm_std_aux_dep = declare_dependency(
link_with: shared_nm_std_aux,
include_directories: [
top_inc,
shared_inc,
],
)
shared_nm_utils_c_args = [
'-DG_LOG_DOMAIN="@0@"'.format(libnm_name),
'-DNETWORKMANAGER_COMPILATION=(NM_NETWORKMANAGER_COMPILATION_GLIB|NM_NETWORKMANAGER_COMPILATION_WITH_GLIB_I18N_LIB)',
......@@ -92,8 +115,7 @@ shared_nm_utils_c_args = [
shared_nm_utils_base = static_library(
'nm-utils-base',
sources: files('nm-utils/c-list-util.c',
'nm-utils/nm-dedup-multi.c',
sources: files('nm-utils/nm-dedup-multi.c',
'nm-utils/nm-enum-utils.c',
'nm-utils/nm-errno.c',
'nm-utils/nm-hash-utils.c',
......@@ -109,6 +131,7 @@ shared_nm_utils_base = static_library(
],
dependencies: [
glib_dep,
shared_nm_std_aux_dep,
],
)
......
......@@ -23,7 +23,7 @@
#define __NM_DEDUP_MULTI_H__
#include "nm-obj.h"
#include "c-list-util.h"
#include "nm-std-aux/c-list-util.h"
/*****************************************************************************/
......
......@@ -21,9 +21,9 @@
#include "nm-default.h"
#include "nm-utils/nm-time-utils.h"
#include "nm-std-aux/unaligned.h"
#include "nm-utils/nm-random-utils.h"
#include "nm-utils/unaligned.h"
#include "nm-utils/nm-time-utils.h"
#include "nm-utils/nm-test-utils.h"
......
#pragma once
#include "nm-utils/unaligned.h"
#include "nm-std-aux/unaligned.h"
......@@ -36,9 +36,9 @@
#include <linux/rtnetlink.h>
#include <linux/pkt_sched.h>
#include "nm-std-aux/unaligned.h"
#include "nm-utils/nm-dedup-multi.h"
#include "nm-utils/nm-random-utils.h"
#include "nm-utils/unaligned.h"
#include "nm-ethtool-utils.h"
#include "nm-common-macros.h"
......
......@@ -24,8 +24,8 @@
#include <net/ethernet.h>
#include "nm-std-aux/unaligned.h"
#include "platform/nm-platform.h"
#include "nm-utils/unaligned.h"
#include "nm-utils/nm-c-list.h"
#include "nm-utils.h"
......
......@@ -27,7 +27,7 @@
#include <net/if_arp.h>
#include "nm-utils/nm-dedup-multi.h"
#include "nm-utils/unaligned.h"
#include "nm-std-aux/unaligned.h"
#include "nm-utils.h"
#include "nm-config.h"
......
......@@ -37,9 +37,9 @@
#include <net/if_arp.h>
#include <net/ethernet.h>
#include "nm-std-aux/unaligned.h"
#include "nm-utils/nm-random-utils.h"
#include "nm-utils/nm-io-utils.h"
#include "nm-utils/unaligned.h"
#include "nm-utils/nm-secret-utils.h"
#include "nm-utils.h"
#include "nm-core-internal.h"
......
......@@ -41,6 +41,8 @@
#include <sys/socket.h>
#include <unistd.h>
#include "nm-std-aux/unaligned.h"
#include "nm-utils.h"
#include "nm-core-internal.h"
#include "nm-setting-vlan.h"
......@@ -56,7 +58,6 @@
#include "wifi/nm-wifi-utils.h"
#include "wifi/nm-wifi-utils-wext.h"
#include "wpan/nm-wpan-utils.h"
#include "nm-utils/unaligned.h"
#include "nm-utils/nm-io-utils.h"
#include "nm-utils/nm-udev-utils.h"
......
......@@ -25,7 +25,7 @@
#include <linux/rtnetlink.h>
#include <linux/genetlink.h>
#include "nm-utils/unaligned.h"
#include "nm-std-aux/unaligned.h"
/*****************************************************************************/
......
......@@ -22,7 +22,7 @@
#include <linux/fib_rules.h>
#include <linux/rtnetlink.h>
#include "nm-utils/c-list-util.h"
#include "nm-std-aux/c-list-util.h"
#include "nmp-object.h"
/*****************************************************************************/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment