summaryrefslogtreecommitdiff
path: root/src/systemd
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2015-09-16 15:49:02 +0200
committerThomas Haller <thaller@redhat.com>2015-09-16 16:54:51 +0200
commit3ba1c8e297af0e66eaf40ff1d33e1c1087efa685 (patch)
tree428b8de23f4e162d64ff0bcb59d5bc70be6c7446 /src/systemd
parentc05557971c09782316ee7e39ae4e7a7675d338f1 (diff)
downloadNetworkManager-3ba1c8e297af0e66eaf40ff1d33e1c1087efa685.tar.gz
systemd/build: use separate NETWORKMANAGER_COMPILATION define for systemd build
Diffstat (limited to 'src/systemd')
-rw-r--r--src/systemd/nm-sd-adapt.h50
1 files changed, 30 insertions, 20 deletions
diff --git a/src/systemd/nm-sd-adapt.h b/src/systemd/nm-sd-adapt.h
index d140b9c260..c392879c03 100644
--- a/src/systemd/nm-sd-adapt.h
+++ b/src/systemd/nm-sd-adapt.h
@@ -13,7 +13,7 @@
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
- * Copyright (C) 2014 Red Hat, Inc.
+ * Copyright (C) 2014 - 2015 Red Hat, Inc.
*/
#ifndef NM_SD_ADAPT_H
@@ -21,30 +21,13 @@
#include "config.h"
-#include <glib.h>
-
-#include <netinet/in.h>
#include <stdbool.h>
#include <syslog.h>
-#include <string.h>
-#include <stdio.h>
-#include <errno.h>
-#include <elf.h>
-#ifdef HAVE_SYS_AUXV_H
-#include <sys/auxv.h>
-#endif
-#include <unistd.h>
-#include <sys/syscall.h>
-
-#include <net/if_arp.h>
#include <sys/resource.h>
#include "nm-default.h"
-/* Missing in Linux 3.2.0, in Ubuntu 12.04 */
-#ifndef BPF_XOR
-#define BPF_XOR 0xa0
-#endif
+#define noreturn G_GNUC_NORETURN
/*****************************************************************************/
@@ -92,6 +75,32 @@ G_STMT_START { \
(void) 0; \
})
+
+/*****************************************************************************
+ * The remainder of the header is only enabled when building the systemd code
+ * itself.
+ *****************************************************************************/
+
+#if (NETWORKMANAGER_COMPILATION) == NM_NETWORKMANAGER_COMPILATION_SYSTEMD
+
+#include <netinet/in.h>
+#include <string.h>
+#include <stdio.h>
+#include <errno.h>
+#include <elf.h>
+#ifdef HAVE_SYS_AUXV_H
+#include <sys/auxv.h>
+#endif
+#include <unistd.h>
+#include <sys/syscall.h>
+
+#include <net/if_arp.h>
+
+/* Missing in Linux 3.2.0, in Ubuntu 12.04 */
+#ifndef BPF_XOR
+#define BPF_XOR 0xa0
+#endif
+
/*****************************************************************************/
/* Can't include both net/if.h and linux/if.h; so have to define this here */
@@ -103,7 +112,6 @@ G_STMT_START { \
#define MAX_HANDLE_SZ 128
#endif
-#define noreturn G_GNUC_NORETURN
/*
* Some toolchains (E.G. uClibc 0.9.33 and earlier) don't export
@@ -123,5 +131,7 @@ static inline pid_t gettid(void) {
return (pid_t) syscall(SYS_gettid);
}
+#endif /* (NETWORKMANAGER_COMPILATION) == NM_NETWORKMANAGER_COMPILATION_SYSTEMD */
+
#endif /* NM_SD_ADAPT_H */