From nobody Tue Feb 10 19:08:04 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1624631578124245.1928620067713; Fri, 25 Jun 2021 07:32:58 -0700 (PDT) Received: from localhost ([::1]:35164 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lwmt6-0003jW-Ui for importer@patchew.org; Fri, 25 Jun 2021 10:32:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60702) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lwmfD-0002z8-A5 for qemu-devel@nongnu.org; Fri, 25 Jun 2021 10:18:35 -0400 Received: from mail-ej1-x62f.google.com ([2a00:1450:4864:20::62f]:37623) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lwmfA-0003AJ-W0 for qemu-devel@nongnu.org; Fri, 25 Jun 2021 10:18:34 -0400 Received: by mail-ej1-x62f.google.com with SMTP id o11so2223504ejd.4 for ; Fri, 25 Jun 2021 07:18:32 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id c28sm326579ejc.102.2021.06.25.07.18.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Jun 2021 07:18:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Xs9h6JVvEzIMS5Kp/ZSehjw8VqtorUSKIK1nTr/EzMM=; b=AigWCR7U8GmDuRneXJjhm111zMfyZgEZN277tSuxHFmMsbp6swxAP/yctgYBWWfOGg cRrhhwpwVp48DwY/4Ul1ryTIgNnDj8oH+gAEqHHT9VBXJMjICNkf+FF1nYikiAuDulDj svbkpmgY/MT9iBFIkxyyJpFdjP9ugyyT0KCVdqzZEHgNGQ5zCSIj0Tj9CtJ4tgpoBCgL qusSEj2hKDboPyBYbq/MoKUBkxhtPz7I9LSYBatRhBjrpQE0yydR1EQ2nQ7Lw70jgitL Bv0jim0goC1qgZ0z8sQstuEV5B8ef12juP95kPh1o5QmaEAGvWB7I2fu50FIXvUC25p7 HJIg== 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:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=Xs9h6JVvEzIMS5Kp/ZSehjw8VqtorUSKIK1nTr/EzMM=; b=EqDcelgWqzZaZdIsRxFcB+aCqTwMzR76AJlBPg+W2fPruKzyupgLex6xRQBGxLuQv2 eqDiX99s2UAXsXVEUe3OKllyMBVvWPIV9+MdXEXz7Sso5X9iijZdQDun4xhMzqF66BS7 OQJnQfpSMIh7mJluFoadnjVrAglu4pGS1oa2AtDrzs/QWBTVhbnYywnOHekiDN21zAtJ 4EHpiXxBUB/SNM7vS6wy8a2DjA9E7N3NU7sBzp3AXRyi/4RMOlocJWeKEgFj+ov4rUB3 iKeDopwR89X9sERtlqN9UF2175iuWsvE37H/V+2csW2l49zcVOA2NYk4RS3wBr+Wuz4x /s/Q== X-Gm-Message-State: AOAM531mHoCcvdW0JZPUsLEx0ol8zow5K09kJsNxOscg01Wh/dpVFwfu zHZpfg8vzWCcKLCVKo1FQiLeH5FlPM8= X-Google-Smtp-Source: ABdhPJzAbPofI186io/sUrHdpHe0K9BW5uS7bq+soczPpsqFwZUctvruL/Abx5SK0XRtcJvjB61UcQ== X-Received: by 2002:a17:906:2c43:: with SMTP id f3mr10874405ejh.505.1624630711693; Fri, 25 Jun 2021 07:18:31 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 09/28] configure, meson: convert libusb detection to meson Date: Fri, 25 Jun 2021 16:18:03 +0200 Message-Id: <20210625141822.1368639-10-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210625141822.1368639-1-pbonzini@redhat.com> References: <20210625141822.1368639-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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::62f; envelope-from=paolo.bonzini@gmail.com; helo=mail-ej1-x62f.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: , Cc: =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Reviewed-by: Daniel P. Berrang=C3=A9 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 237e99c3d0..e54d06b99e 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 @@ -5631,12 +5617,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 @@ -6215,6 +6195,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 d3025e05fc..0b4b55b9da 100644 --- a/meson.build +++ b/meson.build @@ -992,10 +992,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(), @@ -1211,6 +1213,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()) @@ -2780,7 +2783,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