mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-27 01:10:08 +01:00
build: don't add systemd path the include search path
Our internal copy of systemd should not be in the search path. Instead, let users only #include "systemd/nm-sd.h" which then includes everything from systemd that we need. We want to avoid to accidentally include anything from our systemd-copy. Any user of that should only include "nm-sd.h", which then includes everything that is needed further. For example, "src/devices/wwan/nm-modem-manager.c" has #include <systemd/nm-daemon.h> which in turn includes #include "_sd-common.h" This works all correctly before, because #include "" will first look in the directory where sd-daemon.h is. However, our mixing of external systemd library and internal copy is rather dangerous. Try to avoid it further by keeping the include paths clean.
This commit is contained in:
parent
3f4aa48d6b
commit
e3a072f3c0
11 changed files with 15 additions and 24 deletions
|
|
@ -76,9 +76,6 @@ AM_CPPFLAGS = \
|
|||
$(SYSTEMD_JOURNAL_CFLAGS) \
|
||||
$(CODE_COVERAGE_CFLAGS) \
|
||||
\
|
||||
-I$(top_srcdir)/src/systemd/src/systemd/ \
|
||||
-I$(top_srcdir)/src/systemd/ \
|
||||
\
|
||||
$(NULL)
|
||||
|
||||
AM_LDFLAGS = $(CODE_COVERAGE_LDFLAGS)
|
||||
|
|
|
|||
|
|
@ -62,8 +62,8 @@
|
|||
#include "nm-core-internal.h"
|
||||
#include "nm-default-route-manager.h"
|
||||
#include "nm-route-manager.h"
|
||||
#include "systemd/nm-sd.h"
|
||||
#include "nm-lldp-listener.h"
|
||||
#include "sd-ipv4ll.h"
|
||||
#include "nm-audit-manager.h"
|
||||
#include "nm-arping-manager.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
#include "nm-platform.h"
|
||||
#include "nm-utils.h"
|
||||
|
||||
#include "sd-lldp.h"
|
||||
#include "systemd/nm-sd.h"
|
||||
|
||||
#define MAX_NEIGHBORS 4096
|
||||
#define MIN_UPDATE_INTERVAL_NS (2 * NM_UTILS_NS_PER_SECOND)
|
||||
|
|
|
|||
|
|
@ -5,9 +5,6 @@ AM_CPPFLAGS = \
|
|||
-I$(top_builddir)/libnm-core \
|
||||
-I$(top_srcdir)/src/platform \
|
||||
-I$(top_srcdir)/src/devices \
|
||||
-I$(top_srcdir)/src/systemd/ \
|
||||
-I$(top_srcdir)/src/systemd/src/systemd/ \
|
||||
-I$(top_srcdir)/src/systemd/src/libsystemd-network/ \
|
||||
-I$(top_srcdir)/src \
|
||||
-I$(top_builddir)/src \
|
||||
-DG_LOG_DOMAIN=\""NetworkManager"\" \
|
||||
|
|
|
|||
|
|
@ -27,9 +27,7 @@
|
|||
#include <sys/types.h>
|
||||
|
||||
#include "nm-lldp-listener.h"
|
||||
#include "nm-sd.h"
|
||||
|
||||
#include "sd-lldp.h"
|
||||
#include "systemd/nm-sd.h"
|
||||
|
||||
#include "test-common.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -34,10 +34,7 @@
|
|||
#include "NetworkManagerUtils.h"
|
||||
#include "nm-platform.h"
|
||||
#include "nm-dhcp-client-logging.h"
|
||||
#include "nm-sd.h"
|
||||
|
||||
#include "sd-dhcp-client.h"
|
||||
#include "sd-dhcp6-client.h"
|
||||
#include "systemd/nm-sd.h"
|
||||
|
||||
G_DEFINE_TYPE (NMDhcpSystemd, nm_dhcp_systemd, NM_TYPE_DHCP_CLIENT)
|
||||
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@
|
|||
#include "nm-auth-manager.h"
|
||||
#include "nm-core-internal.h"
|
||||
#include "nm-exported-object.h"
|
||||
#include "nm-sd.h"
|
||||
#include "systemd/nm-sd.h"
|
||||
|
||||
#if !defined(NM_DIST_VERSION)
|
||||
# define NM_DIST_VERSION VERSION
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ extern unsigned int if_nametoindex (const char *__ifname);
|
|||
#include "nm-lndp-rdisc.h"
|
||||
#include "nm-utils.h"
|
||||
#include "nm-setting-ip6-config.h"
|
||||
#include "nm-sd.h"
|
||||
#include "systemd/nm-sd.h"
|
||||
|
||||
#if !defined(NM_DIST_VERSION)
|
||||
# define NM_DIST_VERSION VERSION
|
||||
|
|
|
|||
|
|
@ -19,6 +19,13 @@
|
|||
#ifndef __NM_SD_H__
|
||||
#define __NM_SD_H__
|
||||
|
||||
#include "systemd/src/systemd/sd-dhcp-client.h"
|
||||
#include "systemd/src/systemd/sd-dhcp6-client.h"
|
||||
#include "systemd/src/systemd/sd-lldp.h"
|
||||
#include "systemd/src/systemd/sd-ipv4ll.h"
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
guint nm_sd_event_attach_default (void);
|
||||
|
||||
/*****************************************************************************
|
||||
|
|
|
|||
|
|
@ -123,8 +123,7 @@ test_wired_defname_LDADD = \
|
|||
test_systemd_CFLAGS = \
|
||||
"-I$(srcdir)/../" \
|
||||
"-I$(srcdir)/../platform" \
|
||||
"-I$(srcdir)/../systemd" \
|
||||
"-I$(srcdir)/../systemd/src/systemd"
|
||||
$(NULL)
|
||||
|
||||
test_systemd_SOURCES = \
|
||||
test-systemd.c
|
||||
|
|
|
|||
|
|
@ -19,11 +19,7 @@
|
|||
|
||||
#include "nm-default.h"
|
||||
|
||||
#include "nm-sd.h"
|
||||
|
||||
#include "sd-dhcp-client.h"
|
||||
#include "sd-lldp.h"
|
||||
#include "sd-event.h"
|
||||
#include "systemd/nm-sd.h"
|
||||
|
||||
#include "nm-test-utils-core.h"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue