]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
build: fix hook program build
authorChristian Brauner <christian.brauner@ubuntu.com>
Thu, 16 Sep 2021 08:48:25 +0000 (10:48 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Thu, 16 Sep 2021 12:45:36 +0000 (14:45 +0200)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
hooks/Makefile.am
hooks/unmount-namespace.c
meson.build

index 5ae73d72c530b18937b02b0f50f03d4aaee71444..e8cf37bdfd8d2f6eeb724c7905de7f0deb323d5a 100644 (file)
@@ -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
 
index c0c8b191cd2edbd7fa20b03de1d0a4f59ed0c903..4a4e974052af4afaaa0f3ecbee4a8ac23822f29b 100644 (file)
@@ -25,7 +25,8 @@
  * namespaces are gone.
  */
 
-#define _GNU_SOURCE    /* setns */
+#include "config.h"
+
 #include <stdio.h>     /* fdopen, getmntent, endmntent */
 #include <stdlib.h>    /* malloc, qsort */
 #include <unistd.h>    /* close */
@@ -37,8 +38,6 @@
 #include <fcntl.h>     /* openat, open */
 #include <errno.h>     /* errno */
 
-#include <../src/config.h>
-
 #if IS_BIONIC
 #include "lxcmntent.h"
 #else
index ea5ee5d75a7d7690b39cac9133afb88c555da58f..d50418023939689a25c9b924bc2e457e8350b2bf 100644 (file)
@@ -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 = []