From nobody Tue Nov 18 09:03:10 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1608564088; cv=none; d=zohomail.com; s=zohoarc; b=fRizw7qTKknl8Bg/4anl3Jj5wqO8kxci280eiQg5MsBbpZ7bnxbJ2avxoddBKtnM9p5J3AbIMmc0RRG4LSRYcdR7KCRCTP9KLWd8GVCbo/K2v4lt8s6NreV1HKCSOj7vZIn/Pf+2NjzehsmPl0s0tgjPI8m6Um74DBteWn0AqIg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1608564088; h=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=x+XV7POEVzZV9uOrwvIZLsGMYHJ/WzP2anWj6Wklw4o=; b=GVLs9gKI2eDEc733vj0VKyvTHhJ9Nei66rHCI6r1buwgFJGr6luiyYWN8TEq6WK1Wb6mYbKt4UNJfRatD8YddC5geiAbf5ceU3HeFVh8cSpO2bqri4LF7sTK7gkahgU3W7sbHiCB+hymNudlE2sKfmW3aJxeRCoRKgtJmI7rJIk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1608564088728950.6224569188026; Mon, 21 Dec 2020 07:21:28 -0800 (PST) Received: from localhost ([::1]:50122 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1krN00-0004CA-Ul for importer@patchew.org; Mon, 21 Dec 2020 10:21:24 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:42800) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1krMRQ-0005FE-On for qemu-devel@nongnu.org; Mon, 21 Dec 2020 09:45:40 -0500 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]:40441) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1krMRM-0007yC-5b for qemu-devel@nongnu.org; Mon, 21 Dec 2020 09:45:40 -0500 Received: by mail-wr1-x432.google.com with SMTP id 91so11314171wrj.7 for ; Mon, 21 Dec 2020 06:45:35 -0800 (PST) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id l5sm27439627wrv.44.2020.12.21.06.45.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Dec 2020 06:45:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=x+XV7POEVzZV9uOrwvIZLsGMYHJ/WzP2anWj6Wklw4o=; b=EpVJHdcrjVOeV+TcaUSqr98K+inA8CLtvlYV4nS1r/a6wbu1hYhRQdRGQIMm+dqr1N gNCvAdGIOrit0x8P5tdKdFhtRF387c536drwILymXUSHW7pR4Ak0t0hFpBevixCiptN1 FAB7BqrVDJmhIWgaH1bXmX0o4yBLDIaWNcv4Lw7bR8Y39zwJhuQlnni+hD3IludyZGI5 kNJ6CT5pE1z268xMpJ/yxk+QSt4F3w8YEEbYr13g/fBr27yO4fEME1QcQaPWf+NtbgrX eZuEd0xa0xIbKuQUeZ4R3mYl6BG6YZb3v9Gf2IaRT+GUg40JacK4lOfJq6BhomOayOg2 wTHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=x+XV7POEVzZV9uOrwvIZLsGMYHJ/WzP2anWj6Wklw4o=; b=iHJefzhMpy7O4MmR/rcpw4PfkurjfeKeT1BxIu5y67yhwPKc+Om86cZZ04nfU9LuYp ZDM4gwwRgbusGwmQTUnwaUGxvchcFytepmpHNYcjFF1706CyKGiUSpcTV/HjYBSbTkd8 R6QwCqTGAHnk8echHnOnJ26CN/6MWq1/W7MgD/Ezk/lLv7tkYVrrPyQNJ67exJ2L4MN8 R+6h1Zhe/MJ+3/cLgz73S3Eir/cBmqxel/2CK/r3liH1ndYA3blzT7xyn13budKYfpoU AcBuO1NLMk0kUVlzwp1wTB3cwM7lkRj8i6N6UN6kPgZV5k/pWumCmmlsd+6m42ydHi7k DexQ== X-Gm-Message-State: AOAM531gT+U+e6jVsU3NA7D9d8n5jGCbPP7hsYpO1rtYGU58ZU2RDjmh jpVV+wbhlaqAcYOVOLS1zID7c/7WTpw= X-Google-Smtp-Source: ABdhPJzgchAneWYicCTcY6OhG+m2iBC46VsiZk0xoe9x2AK3SYrKNSt4ddJ0OHvAfVEFfuVQXrVSLQ== X-Received: by 2002:adf:c387:: with SMTP id p7mr18943960wrf.95.1608561934748; Mon, 21 Dec 2020 06:45:34 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 52/55] libattr: convert to meson Date: Mon, 21 Dec 2020 15:44:44 +0100 Message-Id: <20201221144447.26161-53-pbonzini@redhat.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201221144447.26161-1-pbonzini@redhat.com> References: <20201221144447.26161-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::432; envelope-from=paolo.bonzini@gmail.com; helo=mail-wr1-x432.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Signed-off-by: Paolo Bonzini --- configure | 45 ++++----------------------------------------- meson.build | 38 +++++++++++++++++++++++++++++++++++--- meson_options.txt | 2 ++ 3 files changed, 41 insertions(+), 44 deletions(-) diff --git a/configure b/configure index 569396248b..18af62a3e0 100755 --- a/configure +++ b/configure @@ -331,8 +331,7 @@ xen_pci_passthrough=3D"auto" linux_aio=3D"$default_feature" linux_io_uring=3D"$default_feature" cap_ng=3D"auto" -attr=3D"$default_feature" -libattr=3D"$default_feature" +attr=3D"auto" xfs=3D"$default_feature" tcg=3D"enabled" membarrier=3D"$default_feature" @@ -1229,9 +1228,9 @@ for opt do ;; --enable-linux-io-uring) linux_io_uring=3D"yes" ;; - --disable-attr) attr=3D"no" + --disable-attr) attr=3D"disabled" ;; - --enable-attr) attr=3D"yes" + --enable-attr) attr=3D"enabled" ;; --disable-membarrier) membarrier=3D"no" ;; @@ -3542,36 +3541,6 @@ elif test "$tpm" =3D "yes"; then fi fi =20 -########################################## -# attr probe - -libattr_libs=3D -if test "$attr" !=3D "no" ; then - cat > $TMPC < -#include -#ifdef CONFIG_LIBATTR -#include -#else -#include -#endif -int main(void) { getxattr(NULL, NULL, NULL, 0); setxattr(NULL, NULL, NULL,= 0, 0); return 0; } -EOF - if compile_prog "" "" ; then - attr=3Dyes - # Older distros have , and need -lattr: - elif compile_prog "-DCONFIG_LIBATTR" "-lattr" ; then - attr=3Dyes - libattr_libs=3D"-lattr" - libattr=3Dyes - else - if test "$attr" =3D "yes" ; then - feature_not_found "ATTR" "Install libc6 or libattr devel" - fi - attr=3Dno - fi -fi - ########################################## # iovec probe cat > $TMPC <> $config_host_mak echo "LINUX_IO_URING_LIBS=3D$linux_io_uring_libs" >> $config_host_mak fi -if test "$attr" =3D "yes" ; then - echo "CONFIG_ATTR=3Dy" >> $config_host_mak - echo "LIBATTR_LIBS=3D$libattr_libs" >> $config_host_mak -fi -if test "$libattr" =3D "yes" ; then - echo "CONFIG_LIBATTR=3Dy" >> $config_host_mak -fi if test "$vhost_scsi" =3D "yes" ; then echo "CONFIG_VHOST_SCSI=3Dy" >> $config_host_mak fi @@ -6534,6 +6496,7 @@ NINJA=3D$ninja $meson setup \ -Dlibnfs=3D$libnfs -Diconv=3D$iconv -Dcurses=3D$curses -Dlibudev= =3D$libudev\ -Dlibssh=3D$libssh -Drbd=3D$rbd -Dlzo=3D$lzo -Dsnappy=3D$snappy -D= lzfse=3D$lzfse \ -Dzstd=3D$zstd -Dseccomp=3D$seccomp -Dvirtfs=3D$virtfs -Dcap_ng=3D= $cap_ng \ + -Dattr=3D$attr \ -Ddocs=3D$docs -Dsphinx_build=3D$sphinx_build -Dinstall_blobs=3D$b= lobs \ -Dvhost_user_blk_server=3D$vhost_user_blk_server \ -Dfuse=3D$fuse -Dfuse_lseek=3D$fuse_lseek \ diff --git a/meson.build b/meson.build index f580f2f67f..fef0c0f013 100644 --- a/meson.build +++ b/meson.build @@ -324,10 +324,40 @@ if not get_option('libnfs').auto() or have_block required: get_option('libnfs'), method: 'pkg-config', static: enable_static) endif + +libattr_test =3D ''' + #include + #include + #ifdef CONFIG_LIBATTR + #include + #else + #include + #endif + int main(void) { getxattr(NULL, NULL, NULL, 0); setxattr(NULL, NULL, NUL= L, 0, 0); return 0; }''' + libattr =3D not_found -if 'CONFIG_ATTR' in config_host - libattr =3D declare_dependency(link_args: config_host['LIBATTR_LIBS'].sp= lit()) +have_old_libattr =3D false +if not get_option('attr').disabled() + if cc.links(libattr_test) + libattr =3D declare_dependency() + else + libattr =3D cc.find_library('attr', has_headers: ['attr/xattr.h'], + required: get_option('attr'), + static: enable_static) + if libattr.found() and not \ + cc.links(libattr_test, dependencies: libattr, args: '-DCONFIG_LIBATT= R') + libattr =3D not_found + if get_option('attr').enabled() + error('could not link libattr') + else + warning('could not link libattr, disabling') + endif + else + have_old_libattr =3D libattr.found() + endif + endif endif + seccomp =3D not_found if not get_option('libiscsi').auto() or have_system or have_tools seccomp =3D dependency('libseccomp', version: '>=3D2.3.0', @@ -1010,6 +1040,7 @@ config_host_data.set_quoted('CONFIG_QEMU_LOCALSTATEDI= R', get_option('prefix') / config_host_data.set_quoted('CONFIG_QEMU_MODDIR', get_option('prefix') / q= emu_moddir) config_host_data.set_quoted('CONFIG_SYSCONFDIR', get_option('prefix') / ge= t_option('sysconfdir')) =20 +config_host_data.set('CONFIG_ATTR', libattr.found()) config_host_data.set('CONFIG_BRLAPI', brlapi.found()) config_host_data.set('CONFIG_COCOA', cocoa.found()) config_host_data.set('CONFIG_LIBUDEV', libudev.found()) @@ -1027,6 +1058,7 @@ if glusterfs.found() config_host_data.set('CONFIG_GLUSTERFS_FTRUNCATE_HAS_STAT', glusterfs_ft= runcate_has_stat) config_host_data.set('CONFIG_GLUSTERFS_IOCB_HAS_STAT', glusterfs_iocb_ha= s_stat) endif +config_host_data.set('CONFIG_LIBATTR', have_old_libattr) config_host_data.set('CONFIG_LIBCAP_NG', libcap_ng.found()) config_host_data.set('CONFIG_LIBISCSI', libiscsi.found()) config_host_data.set('CONFIG_LIBNFS', libnfs.found()) @@ -2350,7 +2382,7 @@ summary_info +=3D {'vde support': config_host.h= as_key('CONFIG_VDE')} summary_info +=3D {'netmap support': config_host.has_key('CONFIG_NETMAP= ')} summary_info +=3D {'Linux AIO support': config_host.has_key('CONFIG_LINUX_= AIO')} summary_info +=3D {'Linux io_uring support': config_host.has_key('CONFIG_L= INUX_IO_URING')} -summary_info +=3D {'ATTR/XATTR support': config_host.has_key('CONFIG_ATTR'= )} +summary_info +=3D {'ATTR/XATTR support': libattr.found()} summary_info +=3D {'Install blobs': get_option('install_blobs')} summary_info +=3D {'KVM support': config_all.has_key('CONFIG_KVM')} summary_info +=3D {'HAX support': config_all.has_key('CONFIG_HAX')} diff --git a/meson_options.txt b/meson_options.txt index 12a1872f20..8fcec056cd 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -40,6 +40,8 @@ option('cfi', type: 'boolean', value: 'false', option('cfi_debug', type: 'boolean', value: 'false', description: 'Verbose errors in case of CFI violation') =20 +option('attr', type : 'feature', value : 'auto', + description: 'attr/xattr support') option('brlapi', type : 'feature', value : 'auto', description: 'brlapi character device driver') option('bzip2', type : 'feature', value : 'auto', --=20 2.29.2