[gnome-desktop] build: Disable seccomp on Linux arches where it's not supported



commit 842306a145cb24c841deeb509ae2a42d2b43c44d
Author: Laurent Bigonville <bigon bigon be>
Date:   Mon Feb 5 14:57:28 2018 +0100

    build: Disable seccomp on Linux arches where it's not supported
    
    seccomp isn't currently supported on all the Linux architectures, see:
    https://github.com/seccomp/libseccomp/blob/master/src/arch.c
    
    Only disable seccomp on architectures where it's not supported, keeping it
    enabled on all the other (Linux) ones.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=786358

 configure.ac |   17 ++++++++++++++---
 1 files changed, 14 insertions(+), 3 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index f09e198..94ade7f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -160,14 +160,24 @@ else
 fi
 
 SECCOMP_PKG=""
+enable_seccomp="no"
 dnl Check for bubblewrap compatible platform
 case $host_os in
   linux*)
-    PKG_CHECK_MODULES(LIBSECCOMP, [libseccomp])
-    SECCOMP_PKG="libseccomp"
+    case $host_cpu in
+      alpha|ia64|m68k|sh4|sparc64)
+        enable_seccomp="no (not available on this architecture)"
+        AC_MSG_WARN("seccomp not available on this architecture")
+        ;;
+      *)
+        PKG_CHECK_MODULES(LIBSECCOMP, [libseccomp])
+        SECCOMP_PKG="libseccomp"
+        AC_DEFINE([ENABLE_SECCOMP], [1], [Define if using seccomp])
+        enable_seccomp="yes"
+        ;;
+    esac
     AC_DEFINE_UNQUOTED(_GNU_SOURCE, 1, [Define to include GNU extensions])
     AC_DEFINE_UNQUOTED(HAVE_BWRAP, 1, [Define to 1 if Bubblewrap support is available])
-    AC_DEFINE([ENABLE_SECCOMP], [1], [Define if using seccomp])
     AC_DEFINE_UNQUOTED(INSTALL_PREFIX, "$prefix", [Path to library install prefix])
     ;;
 esac
@@ -270,5 +280,6 @@ echo "
         Date in gnome-version.xml:    ${enable_date_in_gnome_version}
         Build gtk-doc documentation:  ${enable_gtk_doc}
         Build with udev support:      ${enable_udev}
+        Build with seccomp support:   ${enable_seccomp}
 
 "


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]