From 82b088ab5f8b619cbbd187d1906e196deaf759ef Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Wed, 30 May 2018 11:13:41 +0200 Subject: [PATCH] build: don't add shared/nm-utils directory to include search path All users are supposed to include files from nm-utils by fully specifying the path. -I.*shared/nm-utils is wrong. Only, systemd code likes to include "siphash24.h" directly. Instead of adding "-Ishared/nm-utils" to the search path, add an intermediary header to sd-adapt. Note, that in the meantime we anyway should rework siphash24 to use shared/c-siphash instead. This also fixes build for meson, which was broken recently. --- Makefile.am | 3 ++- shared/meson.build | 1 - src/systemd/sd-adapt/siphash24.h | 3 +++ src/systemd/sd-adapt/unaligned.h | 3 +++ 4 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 src/systemd/sd-adapt/siphash24.h create mode 100644 src/systemd/sd-adapt/unaligned.h diff --git a/Makefile.am b/Makefile.am index 75283d47a..a16501007 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1258,7 +1258,6 @@ src_libsystemd_nm_la_cppflags = \ -I$(builddir)/libnm-core \ -I$(srcdir)/src \ -I$(srcdir)/src/systemd/sd-adapt \ - -I$(srcdir)/shared/nm-utils \ -I$(srcdir)/src/systemd/src/systemd \ -I$(srcdir)/src/systemd/src/basic \ -I$(srcdir)/src/systemd/src/shared \ @@ -1301,10 +1300,12 @@ src_libsystemd_nm_la_SOURCES = \ src/systemd/sd-adapt/procfs-util.h \ src/systemd/sd-adapt/raw-clone.h \ src/systemd/sd-adapt/sd-daemon.h \ + src/systemd/sd-adapt/siphash24.h \ src/systemd/sd-adapt/stat-util.h \ src/systemd/sd-adapt/terminal-util.h \ src/systemd/sd-adapt/udev-util.h \ src/systemd/sd-adapt/udev.h \ + src/systemd/sd-adapt/unaligned.h \ src/systemd/sd-adapt/user-util.h \ src/systemd/sd-adapt/virt.h \ src/systemd/src/basic/alloc-util.c \ diff --git a/shared/meson.build b/shared/meson.build index a812b5882..98243435d 100644 --- a/shared/meson.build +++ b/shared/meson.build @@ -64,7 +64,6 @@ shared_dep = declare_dependency( include_directories: [ top_inc, shared_inc, - include_directories('nm-utils') ], dependencies: glib_dep ) diff --git a/src/systemd/sd-adapt/siphash24.h b/src/systemd/sd-adapt/siphash24.h new file mode 100644 index 000000000..ac6e5a1d1 --- /dev/null +++ b/src/systemd/sd-adapt/siphash24.h @@ -0,0 +1,3 @@ +#pragma once + +#include "nm-utils/siphash24.h" diff --git a/src/systemd/sd-adapt/unaligned.h b/src/systemd/sd-adapt/unaligned.h new file mode 100644 index 000000000..17dc04446 --- /dev/null +++ b/src/systemd/sd-adapt/unaligned.h @@ -0,0 +1,3 @@ +#pragma once + +#include "nm-utils/unaligned.h"