All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Daniel P . Berrangé" <berrange@redhat.com>
Subject: [PATCH 04/17] configure, meson: convert libdaxctl detection to meson
Date: Mon,  5 Jul 2021 18:00:05 +0200	[thread overview]
Message-ID: <20210705160018.241397-5-pbonzini@redhat.com> (raw)
In-Reply-To: <20210705160018.241397-1-pbonzini@redhat.com>

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 configure         | 28 ++++------------------------
 meson.build       |  8 +++++---
 meson_options.txt |  2 ++
 3 files changed, 11 insertions(+), 27 deletions(-)

diff --git a/configure b/configure
index 895192e0de..5b18f4fac3 100755
--- a/configure
+++ b/configure
@@ -433,7 +433,7 @@ plugins="no"
 fuzzing="no"
 rng_none="no"
 secret_keyring="$default_feature"
-libdaxctl="$default_feature"
+libdaxctl="auto"
 meson=""
 ninja=""
 skip_meson=no
@@ -1534,9 +1534,9 @@ for opt do
   ;;
   --disable-keyring) secret_keyring="no"
   ;;
-  --enable-libdaxctl) libdaxctl=yes
+  --enable-libdaxctl) libdaxctl=disabled
   ;;
-  --disable-libdaxctl) libdaxctl=no
+  --disable-libdaxctl) libdaxctl=enabled
   ;;
   --enable-fuse) fuse="enabled"
   ;;
@@ -4949,22 +4949,6 @@ if test "$libpmem" != "no"; then
 	fi
 fi
 
-##########################################
-# check for libdaxctl
-
-if test "$libdaxctl" != "no"; then
-	if $pkg_config --atleast-version=57 "libdaxctl"; then
-		libdaxctl="yes"
-		libdaxctl_libs=$($pkg_config --libs libdaxctl)
-		libdaxctl_cflags=$($pkg_config --cflags libdaxctl)
-	else
-		if test "$libdaxctl" = "yes" ; then
-			feature_not_found "libdaxctl" "Install libdaxctl"
-		fi
-		libdaxctl="no"
-	fi
-fi
-
 ##########################################
 # check for slirp
 
@@ -5738,11 +5722,6 @@ if test "$libpmem" = "yes" ; then
   echo "LIBPMEM_CFLAGS=$libpmem_cflags" >> $config_host_mak
 fi
 
-if test "$libdaxctl" = "yes" ; then
-  echo "CONFIG_LIBDAXCTL=y" >> $config_host_mak
-  echo "LIBDAXCTL_LIBS=$libdaxctl_libs" >> $config_host_mak
-fi
-
 if test "$bochs" = "yes" ; then
   echo "CONFIG_BOCHS=y" >> $config_host_mak
 fi
@@ -6108,6 +6087,7 @@ if test "$skip_meson" = no; then
         -Dcurl=$curl -Dglusterfs=$glusterfs -Dbzip2=$bzip2 -Dlibiscsi=$libiscsi \
         -Dlibnfs=$libnfs -Diconv=$iconv -Dcurses=$curses -Dlibudev=$libudev\
         -Drbd=$rbd -Dlzo=$lzo -Dsnappy=$snappy -Dlzfse=$lzfse \
+        -Dlibdaxctl=$libdaxctl \
         -Dgnutls=$gnutls -Dnettle=$nettle -Dgcrypt=$gcrypt -Dauth_pam=$auth_pam \
         -Dzstd=$zstd -Dseccomp=$seccomp -Dvirtfs=$virtfs -Dcap_ng=$cap_ng \
         -Dattr=$attr -Ddefault_devices=$default_devices -Dvirglrenderer=$virglrenderer \
diff --git a/meson.build b/meson.build
index 84ffdb4599..e530829105 100644
--- a/meson.build
+++ b/meson.build
@@ -1011,8 +1011,10 @@ if 'CONFIG_LIBPMEM' in config_host
                                link_args: config_host['LIBPMEM_LIBS'].split())
 endif
 libdaxctl = not_found
