From nobody Tue Feb 10 05:45:35 2026 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=1623151821; cv=none; d=zohomail.com; s=zohoarc; b=ja0XY/tyOVmjqg2tJthd/CwIYLxFZFi0ufzcEgY8R/RPy3d2D5SeDP2DLLA2e5cnL89Zr0mx6AO53CyYWDIsy51zLumAyVRUVlDBTYWYeuV+hcoRPzGDjDhj8SbxZZXpe9w0J3gdbY1lRKKjTns4pW98jKSUyskG7JujpMig5f0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1623151821; 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=ryYpyCa0TSy+bqr+nzscGtPe1ekDpgp26HoVE89U+pY=; b=ny+1xZShAlRH/QoJmlS4c7f4Fo436rhyUfST5pOlQDADjIlfdH6R3bwtIiYXa0NmRkKxpsSu21gjI4B2vEeQ6ABZhT7N76Hr732Yhpsl6EQQNyCddbQ8suyRZGf5FGAlZqbsBO8JdYEg69a9TpD230EzEJzECyXVZkQPpuGBip0= 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 1623151821025971.4790866441175; Tue, 8 Jun 2021 04:30:21 -0700 (PDT) Received: from localhost ([::1]:51310 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lqZw3-0003S5-Nn for importer@patchew.org; Tue, 08 Jun 2021 07:30:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43514) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lqZp9-0006T4-P0 for qemu-devel@nongnu.org; Tue, 08 Jun 2021 07:23:11 -0400 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]:44951) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lqZp7-0007yb-Fa for qemu-devel@nongnu.org; Tue, 08 Jun 2021 07:23:11 -0400 Received: by mail-wr1-x433.google.com with SMTP id f2so21118531wri.11 for ; Tue, 08 Jun 2021 04:23:09 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:5e2c:eb9a:a8b6:fd3e]) by smtp.gmail.com with ESMTPSA id i9sm15388621wrn.54.2021.06.08.04.23.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Jun 2021 04:23:07 -0700 (PDT) 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=ryYpyCa0TSy+bqr+nzscGtPe1ekDpgp26HoVE89U+pY=; b=rcP+1Fmo8QBpva58NtbWPYEPlNs7ewvf4xIC9Oq3T/CioghrZWC5y+ZPeMtik6tXb7 /gh0HoqBaO+UGzDH+z6TToh458R0vj8mruiJbbqWsS7buge+LzfNLwVM6Fc0MF94wUak rVKVM0oRtlRgPWWMjA1EQXkORPdjISsJILEVu9a4FuRe56MscV78PHU0W3kR3mo4VFXo lNzgfrbgQYA077FKhRnIv7jsyn6YcCjCN8KuLCg+KvWlDj8kYRKjuKRH25mzAWN/ep7P ZfeC2MRzwXVfHcKcczo7ayDkoEnY3dFIdXwfVoGdckDX9lTFicm/pTas2XBIFJTPu/dH eIRA== 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=ryYpyCa0TSy+bqr+nzscGtPe1ekDpgp26HoVE89U+pY=; b=cMGQ/Hk/xAYrmyu/nwHii4zHhenrfi91yCynBFf1b1K0J+b1wq3VvlSvPDJ2uPLoFm T6OZmQFKJ6T9/AIzszkv96CqmAjbwrsZpU/AJjAgZZJHwG4Y/aHA5bIKBI0vFv4wyWsO l/vFb9wQYlXpO5FXrLThmCrs5BGcORzC5+be/jfyeAGD3ufAzWHq3DWlqVrZK7z618Js qbtgQ8+hyL5r2UT5z7Y3DDHzV4Xp4Wp4wBrdTj+bSoM0jdRxz9lmNuGgqt6PxURkd5OQ 3AUiud/Np26DmY3l8TceSdUVnWKkq+W/QPVU2VFVq/R5pQJqcNUeCFPU7YnbWC7JYEth JDjg== X-Gm-Message-State: AOAM531RZGDsF+/rRE/8vhODsCTVdazLurwdcdZDk0/aqNCmfVjTHN4n +EYJ0BSo0Vx21cYonwMU8k4/KSp36G6dfQ== X-Google-Smtp-Source: ABdhPJyfiVGbDpmG/pY0X+Lj1LzLr7+FvNN2T8ScD/oifo2bDo6UY0HoMkPMdj66VRQ+BDMkOV8gIg== X-Received: by 2002:a05:6000:1542:: with SMTP id 2mr22237625wry.4.1623151388282; Tue, 08 Jun 2021 04:23:08 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH 06/26] configure, meson: convert libusb detection to meson Date: Tue, 8 Jun 2021 13:22:41 +0200 Message-Id: <20210608112301.402434-7-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210608112301.402434-1-pbonzini@redhat.com> References: <20210608112301.402434-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::433; envelope-from=paolo.bonzini@gmail.com; helo=mail-wr1-x433.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.248, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.248, 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 | 27 ++++----------------------- hw/usb/meson.build | 2 +- meson.build | 11 +++++++---- meson_options.txt | 2 ++ 4 files changed, 14 insertions(+), 28 deletions(-) diff --git a/configure b/configure index d3c2e8ccaf..651273c023 100755 --- a/configure +++ b/configure @@ -374,7 +374,7 @@ spice_protocol=3D"auto" rbd=3D"auto" smartcard=3D"$default_feature" u2f=3D"auto" -libusb=3D"$default_feature" +libusb=3D"auto" usb_redir=3D"$default_feature" opengl=3D"$default_feature" cpuid_h=3D"no" @@ -1285,9 +1285,9 @@ for opt do ;; --enable-u2f) u2f=3D"enabled" ;; - --disable-libusb) libusb=3D"no" + --disable-libusb) libusb=3D"disabled" ;; - --enable-libusb) libusb=3D"yes" + --enable-libusb) libusb=3D"enabled" ;; --disable-usb-redir) usb_redir=3D"no" ;; @@ -3994,20 +3994,6 @@ if test "$smartcard" !=3D "no"; then fi fi =20 -# check for libusb -if test "$libusb" !=3D "no" ; then - if $pkg_config --atleast-version=3D1.0.13 libusb-1.0; then - libusb=3D"yes" - libusb_cflags=3D$($pkg_config --cflags libusb-1.0) - libusb_libs=3D$($pkg_config --libs libusb-1.0) - else - if test "$libusb" =3D "yes"; then - feature_not_found "libusb" "Install libusb devel >=3D 1.0.13" - fi - libusb=3D"no" - fi -fi - # check for usbredirparser for usb network redirection support if test "$usb_redir" !=3D "no" ; then if $pkg_config --atleast-version=3D0.6 libusbredirparser-0.5; then @@ -5626,12 +5612,6 @@ if test "$smartcard" =3D "yes" ; then echo "SMARTCARD_LIBS=3D$libcacard_libs" >> $config_host_mak fi =20 -if test "$libusb" =3D "yes" ; then - echo "CONFIG_USB_LIBUSB=3Dy" >> $config_host_mak - echo "LIBUSB_CFLAGS=3D$libusb_cflags" >> $config_host_mak - echo "LIBUSB_LIBS=3D$libusb_libs" >> $config_host_mak -fi - if test "$usb_redir" =3D "yes" ; then echo "CONFIG_USB_REDIR=3Dy" >> $config_host_mak echo "USB_REDIR_CFLAGS=3D$usb_redir_cflags" >> $config_host_mak @@ -6214,6 +6194,7 @@ if test "$skip_meson" =3D no; then -Dkvm=3D$kvm -Dhax=3D$hax -Dwhpx=3D$whpx -Dhvf=3D$hvf -Dnvmm=3D$nv= mm \ -Dxen=3D$xen -Dxen_pci_passthrough=3D$xen_pci_passthrough -Dtcg=3D= $tcg \ -Dcocoa=3D$cocoa -Dgtk=3D$gtk -Dmpath=3D$mpath -Dsdl=3D$sdl -Dsdl_= image=3D$sdl_image \ + -Dlibusb=3D$libusb \ -Dvnc=3D$vnc -Dvnc_sasl=3D$vnc_sasl -Dvnc_jpeg=3D$vnc_jpeg -Dvnc_p= ng=3D$vnc_png \ -Dgettext=3D$gettext -Dxkbcommon=3D$xkbcommon -Du2f=3D$u2f -Dvirti= ofsd=3D$virtiofsd \ -Dcapstone=3D$capstone -Dslirp=3D$slirp -Dfdt=3D$fdt -Dbrlapi=3D$b= rlapi \ diff --git a/hw/usb/meson.build b/hw/usb/meson.build index f357270d0b..bd3f8735b9 100644 --- a/hw/usb/meson.build +++ b/hw/usb/meson.build @@ -72,7 +72,7 @@ if config_host.has_key('CONFIG_USB_REDIR') endif =20 # usb pass-through -softmmu_ss.add(when: ['CONFIG_USB', 'CONFIG_USB_LIBUSB', libusb], +softmmu_ss.add(when: ['CONFIG_USB', libusb], if_true: files('host-libusb.c'), if_false: files('host-stub.c')) softmmu_ss.add(when: 'CONFIG_ALL', if_true: files('host-stub.c')) diff --git a/meson.build b/meson.build index 0d4b6fff16..2a4a47d281 100644 --- a/meson.build +++ b/meson.build @@ -991,10 +991,12 @@ if 'CONFIG_USB_REDIR' in config_host link_args: config_host['USB_REDIR_LIBS'].s= plit()) endif libusb =3D not_found -if 'CONFIG_USB_LIBUSB' in config_host - libusb =3D declare_dependency(compile_args: config_host['LIBUSB_CFLAGS']= .split(), - link_args: config_host['LIBUSB_LIBS'].split(= )) +if not get_option('libusb').auto() or have_system + libusb =3D dependency('libusb-1.0', required: get_option('libusb'), + version: '>=3D1.0.13', method: 'pkg-config', + kwargs: static_kwargs) endif + libpmem =3D not_found if 'CONFIG_LIBPMEM' in config_host libpmem =3D declare_dependency(compile_args: config_host['LIBPMEM_CFLAGS= '].split(), @@ -1213,6 +1215,7 @@ config_host_data.set('CONFIG_SDL', sdl.found()) config_host_data.set('CONFIG_SDL_IMAGE', sdl_image.found()) config_host_data.set('CONFIG_SECCOMP', seccomp.found()) config_host_data.set('CONFIG_SNAPPY', snappy.found()) +config_host_data.set('CONFIG_USB_LIBUSB', libusb.found()) config_host_data.set('CONFIG_VHOST_USER_BLK_SERVER', have_vhost_user_blk_s= erver) config_host_data.set('CONFIG_VNC', vnc.found()) config_host_data.set('CONFIG_VNC_JPEG', jpeg.found()) @@ -2793,7 +2796,7 @@ summary_info +=3D {'rbd support': rbd.found()} summary_info +=3D {'xfsctl support': config_host.has_key('CONFIG_XFS')} summary_info +=3D {'smartcard support': config_host.has_key('CONFIG_SMARTC= ARD')} summary_info +=3D {'U2F support': u2f.found()} -summary_info +=3D {'libusb': config_host.has_key('CONFIG_USB_LI= BUSB')} +summary_info +=3D {'libusb': libusb.found()} summary_info +=3D {'usb net redir': config_host.has_key('CONFIG_USB_RE= DIR')} summary_info +=3D {'OpenGL support': config_host.has_key('CONFIG_OPENGL= ')} summary_info +=3D {'GBM': config_host.has_key('CONFIG_GBM')} diff --git a/meson_options.txt b/meson_options.txt index ac6e90da07..02c14d4751 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -86,6 +86,8 @@ option('gcrypt', type : 'feature', value : 'auto', description: 'libgcrypt cryptography support') option('libudev', type : 'feature', value : 'auto', description: 'Use libudev to enumerate host devices') +option('libusb', type : 'feature', value : 'auto', + description: 'libusb support for USB passthrough') option('lzfse', type : 'feature', value : 'auto', description: 'lzfse support for DMG images') option('lzo', type : 'feature', value : 'auto', --=20 2.31.1