From: Thomas Devoogdt Date: Thu, 6 Mar 2025 10:49:12 +0000 (+0100) Subject: {configure.ac,meson.build}: conditionally build {enosys,setpriv} if seccomp is presen... X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8de1ec203b0fbf86ae67b1ac18ba094d36b6a34a;p=thirdparty%2Futil-linux.git {configure.ac,meson.build}: conditionally build {enosys,setpriv} if seccomp is present #3280 misc-utils/enosys.c:25:27: fatal error: linux/seccomp.h: No such file or directory #include Signed-off-by: Thomas Devoogdt --- diff --git a/configure.ac b/configure.ac index e8826caff..37725c257 100644 --- a/configure.ac +++ b/configure.ac @@ -349,6 +349,7 @@ AC_CHECK_HEADERS([ \ linux/nsfs.h \ linux/pr.h \ linux/raw.h \ + linux/seccomp.h \ linux/securebits.h \ linux/tiocl.h \ linux/version.h \ @@ -515,6 +516,7 @@ have_linux_kcmp_h=$ac_cv_header_linux_kcmp_h have_linux_mount_h=$ac_cv_header_linux_mount_h have_linux_pr_h=$ac_cv_header_linux_pr_h have_linux_raw_h=$ac_cv_header_linux_raw_h +have_linux_seccomp_h=$ac_cv_header_linux_seccomp_h have_linux_securebits_h=$ac_cv_header_linux_securebits_h have_linux_version_h=$ac_cv_header_linux_version_h have_linux_watchdog_h=$ac_cv_header_linux_watchdog_h @@ -1704,6 +1706,7 @@ AC_ARG_ENABLE([setpriv], ) UL_BUILD_INIT([setpriv]) UL_REQUIRES_LINUX([setpriv]) +UL_REQUIRES_HAVE([setpriv], [linux_seccomp_h], [linux/seccomp.h header file]) UL_REQUIRES_HAVE([setpriv], [linux_securebits_h], [linux/securebits.h header file]) UL_REQUIRES_HAVE([setpriv], [linux_capability_h], [linux/capability.h header file]) UL_REQUIRES_HAVE([setpriv], [cap_ng], [libcap-ng library]) @@ -2021,6 +2024,7 @@ AC_ARG_ENABLE([enosys], UL_BUILD_INIT([enosys]) UL_REQUIRES_LINUX([enosys]) UL_REQUIRES_HAVE([enosys], [linux_audit_h], [linux/audit.h header file]) +UL_REQUIRES_HAVE([enosys], [linux_seccomp_h], [linux/seccomp.h header file]) AS_IF([test "x$build_enosys" = xyes], [ AC_MSG_CHECKING([for valid audit arch]) AC_COMPILE_IFELSE( diff --git a/meson.build b/meson.build index 311c0a114..fba31406c 100644 --- a/meson.build +++ b/meson.build @@ -2171,7 +2171,9 @@ if opt and not is_disabler(exe) exes += exe endif -opt = not get_option('build-setpriv').disabled() and lib_cap_ng.found() +opt = not get_option('build-setpriv').disabled() \ + and lib_cap_ng.found() \ + and cc.has_header('linux/seccomp.h') exe = executable( 'setpriv', setpriv_sources, @@ -3328,9 +3330,10 @@ syscalls_h = custom_target('syscalls.h', ) have_linux_audit_h = cc.has_header('linux/audit.h') +have_linux_seccomp_h = cc.has_header('linux/seccomp.h') have_audit_arch_native = cc.compiles(fs.read('include/audit-arch.h'), name : 'has AUDIT_ARCH_NATIVE') -opt = get_option('build-enosys').require(have_linux_audit_h and have_audit_arch_native).allowed() +opt = get_option('build-enosys').require(have_linux_audit_h and have_linux_seccomp_h and have_audit_arch_native).allowed() exe = executable( 'enosys', 'misc-utils/enosys.c', syscalls_h, errnos_h,