]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
{configure.ac,meson.build}: conditionally build {enosys,setpriv} if seccomp is presen...
authorThomas Devoogdt <thomas.devoogdt@barco.com>
Thu, 6 Mar 2025 10:49:12 +0000 (11:49 +0100)
committerThomas Devoogdt <thomas.devoogdt@barco.com>
Fri, 7 Mar 2025 07:03:10 +0000 (08:03 +0100)
misc-utils/enosys.c:25:27: fatal error: linux/seccomp.h: No such file or directory
 #include <linux/seccomp.h>

Signed-off-by: Thomas Devoogdt <thomas.devoogdt@barco.com>
configure.ac
meson.build

index e8826caff8564c1dc9f8914b4178332b5204a7e6..37725c2574fa72dc70012e82d08b9c8e409df867 100644 (file)
@@ -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(
index 311c0a114d037d1522f82712b69453cbc477ac33..fba31406c2030f2e557459351e9e8b23398cf5b4 100644 (file)
@@ -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,