Makefile: correctly check seccomp notify support

Signed-off-by: Peter Hunt <pehunt@redhat.com>
This commit is contained in:
Peter Hunt 2021-06-23 11:50:55 -04:00
parent e796a80009
commit 1d67d9ed60
2 changed files with 5 additions and 1 deletions

View File

@ -46,7 +46,7 @@ else ifeq ($(shell $(PKG_CONFIG) --exists libsystemd && echo "0"), 0)
override CFLAGS += $(shell $(PKG_CONFIG) --cflags libsystemd) -D USE_JOURNALD=1
endif
ifeq ($(shell $(PKG_CONFIG) --atleast-version 2.5.0 libseccomp && echo "0"), 0)
ifeq ($(shell hack/seccomp-notify.sh), 0)
override LIBS += $(shell $(PKG_CONFIG) --libs libseccomp) -ldl
override CFLAGS += $(shell $(PKG_CONFIG) --cflags libseccomp) -D USE_SECCOMP=1
else

4
hack/seccomp-notify.sh Executable file
View File

@ -0,0 +1,4 @@
#!/bin/bash
if $(printf '#include <linux/seccomp.h>\nvoid main(){struct seccomp_notif_sizes s;}' | cc -x c - -o /dev/null 2> /dev/null && pkg-config --atleast-version 2.5.0 libseccomp); then
echo "0"
fi