Commit 284ac92e authored by Thomas Haller's avatar Thomas Haller

shared: build helper "libnm-libnm-core-{intern|aux}.la" library for libnm-core

"libnm-core" implements common functionality for "NetworkManager" and
"libnm".

Note that clients like "nmcli" cannot access the internal API provided
by "libnm-core". So, if nmcli wants to do something that is also done by
"libnm-core", , "libnm", or "NetworkManager", the code would have to be
duplicated.

Instead, such code can be in "libnm-libnm-core-{intern|aux}.la".
Note that:

  0) "libnm-libnm-core-intern.la" is used by libnm-core itsself.
     On the other hand, "libnm-libnm-core-aux.la" is not used by
     libnm-core, but provides utilities on top of it.

  1) they both extend "libnm-core" with utlities that are not public
     API of libnm itself. Maybe part of the code should one day become
     public API of libnm. On the other hand, this is code for which
     we may not want to commit to a stable interface or which we
     don't want to provide as part of the API.

  2) "libnm-libnm-core-intern.la" is statically linked by "libnm-core"
     and thus directly available to "libnm" and "NetworkManager".
     On the other hand, "libnm-libnm-core-aux.la" may be used by "libnm"
     and "NetworkManager".
     Both libraries may be statically linked by libnm clients (like
     nmcli).

  3) it must only use glib, libnm-glib-aux.la, and the public API
     of libnm-core.
     This is important: it must not use "libnm-core/nm-core-internal.h"
     nor "libnm-core/nm-utils-private.h" so the static library is usable
     by nmcli which couldn't access these.

Note that "shared/nm-meta-setting.c" is an entirely different case,
because it behaves differently depending on whether linking against
"libnm-core" or the client programs. As such, this file must be compiled
twice.