-if 'CONFIG_LIBDAXCTL' in config_host
-  libdaxctl = declare_dependency(link_args: config_host['LIBDAXCTL_LIBS'].split())
+if not get_option('libdaxctl').auto() or have_system
+  libdaxctl = dependency('libdaxctl', required: get_option('libdaxctl'),
+                         version: '>=57', method: 'pkg-config',
+                         kwargs: static_kwargs)
 endif
 tasn1 = not_found
 if gnutls.found()
@@ -2821,7 +2823,7 @@ summary_info += {'NUMA host support': config_host.has_key('CONFIG_NUMA')}
 summary_info += {'libxml2':           config_host.has_key('CONFIG_LIBXML2')}
 summary_info += {'capstone':          capstone_opt == 'disabled' ? false : capstone_opt}
 summary_info += {'libpmem support':   config_host.has_key('CONFIG_LIBPMEM')}
-summary_info += {'libdaxctl support': config_host.has_key('CONFIG_LIBDAXCTL')}
+summary_info += {'libdaxctl support': libdaxctl.found()}
 summary_info += {'libudev':           libudev.found()}
 summary_info += {'FUSE lseek':        fuse_lseek.found()}
 summary(summary_info, bool_yn: true, section: 'Dependencies')
diff --git a/meson_options.txt b/meson_options.txt
index a70aedb0eb..46180000fd 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -84,6 +84,8 @@ option('nettle', type : 'feature', value : 'auto',
        description: 'nettle cryptography support')
 option('gcrypt', type : 'feature', value : 'auto',
        description: 'libgcrypt cryptography support')
+option('libdaxctl', type : 'feature', value : 'auto',
+       description: 'libdaxctl support')
 option('libudev', type : 'feature', value : 'auto',
        description: 'Use libudev to enumerate host devices')
 option('libusb', type : 'feature', value : 'auto',
-- 
2.31.1




  parent reply	other threads:[~2021-07-05 16:06 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-05 16:00 [PATCH v2 00/17] convert more library and compiler checks to Meson Paolo Bonzini
2021-07-05 16:00 ` [PATCH 01/17] configure: drop vte-2.90 check Paolo Bonzini
2021-07-05 16:03   ` Daniel P. Berrangé
2021-07-05 16:00 ` [PATCH 02/17] configure, meson: convert vte detection to meson Paolo Bonzini
2021-07-05 16:21   ` Daniel P. Berrangé
2021-07-05 16:00 ` [PATCH 03/17] configure, meson: convert virgl " Paolo Bonzini
2021-07-05 16:00 ` Paolo Bonzini [this message]
2021-07-05 16:00 ` [PATCH 05/17] configure, meson: convert libpmem " Paolo Bonzini
2021-07-05 16:00 ` [PATCH 06/17] configure, meson: convert liburing " Paolo Bonzini
2021-07-05 16:00 ` [PATCH 07/17] configure, meson: convert libxml2 " Paolo Bonzini
2021-07-05 16:00 ` [PATCH 08/17] meson: sort existing compiler tests Paolo Bonzini
2021-07-05 16:22   ` Daniel P. Berrangé
2021-07-05 16:00 ` [PATCH 09/17] meson: store dependency('threads') in a variable Paolo Bonzini
2021-07-05 16:00 ` [PATCH 10/17] configure, meson: move CONFIG_IVSHMEM to meson Paolo Bonzini
2021-07-05 16:00 ` [PATCH 11/17] configure: convert HAVE_BROKEN_SIZE_MAX " Paolo Bonzini
2021-07-05 16:00 ` [PATCH 12/17] configure: convert compiler tests to meson, part 1 Paolo Bonzini
2021-07-05 16:23   ` Daniel P. Berrangé
2021-07-05 16:00 ` [PATCH 13/17] configure: convert compiler tests to meson, part 2 Paolo Bonzini
2021-07-05 16:00 ` [PATCH 14/17] configure: convert compiler tests to meson, part 3 Paolo Bonzini
2021-07-05 16:00 ` [PATCH 15/17] configure: convert compiler tests to meson, part 4 Paolo Bonzini
2021-07-05 16:00 ` [PATCH 16/17] configure: convert compiler tests to meson, part 5 Paolo Bonzini
2021-07-05 16:00 ` [PATCH 17/17] configure: convert compiler tests to meson, part 6 Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210705160018.241397-5-pbonzini@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=berrange@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.