mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager
synced 2024-07-22 18:54:36 +00:00
build: refine the NETWORKMANAGER_COMPILATION define
Note that: - we compile some source files multiple times. Most notably those under "shared/". - we include a default header "shared/nm-default.h" in every source file. This header is supposed to setup a common environment by defining and including parts that are commonly used. As we always include the same header, the header must behave differently depending one whether the compilation is for libnm-core, NetworkManager or libnm-glib. E.g. it must include <glib/gi18n.h> or <glib/gi18n-lib.h> depending on whether we compile a library or an application. For that, the source files need the NETWORKMANAGER_COMPILATION #define to behave accordingly. Extend the define to be composed of flags. These flags are all named NM_NETWORKMANAGER_COMPILATION_WITH_*, they indicate which part of the build are available. E.g. when building libnm-core.la itself, then WITH_LIBNM_CORE, WITH_LIBNM_CORE_INTERNAL, and WITH_LIBNM_CORE_PRIVATE are available. When building NetworkManager, WITH_LIBNM_CORE_PRIVATE is not available but the internal parts are still accessible. When building nmcli, only WITH_LIBNM_CORE (the public part) is available. This granularily controls the build.
This commit is contained in:
parent
31b6abd4b5
commit
22ef6a507a
110
Makefile.am
110
Makefile.am
|
@ -579,12 +579,13 @@ $(src_devices_wwan_libnm_device_plugin_wwan_la_OBJECTS): $(li
|
|||
libnm_core_libnm_core_la_CPPFLAGS = \
|
||||
$(dflt_cppflags_libnm_core) \
|
||||
-DG_LOG_DOMAIN=\""libnm"\" \
|
||||
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIBNM_CORE \
|
||||
-DLOCALEDIR=\"$(datadir)/locale\" \
|
||||
-DNMCONFDIR=\"$(nmconfdir)\" \
|
||||
-DNMLIBDIR=\"$(nmlibdir)\" \
|
||||
-DNMPLUGINDIR=\"$(pkglibdir)\" \
|
||||
-DLIBEXECDIR=\"$(libexecdir)\" \
|
||||
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIB
|
||||
$(NULL)
|
||||
|
||||
if WITH_JSON_VALIDATION
|
||||
libnm_core_libnm_core_la_CPPFLAGS += $(JANSSON_CFLAGS)
|
||||
|
@ -662,6 +663,8 @@ libnm_core_tests_cppflags = \
|
|||
$(dflt_cppflags_libnm_core) \
|
||||
-I$(srcdir)/libnm-core/tests \
|
||||
-I$(builddir)/libnm-core/tests \
|
||||
-DNETWORKMANAGER_COMPILATION_TEST \
|
||||
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIBNM_CORE \
|
||||
-DTEST_CERT_DIR=\"$(abs_srcdir)/libnm-core/tests/certs\"
|
||||
|
||||
libnm_core_tests_test_compare_CPPFLAGS = $(libnm_core_tests_cppflags)
|
||||
|
@ -842,7 +845,7 @@ libnm_lib_cppflags = \
|
|||
-I$(srcdir)/libnm \
|
||||
-I$(builddir)/libnm \
|
||||
-DG_LOG_DOMAIN=\""libnm"\" \
|
||||
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIB \
|
||||
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIBNM \
|
||||
-DNMRUNDIR=\"$(nmrundir)\"
|
||||
|
||||
libnminclude_HEADERS += \
|
||||
|
@ -1047,7 +1050,8 @@ libnm_tests_cppflags = \
|
|||
$(dflt_cppflags_libnm_core) \
|
||||
-I$(srcdir)/libnm \
|
||||
-I$(builddir)/libnm \
|
||||
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIB \
|
||||
-DNETWORKMANAGER_COMPILATION_TEST \
|
||||
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIBNM \
|
||||
-DTEST_NM_SERVICE=\"$(abs_srcdir)/tools/test-networkmanager-service.py\"
|
||||
|
||||
libnm_tests_ldadd = \
|
||||
|
@ -1107,7 +1111,9 @@ libnm_tests_libnm_vpn_plugin_utils_test_la_CFLAGS = \
|
|||
-I$(builddir)/libnm-core \
|
||||
-I$(srcdir)/libnm \
|
||||
-I$(builddir)/libnm \
|
||||
$(GLIB_CFLAGS)
|
||||
$(GLIB_CFLAGS) \
|
||||
-DNETWORKMANAGER_COMPILATION_TEST \
|
||||
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_CLIENT
|
||||
|
||||
libnm_tests_libnm_vpn_plugin_utils_test_la_LIBADD = \
|
||||
$(GLIB_LIBS)
|
||||
|
@ -1122,8 +1128,7 @@ src_cppflags = \
|
|||
-I$(builddir)/src \
|
||||
\
|
||||
-DPREFIX=\"$(prefix)\" \
|
||||
-DG_LOG_DOMAIN=\""NetworkManager"\" \
|
||||
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_INSIDE_DAEMON \
|
||||
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_DAEMON \
|
||||
\
|
||||
-DBINDIR=\"$(bindir)\" \
|
||||
-DDATADIR=\"$(datadir)\" \
|
||||
|
@ -1610,7 +1615,8 @@ $(src_libNetworkManager_la_OBJECTS): $(libnm_core_lib_h_pub_mkenums)
|
|||
check_ltlibraries += src/libNetworkManagerTest.la
|
||||
|
||||
src_tests_cppflags = \
|
||||
$(src_cppflags)
|
||||
$(src_cppflags) \
|
||||
-DNETWORKMANAGER_COMPILATION_TEST
|
||||
|
||||
if REQUIRE_ROOT_TESTS
|
||||
src_tests_cppflags += -DREQUIRE_ROOT_TESTS=1
|
||||
|
@ -1699,9 +1705,8 @@ src_dhcp_nm_dhcp_helper_CPPFLAGS = \
|
|||
$(GLIB_CFLAGS) \
|
||||
-I$(srcdir)/shared \
|
||||
-I$(builddir)/shared \
|
||||
-I$(srcdir)/libnm-core \
|
||||
-I$(builddir)/libnm-core \
|
||||
-DG_LOG_DOMAIN=\""nm-dhcp-helper"\" \
|
||||
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_GLIB \
|
||||
-DNMRUNDIR=\"$(nmrundir)\"
|
||||
|
||||
src_dhcp_nm_dhcp_helper_SOURCES = \
|
||||
|
@ -1760,10 +1765,8 @@ src_ppp_nm_pppd_plugin_la_CPPFLAGS = \
|
|||
-I$(srcdir)/shared \
|
||||
-I$(builddir)/shared \
|
||||
-I$(srcdir)/libnm-core \
|
||||
-I$(srcdir)/src \
|
||||
-I$(builddir)/libnm-core \
|
||||
-DG_LOG_DOMAIN=\""nm-pppd-plugin"\" \
|
||||
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_INSIDE_DAEMON \
|
||||
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_GLIB \
|
||||
$(GLIB_CFLAGS)
|
||||
|
||||
src_ppp_nm_pppd_plugin_la_SOURCES = \
|
||||
|
@ -1798,8 +1801,7 @@ src_ppp_libnm_ppp_plugin_la_CPPFLAGS = \
|
|||
-I$(builddir)/libnm-core \
|
||||
-I$(srcdir)/libnm-core \
|
||||
-DPPPD_PLUGIN_DIR=\"$(PPPD_PLUGIN_DIR)\" \
|
||||
-DG_LOG_DOMAIN=\""NetworkManager"\" \
|
||||
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_INSIDE_DAEMON \
|
||||
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_DAEMON \
|
||||
$(GLIB_CFLAGS)
|
||||
|
||||
src_ppp_libnm_ppp_plugin_la_LDFLAGS = \
|
||||
|
@ -1890,9 +1892,8 @@ src_settings_plugins_ibft_cppflags = \
|
|||
-I$(builddir)/shared \
|
||||
-I$(srcdir)/libnm-core \
|
||||
-I$(builddir)/libnm-core \
|
||||
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_INSIDE_DAEMON \
|
||||
$(GLIB_CFLAGS) \
|
||||
-DG_LOG_DOMAIN=\""NetworkManager"\" \
|
||||
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_DAEMON \
|
||||
-DSYSCONFDIR=\"$(sysconfdir)\" \
|
||||
-DSBINDIR=\"$(sbindir)\"
|
||||
|
||||
|
@ -1931,8 +1932,8 @@ src_settings_plugins_ibft_tests_test_ibft_CPPFLAGS = \
|
|||
-I$(srcdir)/libnm-core \
|
||||
-I$(builddir)/libnm-core \
|
||||
-I$(srcdir)/src \
|
||||
-DG_LOG_DOMAIN=\""NetworkManager"\" \
|
||||
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_INSIDE_DAEMON \
|
||||
-DNETWORKMANAGER_COMPILATION_TEST \
|
||||
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_DAEMON \
|
||||
-DTEST_IBFT_DIR=\"$(abs_srcdir)/src/settings/plugins/ibft/tests\" \
|
||||
-DTEST_SCRATCH_DIR=\"$(abs_builddir)/src/settings/plugins/ibft/tests\"
|
||||
|
||||
|
@ -1983,10 +1984,9 @@ src_settings_plugins_ifcfg_rh_cppflags = \
|
|||
-I$(builddir)/shared \
|
||||
-I$(srcdir)/libnm-core \
|
||||
-I$(builddir)/libnm-core \
|
||||
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_INSIDE_DAEMON \
|
||||
$(GLIB_CFLAGS) \
|
||||
$(NSS_CFLAGS) \
|
||||
-DG_LOG_DOMAIN=\""NetworkManager"\" \
|
||||
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_DAEMON \
|
||||
-DSYSCONFDIR=\"$(sysconfdir)\" \
|
||||
-DSBINDIR=\"$(sbindir)\"
|
||||
|
||||
|
@ -2320,8 +2320,7 @@ src_settings_plugins_ifupdown_cppflags = \
|
|||
-I$(builddir)/shared \
|
||||
-I$(srcdir)/libnm-core \
|
||||
-I$(builddir)/libnm-core \
|
||||
-DG_LOG_DOMAIN=\""NetworkManager"\" \
|
||||
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_INSIDE_DAEMON \
|
||||
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_DAEMON \
|
||||
$(GLIB_CFLAGS) \
|
||||
$(LIBUDEV_CFLAGS) \
|
||||
-DSYSCONFDIR=\"$(sysconfdir)\"
|
||||
|
@ -2371,8 +2370,8 @@ src_settings_plugins_ifupdown_tests_test_ifupdown_CPPFLAGS = \
|
|||
-I$(srcdir)/libnm-core \
|
||||
-I$(builddir)/libnm-core \
|
||||
-I$(srcdir)/src \
|
||||
-DG_LOG_DOMAIN=\""NetworkManager"\" \
|
||||
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_INSIDE_DAEMON \
|
||||
-DNETWORKMANAGER_COMPILATION_TEST \
|
||||
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_DAEMON \
|
||||
$(GLIB_CFLAGS) \
|
||||
-DTEST_ENI_DIR=\"$(abs_srcdir)/src/settings/plugins/ifupdown/tests\"
|
||||
|
||||
|
@ -2431,8 +2430,7 @@ src_devices_adsl_libnm_device_plugin_adsl_la_CPPFLAGS = \
|
|||
-I$(builddir)/shared \
|
||||
-I$(builddir)/libnm-core \
|
||||
-I$(srcdir)/libnm-core \
|
||||
-DG_LOG_DOMAIN=\""NetworkManager"\" \
|
||||
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_INSIDE_DAEMON \
|
||||
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_DAEMON \
|
||||
$(GLIB_CFLAGS) \
|
||||
$(LIBUDEV_CFLAGS)
|
||||
|
||||
|
@ -2463,8 +2461,7 @@ src_devices_wwan_cppflags = \
|
|||
-I$(builddir)/shared \
|
||||
-I$(srcdir)/libnm-core \
|
||||
-I$(builddir)/libnm-core \
|
||||
-DG_LOG_DOMAIN=\""NetworkManager"\" \
|
||||
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_INSIDE_DAEMON \
|
||||
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_DAEMON \
|
||||
$(GLIB_CFLAGS) \
|
||||
$(LIBSYSTEMD_CFLAGS) \
|
||||
$(MM_GLIB_CFLAGS)
|
||||
|
@ -2564,8 +2561,7 @@ src_devices_bluetooth_libnm_device_plugin_bluetooth_la_CPPFLAGS = \
|
|||
-I$(builddir)/shared \
|
||||
-I$(builddir)/libnm-core \
|
||||
-I$(srcdir)/libnm-core \
|
||||
-DG_LOG_DOMAIN=\""NetworkManager"\" \
|
||||
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_INSIDE_DAEMON \
|
||||
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_DAEMON \
|
||||
$(GLIB_CFLAGS)
|
||||
|
||||
src_devices_bluetooth_libnm_device_plugin_bluetooth_la_LDFLAGS = \
|
||||
|
@ -2629,8 +2625,7 @@ src_devices_wifi_libnm_device_plugin_wifi_la_CPPFLAGS = \
|
|||
-I$(builddir)/shared \
|
||||
-I$(builddir)/libnm-core \
|
||||
-I$(srcdir)/libnm-core \
|
||||
-DG_LOG_DOMAIN=\""NetworkManager"\" \
|
||||
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_INSIDE_DAEMON \
|
||||
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_DAEMON \
|
||||
$(GLIB_CFLAGS)
|
||||
|
||||
src_devices_wifi_libnm_device_plugin_wifi_la_LDFLAGS = \
|
||||
|
@ -2663,8 +2658,8 @@ src_devices_wifi_tests_test_general_CPPFLAGS = \
|
|||
-I$(builddir)/libnm-core \
|
||||
-I$(srcdir)/src \
|
||||
-I$(builddir)/src \
|
||||
-DG_LOG_DOMAIN=\""NetworkManager"\" \
|
||||
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_INSIDE_DAEMON \
|
||||
-DNETWORKMANAGER_COMPILATION_TEST \
|
||||
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_DAEMON \
|
||||
$(GLIB_CFLAGS)
|
||||
|
||||
src_devices_wifi_tests_test_general_LDADD = src/libNetworkManagerTest.la
|
||||
|
@ -2693,8 +2688,7 @@ src_devices_team_libnm_device_plugin_team_la_CPPFLAGS = \
|
|||
-I$(builddir)/shared \
|
||||
-I$(builddir)/libnm-core \
|
||||
-I$(srcdir)/libnm-core \
|
||||
-DG_LOG_DOMAIN=\""NetworkManager"\" \
|
||||
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_INSIDE_DAEMON \
|
||||
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_DAEMON \
|
||||
$(LIBTEAMDCTL_CFLAGS) \
|
||||
$(JANSSON_CFLAGS) \
|
||||
$(GLIB_CFLAGS)
|
||||
|
@ -2752,8 +2746,7 @@ src_devices_ovs_libnm_device_plugin_ovs_la_CPPFLAGS = \
|
|||
-I$(builddir)/libnm-core \
|
||||
-I$(srcdir)/libnm-core \
|
||||
\
|
||||
-DG_LOG_DOMAIN=\""NetworkManager"\" \
|
||||
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_INSIDE_DAEMON \
|
||||
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_DAEMON \
|
||||
-DRUNSTATEDIR=\"$(runstatedir)\" \
|
||||
\
|
||||
$(JANSSON_CFLAGS) \
|
||||
|
@ -3045,7 +3038,9 @@ $(src_tests_test_general_with_expect_OBJECTS): $(libnm_core_lib_h_pub_mkenums)
|
|||
$(src_tests_test_wired_defname_OBJECTS): $(libnm_core_lib_h_pub_mkenums)
|
||||
$(src_tests_test_utils_OBJECTS): $(libnm_core_lib_h_pub_mkenums)
|
||||
|
||||
src_tests_test_systemd_CPPFLAGS = $(src_libsystemd_nm_la_cppflags)
|
||||
src_tests_test_systemd_CPPFLAGS = \
|
||||
$(src_libsystemd_nm_la_cppflags) \
|
||||
-DNETWORKMANAGER_COMPILATION_TEST
|
||||
src_tests_test_systemd_SOURCES = \
|
||||
shared/nm-utils/siphash24.c \
|
||||
src/tests/test-systemd.c
|
||||
|
@ -3072,9 +3067,13 @@ dispatcher_cppflags = \
|
|||
-I$(builddir)/shared \
|
||||
-I$(srcdir)/libnm-core \
|
||||
-I$(builddir)/libnm-core \
|
||||
-I$(srcdir)/libnm \
|
||||
-I$(builddir)/libnm \
|
||||
-I$(srcdir)/dispatcher \
|
||||
-I$(builddir)/dispatcher \
|
||||
$(GLIB_CFLAGS) \
|
||||
-DG_LOG_DOMAIN=\""nm-dispatcher"\" \
|
||||
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_CLIENT \
|
||||
-DNMCONFDIR=\"$(nmconfdir)\" \
|
||||
-DSYSCONFDIR=\"$(sysconfdir)\" \
|
||||
-DLIBEXECDIR=\"$(libexecdir)\"
|
||||
|
@ -3166,9 +3165,13 @@ dispatcher_tests_test_dispatcher_envp_CPPFLAGS = \
|
|||
-I$(builddir)/shared \
|
||||
-I$(srcdir)/libnm-core \
|
||||
-I$(builddir)/libnm-core \
|
||||
-I$(srcdir)/libnm \
|
||||
-I$(builddir)/libnm \
|
||||
-I$(srcdir)/dispatcher \
|
||||
-I$(builddir)/dispatcher \
|
||||
-DSRCDIR=\"$(abs_srcdir)/dispatcher/tests\" \
|
||||
-DNETWORKMANAGER_COMPILATION_TEST \
|
||||
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_CLIENT \
|
||||
$(GLIB_CFLAGS)
|
||||
|
||||
dispatcher_tests_test_dispatcher_envp_LDADD = \
|
||||
|
@ -3202,6 +3205,7 @@ clients_nm_online_CPPFLAGS = \
|
|||
-I$(builddir)/libnm \
|
||||
$(GLIB_CFLAGS) \
|
||||
-DG_LOG_DOMAIN=\""nm-online"\" \
|
||||
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_CLIENT \
|
||||
-DNMLOCALEDIR=\"$(datadir)/locale\"
|
||||
|
||||
clients_nm_online_LDFLAGS = \
|
||||
|
@ -3227,7 +3231,8 @@ clients_cppflags = \
|
|||
-I$(srcdir)/clients/common \
|
||||
-I$(builddir)/clients/common \
|
||||
$(GLIB_CFLAGS) \
|
||||
-DNMLOCALEDIR=\"$(datadir)/locale\"
|
||||
-DNMLOCALEDIR=\"$(datadir)/locale\" \
|
||||
$(NULL)
|
||||
|
||||
check_ltlibraries += clients/common/libnmc-base.la
|
||||
|
||||
|
@ -3251,7 +3256,8 @@ clients_common_libnmc_base_la_SOURCES = \
|
|||
|
||||
clients_common_libnmc_base_la_CPPFLAGS = \
|
||||
$(clients_cppflags) \
|
||||
-DG_LOG_DOMAIN=\""libnmc"\"
|
||||
-DG_LOG_DOMAIN=\""libnmc"\" \
|
||||
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_CLIENT
|
||||
|
||||
clients_common_libnmc_base_la_LIBADD = \
|
||||
libnm/libnm.la \
|
||||
|
@ -3301,7 +3307,8 @@ clients_common_libnmc_la_SOURCES = \
|
|||
|
||||
clients_common_libnmc_la_CPPFLAGS = \
|
||||
$(clients_cppflags) \
|
||||
-DG_LOG_DOMAIN=\""libnmc"\"
|
||||
-DG_LOG_DOMAIN=\""libnmc"\" \
|
||||
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_CLIENT
|
||||
|
||||
clients_common_libnmc_la_LIBADD = \
|
||||
libnm/libnm.la \
|
||||
|
@ -3323,7 +3330,8 @@ endif
|
|||
clients_common_tests_test_general_CPPFLAGS = \
|
||||
-I$(srcdir)/clients/common/tests \
|
||||
$(clients_cppflags) \
|
||||
-DG_LOG_DOMAIN=\""libnmc"\"
|
||||
-DNETWORKMANAGER_COMPILATION_TEST \
|
||||
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_CLIENT
|
||||
|
||||
clients_common_tests_test_general_LDADD = \
|
||||
libnm/libnm.la \
|
||||
|
@ -3366,6 +3374,7 @@ clients_cli_nmcli_CPPFLAGS = \
|
|||
-I$(srcdir)/clients/cli \
|
||||
$(clients_cppflags) \
|
||||
-DG_LOG_DOMAIN=\""nmcli"\" \
|
||||
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_CLIENT \
|
||||
-DNMCLI_LOCALEDIR=\"$(datadir)/locale\"
|
||||
|
||||
clients_cli_nmcli_LDADD = \
|
||||
|
@ -3463,7 +3472,10 @@ clients_tui_newt_libnmt_newt_a_CPPFLAGS = \
|
|||
-I$(builddir)/shared \
|
||||
-I$(srcdir)/libnm-core \
|
||||
-I$(builddir)/libnm-core \
|
||||
-I$(srcdir)/libnm \
|
||||
-I$(builddir)/libnm \
|
||||
-DG_LOG_DOMAIN=\""nmtui"\" \
|
||||
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_CLIENT \
|
||||
$(GLIB_CFLAGS) \
|
||||
$(NEWT_CFLAGS) \
|
||||
$(NULL)
|
||||
|
@ -3560,6 +3572,7 @@ clients_tui_nmtui_CPPFLAGS = \
|
|||
$(clients_cppflags) \
|
||||
$(NEWT_CFLAGS) \
|
||||
-DG_LOG_DOMAIN=\""nmtui"\" \
|
||||
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_CLIENT \
|
||||
-DLOCALEDIR=\""$(localedir)"\"
|
||||
|
||||
clients_tui_nmtui_LDFLAGS = \
|
||||
|
@ -3686,8 +3699,8 @@ libnm_util_cppflags = \
|
|||
-I$(srcdir)/shared \
|
||||
-I$(builddir)/shared \
|
||||
-DG_LOG_DOMAIN=\""libnm-util"\" \
|
||||
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIBNM_UTIL \
|
||||
-DLOCALEDIR=\"$(datadir)/locale\" \
|
||||
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIB_LEGACY \
|
||||
$(GLIB_CFLAGS) \
|
||||
$(DBUS_CFLAGS) \
|
||||
$(UUID_CFLAGS)
|
||||
|
@ -3897,7 +3910,9 @@ libnm_util_tests_cppflags = \
|
|||
$(GLIB_CFLAGS) \
|
||||
$(DBUS_CFLAGS) \
|
||||
-DBUILD_DIR=\"$(abs_builddir)/libnm-util/tests\" \
|
||||
-DTEST_CERT_DIR=\"$(abs_srcdir)/libnm-core/tests/certs\"
|
||||
-DTEST_CERT_DIR=\"$(abs_srcdir)/libnm-core/tests/certs\" \
|
||||
-DNETWORKMANAGER_COMPILATION_TEST \
|
||||
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIBNM_UTIL
|
||||
|
||||
libnm_util_tests_ldadd = \
|
||||
libnm-util/libnm-util.la \
|
||||
|
@ -3961,7 +3976,7 @@ libnm_glib_cppflags = \
|
|||
-I$(srcdir)/libnm-glib \
|
||||
-I$(builddir)/libnm-glib \
|
||||
-DG_LOG_DOMAIN=\""libnm-glib"\" \
|
||||
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIB_LEGACY \
|
||||
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIBNM_GLIB \
|
||||
$(DBUS_CFLAGS) \
|
||||
$(GLIB_CFLAGS)
|
||||
|
||||
|
@ -4232,7 +4247,8 @@ libnm_glib_tests_cppflags = \
|
|||
-I$(srcdir)/libnm-util \
|
||||
-I$(builddir)/libnm-util \
|
||||
-I$(srcdir)/libnm-glib \
|
||||
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIB_LEGACY \
|
||||
-DNETWORKMANAGER_COMPILATION_TEST \
|
||||
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIBNM_GLIB \
|
||||
-DTEST_NM_SERVICE=\"$(abs_srcdir)/tools/test-networkmanager-service.py\" \
|
||||
$(GLIB_CFLAGS) \
|
||||
$(DBUS_CFLAGS)
|
||||
|
|
|
@ -30,9 +30,9 @@ deps = [
|
|||
readline_dep
|
||||
]
|
||||
|
||||
cflags = [
|
||||
cflags = clients_cflags + [
|
||||
'-DG_LOG_DOMAIN="nmcli"',
|
||||
'-DNMCLI_LOCALEDIR="@0@"'.format(nm_localedir)
|
||||
'-DNMCLI_LOCALEDIR="@0@"'.format(nm_localedir),
|
||||
]
|
||||
|
||||
ldflags = []
|
||||
|
|
|
@ -13,9 +13,8 @@ deps = [
|
|||
libnm_dep
|
||||
]
|
||||
|
||||
cflags = [
|
||||
cflags = clients_cflags + [
|
||||
'-DG_LOG_DOMAIN="libnmc"',
|
||||
'-DNMLOCALEDIR="@0@"'.format(nm_localedir)
|
||||
]
|
||||
|
||||
sources = shared_utils + files(
|
||||
|
@ -29,7 +28,7 @@ libnmc_base = static_library(
|
|||
sources: sources + [libnm_core_enum[1]],
|
||||
include_directories: incs,
|
||||
dependencies: deps,
|
||||
c_args: common_cflags
|
||||
c_args: cflags,
|
||||
)
|
||||
|
||||
libnmc_base_dep = declare_dependency(
|
||||
|
@ -75,7 +74,7 @@ libnmc = static_library(
|
|||
sources: sources + [libnm_core_enum[1]],
|
||||
include_directories: incs,
|
||||
dependencies: deps,
|
||||
c_args: common_cflags,
|
||||
c_args: cflags,
|
||||
link_with: libnmc_base,
|
||||
link_depends: settings_docs_source
|
||||
)
|
||||
|
|
|
@ -10,7 +10,9 @@ exe = executable(
|
|||
test_unit + '.c',
|
||||
include_directories: incs,
|
||||
dependencies: deps,
|
||||
c_args: cflags
|
||||
c_args: clients_cflags + [
|
||||
'-DNETWORKMANAGER_COMPILATION_TEST',
|
||||
],
|
||||
)
|
||||
|
||||
test(test_unit, exe)
|
||||
|
|
|
@ -11,9 +11,13 @@ deps = [
|
|||
libnm_dep
|
||||
]
|
||||
|
||||
cflags = [
|
||||
clients_cflags = [
|
||||
'-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_CLIENT',
|
||||
'-DNMLOCALEDIR="@0@"'.format(nm_localedir),
|
||||
]
|
||||
|
||||
cflags = clients_cflags + [
|
||||
'-DG_LOG_DOMAIN="@0@"'.format(name),
|
||||
'-DNMLOCALEDIR="@0@"'.format(nm_localedir)
|
||||
]
|
||||
|
||||
ldflags = []
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
incs = [
|
||||
top_inc,
|
||||
shared_inc,
|
||||
libnm_core_inc
|
||||
libnm_core_inc,
|
||||
libnm_inc,
|
||||
]
|
||||
|
||||
deps = [
|
||||
|
@ -9,7 +10,10 @@ deps = [
|
|||
newt_dep
|
||||
]
|
||||
|
||||
cflags = ['-DG_LOG_DOMAIN="nmtui"']
|
||||
cflags = clients_cflags + [
|
||||
'-DG_LOG_DOMAIN="nmtui"',
|
||||
'-DLOCALEDIR="@0@"'.format(nm_localedir),
|
||||
]
|
||||
|
||||
subdir('newt')
|
||||
|
||||
|
@ -62,8 +66,6 @@ deps += [
|
|||
libnmt_newt_dep
|
||||
]
|
||||
|
||||
cflags += '-DLOCALEDIR="@0@"'.format(nm_localedir)
|
||||
|
||||
ldflags = []
|
||||
if have_version_script
|
||||
ldflags += '-Wl,--version-script,@0@'.format(linker_script_binary)
|
||||
|
|
|
@ -39,7 +39,9 @@ deps = [
|
|||
cflags = [
|
||||
'-DLIBEXECDIR="@0@"'.format(nm_libexecdir),
|
||||
'-DSYSCONFDIR="@0@"'.format(nm_sysconfdir),
|
||||
'-DNMCONFDIR="@0@"'.format(nm_pkgconfdir)
|
||||
'-DNMCONFDIR="@0@"'.format(nm_pkgconfdir),
|
||||
'-DG_LOG_DOMAIN="@0@"'.format(name),
|
||||
'-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_CLIENT',
|
||||
]
|
||||
|
||||
libnm_dispatcher_core = static_library(
|
||||
|
|
|
@ -4,10 +4,15 @@ incs = [
|
|||
top_inc,
|
||||
shared_inc,
|
||||
libnm_core_inc,
|
||||
libnm_inc,
|
||||
dispatcher_inc
|
||||
]
|
||||
|
||||
cflags = '-DSRCDIR="@0@"'.format(meson.current_source_dir())
|
||||
cflags = [
|
||||
'-DNETWORKMANAGER_COMPILATION_TEST',
|
||||
'-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_CLIENT',
|
||||
'-DSRCDIR="@0@"'.format(meson.current_source_dir()),
|
||||
]
|
||||
|
||||
exe = executable(
|
||||
test_unit,
|
||||
|
|
|
@ -24,7 +24,6 @@
|
|||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "nm-core-internal.h"
|
||||
#include "nm-dispatcher-utils.h"
|
||||
#include "nm-dispatcher-api.h"
|
||||
|
||||
|
|
|
@ -24,6 +24,10 @@
|
|||
#ifndef __CRYPTO_H__
|
||||
#define __CRYPTO_H__
|
||||
|
||||
#if !((NETWORKMANAGER_COMPILATION) & NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_CORE_PRIVATE)
|
||||
#error Cannot use this header.
|
||||
#endif
|
||||
|
||||
#define MD5_HASH_LEN 20
|
||||
#define CIPHER_DES_EDE3_CBC "DES-EDE3-CBC"
|
||||
#define CIPHER_DES_CBC "DES-CBC"
|
||||
|
|
|
@ -142,7 +142,7 @@ deps = [
|
|||
|
||||
cflags = [
|
||||
'-DG_LOG_DOMAIN="libnm"',
|
||||
'-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIB',
|
||||
'-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIBNM_CORE',
|
||||
'-DLIBEXECDIR="@0@"'.format(nm_libexecdir),
|
||||
'-DLOCALEDIR="@0@"'.format(nm_localedir),
|
||||
'-DNMCONFDIR="@0@"'.format(nm_pkgconfdir),
|
||||
|
|
|
@ -21,6 +21,10 @@
|
|||
#ifndef __NM_CONNECTION_PRIVATE_H__
|
||||
#define __NM_CONNECTION_PRIVATE_H__
|
||||
|
||||
#if !((NETWORKMANAGER_COMPILATION) & NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_CORE_PRIVATE)
|
||||
#error Cannot use this header.
|
||||
#endif
|
||||
|
||||
#include "nm-setting.h"
|
||||
#include "nm-connection.h"
|
||||
|
||||
|
|
|
@ -31,6 +31,9 @@
|
|||
* statically against libnm-core. This basically means libnm-core, libnm, NetworkManager
|
||||
* and some test programs.
|
||||
**/
|
||||
#if !((NETWORKMANAGER_COMPILATION) & NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_CORE_INTERNAL)
|
||||
#error Cannot use this header.
|
||||
#endif
|
||||
|
||||
|
||||
#include "nm-connection.h"
|
||||
|
|
|
@ -22,6 +22,10 @@
|
|||
#ifndef NM_CORE_TYPES_INTERNAL_H
|
||||
#define NM_CORE_TYPES_INTERNAL_H
|
||||
|
||||
#if !((NETWORKMANAGER_COMPILATION) & NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_CORE_INTERNAL)
|
||||
#error Cannot use this header.
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
guint32 from;
|
||||
guint32 to;
|
||||
|
|
|
@ -22,6 +22,10 @@
|
|||
#ifndef __NM_KEYFILE_INTERNAL_H__
|
||||
#define __NM_KEYFILE_INTERNAL_H__
|
||||
|
||||
#if !((NETWORKMANAGER_COMPILATION) & NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_CORE_INTERNAL)
|
||||
#error Cannot use this header.
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#include "nm-connection.h"
|
||||
|
|
|
@ -21,7 +21,9 @@
|
|||
#ifndef __NM_KEYFILE_UTILS_H__
|
||||
#define __NM_KEYFILE_UTILS_H__
|
||||
|
||||
#include <glib.h>
|
||||
#if !((NETWORKMANAGER_COMPILATION) & NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_CORE_PRIVATE)
|
||||
#error Cannot use this header.
|
||||
#endif
|
||||
|
||||
#define NM_KEYFILE_GROUP_VPN_SECRETS "vpn-secrets"
|
||||
|
||||
|
|
|
@ -23,6 +23,10 @@
|
|||
#ifndef __NM_PROPERTY_COMPARE_H__
|
||||
#define __NM_PROPERTY_COMPARE_H__
|
||||
|
||||
#if !((NETWORKMANAGER_COMPILATION) & NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_CORE_PRIVATE)
|
||||
#error Cannot use this header.
|
||||
#endif
|
||||
|
||||
int nm_property_compare (GVariant *value1, GVariant *value2);
|
||||
|
||||
#endif /* __NM_PROPERTY_COMPARE_H__ */
|
||||
|
|
|
@ -21,6 +21,10 @@
|
|||
#ifndef __NM_SETTING_PRIVATE_H__
|
||||
#define __NM_SETTING_PRIVATE_H__
|
||||
|
||||
#if !((NETWORKMANAGER_COMPILATION) & NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_CORE_PRIVATE)
|
||||
#error Cannot use this header.
|
||||
#endif
|
||||
|
||||
#include "nm-setting.h"
|
||||
#include "nm-connection.h"
|
||||
#include "nm-core-enum-types.h"
|
||||
|
|
|
@ -21,8 +21,8 @@
|
|||
#ifndef __NM_UTILS_PRIVATE_H__
|
||||
#define __NM_UTILS_PRIVATE_H__
|
||||
|
||||
#ifdef __NETWORKMANAGER_TYPES_H__
|
||||
#error "nm-utils-private.h" must not be used outside of libnm-core/. Do you want "nm-core-internal.h"?
|
||||
#if !((NETWORKMANAGER_COMPILATION) & NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_CORE_PRIVATE)
|
||||
#error Cannot use this header.
|
||||
#endif
|
||||
|
||||
#include "nm-setting-private.h"
|
||||
|
|
|
@ -35,7 +35,11 @@ incs = [
|
|||
|
||||
test_cert_dir = join_paths(meson.current_source_dir(), 'certs')
|
||||
|
||||
cflags = '-DTEST_CERT_DIR="@0@"'.format(test_cert_dir)
|
||||
cflags = [
|
||||
'-DNETWORKMANAGER_COMPILATION_TEST',
|
||||
'-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIBNM_CORE',
|
||||
'-DTEST_CERT_DIR="@0@"'.format(test_cert_dir),
|
||||
]
|
||||
|
||||
foreach test_unit: test_units
|
||||
exe = executable(
|
||||
|
|
|
@ -12,8 +12,11 @@ common_deps = [
|
|||
]
|
||||
|
||||
common_cflags = [
|
||||
'-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIBNM_GLIB',
|
||||
]
|
||||
|
||||
cflags = common_cflags + [
|
||||
'-DG_LOG_DOMAIN="libnm-glib"',
|
||||
'-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIB_LEGACY'
|
||||
]
|
||||
|
||||
libnm_glib_inc = include_directories('.')
|
||||
|
@ -64,17 +67,15 @@ install_headers(
|
|||
|
||||
incs = common_incs + [libnm_util_inc]
|
||||
|
||||
cflags = common_cflags + [
|
||||
'-Wno-deprecated-declarations',
|
||||
'-Wno-deprecated'
|
||||
]
|
||||
|
||||
libdeprecated_nm_glib = static_library(
|
||||
'deprecated-nm-glib',
|
||||
sources: 'libnm_glib.c',
|
||||
include_directories: incs,
|
||||
dependencies: common_deps,
|
||||
c_args: cflags
|
||||
c_args: cflags + [
|
||||
'-Wno-deprecated-declarations',
|
||||
'-Wno-deprecated',
|
||||
],
|
||||
)
|
||||
|
||||
sources = files(
|
||||
|
@ -119,7 +120,7 @@ libnm_glib_vpn = shared_library(
|
|||
version: libnm_glib_vpn_version,
|
||||
include_directories: common_incs,
|
||||
dependencies: deps,
|
||||
c_args: common_cflags,
|
||||
c_args: cflags,
|
||||
link_args: ldflags,
|
||||
link_depends: symbol_map,
|
||||
install: true
|
||||
|
@ -200,8 +201,6 @@ deps = common_deps + [
|
|||
libnm_util_dep
|
||||
]
|
||||
|
||||
cflags = common_cflags + ['-DNMRUNDIR="@0@"'.format(nm_pkgrundir)]
|
||||
|
||||
symbol_map = join_paths(meson.current_source_dir(), 'libnm-glib.ver')
|
||||
|
||||
ldflags = []
|
||||
|
@ -215,7 +214,9 @@ libnm_glib = shared_library(
|
|||
version: libnm_glib_version,
|
||||
include_directories: common_incs,
|
||||
dependencies: deps,
|
||||
c_args: cflags,
|
||||
c_args: cflags + [
|
||||
'-DNMRUNDIR="@0@"'.format(nm_pkgrundir),
|
||||
],
|
||||
link_with: libdeprecated_nm_glib,
|
||||
link_args: ldflags,
|
||||
link_depends: symbol_map,
|
||||
|
@ -262,7 +263,9 @@ if enable_introspection
|
|||
symbol_prefix: nm_id_prefix.to_lower(),
|
||||
export_packages: ['libnm-glib', 'libnm-glib-vpn'],
|
||||
includes: gir_includes,
|
||||
extra_args: common_cflags + ['--include-uninstalled=' + libnm_util_gir[0].full_path()],
|
||||
extra_args: cflags + [
|
||||
'--include-uninstalled=' + libnm_util_gir[0].full_path(),
|
||||
],
|
||||
install: true
|
||||
)
|
||||
endif
|
||||
|
@ -276,7 +279,7 @@ executable(
|
|||
[name + '.c', libnm_utils_enum[1]],
|
||||
include_directories: common_incs,
|
||||
dependencies: deps,
|
||||
c_args: common_cflags,
|
||||
c_args: cflags,
|
||||
link_with: libnm_glib
|
||||
)
|
||||
|
||||
|
|
|
@ -11,11 +11,6 @@ deps = [
|
|||
libnm_util_dep
|
||||
]
|
||||
|
||||
cflags = [
|
||||
'-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIB_LEGACY',
|
||||
'-DTEST_NM_SERVICE="@0@"'.format(join_paths(meson.source_root(), 'tools', 'test-networkmanager-service.py'))
|
||||
]
|
||||
|
||||
test_units = [
|
||||
'test-nm-client',
|
||||
'test-remote-settings-client'
|
||||
|
@ -27,7 +22,10 @@ foreach test_unit: test_units
|
|||
[test_unit + '.c', libnm_utils_enum[1]] + shared_test_utils,
|
||||
include_directories: incs,
|
||||
dependencies: deps,
|
||||
c_args: cflags
|
||||
c_args: common_cflags + [
|
||||
'-DNETWORKMANAGER_COMPILATION_TEST',
|
||||
'-DTEST_NM_SERVICE="@0@"'.format(join_paths(meson.source_root(), 'tools', 'test-networkmanager-service.py')),
|
||||
],
|
||||
)
|
||||
|
||||
test(test_unit, exe)
|
||||
|
|
|
@ -104,10 +104,13 @@ deps = [
|
|||
uuid_dep
|
||||
]
|
||||
|
||||
cflags = [
|
||||
common_cflags = [
|
||||
'-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIBNM_UTIL',
|
||||
'-DLOCALEDIR="@0@"'.format(nm_localedir),
|
||||
]
|
||||
|
||||
cflags = common_cflags + [
|
||||
'-DG_LOG_DOMAIN="libnm-util"',
|
||||
'-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIB_LEGACY',
|
||||
'-DLOCALEDIR="@0@"'.format(nm_localedir)
|
||||
]
|
||||
|
||||
symbol_map = join_paths(meson.current_source_dir(), 'libnm-util.ver')
|
||||
|
|
|
@ -10,9 +10,10 @@ deps = [
|
|||
libnm_util_dep
|
||||
]
|
||||
|
||||
cflags = [
|
||||
cflags = common_cflags + [
|
||||
'-DBUILD_DIR="@0@"'.format(meson.current_build_dir()),
|
||||
'-DTEST_CERT_DIR="@0@"'.format(test_cert_dir)
|
||||
'-DTEST_CERT_DIR="@0@"'.format(test_cert_dir),
|
||||
'-DNETWORKMANAGER_COMPILATION_TEST',
|
||||
]
|
||||
|
||||
test = 'test-libnm-linking'
|
||||
|
|
|
@ -21,7 +21,7 @@ deps = [
|
|||
|
||||
cflags = [
|
||||
'-DG_LOG_DOMAIN="libnm"',
|
||||
'-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIB',
|
||||
'-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIBNM',
|
||||
'-DNMRUNDIR="@0@"'.format(nm_pkgrundir)
|
||||
]
|
||||
|
||||
|
|
|
@ -21,6 +21,10 @@
|
|||
#ifndef __NM_DBUS_HELPERS_PRIVATE_H__
|
||||
#define __NM_DBUS_HELPERS_PRIVATE_H__
|
||||
|
||||
#if !((NETWORKMANAGER_COMPILATION) & NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_PRIVATE)
|
||||
#error Cannot use this header.
|
||||
#endif
|
||||
|
||||
#include "nm-dbus-compat.h"
|
||||
|
||||
GBusType _nm_dbus_bus_type (void);
|
||||
|
|
|
@ -21,9 +21,11 @@
|
|||
#ifndef __NM_DHCP4_CONFIG_H__
|
||||
#define __NM_DHCP4_CONFIG_H__
|
||||
|
||||
#include "nm-dhcp-config.h"
|
||||
#if !((NETWORKMANAGER_COMPILATION) & NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_PRIVATE)
|
||||
#error Cannot use this header.
|
||||
#endif
|
||||
|
||||
G_BEGIN_DECLS
|
||||
#include "nm-dhcp-config.h"
|
||||
|
||||
#define NM_TYPE_DHCP4_CONFIG (nm_dhcp4_config_get_type ())
|
||||
#define NM_DHCP4_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DHCP4_CONFIG, NMDhcp4Config))
|
||||
|
@ -40,13 +42,8 @@ typedef struct {
|
|||
|
||||
typedef struct {
|
||||
NMDhcpConfigClass parent;
|
||||
|
||||
/*< private >*/
|
||||
gpointer padding[4];
|
||||
} NMDhcp4ConfigClass;
|
||||
|
||||
GType nm_dhcp4_config_get_type (void);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __NM_DHCP4_CONFIG_H__ */
|
||||
|
|
|
@ -21,9 +21,11 @@
|
|||
#ifndef __NM_DHCP6_CONFIG_H__
|
||||
#define __NM_DHCP6_CONFIG_H__
|
||||
|
||||
#include "nm-dhcp-config.h"
|
||||
#if !((NETWORKMANAGER_COMPILATION) & NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_PRIVATE)
|
||||
#error Cannot use this header.
|
||||
#endif
|
||||
|
||||
G_BEGIN_DECLS
|
||||
#include "nm-dhcp-config.h"
|
||||
|
||||
#define NM_TYPE_DHCP6_CONFIG (nm_dhcp6_config_get_type ())
|
||||
#define NM_DHCP6_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DHCP6_CONFIG, NMDhcp6Config))
|
||||
|
@ -40,13 +42,8 @@ typedef struct {
|
|||
|
||||
typedef struct {
|
||||
NMDhcpConfigClass parent;
|
||||
|
||||
/*< private >*/
|
||||
gpointer padding[4];
|
||||
} NMDhcp6ConfigClass;
|
||||
|
||||
GType nm_dhcp6_config_get_type (void);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __NM_DHCP6_CONFIG_H__ */
|
||||
|
|
|
@ -21,11 +21,13 @@
|
|||
#ifndef __NM_DNS_MANAGER_H__
|
||||
#define __NM_DNS_MANAGER_H__
|
||||
|
||||
#if !((NETWORKMANAGER_COMPILATION) & NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_PRIVATE)
|
||||
#error Cannot use this header.
|
||||
#endif
|
||||
|
||||
#include "nm-object.h"
|
||||
#include "nm-client.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define NM_TYPE_DNS_MANAGER (nm_dns_manager_get_type ())
|
||||
#define NM_DNS_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DNS_MANAGER, NMDnsManager))
|
||||
#define NM_DNS_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_DNS_MANAGER, NMDnsManagerClass))
|
||||
|
@ -49,13 +51,8 @@ struct _NMDnsManager {
|
|||
|
||||
struct _NMDnsManagerClass {
|
||||
NMObjectClass parent;
|
||||
|
||||
/*< private >*/
|
||||
gpointer padding[8];
|
||||
};
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
GType nm_dns_manager_get_type (void);
|
||||
|
||||
const char *nm_dns_manager_get_mode (NMDnsManager *manager);
|
||||
|
|
|
@ -22,9 +22,11 @@
|
|||
#ifndef __NM_IP4_CONFIG_H__
|
||||
#define __NM_IP4_CONFIG_H__
|
||||
|
||||
#include "nm-ip-config.h"
|
||||
#if !((NETWORKMANAGER_COMPILATION) & NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_PRIVATE)
|
||||
#error Cannot use this header.
|
||||
#endif
|
||||
|
||||
G_BEGIN_DECLS
|
||||
#include "nm-ip-config.h"
|
||||
|
||||
#define NM_TYPE_IP4_CONFIG (nm_ip4_config_get_type ())
|
||||
#define NM_IP4_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_IP4_CONFIG, NMIP4Config))
|
||||
|
@ -42,13 +44,8 @@ typedef struct {
|
|||
|
||||
typedef struct {
|
||||
NMIPConfigClass parent;
|
||||
|
||||
/*< private >*/
|
||||
gpointer padding[4];
|
||||
} NMIP4ConfigClass;
|
||||
|
||||
GType nm_ip4_config_get_type (void);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __NM_IP4_CONFIG_H__ */
|
||||
|
|
|
@ -22,9 +22,11 @@
|
|||
#ifndef __NM_IP6_CONFIG_H__
|
||||
#define __NM_IP6_CONFIG_H__
|
||||
|
||||
#include "nm-ip-config.h"
|
||||
#if !((NETWORKMANAGER_COMPILATION) & NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_PRIVATE)
|
||||
#error Cannot use this header.
|
||||
#endif
|
||||
|
||||
G_BEGIN_DECLS
|
||||
#include "nm-ip-config.h"
|
||||
|
||||
#define NM_TYPE_IP6_CONFIG (nm_ip6_config_get_type ())
|
||||
#define NM_IP6_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_IP6_CONFIG, NMIP6Config))
|
||||
|
@ -42,13 +44,8 @@ typedef struct {
|
|||
|
||||
typedef struct {
|
||||
NMIPConfigClass parent;
|
||||
|
||||
/*< private >*/
|
||||
gpointer padding[4];
|
||||
} NMIP6ConfigClass;
|
||||
|
||||
GType nm_ip6_config_get_type (void);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __NM_IP6_CONFIG_H__ */
|
||||
|
|
|
@ -21,6 +21,10 @@
|
|||
#ifndef __NM_LIBNM_UTILS_H__
|
||||
#define __NM_LIBNM_UTILS_H__
|
||||
|
||||
#if !((NETWORKMANAGER_COMPILATION) & NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_PRIVATE)
|
||||
#error Cannot use this header.
|
||||
#endif
|
||||
|
||||
char *nm_utils_fixup_desc_string (const char *desc);
|
||||
|
||||
#endif /* __NM_LIBNM_UTILS_H__ */
|
||||
|
|
|
@ -22,11 +22,13 @@
|
|||
#ifndef __NM_MANAGER_H__
|
||||
#define __NM_MANAGER_H__
|
||||
|
||||
#if !((NETWORKMANAGER_COMPILATION) & NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_PRIVATE)
|
||||
#error Cannot use this header.
|
||||
#endif
|
||||
|
||||
#include "nm-object.h"
|
||||
#include "nm-client.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define NM_TYPE_MANAGER (nm_manager_get_type ())
|
||||
#define NM_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_MANAGER, NMManager))
|
||||
#define NM_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_MANAGER, NMManagerClass))
|
||||
|
@ -75,8 +77,6 @@ typedef struct {
|
|||
void (*permission_changed) (NMManager *manager,
|
||||
NMClientPermission permission,
|
||||
NMClientPermissionResult result);
|
||||
|
||||
/* nm-manager.h is internal API. We can add more slots without breaking ABI. */
|
||||
} NMManagerClass;
|
||||
|
||||
GType nm_manager_get_type (void);
|
||||
|
@ -102,13 +102,10 @@ gboolean nm_manager_wimax_get_enabled (NMManager *manager);
|
|||
void nm_manager_wimax_set_enabled (NMManager *manager, gboolean enabled);
|
||||
gboolean nm_manager_wimax_hardware_get_enabled (NMManager *manager);
|
||||
|
||||
NM_AVAILABLE_IN_1_10
|
||||
gboolean nm_manager_connectivity_check_get_available (NMManager *manager);
|
||||
|
||||
NM_AVAILABLE_IN_1_10
|
||||
gboolean nm_manager_connectivity_check_get_enabled (NMManager *manager);
|
||||
|
||||
NM_AVAILABLE_IN_1_10
|
||||
void nm_manager_connectivity_check_set_enabled (NMManager *manager,
|
||||
gboolean enabled);
|
||||
|
||||
|
@ -140,7 +137,6 @@ NMConnectivityState nm_manager_check_connectivity_finish (NMManager *manager,
|
|||
/* Devices */
|
||||
|
||||
const GPtrArray *nm_manager_get_devices (NMManager *manager);
|
||||
NM_AVAILABLE_IN_1_2
|
||||
const GPtrArray *nm_manager_get_all_devices(NMManager *manager);
|
||||
NMDevice *nm_manager_get_device_by_path (NMManager *manager, const char *object_path);
|
||||
NMDevice *nm_manager_get_device_by_iface (NMManager *manager, const char *iface);
|
||||
|
@ -215,6 +211,4 @@ GHashTable *nm_manager_checkpoint_rollback_finish (NMManager *manager,
|
|||
GAsyncResult *result,
|
||||
GError **error);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __NM_MANAGER_H__ */
|
||||
|
|
|
@ -21,6 +21,10 @@
|
|||
#ifndef __NM_OBJECT_PRIVATE_H__
|
||||
#define __NM_OBJECT_PRIVATE_H__
|
||||
|
||||
#if !((NETWORKMANAGER_COMPILATION) & NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_PRIVATE)
|
||||
#error Cannot use this header.
|
||||
#endif
|
||||
|
||||
#include "nm-object.h"
|
||||
|
||||
typedef gboolean (*PropertyMarshalFunc) (NMObject *, GParamSpec *, GVariant *, gpointer);
|
||||
|
|
|
@ -21,6 +21,10 @@
|
|||
#ifndef __NM_REMOTE_CONNECTION_PRIVATE_H__
|
||||
#define __NM_REMOTE_CONNECTION_PRIVATE_H__
|
||||
|
||||
#if !((NETWORKMANAGER_COMPILATION) & NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_PRIVATE)
|
||||
#error Cannot use this header.
|
||||
#endif
|
||||
|
||||
#define NM_REMOTE_CONNECTION_INIT_RESULT "init-result"
|
||||
|
||||
typedef enum {
|
||||
|
|
|
@ -22,9 +22,11 @@
|
|||
#ifndef __NM_REMOTE_SETTINGS_H__
|
||||
#define __NM_REMOTE_SETTINGS_H__
|
||||
|
||||
#include "nm-object.h"
|
||||
#if !((NETWORKMANAGER_COMPILATION) & NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_PRIVATE)
|
||||
#error Cannot use this header.
|
||||
#endif
|
||||
|
||||
G_BEGIN_DECLS
|
||||
#include "nm-object.h"
|
||||
|
||||
#define NM_TYPE_REMOTE_SETTINGS (nm_remote_settings_get_type ())
|
||||
#define NM_REMOTE_SETTINGS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_REMOTE_SETTINGS, NMRemoteSettings))
|
||||
|
@ -53,14 +55,10 @@ struct _NMRemoteSettings {
|
|||
struct _NMRemoteSettingsClass {
|
||||
NMObjectClass parent;
|
||||
|
||||
/* Signals */
|
||||
void (*connection_added) (NMRemoteSettings *settings,
|
||||
NMRemoteConnection *connection);
|
||||
void (*connection_removed) (NMRemoteSettings *settings,
|
||||
NMRemoteConnection *connection);
|
||||
|
||||
/*< private >*/
|
||||
gpointer padding[8];
|
||||
};
|
||||
|
||||
GType nm_remote_settings_get_type (void);
|
||||
|
@ -125,6 +123,4 @@ gboolean nm_remote_settings_save_hostname_finish (NMRemoteSettings *settings,
|
|||
GAsyncResult *result,
|
||||
GError **error);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __NM_REMOTE_SETTINGS_H__ */
|
||||
|
|
|
@ -18,7 +18,8 @@ deps = [
|
|||
]
|
||||
|
||||
cflags = [
|
||||
'-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIB',
|
||||
'-DNETWORKMANAGER_COMPILATION_TEST',
|
||||
'-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIBNM',
|
||||
'-DTEST_NM_SERVICE="@0@"'.format(join_paths(meson.source_root(), 'tools', 'test-networkmanager-service.py'))
|
||||
]
|
||||
|
||||
|
@ -47,5 +48,6 @@ libnm_vpn_plugin_utils_test = static_library(
|
|||
'nm-vpn-plugin-utils-test',
|
||||
sources: shared_vpn_plugin_utils + [libnm_enum[1]],
|
||||
include_directories: incs,
|
||||
dependencies: glib_dep
|
||||
dependencies: glib_dep,
|
||||
c_args: cflags,
|
||||
)
|
||||
|
|
|
@ -22,19 +22,85 @@
|
|||
#ifndef __NM_DEFAULT_H__
|
||||
#define __NM_DEFAULT_H__
|
||||
|
||||
/* makefiles define NETWORKMANAGER_COMPILATION for compiling NetworkManager.
|
||||
* Depending on which parts are compiled, different values are set. */
|
||||
#define NM_NETWORKMANAGER_COMPILATION_DEFAULT 0x0001
|
||||
#define NM_NETWORKMANAGER_COMPILATION_INSIDE_DAEMON 0x0002
|
||||
#define NM_NETWORKMANAGER_COMPILATION_LIB 0x0004
|
||||
#define NM_NETWORKMANAGER_COMPILATION_SYSTEMD 0x0008
|
||||
#define NM_NETWORKMANAGER_COMPILATION_LIB_LEGACY 0x0010
|
||||
#define NM_NETWORKMANAGER_COMPILATION_WITH_GLIB (1 << 0)
|
||||
#define NM_NETWORKMANAGER_COMPILATION_WITH_GLIB_I18N_LIB (1 << 1)
|
||||
#define NM_NETWORKMANAGER_COMPILATION_WITH_GLIB_I18N_PROG (1 << 2)
|
||||
#define NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM (1 << 3)
|
||||
#define NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_PRIVATE (1 << 4)
|
||||
#define NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_CORE (1 << 5)
|
||||
#define NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_CORE_INTERNAL (1 << 6)
|
||||
#define NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_CORE_PRIVATE (1 << 7)
|
||||
#define NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_UTIL (1 << 8)
|
||||
#define NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_GLIB (1 << 9)
|
||||
#define NM_NETWORKMANAGER_COMPILATION_WITH_DAEMON (1 << 10)
|
||||
#define NM_NETWORKMANAGER_COMPILATION_WITH_SYSTEMD (1 << 11)
|
||||
|
||||
#define NM_NETWORKMANAGER_COMPILATION_LIBNM_CORE ( 0 \
|
||||
| NM_NETWORKMANAGER_COMPILATION_WITH_GLIB \
|
||||
| NM_NETWORKMANAGER_COMPILATION_WITH_GLIB_I18N_LIB \
|
||||
| NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_CORE \
|
||||
| NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_CORE_PRIVATE \
|
||||
| NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_CORE_INTERNAL \
|
||||
)
|
||||
|
||||
#define NM_NETWORKMANAGER_COMPILATION_LIBNM ( 0 \
|
||||
| NM_NETWORKMANAGER_COMPILATION_WITH_GLIB \
|
||||
| NM_NETWORKMANAGER_COMPILATION_WITH_GLIB_I18N_LIB \
|
||||
| NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM \
|
||||
| NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_PRIVATE \
|
||||
| NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_CORE \
|
||||
| NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_CORE_INTERNAL \
|
||||
)
|
||||
|
||||
#define NM_NETWORKMANAGER_COMPILATION_LIBNM_UTIL ( 0 \
|
||||
| NM_NETWORKMANAGER_COMPILATION_WITH_GLIB \
|
||||
| NM_NETWORKMANAGER_COMPILATION_WITH_GLIB_I18N_LIB \
|
||||
| NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_UTIL \
|
||||
)
|
||||
|
||||
#define NM_NETWORKMANAGER_COMPILATION_LIBNM_GLIB ( 0 \
|
||||
| NM_NETWORKMANAGER_COMPILATION_LIBNM_UTIL \
|
||||
| NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_GLIB \
|
||||
)
|
||||
|
||||
#define NM_NETWORKMANAGER_COMPILATION_CLIENT ( 0 \
|
||||
| NM_NETWORKMANAGER_COMPILATION_WITH_GLIB \
|
||||
| NM_NETWORKMANAGER_COMPILATION_WITH_GLIB_I18N_PROG \
|
||||
| NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM \
|
||||
| NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_CORE \
|
||||
)
|
||||
|
||||
#define NM_NETWORKMANAGER_COMPILATION_DAEMON ( 0 \
|
||||
| NM_NETWORKMANAGER_COMPILATION_WITH_GLIB \
|
||||
| NM_NETWORKMANAGER_COMPILATION_WITH_GLIB_I18N_PROG \
|
||||
| NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_CORE \
|
||||
| NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_CORE_INTERNAL \
|
||||
| NM_NETWORKMANAGER_COMPILATION_WITH_DAEMON \
|
||||
)
|
||||
|
||||
#define NM_NETWORKMANAGER_COMPILATION_SYSTEMD ( 0 \
|
||||
| NM_NETWORKMANAGER_COMPILATION_DAEMON \
|
||||
| NM_NETWORKMANAGER_COMPILATION_WITH_SYSTEMD \
|
||||
)
|
||||
|
||||
#define NM_NETWORKMANAGER_COMPILATION_GLIB ( 0 \
|
||||
| NM_NETWORKMANAGER_COMPILATION_WITH_GLIB \
|
||||
)
|
||||
|
||||
#ifndef NETWORKMANAGER_COMPILATION
|
||||
/* For convenience, we don't require our Makefile.am to define
|
||||
* -DNETWORKMANAGER_COMPILATION. As we now include this internal header,
|
||||
* we know we do a NETWORKMANAGER_COMPILATION. */
|
||||
#define NETWORKMANAGER_COMPILATION NM_NETWORKMANAGER_COMPILATION_DEFAULT
|
||||
#error Define NETWORKMANAGER_COMPILATION accordingly
|
||||
#endif
|
||||
|
||||
#ifndef G_LOG_DOMAIN
|
||||
#if defined(NETWORKMANAGER_COMPILATION_TEST)
|
||||
#define G_LOG_DOMAIN "test"
|
||||
#elif NETWORKMANAGER_COMPILATION & NM_NETWORKMANAGER_COMPILATION_WITH_DAEMON
|
||||
#define G_LOG_DOMAIN "NetworkManager"
|
||||
#else
|
||||
#error Need to define G_LOG_DOMAIN
|
||||
#endif
|
||||
#elif defined (NETWORKMANAGER_COMPILATION_TEST) || (NETWORKMANAGER_COMPILATION & NM_NETWORKMANAGER_COMPILATION_WITH_DAEMON)
|
||||
#error Do not define G_LOG_DOMAIN with NM_NETWORKMANAGER_COMPILATION_WITH_DAEMON
|
||||
#endif
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -110,8 +176,22 @@
|
|||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
#if (NETWORKMANAGER_COMPILATION) & NM_NETWORKMANAGER_COMPILATION_WITH_GLIB
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
#if (NETWORKMANAGER_COMPILATION) & NM_NETWORKMANAGER_COMPILATION_WITH_GLIB_I18N_PROG
|
||||
#if (NETWORKMANAGER_COMPILATION) & NM_NETWORKMANAGER_COMPILATION_WITH_GLIB_I18N_LIB
|
||||
#error Cannot define NM_NETWORKMANAGER_COMPILATION_WITH_GLIB_I18N_PROG and NM_NETWORKMANAGER_COMPILATION_WITH_GLIB_I18N_LIB
|
||||
#endif
|
||||
#include <glib/gi18n.h>
|
||||
#elif (NETWORKMANAGER_COMPILATION) & NM_NETWORKMANAGER_COMPILATION_WITH_GLIB_I18N_LIB
|
||||
#include <glib/gi18n-lib.h>
|
||||
#endif
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
#if NM_MORE_ASSERTS == 0
|
||||
|
@ -178,35 +258,30 @@ _nm_g_return_if_fail_warning (const char *log_domain,
|
|||
#include "nm-utils/nm-macros-internal.h"
|
||||
#include "nm-utils/nm-shared-utils.h"
|
||||
|
||||
#if ((NETWORKMANAGER_COMPILATION) & NM_NETWORKMANAGER_COMPILATION_LIB_LEGACY) == 0
|
||||
#if (NETWORKMANAGER_COMPILATION) & NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_UTIL
|
||||
/* no hash-utils in legacy code. */
|
||||
#else
|
||||
#include "nm-utils/nm-hash-utils.h"
|
||||
#endif
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
#if (NETWORKMANAGER_COMPILATION) & (NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_CORE | NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_UTIL)
|
||||
#include "nm-version.h"
|
||||
#endif
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
#if ((NETWORKMANAGER_COMPILATION) == NM_NETWORKMANAGER_COMPILATION_LIB) || ((NETWORKMANAGER_COMPILATION) == NM_NETWORKMANAGER_COMPILATION_LIB_LEGACY)
|
||||
|
||||
#include <glib/gi18n-lib.h>
|
||||
|
||||
#else
|
||||
|
||||
#include <glib/gi18n.h>
|
||||
|
||||
#endif /* NM_NETWORKMANAGER_COMPILATION_LIB || NM_NETWORKMANAGER_COMPILATION_LIB_LEGACY */
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
#if (NETWORKMANAGER_COMPILATION) == NM_NETWORKMANAGER_COMPILATION_INSIDE_DAEMON || (NETWORKMANAGER_COMPILATION) == NM_NETWORKMANAGER_COMPILATION_SYSTEMD
|
||||
|
||||
/* the header is used inside src/, where additional
|
||||
* headers are available. */
|
||||
|
||||
#if (NETWORKMANAGER_COMPILATION) & NM_NETWORKMANAGER_COMPILATION_WITH_DAEMON
|
||||
#include "nm-types.h"
|
||||
#include "nm-logging.h"
|
||||
#endif
|
||||
|
||||
#endif /* NM_NETWORKMANAGER_COMPILATION_INSIDE_DAEMON */
|
||||
#if ((NETWORKMANAGER_COMPILATION) & NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM) && !((NETWORKMANAGER_COMPILATION) & (NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_PRIVATE | NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_CORE_INTERNAL))
|
||||
#include "NetworkManager.h"
|
||||
#endif
|
||||
|
||||
#endif /* NM_NETWORKMANAGER_COMPILATION_WITH_GLIB */
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
|
|
|
@ -22,6 +22,10 @@
|
|||
|
||||
#include "nm-utils/nm-test-utils.h"
|
||||
|
||||
#if (NETWORKMANAGER_COMPILATION) & NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_GLIB
|
||||
#include "nm-dbus-glib-types.h"
|
||||
#endif
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
typedef struct {
|
||||
|
@ -29,7 +33,7 @@ typedef struct {
|
|||
GDBusProxy *proxy;
|
||||
GPid pid;
|
||||
int keepalive_fd;
|
||||
#if ((NETWORKMANAGER_COMPILATION) == NM_NETWORKMANAGER_COMPILATION_LIB_LEGACY)
|
||||
#if (NETWORKMANAGER_COMPILATION) & NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_GLIB
|
||||
struct {
|
||||
DBusGConnection *bus;
|
||||
} libdbus;
|
||||
|
@ -54,7 +58,15 @@ static inline void _nmtstc_auto_service_cleanup (NMTstcServiceInfo **info)
|
|||
|
||||
/*****************************************************************************/
|
||||
|
||||
#if ((NETWORKMANAGER_COMPILATION) == NM_NETWORKMANAGER_COMPILATION_LIB)
|
||||
#if (NETWORKMANAGER_COMPILATION) & NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_GLIB
|
||||
|
||||
#include "nm-client.h"
|
||||
#include "nm-remote-settings.h"
|
||||
|
||||
NMClient *nmtstc_nm_client_new (void);
|
||||
NMRemoteSettings *nmtstc_nm_remote_settings_new (void);
|
||||
|
||||
#else
|
||||
|
||||
NMDevice *nmtstc_service_add_device (NMTstcServiceInfo *info,
|
||||
NMClient *client,
|
||||
|
@ -67,17 +79,9 @@ NMDevice * nmtstc_service_add_wired_device (NMTstcServiceInfo *sinfo,
|
|||
const char *hwaddr,
|
||||
const char **subchannels);
|
||||
|
||||
#endif /* NM_NETWORKMANAGER_COMPILATION_LIB */
|
||||
#endif
|
||||
|
||||
#if ((NETWORKMANAGER_COMPILATION) == NM_NETWORKMANAGER_COMPILATION_LIB_LEGACY)
|
||||
|
||||
#include "nm-client.h"
|
||||
#include "nm-remote-settings.h"
|
||||
|
||||
NMClient *nmtstc_nm_client_new (void);
|
||||
NMRemoteSettings *nmtstc_nm_remote_settings_new (void);
|
||||
|
||||
#endif /* NM_NETWORKMANAGER_COMPILATION_LIB_LEGACY */
|
||||
/*****************************************************************************/
|
||||
|
||||
void nmtstc_service_add_connection (NMTstcServiceInfo *sinfo,
|
||||
NMConnection *connection,
|
||||
|
|
|
@ -25,10 +25,6 @@
|
|||
#include "NetworkManager.h"
|
||||
#include "nm-dbus-compat.h"
|
||||
|
||||
#if ((NETWORKMANAGER_COMPILATION) == NM_NETWORKMANAGER_COMPILATION_LIB_LEGACY)
|
||||
#include "nm-dbus-glib-types.h"
|
||||
#endif
|
||||
|
||||
#include "nm-test-libnm-utils.h"
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -58,8 +54,7 @@ name_exists (GDBusConnection *c, const char *name)
|
|||
return exists;
|
||||
}
|
||||
|
||||
#if ((NETWORKMANAGER_COMPILATION) == NM_NETWORKMANAGER_COMPILATION_LIB_LEGACY)
|
||||
|
||||
#if (NETWORKMANAGER_COMPILATION) & NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_GLIB
|
||||
static DBusGProxy *
|
||||
_libdbus_create_proxy_test (DBusGConnection *bus)
|
||||
{
|
||||
|
@ -75,7 +70,6 @@ _libdbus_create_proxy_test (DBusGConnection *bus)
|
|||
|
||||
return proxy;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
NMTstcServiceInfo *
|
||||
|
@ -121,7 +115,7 @@ nmtstc_service_init (void)
|
|||
NULL, &error);
|
||||
g_assert_no_error (error);
|
||||
|
||||
#if ((NETWORKMANAGER_COMPILATION) == NM_NETWORKMANAGER_COMPILATION_LIB_LEGACY)
|
||||
#if (NETWORKMANAGER_COMPILATION) & NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_GLIB
|
||||
info->libdbus.bus = dbus_g_bus_get (DBUS_BUS_SESSION, &error);
|
||||
g_assert_no_error (error);
|
||||
g_assert (info->libdbus.bus);
|
||||
|
@ -148,7 +142,7 @@ nmtstc_service_cleanup (NMTstcServiceInfo *info)
|
|||
g_object_unref (info->bus);
|
||||
nm_close (info->keepalive_fd);
|
||||
|
||||
#if ((NETWORKMANAGER_COMPILATION) == NM_NETWORKMANAGER_COMPILATION_LIB_LEGACY)
|
||||
#if (NETWORKMANAGER_COMPILATION) & NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_GLIB
|
||||
g_clear_pointer (&info->libdbus.bus, dbus_g_connection_unref);
|
||||
#endif
|
||||
|
||||
|
@ -156,8 +150,7 @@ nmtstc_service_cleanup (NMTstcServiceInfo *info)
|
|||
g_free (info);
|
||||
}
|
||||
|
||||
#if ((NETWORKMANAGER_COMPILATION) == NM_NETWORKMANAGER_COMPILATION_LIB)
|
||||
|
||||
#if !((NETWORKMANAGER_COMPILATION) & NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_GLIB)
|
||||
typedef struct {
|
||||
GMainLoop *loop;
|
||||
const char *ifname;
|
||||
|
@ -270,8 +263,7 @@ nmtstc_service_add_wired_device (NMTstcServiceInfo *sinfo, NMClient *client,
|
|||
{
|
||||
return add_device_common (sinfo, client, "AddWiredDevice", ifname, hwaddr, subchannels);
|
||||
}
|
||||
|
||||
#endif /* NM_NETWORKMANAGER_COMPILATION_LIB */
|
||||
#endif
|
||||
|
||||
void
|
||||
nmtstc_service_add_connection (NMTstcServiceInfo *sinfo,
|
||||
|
@ -279,7 +271,7 @@ nmtstc_service_add_connection (NMTstcServiceInfo *sinfo,
|
|||
gboolean verify_connection,
|
||||
char **out_path)
|
||||
{
|
||||
#if ((NETWORKMANAGER_COMPILATION) == NM_NETWORKMANAGER_COMPILATION_LIB_LEGACY)
|
||||
#if (NETWORKMANAGER_COMPILATION) & NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_GLIB
|
||||
gs_unref_hashtable GHashTable *new_settings = NULL;
|
||||
gboolean success;
|
||||
gs_free_error GError *error = NULL;
|
||||
|
@ -353,7 +345,7 @@ nmtstc_service_update_connection (NMTstcServiceInfo *sinfo,
|
|||
path = nm_connection_get_path (connection);
|
||||
g_assert (path);
|
||||
|
||||
#if ((NETWORKMANAGER_COMPILATION) == NM_NETWORKMANAGER_COMPILATION_LIB_LEGACY)
|
||||
#if (NETWORKMANAGER_COMPILATION) & NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_GLIB
|
||||
{
|
||||
gs_unref_hashtable GHashTable *new_settings = NULL;
|
||||
gboolean success;
|
||||
|
@ -414,8 +406,7 @@ nmtstc_service_update_connection_variant (NMTstcServiceInfo *sinfo,
|
|||
|
||||
/*****************************************************************************/
|
||||
|
||||
#if ((NETWORKMANAGER_COMPILATION) == NM_NETWORKMANAGER_COMPILATION_LIB_LEGACY)
|
||||
|
||||
#if (NETWORKMANAGER_COMPILATION) & NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_GLIB
|
||||
NMClient *
|
||||
nmtstc_nm_client_new (void)
|
||||
{
|
||||
|
@ -461,7 +452,6 @@ nmtstc_nm_remote_settings_new (void)
|
|||
|
||||
return settings;
|
||||
}
|
||||
|
||||
#endif /* NM_NETWORKMANAGER_COMPILATION_LIB_LEGACY */
|
||||
#endif
|
||||
|
||||
/*****************************************************************************/
|
||||
|
|
|
@ -21,6 +21,10 @@
|
|||
#ifndef __NM_TEST_UTILS_H__
|
||||
#define __NM_TEST_UTILS_H__
|
||||
|
||||
#if defined(NETWORKMANAGER_COMPILATION) && !defined(NETWORKMANAGER_COMPILATION_TEST)
|
||||
#error Need to mark the compilation with NETWORKMANAGER_COMPILATION_TEST.
|
||||
#endif
|
||||
|
||||
/*******************************************************************************
|
||||
* HOWTO run tests.
|
||||
*
|
||||
|
|
|
@ -2,7 +2,8 @@ name = 'nm-dhcp-helper'
|
|||
|
||||
cflags = [
|
||||
'-DG_LOG_DOMAIN="@0@"'.format(name),
|
||||
'-DNMRUNDIR="@0@"'.format(nm_pkgrundir)
|
||||
'-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_GLIB',
|
||||
'-DNMRUNDIR="@0@"'.format(nm_pkgrundir),
|
||||
]
|
||||
|
||||
ldflags = []
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
test_unit = 'test-dnsmasq-utils'
|
||||
|
||||
cflags = '-DTESTDIR="@0@"'.format(meson.source_root())
|
||||
cflags = [
|
||||
'-DTESTDIR="@0@"'.format(meson.source_root()),
|
||||
'-DNETWORKMANAGER_COMPILATION_TEST',
|
||||
'-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_DAEMON',
|
||||
]
|
||||
|
||||
exe = executable(
|
||||
test_unit,
|
||||
|
|
|
@ -7,11 +7,6 @@ install_data(
|
|||
|
||||
subdir('systemd')
|
||||
|
||||
core_cflags = [
|
||||
'-DG_LOG_DOMAIN="@0@"'.format(nm_name),
|
||||
'-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_INSIDE_DAEMON'
|
||||
]
|
||||
|
||||
core_incs = [
|
||||
top_inc,
|
||||
shared_inc,
|
||||
|
@ -23,7 +18,9 @@ core_dep = declare_dependency(
|
|||
sources: libnm_core_enum[1],
|
||||
include_directories: core_incs,
|
||||
dependencies: glib_dep,
|
||||
compile_args: core_cflags
|
||||
compile_args: [
|
||||
'-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_DAEMON',
|
||||
],
|
||||
)
|
||||
|
||||
core_plugins = []
|
||||
|
@ -43,7 +40,8 @@ common_cflags = [
|
|||
'-DNMPLUGINDIR="@0@"'.format(nm_pkglibdir),
|
||||
'-DNMRUNDIR="@0@"'.format(nm_pkgrundir),
|
||||
'-DNMSTATEDIR="@0@"'.format(nm_pkgstatedir),
|
||||
'-DNMLIBDIR="@0@"'.format(nm_pkglibdir)
|
||||
'-DNMLIBDIR="@0@"'.format(nm_pkglibdir),
|
||||
'-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_DAEMON',
|
||||
]
|
||||
|
||||
if enable_dhcpcanon
|
||||
|
@ -297,13 +295,20 @@ if enable_tests
|
|||
libudev_dep
|
||||
]
|
||||
|
||||
test_cflags = []
|
||||
test_cflags = [
|
||||
'-DNETWORKMANAGER_COMPILATION_TEST',
|
||||
'-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_DAEMON',
|
||||
]
|
||||
if require_root_tests
|
||||
test_cflags += ['-DREQUIRE_ROOT_TESTS=1']
|
||||
endif
|
||||
|
||||
platform = (host_machine.system().contains('linux') ? 'linux' : 'fake')
|
||||
test_cflags_platform = '-DSETUP=nm_' + platform + '_platform_setup'
|
||||
test_cflags_platform = [
|
||||
'-DSETUP=nm_' + platform + '_platform_setup',
|
||||
'-DNETWORKMANAGER_COMPILATION_TEST',
|
||||
'-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_DAEMON',
|
||||
]
|
||||
|
||||
libnetwork_manager_test = static_library(
|
||||
'NetworkManagerTest',
|
||||
|
|
|
@ -21,8 +21,8 @@
|
|||
#ifndef __NETWORKMANAGER_TYPES_H__
|
||||
#define __NETWORKMANAGER_TYPES_H__
|
||||
|
||||
#ifdef __NM_UTILS_PRIVATE_H__
|
||||
#error "nm-utils-private.h" must not be used outside of libnm-core/. Do you want "nm-core-internal.h"?
|
||||
#if !((NETWORKMANAGER_COMPILATION) & NM_NETWORKMANAGER_COMPILATION_WITH_DAEMON)
|
||||
#error Cannot use this header.
|
||||
#endif
|
||||
|
||||
#define _NM_SD_MAX_CLIENT_ID_LEN (sizeof (guint32) + 128)
|
||||
|
|
|
@ -5,18 +5,16 @@ deps = [
|
|||
glib_dep
|
||||
]
|
||||
|
||||
cflags = [
|
||||
'-DG_LOG_DOMAIN="@0@"'.format(name),
|
||||
'-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_INSIDE_DAEMON'
|
||||
]
|
||||
|
||||
nm_pppd_plugin = shared_module(
|
||||
name,
|
||||
name_prefix: '',
|
||||
sources: [name + '.c', libnm_core_enum[1]],
|
||||
include_directories: core_incs,
|
||||
dependencies: deps,
|
||||
c_args: cflags,
|
||||
c_args: [
|
||||
'-DG_LOG_DOMAIN="nm-pppd-plugin"',
|
||||
'-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_GLIB',
|
||||
],
|
||||
install: true,
|
||||
install_dir: pppd_plugin_dir
|
||||
)
|
||||
|
@ -28,7 +26,10 @@ deps = [
|
|||
libnmdbus_dep
|
||||
]
|
||||
|
||||
cflags = '-DPPPD_PLUGIN_DIR="@0@"'.format(pppd_plugin_dir)
|
||||
cflags = [
|
||||
'-DPPPD_PLUGIN_DIR="@0@"'.format(pppd_plugin_dir),
|
||||
'-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_DAEMON',
|
||||
]
|
||||
|
||||
symbol_map = join_paths(meson.current_source_dir(), name + '.ver')
|
||||
|
||||
|
|
|
@ -36,7 +36,9 @@
|
|||
#include <pppd/ipv6cp.h>
|
||||
|
||||
#include "nm-default.h"
|
||||
|
||||
#include "nm-dbus-interface.h"
|
||||
|
||||
#include "nm-pppd-plugin.h"
|
||||
#include "nm-ppp-status.h"
|
||||
|
||||
|
|
|
@ -105,7 +105,7 @@ G_STMT_START { \
|
|||
* itself.
|
||||
*****************************************************************************/
|
||||
|
||||
#if (NETWORKMANAGER_COMPILATION) == NM_NETWORKMANAGER_COMPILATION_SYSTEMD
|
||||
#if (NETWORKMANAGER_COMPILATION) & NM_NETWORKMANAGER_COMPILATION_WITH_SYSTEMD
|
||||
|
||||
#include <netinet/in.h>
|
||||
#include <string.h>
|
||||
|
@ -186,7 +186,7 @@ static inline pid_t gettid(void) {
|
|||
return (pid_t) syscall(SYS_gettid);
|
||||
}
|
||||
|
||||
#endif /* (NETWORKMANAGER_COMPILATION) == NM_NETWORKMANAGER_COMPILATION_SYSTEMD */
|
||||
#endif /* (NETWORKMANAGER_COMPILATION) & NM_NETWORKMANAGER_COMPILATION_WITH_SYSTEMD */
|
||||
|
||||
#endif /* NM_SD_ADAPT_H */
|
||||
|
||||
|
|
|
@ -23,7 +23,10 @@ endforeach
|
|||
|
||||
test_unit = 'test-systemd'
|
||||
|
||||
cflags = '-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_SYSTEMD'
|
||||
cflags = [
|
||||
'-DNETWORKMANAGER_COMPILATION_TEST',
|
||||
'-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_SYSTEMD',
|
||||
]
|
||||
|
||||
exe = executable(
|
||||
test_unit,
|
||||
|
|
Loading…
Reference in a new issue