From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, HTML_MESSAGE,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C2348C4361B for ; Thu, 17 Dec 2020 13:19:33 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1B26A2389A for ; Thu, 17 Dec 2020 13:19:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1B26A2389A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:35444 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kptBs-0005gz-7E for qemu-devel@archiver.kernel.org; Thu, 17 Dec 2020 08:19:32 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:38370) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kpt4O-0008Sy-8w for qemu-devel@nongnu.org; Thu, 17 Dec 2020 08:11:48 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:32887) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kpt48-0004de-5d for qemu-devel@nongnu.org; Thu, 17 Dec 2020 08:11:48 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1608210690; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=hLatkZQKTcOuRGYhtQ4mDaDVL0qc3swgMUD7uZ0IZ4s=; b=LwtTVZIuFJDt/2P15i5OMPxijqlgXsq23Z2549I1eHVNZSKsJXTXKv/dmKVIvtNB2876AP qCP0AHd8EbuY0CGdy9p9qEw/Y8Eokc4ccYNQkujthtQyEmiJYIqL72gNACwZXnfP081FSS FXU7bpQCfWiVTUzqIatE8sZwfSUyBcA= Received: from mail-il1-f198.google.com (mail-il1-f198.google.com [209.85.166.198]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-282-xVDYbpCZPby-nnsqIwblyw-1; Thu, 17 Dec 2020 08:11:28 -0500 X-MC-Unique: xVDYbpCZPby-nnsqIwblyw-1 Received: by mail-il1-f198.google.com with SMTP id g1so25945273ilq.7 for ; Thu, 17 Dec 2020 05:11:28 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=hLatkZQKTcOuRGYhtQ4mDaDVL0qc3swgMUD7uZ0IZ4s=; b=uPI2fwxQGrrwgfM0305P8Wef5G0ZZl2cwQtxVAXGrERfHWsGIZiPAF9iJIYXIp1t9p cOdRSyv6Seroo5XP05toZ9AyuCkf+VZJxWKGdmr91GVQ1jWAsRhG+p5auT1nm9Xxzx3F GchlpJhlp16Q/tqgpHfwHP7e12Wu7TQoej6SMQcZv/01uUF6VRLx1YoI5/wnIO6mojvM 105bPUFkTeQzKxB08ERSghhANl3sYmfVvowvCRjI+n1PlkkvEEJRrULLfmYPczQc4I3A iVjxynpLJDxEvWH9bv509YJP1/NVZfc73x1rLRYaX8Kuriyq29MJuJEYjVtPxtn8kzKH HRmQ== X-Gm-Message-State: AOAM532XFNoKHfib5bz3NxMoOGmnk4vnQ8VIMriVoV4/Y208RMQZejlO KoZrpW+NuinjPWfJ1U7UR0AJMQB5CUo/e9loh9dT7V7nUDIUq5p8R4XR+IMTlQictWi5miw+ZKU 9mtBqvWuz2FnbnJwz3tXqe7P2qap0ePQ= X-Received: by 2002:a92:4101:: with SMTP id o1mr50760624ila.82.1608210687501; Thu, 17 Dec 2020 05:11:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJztPnJJaOkoyfPwzigRx65Jl0nEoxShQOZ/0jJbokiQa0kUQL4FLozd7aVttGpy8B3QrAR97bx8iyzPq/OKc9M= X-Received: by 2002:a92:4101:: with SMTP id o1mr50760603ila.82.1608210687209; Thu, 17 Dec 2020 05:11:27 -0800 (PST) MIME-Version: 1.0 References: <20201217094044.46462-1-pbonzini@redhat.com> <20201217094044.46462-13-pbonzini@redhat.com> In-Reply-To: <20201217094044.46462-13-pbonzini@redhat.com> From: =?UTF-8?B?TWFyYy1BbmRyw6kgTHVyZWF1?= Date: Thu, 17 Dec 2020 17:11:16 +0400 Message-ID: Subject: Re: [PATCH 12/18] lzfse: convert to meson To: Paolo Bonzini Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mlureau@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: multipart/alternative; boundary="000000000000bc55d905b6a8bad1" Received-SPF: pass client-ip=63.128.21.124; envelope-from=mlureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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: qemu-devel Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" --000000000000bc55d905b6a8bad1 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Dec 17, 2020 at 1:41 PM Paolo Bonzini wrote: > Signed-off-by: Paolo Bonzini > Reviewed-by: Marc-Andr=C3=A9 Lureau --- > configure | 31 ++++--------------------------- > meson.build | 19 +++++++++++++++---- > meson_options.txt | 2 ++ > 3 files changed, 21 insertions(+), 31 deletions(-) > > diff --git a/configure b/configure > index aee27d9cdd..ea5650acca 100755 > --- a/configure > +++ b/configure > @@ -397,7 +397,7 @@ capstone=3D"auto" > lzo=3D"auto" > snappy=3D"auto" > bzip2=3D"auto" > -lzfse=3D"$default_feature" > +lzfse=3D"auto" > zstd=3D"$default_feature" > guest_agent=3D"$default_feature" > guest_agent_with_vss=3D"no" > @@ -1324,9 +1324,9 @@ for opt do > ;; > --enable-bzip2) bzip2=3D"enabled" > ;; > - --enable-lzfse) lzfse=3D"yes" > + --enable-lzfse) lzfse=3D"enabled" > ;; > - --disable-lzfse) lzfse=3D"no" > + --disable-lzfse) lzfse=3D"disabled" > ;; > --disable-zstd) zstd=3D"no" > ;; > @@ -2458,24 +2458,6 @@ EOF > fi > fi > > -########################################## > -# lzfse check > - > -if test "$lzfse" !=3D "no" ; then > - cat > $TMPC << EOF > -#include > -int main(void) { lzfse_decode_scratch_size(); return 0; } > -EOF > - if compile_prog "" "-llzfse" ; then > - lzfse=3D"yes" > - else > - if test "$lzfse" =3D "yes"; then > - feature_not_found "lzfse" "Install lzfse devel" > - fi > - lzfse=3D"no" > - fi > -fi > - > ########################################## > # zstd check > > @@ -6088,11 +6070,6 @@ if test "$avx512f_opt" =3D "yes" ; then > echo "CONFIG_AVX512F_OPT=3Dy" >> $config_host_mak > fi > > -if test "$lzfse" =3D "yes" ; then > - echo "CONFIG_LZFSE=3Dy" >> $config_host_mak > - echo "LZFSE_LIBS=3D-llzfse" >> $config_host_mak > -fi > - > if test "$zstd" =3D "yes" ; then > echo "CONFIG_ZSTD=3Dy" >> $config_host_mak > echo "ZSTD_CFLAGS=3D$zstd_cflags" >> $config_host_mak > @@ -6651,7 +6628,7 @@ NINJA=3D$ninja $meson setup \ > -Dcapstone=3D$capstone -Dslirp=3D$slirp -Dfdt=3D$fdt -Dbrlapi=3D= $brlapi \ > -Dcurl=3D$curl -Dglusterfs=3D$glusterfs -Dbzip2=3D$bzip2 > -Dlibiscsi=3D$libiscsi \ > -Dlibnfs=3D$libnfs -Diconv=3D$iconv -Dcurses=3D$curses > -Dlibudev=3D$libudev\ > - -Dlibssh=3D$libssh -Drbd=3D$rbd -Dlzo=3D$lzo -Dsnappy=3D$snappy = \ > + -Dlibssh=3D$libssh -Drbd=3D$rbd -Dlzo=3D$lzo -Dsnappy=3D$snappy > -Dlzfse=3D$lzfse \ > -Ddocs=3D$docs -Dsphinx_build=3D$sphinx_build -Dinstall_blobs=3D= $blobs \ > -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 9f6ea65626..c02d9c3e1a 100644 > --- a/meson.build > +++ b/meson.build > @@ -695,10 +695,21 @@ if not get_option('bzip2').auto() or have_block > endif > endif > endif > -liblzfse =3D not_found > -if 'CONFIG_LZFSE' in config_host > - liblzfse =3D declare_dependency(link_args: > config_host['LZFSE_LIBS'].split()) > + > +liblzfse =3D cc.find_library('lzfse', has_headers: ['lzfse.h'], > + required: get_option('lzfse'), > + static: enable_static) > +if liblzfse.found() and not cc.links(''' > + #include > + int main(void) { lzfse_decode_scratch_size(); return 0; }''', > dependencies: liblzfse) > + liblzfse =3D not_found > + if get_option('lzfse').enabled() > + error('could not link liblzfse') > + else > + warning('could not link liblzfse, disabling') > + endif > endif > + > oss =3D not_found > if 'CONFIG_AUDIO_OSS' in config_host > oss =3D declare_dependency(link_args: config_host['OSS_LIBS'].split()) > @@ -2365,7 +2376,7 @@ summary_info +=3D {'Live block migration': > config_host.has_key('CONFIG_LIVE_BLOCK_ > summary_info +=3D {'lzo support': lzo.found()} > summary_info +=3D {'snappy support': snappy.found()} > summary_info +=3D {'bzip2 support': libbzip2.found()} > -summary_info +=3D {'lzfse support': config_host.has_key('CONFIG_LZFS= E')} > +summary_info +=3D {'lzfse support': liblzfse.found()} > summary_info +=3D {'zstd support': config_host.has_key('CONFIG_ZSTD= ')} > summary_info +=3D {'NUMA host support': config_host.has_key('CONFIG_NUMA= ')} > summary_info +=3D {'libxml2': > config_host.has_key('CONFIG_LIBXML2')} > diff --git a/meson_options.txt b/meson_options.txt > index e2b7e23887..f74a3d78c4 100644 > --- a/meson_options.txt > +++ b/meson_options.txt > @@ -64,6 +64,8 @@ option('curses', type : 'feature', value : 'auto', > description: 'curses UI') > option('libudev', type : 'feature', value : 'auto', > description: 'Use libudev to enumerate host devices') > +option('lzfse', type : 'feature', value : 'auto', > + description: 'lzfse support for DMG images') > option('lzo', type : 'feature', value : 'auto', > description: 'lzo compression support') > option('rbd', type : 'feature', value : 'auto', > -- > 2.29.2 > > > --000000000000bc55d905b6a8bad1 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Thu, Dec 17, 2020 at 1:41 PM Paolo= Bonzini <pbonzini@redhat.com= > wrote:
Sign= ed-off-by: Paolo Bonzini <pbonzini@redhat.com>

Reviewed-by: Marc-Andr=C3=A9 Lureau <marcandre.lureau@redhat.com>=C2=A0

<= /div>
---
=C2=A0configure=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| 31 ++++-----------------= ----------
=C2=A0meson.build=C2=A0 =C2=A0 =C2=A0 =C2=A0| 19 +++++++++++++++----
=C2=A0meson_options.txt |=C2=A0 2 ++
=C2=A03 files changed, 21 insertions(+), 31 deletions(-)

diff --git a/configure b/configure
index aee27d9cdd..ea5650acca 100755
--- a/configure
+++ b/configure
@@ -397,7 +397,7 @@ capstone=3D"auto"
=C2=A0lzo=3D"auto"
=C2=A0snappy=3D"auto"
=C2=A0bzip2=3D"auto"
-lzfse=3D"$default_feature"
+lzfse=3D"auto"
=C2=A0zstd=3D"$default_feature"
=C2=A0guest_agent=3D"$default_feature"
=C2=A0guest_agent_with_vss=3D"no"
@@ -1324,9 +1324,9 @@ for opt do
=C2=A0 =C2=A0;;
=C2=A0 =C2=A0--enable-bzip2) bzip2=3D"enabled"
=C2=A0 =C2=A0;;
-=C2=A0 --enable-lzfse) lzfse=3D"yes"
+=C2=A0 --enable-lzfse) lzfse=3D"enabled"
=C2=A0 =C2=A0;;
-=C2=A0 --disable-lzfse) lzfse=3D"no"
+=C2=A0 --disable-lzfse) lzfse=3D"disabled"
=C2=A0 =C2=A0;;
=C2=A0 =C2=A0--disable-zstd) zstd=3D"no"
=C2=A0 =C2=A0;;
@@ -2458,24 +2458,6 @@ EOF
=C2=A0 =C2=A0fi
=C2=A0fi