(cherry picked from commit af07ed01)
parent 87f7e684
...@@ -398,6 +398,74 @@ shared_nm_udev_aux_libnm_udev_aux_la_LIBADD = \ ...@@ -398,6 +398,74 @@ shared_nm_udev_aux_libnm_udev_aux_la_LIBADD = \
############################################################################### ###############################################################################
noinst_LTLIBRARIES += shared/nm-libnm-core-intern/libnm-libnm-core-intern.la
shared_nm_libnm_core_intern_libnm_libnm_core_intern_la_CPPFLAGS = \
$(dflt_cppflags) \
-I$(srcdir)/shared \
-I$(builddir)/shared \
-I$(srcdir)/libnm-core \
-I$(builddir)/libnm-core \
$(CODE_COVERAGE_CFLAGS) \
$(GLIB_CFLAGS) \
$(SANITIZER_LIB_CFLAGS) \
-DG_LOG_DOMAIN=\""libnm"\" \
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIBNM_CORE \
$(NULL)
shared_nm_libnm_core_intern_libnm_libnm_core_intern_la_SOURCES = \
shared/nm-libnm-core-intern/nm-common-macros.h \
shared/nm-libnm-core-intern/nm-ethtool-utils.c \
shared/nm-libnm-core-intern/nm-ethtool-utils.h \
shared/nm-libnm-core-intern/nm-libnm-core-utils.c \
shared/nm-libnm-core-intern/nm-libnm-core-utils.h \
$(NULL)
shared_nm_libnm_core_intern_libnm_libnm_core_intern_la_LDFLAGS = \
$(CODE_COVERAGE_LDFLAGS) \
$(SANITIZER_LIB_LDFLAGS) \
$(NULL)
shared_nm_libnm_core_intern_libnm_libnm_core_intern_la_LIBADD = \
$(GLIB_LIBS) \
$(NULL)
$(shared_nm_libnm_core_intern_libnm_libnm_core_intern_la_OBJECTS): $(libnm_core_lib_h_pub_mkenums)
###############################################################################
noinst_LTLIBRARIES += shared/nm-libnm-core-aux/libnm-libnm-core-aux.la
shared_nm_libnm_core_aux_libnm_libnm_core_aux_la_CPPFLAGS = \
$(dflt_cppflags) \
-I$(srcdir)/shared \
-I$(builddir)/shared \
-I$(srcdir)/libnm-core \
-I$(builddir)/libnm-core \
$(CODE_COVERAGE_CFLAGS) \
$(GLIB_CFLAGS) \
$(SANITIZER_LIB_CFLAGS) \
-DG_LOG_DOMAIN=\""libnm"\" \
-DNETWORKMANAGER_COMPILATION='(NM_NETWORKMANAGER_COMPILATION_WITH_GLIB|NM_NETWORKMANAGER_COMPILATION_WITH_GLIB_I18N_LIB)' \
$(NULL)
shared_nm_libnm_core_aux_libnm_libnm_core_aux_la_SOURCES = \
shared/nm-libnm-core-aux/nm-dispatcher-api.h \
$(NULL)
shared_nm_libnm_core_aux_libnm_libnm_core_aux_la_LDFLAGS = \
$(CODE_COVERAGE_LDFLAGS) \
$(SANITIZER_LIB_LDFLAGS) \
$(NULL)
shared_nm_libnm_core_aux_libnm_libnm_core_aux_la_LIBADD = \
$(GLIB_LIBS) \
$(NULL)
$(shared_nm_libnm_core_aux_libnm_libnm_core_aux_la_OBJECTS): $(libnm_core_lib_h_pub_mkenums)
###############################################################################
check_programs += shared/nm-utils/tests/test-shared-general check_programs += shared/nm-utils/tests/test-shared-general
shared_nm_utils_tests_test_shared_general_CPPFLAGS = \ shared_nm_utils_tests_test_shared_general_CPPFLAGS = \
...@@ -725,8 +793,6 @@ libnm_core_lib_h_pub_real = \ ...@@ -725,8 +793,6 @@ libnm_core_lib_h_pub_real = \
libnm_core_lib_h_pub_mkenums = \ libnm_core_lib_h_pub_mkenums = \
libnm-core/nm-core-enum-types.h libnm-core/nm-core-enum-types.h
libnm_core_lib_h_priv = \ libnm_core_lib_h_priv = \
shared/nm-ethtool-utils.h \
shared/nm-libnm-core-utils.h \
shared/nm-meta-setting.h \ shared/nm-meta-setting.h \
libnm-core/nm-crypto.h \ libnm-core/nm-crypto.h \
libnm-core/nm-crypto-impl.h \ libnm-core/nm-crypto-impl.h \
...@@ -788,8 +854,6 @@ libnm_core_lib_c_settings_real = \ ...@@ -788,8 +854,6 @@ libnm_core_lib_c_settings_real = \
libnm-core/nm-setting-wpan.c libnm-core/nm-setting-wpan.c
libnm_core_lib_c_real = \ libnm_core_lib_c_real = \
$(libnm_core_lib_c_settings_real) \ $(libnm_core_lib_c_settings_real) \
shared/nm-ethtool-utils.c \
shared/nm-libnm-core-utils.c \
shared/nm-meta-setting.c \ shared/nm-meta-setting.c \
libnm-core/nm-crypto.c \ libnm-core/nm-crypto.c \
libnm-core/nm-connection.c \ libnm-core/nm-connection.c \
...@@ -990,22 +1054,28 @@ libnm_core_tests_test_settings_defaults_CPPFLAGS = $(libnm_core_tests_cppflags) ...@@ -990,22 +1054,28 @@ libnm_core_tests_test_settings_defaults_CPPFLAGS = $(libnm_core_tests_cppflags)
libnm_core_tests_test_general_SOURCES = \ libnm_core_tests_test_general_SOURCES = \
libnm-core/tests/test-general-enums.h \ libnm-core/tests/test-general-enums.h \
libnm-core/tests/test-general.c libnm-core/tests/test-general.c \
$(NULL)
nodist_libnm_core_tests_test_general_SOURCES = \ nodist_libnm_core_tests_test_general_SOURCES = \
libnm-core/tests/nm-core-tests-enum-types.c \ libnm-core/tests/nm-core-tests-enum-types.c \
libnm-core/tests/nm-core-tests-enum-types.h libnm-core/tests/nm-core-tests-enum-types.h \
$(NULL)
libnm_core_tests_ldadd = \ libnm_core_tests_ldadd = \
shared/nm-libnm-core-aux/libnm-libnm-core-aux.la \
libnm-core/libnm-core.la \ libnm-core/libnm-core.la \
$(libnm_crypto_lib) \
shared/nm-libnm-core-intern/libnm-libnm-core-intern.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-glib-aux/libnm-glib-aux.la \ shared/nm-glib-aux/libnm-glib-aux.la \
$(libnm_crypto_lib) \ $(GLIB_LIBS) \
$(GLIB_LIBS) $(NULL)
libnm_core_tests_ldflags = \ libnm_core_tests_ldflags = \
$(SANITIZER_EXEC_LDFLAGS) $(SANITIZER_EXEC_LDFLAGS) \
$(NULL)
libnm_core_tests_test_compare_LDADD = $(libnm_core_tests_ldadd) libnm_core_tests_test_compare_LDADD = $(libnm_core_tests_ldadd)
libnm_core_tests_test_crypto_LDADD = $(libnm_core_tests_ldadd) libnm_core_tests_test_crypto_LDADD = $(libnm_core_tests_ldadd)
...@@ -1209,8 +1279,10 @@ libnm_libnm_utils_la_SOURCES = \ ...@@ -1209,8 +1279,10 @@ libnm_libnm_utils_la_SOURCES = \
libnm/nm-libnm-utils.c libnm/nm-libnm-utils.c
libnm_libnm_utils_la_LIBADD = \ libnm_libnm_utils_la_LIBADD = \
shared/nm-libnm-core-aux/libnm-libnm-core-aux.la \
libnm-core/libnm-core.la \ libnm-core/libnm-core.la \
$(libnm_crypto_lib) \ $(libnm_crypto_lib) \
shared/nm-libnm-core-intern/libnm-libnm-core-intern.la \
introspection/libnmdbus.la \ introspection/libnmdbus.la \
shared/nm-glib-aux/libnm-glib-aux.la \ shared/nm-glib-aux/libnm-glib-aux.la \
$(GLIB_LIBS) \ $(GLIB_LIBS) \
...@@ -1458,9 +1530,6 @@ libnm_tests_test_general_LDADD = \ ...@@ -1458,9 +1530,6 @@ libnm_tests_test_general_LDADD = \
libnm/libnm-utils.la \ libnm/libnm-utils.la \
$(libnm_tests_ldadd) $(libnm_tests_ldadd)
libnm_tests_test_general_LDFLAGS = \
$(libnm_tests_ldflags)
libnm_tests_test_nm_client_LDADD = $(libnm_tests_ldadd) libnm_tests_test_nm_client_LDADD = $(libnm_tests_ldadd)
libnm_tests_test_remote_settings_client_LDADD = $(libnm_tests_ldadd) libnm_tests_test_remote_settings_client_LDADD = $(libnm_tests_ldadd)
libnm_tests_test_secret_agent_LDADD = $(libnm_tests_ldadd) libnm_tests_test_secret_agent_LDADD = $(libnm_tests_ldadd)
...@@ -1895,8 +1964,10 @@ src_libNetworkManagerBase_la_SOURCES += \ ...@@ -1895,8 +1964,10 @@ src_libNetworkManagerBase_la_SOURCES += \
endif endif
src_libNetworkManagerBase_la_LIBADD = \ src_libNetworkManagerBase_la_LIBADD = \
shared/nm-libnm-core-aux/libnm-libnm-core-aux.la \
libnm-core/libnm-core.la \ libnm-core/libnm-core.la \
$(libnm_crypto_lib) \ $(libnm_crypto_lib) \
shared/nm-libnm-core-intern/libnm-libnm-core-intern.la \
shared/nm-udev-aux/libnm-udev-aux.la \ shared/nm-udev-aux/libnm-udev-aux.la \
shared/nm-glib-aux/libnm-glib-aux.la \ shared/nm-glib-aux/libnm-glib-aux.la \
$(GLIB_LIBS) \ $(GLIB_LIBS) \
...@@ -2201,7 +2272,6 @@ src_initrd_nm_initrd_generator_SOURCES = \ ...@@ -2201,7 +2272,6 @@ src_initrd_nm_initrd_generator_SOURCES = \
src/initrd/nm-initrd-generator.c src/initrd/nm-initrd-generator.c
src_initrd_nm_initrd_generator_LDADD = \ src_initrd_nm_initrd_generator_LDADD = \
libnm-core/libnm-core.la \
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 \
...@@ -2225,7 +2295,6 @@ src_initrd_tests_test_ibft_reader_LDFLAGS = \ ...@@ -2225,7 +2295,6 @@ src_initrd_tests_test_ibft_reader_LDFLAGS = \
$(SANITIZER_EXEC_LDFLAGS) $(SANITIZER_EXEC_LDFLAGS)
src_initrd_tests_test_ibft_reader_LDADD = \ src_initrd_tests_test_ibft_reader_LDADD = \
libnm-core/libnm-core.la \
src/initrd/libnmi-core.la \ src/initrd/libnmi-core.la \
src/libNetworkManagerTest.la \ src/libNetworkManagerTest.la \
shared/nm-glib-aux/libnm-glib-aux.la \ shared/nm-glib-aux/libnm-glib-aux.la \
...@@ -2441,7 +2510,6 @@ src_initrd_tests_test_cmdline_reader_LDFLAGS = \ ...@@ -2441,7 +2510,6 @@ src_initrd_tests_test_cmdline_reader_LDFLAGS = \
$(SANITIZER_EXEC_LDFLAGS) $(SANITIZER_EXEC_LDFLAGS)
src_initrd_tests_test_cmdline_reader_LDADD = \ src_initrd_tests_test_cmdline_reader_LDADD = \
libnm-core/libnm-core.la \
src/initrd/libnmi-core.la \ src/initrd/libnmi-core.la \
src/libNetworkManagerTest.la \ src/libNetworkManagerTest.la \
shared/nm-glib-aux/libnm-glib-aux.la \ shared/nm-glib-aux/libnm-glib-aux.la \
...@@ -3816,9 +3884,9 @@ $(dispatcher_nm_dispatcher_OBJECTS): $(dispatcher_nmdbus_dispatcher_sources) ...@@ -3816,9 +3884,9 @@ $(dispatcher_nm_dispatcher_OBJECTS): $(dispatcher_nmdbus_dispatcher_sources)
CLEANFILES += $(dispatcher_nmdbus_dispatcher_sources) CLEANFILES += $(dispatcher_nmdbus_dispatcher_sources)
dispatcher_libnm_dispatcher_core_la_SOURCES = \ dispatcher_libnm_dispatcher_core_la_SOURCES = \
shared/nm-dispatcher-api.h \
dispatcher/nm-dispatcher-utils.c \ dispatcher/nm-dispatcher-utils.c \
dispatcher/nm-dispatcher-utils.h dispatcher/nm-dispatcher-utils.h \
$(NULL)
dispatcher_libnm_dispatcher_core_la_CPPFLAGS = $(dispatcher_cppflags) dispatcher_libnm_dispatcher_core_la_CPPFLAGS = $(dispatcher_cppflags)
...@@ -3827,8 +3895,8 @@ dispatcher_libnm_dispatcher_core_la_LIBADD = \ ...@@ -3827,8 +3895,8 @@ dispatcher_libnm_dispatcher_core_la_LIBADD = \
$(GLIB_LIBS) $(GLIB_LIBS)
dispatcher_nm_dispatcher_SOURCES = \ dispatcher_nm_dispatcher_SOURCES = \
shared/nm-dispatcher-api.h \ dispatcher/nm-dispatcher.c \
dispatcher/nm-dispatcher.c $(NULL)
nodist_dispatcher_nm_dispatcher_SOURCES = $(dispatcher_nmdbus_dispatcher_sources) nodist_dispatcher_nm_dispatcher_SOURCES = $(dispatcher_nmdbus_dispatcher_sources)
...@@ -4018,11 +4086,6 @@ clients_common_libnmc_la_SOURCES = \ ...@@ -4018,11 +4086,6 @@ clients_common_libnmc_la_SOURCES = \
shared/nm-meta-setting.c \ shared/nm-meta-setting.c \
shared/nm-meta-setting.h \ shared/nm-meta-setting.h \
\ \
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.c \
clients/common/nm-meta-setting-desc.h \ clients/common/nm-meta-setting-desc.h \
clients/common/nm-meta-setting-access.c \ clients/common/nm-meta-setting-access.c \
...@@ -4035,8 +4098,10 @@ clients_common_libnmc_la_CPPFLAGS = \ ...@@ -4035,8 +4098,10 @@ clients_common_libnmc_la_CPPFLAGS = \
$(NULL) $(NULL)
clients_common_libnmc_la_LIBADD = \ clients_common_libnmc_la_LIBADD = \
libnm/libnm.la \
clients/common/libnmc-base.la \ clients/common/libnmc-base.la \
libnm/libnm.la \
shared/nm-libnm-core-aux/libnm-libnm-core-aux.la \
shared/nm-libnm-core-intern/libnm-libnm-core-intern.la \
$(GLIB_LIBS) $(GLIB_LIBS)
$(clients_common_libnmc_la_OBJECTS): $(libnm_core_lib_h_pub_mkenums) $(clients_common_libnmc_la_OBJECTS): $(libnm_core_lib_h_pub_mkenums)
...@@ -5311,9 +5376,7 @@ EXTRA_DIST += \ ...@@ -5311,9 +5376,7 @@ EXTRA_DIST += \
\ \
po/meson.build \ po/meson.build \
\ \
shared/nm-common-macros.h \
shared/nm-default.h \ shared/nm-default.h \
shared/nm-dispatcher-api.h \
shared/nm-test-libnm-utils.h \ shared/nm-test-libnm-utils.h \
shared/nm-test-utils-impl.c \ shared/nm-test-utils-impl.c \
shared/nm-utils/nm-compat.c \ shared/nm-utils/nm-compat.c \
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
#include <stdlib.h> #include <stdlib.h>
#include "nm-common-macros.h" #include "nm-libnm-core-intern/nm-common-macros.h"
#include "nm-client-utils.h" #include "nm-client-utils.h"
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <arpa/inet.h> #include <arpa/inet.h>
#include "nm-common-macros.h" #include "nm-libnm-core-intern/nm-common-macros.h"
#include "nm-client-utils.h" #include "nm-client-utils.h"
#include "nm-vpn-helpers.h" #include "nm-vpn-helpers.h"
......
...@@ -4,7 +4,7 @@ nm_polkit_listener = files('nm-polkit-listener.c') ...@@ -4,7 +4,7 @@ nm_polkit_listener = files('nm-polkit-listener.c')
deps = [ deps = [
libnm_dep, libnm_dep,
nm_core_dep, shared_nm_libnm_core_aux_dep,
] ]
cflags = clients_cflags + [ cflags = clients_cflags + [
...@@ -55,7 +55,7 @@ libnmc = static_library( ...@@ -55,7 +55,7 @@ libnmc = static_library(
sources: files( sources: files(
'nm-meta-setting-access.c', 'nm-meta-setting-access.c',
'nm-meta-setting-desc.c', 'nm-meta-setting-desc.c',
) + shared_nm_meta_setting_c + shared_nm_ethtool_utils_c + shared_nm_libnm_core_utils_c + [settings_docs_source], ) + shared_nm_meta_setting_c + [settings_docs_source],
dependencies: deps, dependencies: deps,
c_args: cflags, c_args: cflags,
link_with: libnmc_base, link_with: libnmc_base,
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
#include "nm-meta-setting.h" #include "nm-meta-setting.h"
#include "nm-active-connection.h" #include "nm-active-connection.h"
#include "nm-device.h" #include "nm-device.h"
#include "nm-libnm-core-utils.h" #include "nm-libnm-core-intern/nm-libnm-core-utils.h"
const NMObject **nmc_objects_sort_by_path (const NMObject *const*objs, gssize len); const NMObject **nmc_objects_sort_by_path (const NMObject *const*objs, gssize len);
......
...@@ -24,10 +24,10 @@ ...@@ -24,10 +24,10 @@
#include <stdlib.h> #include <stdlib.h>
#include <arpa/inet.h> #include <arpa/inet.h>
#include "nm-common-macros.h" #include "nm-libnm-core-intern/nm-common-macros.h"
#include "nm-glib-aux/nm-enum-utils.h" #include "nm-glib-aux/nm-enum-utils.h"
#include "nm-glib-aux/nm-secret-utils.h" #include "nm-glib-aux/nm-secret-utils.h"
#include "nm-libnm-core-utils.h" #include "nm-libnm-core-intern/nm-libnm-core-utils.h"
#include "nm-vpn-helpers.h" #include "nm-vpn-helpers.h"
#include "nm-client-utils.h" #include "nm-client-utils.h"
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#include "nm-glib-aux/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-libnm-core-intern/nm-ethtool-utils.h"
struct _NMDevice; struct _NMDevice;
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
#include "nmt-mac-entry.h" #include "nmt-mac-entry.h"
#include "nm-common-macros.h" #include "nm-libnm-core-intern/nm-common-macros.h"
G_DEFINE_TYPE (NmtMacEntry, nmt_mac_entry, NMT_TYPE_NEWT_ENTRY) G_DEFINE_TYPE (NmtMacEntry, nmt_mac_entry, NMT_TYPE_NEWT_ENTRY)
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
#include "nm-setting-ip6-config.h" #include "nm-setting-ip6-config.h"
#include "nm-setting-connection.h" #include "nm-setting-connection.h"
#include "nm-dispatcher-api.h" #include "nm-libnm-core-aux/nm-dispatcher-api.h"
#include "nm-utils.h" #include "nm-utils.h"
/*****************************************************************************/ /*****************************************************************************/
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
#include <arpa/inet.h> #include <arpa/inet.h>
#include <glib-unix.h> #include <glib-unix.h>
#include "nm-dispatcher-api.h" #include "nm-libnm-core-aux/nm-dispatcher-api.h"
#include "nm-dispatcher-utils.h" #include "nm-dispatcher-utils.h"
#include "nmdbus-dispatcher.h" #include "nmdbus-dispatcher.h"
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
#include <stdlib.h> #include <stdlib.h>
#include "nm-dispatcher-utils.h" #include "nm-dispatcher-utils.h"
#include "nm-dispatcher-api.h" #include "nm-libnm-core-aux/nm-dispatcher-api.h"
#include "nm-utils/nm-test-utils.h" #include "nm-utils/nm-test-utils.h"
......
...@@ -139,6 +139,48 @@ libnm_core_enum = gnome.mkenums( ...@@ -139,6 +139,48 @@ libnm_core_enum = gnome.mkenums(
install_dir: libnm_pkgincludedir, install_dir: libnm_pkgincludedir,
) )
libnm_core_enum_dep = declare_dependency(
sources: libnm_core_enum[1],
)
###############################################################################
shared_nm_libnm_core_intern = static_library(
'nm-libnm-core-intern',
sources: files('../shared/nm-libnm-core-intern/nm-ethtool-utils.c',
'../shared/nm-libnm-core-intern/nm-libnm-core-utils.c'),
c_args: [
'-DG_LOG_DOMAIN="@0@"'.format(libnm_name),
'-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIBNM_CORE',
],
include_directories: [
top_inc,
shared_inc,
libnm_core_inc,
],
dependencies: [
glib_dep,
shared_c_siphash_dep,
shared_nm_glib_aux_dep,
libnm_core_enum_dep,
],
)
shared_nm_libnm_core_intern_dep = declare_dependency(
link_with: shared_nm_libnm_core_intern,
include_directories: [
top_inc,
shared_inc,
],
dependencies: [
glib_dep,
shared_nm_glib_aux_dep,
libnm_systemd_shared_dep,
],
)
###############################################################################
deps = [ deps = [
dl_dep, dl_dep,
libudev_dep, libudev_dep,
...@@ -147,6 +189,7 @@ deps = [ ...@@ -147,6 +189,7 @@ deps = [
shared_c_siphash_dep, shared_c_siphash_dep,
shared_nm_glib_aux_dep, shared_nm_glib_aux_dep,
shared_nm_udev_aux_dep, shared_nm_udev_aux_dep,
shared_nm_libnm_core_intern_dep,
] ]
cflags = [ cflags = [
...@@ -188,8 +231,6 @@ endif ...@@ -188,8 +231,6 @@ endif
libnm_core_sources_all = libnm_core_sources libnm_core_sources_all = libnm_core_sources
libnm_core_sources_all += libnm_core_enum libnm_core_sources_all += libnm_core_enum
libnm_core_sources_all += shared_nm_meta_setting_c 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_sources_all += [version_header]
libnm_core = static_library( libnm_core = static_library(
...@@ -204,12 +245,50 @@ nm_core_dep = declare_dependency( ...@@ -204,12 +245,50 @@ 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_libnm_core_intern_dep,
shared_nm_glib_aux_dep, shared_nm_glib_aux_dep,
shared_c_siphash_dep, shared_c_siphash_dep,
libnm_systemd_shared_dep, libnm_systemd_shared_dep,
], ],
) )
###############################################################################
shared_nm_libnm_core_aux = static_library(
'nm-libnm-core-aux',
sources: files('../shared/nm-libnm-core-aux/nm-dispatcher-api.h'),
c_args: [
'-DG_LOG_DOMAIN="@0@"'.format(libnm_name),
'-DNETWORKMANAGER_COMPILATION=(NM_NETWORKMANAGER_COMPILATION_WITH_GLIB|NM_NETWORKMANAGER_COMPILATION_WITH_GLIB_I18N_LIB)',
],
include_directories: [
top_inc,
shared_inc,
libnm_core_inc,
],
dependencies: [
glib_dep,
shared_c_siphash_dep,
shared_nm_glib_aux_dep,
],
)
shared_nm_libnm_core_aux_dep = declare_dependency(
link_with: shared_nm_libnm_core_aux,
include_directories: [
top_inc,
shared_inc,
],
dependencies: [
nm_core_dep,
glib_dep,
shared_nm_glib_aux_dep,
libnm_systemd_shared_dep,
],
)
###############################################################################
enums_to_docbook = join_paths(meson.source_root(), 'tools', 'enums-to-docbook.pl') enums_to_docbook = join_paths(meson.source_root(), 'tools', 'enums-to-docbook.pl')
docbooks = [ docbooks = [
...@@ -234,6 +313,8 @@ foreach docbook: docbooks ...@@ -234,6 +313,8 @@ foreach docbook: docbooks
content_files += xml.full_path() content_files += xml.full_path()
endforeach endforeach
###############################################################################
if enable_tests if enable_tests
subdir('tests') subdir('tests')
endif endif
...@@ -88,7 +88,7 @@ ...@@ -88,7 +88,7 @@
#include "nm-utils.h"