mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-09 13:30:20 +01:00
shared: add "shared/nm-libnm-core-utils.h" utils
We have code in "shared/nm-utils" which are general purpose helpers, independent of "libnm", "libnm-core", "clients" and "src". We have shared code like "shared/nm-ethtool-utils.h" and "shared/nm-meta-setting.h", which is statically linked, shared code that contains libnm related helpers. But these helpers already have a specific use (e.g. they are related to ethtool or NMSetting metadata). Add a general purpose helper that: - depends (and extends) libnm-core - contains unrelated helpers - can be shared (meaning it will be statically linked). - this code can be used by any library user of "libnm.so" (nmcli, nm-applet) and by "libnm-core" itself. Thus, "src/" and "libnm/" may also use this code indirectly, via "libnm-core/".
This commit is contained in:
parent
aaaccfd264
commit
d0f1e68b3e
6 changed files with 53 additions and 1 deletions
|
|
@ -669,6 +669,7 @@ libnm_core_lib_h_pub_mkenums = \
|
|||
libnm-core/nm-core-enum-types.h
|
||||
libnm_core_lib_h_priv = \
|
||||
shared/nm-ethtool-utils.h \
|
||||
shared/nm-libnm-core-utils.h \
|
||||
shared/nm-meta-setting.h \
|
||||
libnm-core/nm-crypto.h \
|
||||
libnm-core/nm-crypto-impl.h \
|
||||
|
|
@ -731,6 +732,7 @@ libnm_core_lib_c_settings_real = \
|
|||
libnm_core_lib_c_real = \
|
||||
$(libnm_core_lib_c_settings_real) \
|
||||
shared/nm-ethtool-utils.c \
|
||||
shared/nm-libnm-core-utils.c \
|
||||
shared/nm-meta-setting.c \
|
||||
libnm-core/nm-crypto.c \
|
||||
libnm-core/nm-connection.c \
|
||||
|
|
@ -3914,6 +3916,8 @@ clients_common_libnmc_la_SOURCES = \
|
|||
\
|
||||
shared/nm-ethtool-utils.c \
|
||||
shared/nm-ethtool-utils.h \
|
||||
shared/nm-libnm-core-utils.c \
|
||||
shared/nm-libnm-core-utils.h \
|
||||
\
|
||||
clients/common/nm-meta-setting-desc.c \
|
||||
clients/common/nm-meta-setting-desc.h \
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ libnmc = static_library(
|
|||
sources: files(
|
||||
'nm-meta-setting-access.c',
|
||||
'nm-meta-setting-desc.c',
|
||||
) + shared_nm_meta_setting_c + shared_nm_ethtool_utils_c + [settings_docs_source],
|
||||
) + shared_nm_meta_setting_c + shared_nm_ethtool_utils_c + shared_nm_libnm_core_utils_c + [settings_docs_source],
|
||||
dependencies: deps,
|
||||
c_args: cflags,
|
||||
link_with: libnmc_base,
|
||||
|
|
|
|||
|
|
@ -189,6 +189,7 @@ libnm_core_sources_all = libnm_core_sources
|
|||
libnm_core_sources_all += libnm_core_enum
|
||||
libnm_core_sources_all += shared_nm_meta_setting_c
|
||||
libnm_core_sources_all += shared_nm_ethtool_utils_c
|
||||
libnm_core_sources_all += shared_nm_libnm_core_utils_c
|
||||
libnm_core_sources_all += [version_header]
|
||||
|
||||
libnm_core = static_library(
|
||||
|
|
|
|||
|
|
@ -75,6 +75,8 @@ version_header = configure_file(
|
|||
|
||||
shared_nm_ethtool_utils_c = files('nm-ethtool-utils.c')
|
||||
|
||||
shared_nm_libnm_core_utils_c = files('nm-libnm-core-utils.c')
|
||||
|
||||
shared_nm_meta_setting_c = files('nm-meta-setting.c')
|
||||
|
||||
shared_nm_test_utils_impl_c = files('nm-test-utils-impl.c')
|
||||
|
|
|
|||
22
shared/nm-libnm-core-utils.c
Normal file
22
shared/nm-libnm-core-utils.c
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
/*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#include "nm-default.h"
|
||||
|
||||
#include "nm-libnm-core-utils.h"
|
||||
|
||||
/*****************************************************************************/
|
||||
23
shared/nm-libnm-core-utils.h
Normal file
23
shared/nm-libnm-core-utils.h
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
/*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#ifndef __NM_LIBNM_SHARED_UTILS_H__
|
||||
#define __NM_LIBNM_SHARED_UTILS_H__
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#endif /* __NM_LIBNM_SHARED_UTILS_H__ */
|
||||
Loading…
Add table
Reference in a new issue