-##########################################
-# lzfse check
-
-if test "$lzfse" !=3D "no" ; then
-=C2=A0 =C2=A0 cat > $TMPC << EOF
-#include <lzfse.h>
-int main(void) { lzfse_decode_scratch_size(); return 0; }
-EOF
-=C2=A0 =C2=A0 if compile_prog "" "-llzfse" ; then
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 lzfse=3D"yes"
-=C2=A0 =C2=A0 else
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 if test "$lzfse" =3D "yes"= ; then
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 feature_not_found "lzfse&qu= ot; "Install lzfse devel"
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 fi
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 lzfse=3D"no"
-=C2=A0 =C2=A0 fi
-fi
-
=C2=A0##########################################
=C2=A0# zstd check

@@ -6088,11 +6070,6 @@ if test "$avx512f_opt" =3D "yes"= ; then
=C2=A0 =C2=A0echo "CONFIG_AVX512F_OPT=3Dy" >> $config_host_= mak
=C2=A0fi

-if test "$lzfse" =3D "yes" ; then
-=C2=A0 echo "CONFIG_LZFSE=3Dy" >> $config_host_mak
-=C2=A0 echo "LZFSE_LIBS=3D-llzfse" >> $config_host_mak
-fi
-
=C2=A0if test "$zstd" =3D "yes" ; then
=C2=A0 =C2=A0echo "CONFIG_ZSTD=3Dy" >> $config_host_mak
=C2=A0 =C2=A0echo "ZSTD_CFLAGS=3D$zstd_cflags" >> $config_h= ost_mak
@@ -6651,7 +6628,7 @@ NINJA=3D$ninja $meson setup \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0-Dcapstone=3D$capstone -Dslirp=3D$slirp -= Dfdt=3D$fdt -Dbrlapi=3D$brlapi \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0-Dcurl=3D$curl -Dglusterfs=3D$glusterfs -= Dbzip2=3D$bzip2 -Dlibiscsi=3D$libiscsi \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0-Dlibnfs=3D$libnfs -Diconv=3D$iconv -Dcur= ses=3D$curses -Dlibudev=3D$libudev\
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 -Dlibssh=3D$libssh -Drbd=3D$rbd -Dlzo=3D$lzo -= Dsnappy=3D$snappy \
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 -Dlibssh=3D$libssh -Drbd=3D$rbd -Dlzo=3D$lzo -= Dsnappy=3D$snappy -Dlzfse=3D$lzfse \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0-Ddocs=3D$docs -Dsphinx_build=3D$sphinx_b= uild -Dinstall_blobs=3D$blobs \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0-Dvhost_user_blk_server=3D$vhost_user_blk= _server \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0-Dfuse=3D$fuse -Dfuse_lseek=3D$fuse_lseek= \
diff --git a/meson.build b/meson.build
index 9f6ea65626..c02d9c3e1a 100644
--- a/meson.build
+++ b/meson.build
@@ -695,10 +695,21 @@ if not get_option('bzip2').auto() or have_blo= ck
=C2=A0 =C2=A0 =C2=A0endif
=C2=A0 =C2=A0endif
=C2=A0endif
-liblzfse =3D not_found
-if 'CONFIG_LZFSE' in config_host
-=C2=A0 liblzfse =3D declare_dependency(link_args: config_host['LZFSE_L= IBS'].split())
+
+liblzfse =3D cc.find_library('lzfse', has_headers: ['lzfse.h&#= 39;],
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 required: get_option('lzfse'),
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 static: enable_static)
+if liblzfse.found() and not cc.links('''
+=C2=A0 =C2=A0#include <lzfse.h>
+=C2=A0 =C2=A0int main(void) { lzfse_decode_scratch_size(); return 0; }'= ;'', dependencies: liblzfse)
+=C2=A0 liblzfse =3D not_found
+=C2=A0 if get_option('lzfse').enabled()
+=C2=A0 =C2=A0 error('could not link liblzfse')
+=C2=A0 else
+=C2=A0 =C2=A0 warning('could not link liblzfse, disabling')
+=C2=A0 endif
=C2=A0endif
+
=C2=A0oss =3D not_found
=C2=A0if 'CONFIG_AUDIO_OSS' in config_host
=C2=A0 =C2=A0oss =3D declare_dependency(link_args: config_host['OSS_LIB= S'].split())
@@ -2365,7 +2376,7 @@ summary_info +=3D {'Live block migration': co= nfig_host.has_key('CONFIG_LIVE_BLOCK_
=C2=A0summary_info +=3D {'lzo support':=C2=A0 =C2=A0 =C2=A0 =C2=A0l= zo.found()}
=C2=A0summary_info +=3D {'snappy support':=C2=A0 =C2=A0 snappy.foun= d()}
=C2=A0summary_info +=3D {'bzip2 support':=C2=A0 =C2=A0 =C2=A0libbzi= p2.found()}
-summary_info +=3D {'lzfse support':=C2=A0 =C2=A0 =C2=A0config_host= .has_key('CONFIG_LZFSE')}
+summary_info +=3D {'lzfse support':=C2=A0 =C2=A0 =C2=A0liblzfse.fo= und()}
=C2=A0summary_info +=3D {'zstd support':=C2=A0 =C2=A0 =C2=A0 config= _host.has_key('CONFIG_ZSTD')}
=C2=A0summary_info +=3D {'NUMA host support': config_host.has_key(&= #39;CONFIG_NUMA')}
=C2=A0summary_info +=3D {'libxml2':=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0config_host.has_key('CONFIG_LIBXML2')}
diff --git a/meson_options.txt b/meson_options.txt
index e2b7e23887..f74a3d78c4 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -64,6 +64,8 @@ option('curses', type : 'feature', value = : 'auto',
=C2=A0 =C2=A0 =C2=A0 =C2=A0 description: 'curses UI')
=C2=A0option('libudev', type : 'feature', value : 'auto= ',
=C2=A0 =C2=A0 =C2=A0 =C2=A0 description: 'Use libudev to enumerate host= devices')
+option('lzfse', type : 'feature', value : 'auto',<= br> +=C2=A0 =C2=A0 =C2=A0 =C2=A0description: 'lzfse support for DMG images&= #39;)
=C2=A0option('lzo', type : 'feature', value : 'auto'= ;,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 description: 'lzo compression support')=
=C2=A0option('rbd', type : 'feature', value : 'auto'= ;,
--
2.29.2


--000000000000bc55d905b6a8bad1--