From nobody Sun Feb 8 10:03:27 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1594893867; cv=none; d=zohomail.com; s=zohoarc; b=Gh5GF+QU1nFFpzIzsxCYunooIhOoDSjI/a4kbKBDS8FTvQuK3zG/wznhXZCNIsRlyZJBxqwwPGfD8W0IGreMnKudp2tIv6eFlN/3f0Apv1IySpwmHQRx1bWwZguAd9Qdni7PE739Oqhg0llLuVA3evUa7PTujti7QYfw7Bfxz+M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594893867; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Pt1YH5DVDf9QwEVC2gZX66OA+i5Cobi9ogDgpgsU3IY=; b=FCEcFzYzCo7DKTOcFCBau5LlIyyuAmJI/VuyfTHmgZvr8qbKuqSh7wsa8NYSa2PrbGvWEnHjsQmWxeB2Ok62Ppmb/MmLHCPQY/B7XvBrYCcQieEA0R2DUfDvGBQQYSwfw5px1ipJlZkGkH8/mgRMLSqRKUAPBHIEJRZYBGDcpdk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1594893867683392.68328501463395; Thu, 16 Jul 2020 03:04:27 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-428-jbJf4U1qNrK56CIVnHgjvg-1; Thu, 16 Jul 2020 06:03:07 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 02FB419253C7; Thu, 16 Jul 2020 10:02:35 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D3A4578A50; Thu, 16 Jul 2020 10:02:34 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 9EA791809554; Thu, 16 Jul 2020 10:02:34 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 06GA2S01016435 for ; Thu, 16 Jul 2020 06:02:28 -0400 Received: by smtp.corp.redhat.com (Postfix) id B43EA2B6DB; Thu, 16 Jul 2020 10:02:28 +0000 (UTC) Received: from antique-work.redhat.com (unknown [10.40.194.85]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2ADDF2E023 for ; Thu, 16 Jul 2020 10:02:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1594893866; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=Pt1YH5DVDf9QwEVC2gZX66OA+i5Cobi9ogDgpgsU3IY=; b=e5V1JzaTv4dvYajoVevZzlhi8nFEYpfja1sc6VunFN/P664OXhCSkw7B+WNiJyaeVuRnFD B3V+zqKGF+XqsuEy28usnfF7NjNgSllr2agxv46qmXTLEh0EFgvE1Bjw1Ay2+gsmBHIuB3 FuQ57fVczW6L61s/62/nm9xnQKgklOM= X-MC-Unique: jbJf4U1qNrK56CIVnHgjvg-1 From: Pavel Hrdina To: libvir-list@redhat.com Subject: [libvirt PATCH 071/351] meson: add SELinux build dependency Date: Thu, 16 Jul 2020 11:55:07 +0200 Message-Id: <58469e49cee5a35fca30c138304d3da73d31975d.1594891445.git.phrdina@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Pavel Hrdina --- configure.ac | 3 --- m4/virt-selinux.m4 | 47 ---------------------------------------------- meson.build | 15 +++++++++++++++ meson_options.txt | 2 ++ 4 files changed, 17 insertions(+), 50 deletions(-) delete mode 100644 m4/virt-selinux.m4 diff --git a/configure.ac b/configure.ac index c8d7bbf7a92..0a51a07be0e 100644 --- a/configure.ac +++ b/configure.ac @@ -109,7 +109,6 @@ fi =20 LIBVIRT_ARG_NSS LIBVIRT_ARG_PM_UTILS -LIBVIRT_ARG_SELINUX LIBVIRT_ARG_UDEV LIBVIRT_ARG_VIRTUALPORT LIBVIRT_ARG_WIRESHARK @@ -118,7 +117,6 @@ LIBVIRT_ARG_YAJL LIBVIRT_CHECK_NWFILTER LIBVIRT_CHECK_PM_UTILS LIBVIRT_CHECK_PTHREAD -LIBVIRT_CHECK_SELINUX LIBVIRT_CHECK_UDEV LIBVIRT_CHECK_VIRTUALPORT LIBVIRT_CHECK_WIRESHARK @@ -406,7 +404,6 @@ LIBVIRT_RESULT_LIBXL LIBVIRT_RESULT_NSS LIBVIRT_RESULT_PM_UTILS LIBVIRT_RESULT_RBD -LIBVIRT_RESULT_SELINUX LIBVIRT_RESULT_UDEV LIBVIRT_RESULT_VIRTUALPORT LIBVIRT_RESULT_XDR diff --git a/m4/virt-selinux.m4 b/m4/virt-selinux.m4 deleted file mode 100644 index fb541e207ed..00000000000 --- a/m4/virt-selinux.m4 +++ /dev/null @@ -1,47 +0,0 @@ -dnl The libselinux.so library -dnl -dnl Copyright (C) 2012-2014, 2016 Red Hat, Inc. -dnl -dnl This library is free software; you can redistribute it and/or -dnl modify it under the terms of the GNU Lesser General Public -dnl License as published by the Free Software Foundation; either -dnl version 2.1 of the License, or (at your option) any later version. -dnl -dnl This library is distributed in the hope that it will be useful, -dnl but WITHOUT ANY WARRANTY; without even the implied warranty of -dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -dnl Lesser General Public License for more details. -dnl -dnl You should have received a copy of the GNU Lesser General Public -dnl License along with this library. If not, see -dnl . -dnl - -AC_DEFUN([LIBVIRT_ARG_SELINUX],[ - LIBVIRT_ARG_WITH_FEATURE([SELINUX], [SELinux], [check]) - LIBVIRT_ARG_WITH([SELINUX_MOUNT], [set SELinux mount point], [check]) -]) - -AC_DEFUN([LIBVIRT_CHECK_SELINUX],[ - LIBVIRT_CHECK_LIB([SELINUX], [selinux], - [fgetfilecon_raw], [selinux/selinux.h]) - - if test "$with_selinux" =3D "yes"; then - AC_MSG_CHECKING([SELinux mount point]) - if test "$with_selinux_mount" =3D "check" || test -z "$with_selinux_mo= unt"; then - if test -d /sys/fs/selinux ; then - SELINUX_MOUNT=3D/sys/fs/selinux - else - SELINUX_MOUNT=3D/selinux - fi - else - SELINUX_MOUNT=3D$with_selinux_mount - fi - AC_MSG_RESULT([$SELINUX_MOUNT]) - AC_DEFINE_UNQUOTED([SELINUX_MOUNT], ["$SELINUX_MOUNT"], [SELinux mount= point]) - fi -]) - -AC_DEFUN([LIBVIRT_RESULT_SELINUX],[ - LIBVIRT_RESULT_LIB([SELINUX]) -]) diff --git a/meson.build b/meson.build index d7f3fa7a198..fa4dbee3ef3 100644 --- a/meson.build +++ b/meson.build @@ -1332,6 +1332,20 @@ else sasl_dep =3D dependency('', required: false) endif =20 +selinux_dep =3D cc.find_library('selinux', required: get_option('selinux')) +if selinux_dep.found() + selinux_mount =3D get_option('selinux_mount') + if selinux_mount =3D=3D '' + if run_command('test', '-d', '/sys/fs/selinux').returncode() =3D=3D 0 + selinux_mount =3D '/sys/fs/selinux' + else + selinux_mount =3D '/selinux' + endif + endif + conf.set_quoted('SELINUX_MOUNT', selinux_mount) + conf.set('WITH_SELINUX', 1) +endif + =20 # generic build dependencies checks =20 @@ -1436,6 +1450,7 @@ libs_summary =3D { 'readline': readline_dep.found(), 'sanlock': conf.has('WITH_SANLOCK'), 'sasl': sasl_dep.found(), + 'selinux': selinux_dep.found(), } summary(libs_summary, section: 'Libraries', bool_yn: true) =20 diff --git a/meson_options.txt b/meson_options.txt index a674876713c..40830f9494a 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -37,3 +37,5 @@ option('polkit', type: 'feature', value: 'auto', descript= ion: 'use PolicyKit for option('readline', type: 'feature', value: 'auto', description: 'readline = support') option('sanlock', type: 'feature', value: 'auto', description: 'sanlock su= pport') option('sasl', type: 'feature', value: 'auto', description: 'sasl supprt') +option('selinux', type: 'feature', value: 'auto', description: 'selinux su= pport') +option('selinux_mount', type: 'string', value: '', description: 'set SELin= ux mount point') --=20 2.26.2