From 9da03da63b7e793caa98488c67993ad4cd08188f Mon Sep 17 00:00:00 2001 From: Thomas Habets Date: Wed, 25 May 2022 17:54:35 +0100 Subject: configure: Make --disable-seccomp actually work More complete fix than #51. Thanks thesamesam! --- configure.ac | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 7e15d06..8e82a57 100644 --- a/configure.ac +++ b/configure.ac @@ -35,10 +35,14 @@ AC_CHECK_LIB([pcap], [pcap_open_live], ,[AC_MSG_ERROR([libpcap not found])]) AC_SEARCH_LIBS([clock_gettime], [rt]) AC_ARG_ENABLE([seccomp], [Enable seccomp priv drops by default (-z to turn on, -Z for off)], [ - if test "$ac_cv_lib_seccomp_seccomp_init" = "no"; then - AC_MSG_ERROR([--enable-seccomp given but seccomp libraries not present]) + if test x"$enableval" = x"yes"; then + if test "$ac_cv_lib_seccomp_seccomp_init" = "no"; then + AC_MSG_ERROR([--enable-seccomp given but seccomp libraries not present]) + fi + AC_DEFINE([DEFAULT_SECCOMP], [1], [Enable seccomp by default]) + else + AC_DEFINE([DEFAULT_SECCOMP], [0], [Enable seccomp by default]) fi - AC_DEFINE([DEFAULT_SECCOMP], [1], [Enable seccomp by default]) ], [ AC_DEFINE([DEFAULT_SECCOMP], [0], [Disable seccomp by default]) ]) -- cgit v1.2.1