From: Christian Brauner Date: Thu, 16 Sep 2021 08:48:25 +0000 (+0200) Subject: build: fix hook program build X-Git-Tag: lxc-5.0.0~87^2~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=26a6b71917680be5cc114904c78250b9909d08fc;p=thirdparty%2Flxc.git build: fix hook program build Signed-off-by: Christian Brauner --- diff --git a/hooks/Makefile.am b/hooks/Makefile.am index 5ae73d72c..e8cf37bdf 100644 --- a/hooks/Makefile.am +++ b/hooks/Makefile.am @@ -13,6 +13,9 @@ hooks_SCRIPTS = \ binhooks_PROGRAMS = \ unmount-namespace +AM_CFLAGS += -I $(top_srcdir)/src \ + -I $(top_srcdir)/src/include + unmount_namespace_SOURCES = \ unmount-namespace.c diff --git a/hooks/unmount-namespace.c b/hooks/unmount-namespace.c index c0c8b191c..4a4e97405 100644 --- a/hooks/unmount-namespace.c +++ b/hooks/unmount-namespace.c @@ -25,7 +25,8 @@ * namespaces are gone. */ -#define _GNU_SOURCE /* setns */ +#include "config.h" + #include /* fdopen, getmntent, endmntent */ #include /* malloc, qsort */ #include /* close */ @@ -37,8 +38,6 @@ #include /* openat, open */ #include /* errno */ -#include <../src/config.h> - #if IS_BIONIC #include "lxcmntent.h" #else diff --git a/meson.build b/meson.build index ea5ee5d75..d50418023 100644 --- a/meson.build +++ b/meson.build @@ -335,6 +335,7 @@ liblxc_includes = [basic_includes, include_directories( add_project_arguments('-include', 'config.h', language : 'c') +subdir('hooks') subdir('src/include') subdir('src/lxc') subdir('src/lxc/tools') @@ -516,6 +517,15 @@ public_programs += executable( dependencies : liblxc_dep, install : true) +hook_programs = [] + +hook_programs += executable( + 'unmount-namespace', + hooks_unmount_namespace_sources, + include_directories : hooks_include_directories, + install : true, + install_dir : lxchookdir) + found_syscalls = [] missing_syscalls = []