[libvirt PATCH 059/351] meson: add libssh2 build dependency

Pavel Hrdina phrdina at redhat.com
Thu Jul 16 09:54:55 UTC 2020


Signed-off-by: Pavel Hrdina <phrdina at redhat.com>
---
 configure.ac      |  4 ----
 m4/virt-ssh2.m4   | 30 ------------------------------
 meson.build       | 11 +++++++++++
 meson_options.txt |  1 +
 4 files changed, 12 insertions(+), 34 deletions(-)
 delete mode 100644 m4/virt-ssh2.m4

diff --git a/configure.ac b/configure.ac
index 1709f56a8b5..c81db75ae33 100644
--- a/configure.ac
+++ b/configure.ac
@@ -96,7 +96,6 @@ fi
 # RPC, we don't need several libraries.
 if test "$with_remote" = "no" ; then
   with_libvirtd=no
-  with_ssh2=no
   with_sasl=no
 fi
 # Stateful drivers are useful only when building the daemon.
@@ -121,7 +120,6 @@ LIBVIRT_ARG_POLKIT
 LIBVIRT_ARG_SANLOCK
 LIBVIRT_ARG_SASL
 LIBVIRT_ARG_SELINUX
-LIBVIRT_ARG_SSH2
 LIBVIRT_ARG_UDEV
 LIBVIRT_ARG_VIRTUALPORT
 LIBVIRT_ARG_WIRESHARK
@@ -140,7 +138,6 @@ LIBVIRT_CHECK_PTHREAD
 LIBVIRT_CHECK_SANLOCK
 LIBVIRT_CHECK_SASL
 LIBVIRT_CHECK_SELINUX
-LIBVIRT_CHECK_SSH2
 LIBVIRT_CHECK_UDEV
 LIBVIRT_CHECK_VIRTUALPORT
 LIBVIRT_CHECK_WIRESHARK
@@ -439,7 +436,6 @@ LIBVIRT_RESULT_RBD
 LIBVIRT_RESULT_SANLOCK
 LIBVIRT_RESULT_SASL
 LIBVIRT_RESULT_SELINUX
-LIBVIRT_RESULT_SSH2
 LIBVIRT_RESULT_UDEV
 LIBVIRT_RESULT_VIRTUALPORT
 LIBVIRT_RESULT_XDR
diff --git a/m4/virt-ssh2.m4 b/m4/virt-ssh2.m4
deleted file mode 100644
index f712f81fe2c..00000000000
--- a/m4/virt-ssh2.m4
+++ /dev/null
@@ -1,30 +0,0 @@
-dnl The libssh2.so library
-dnl
-dnl Copyright (C) 2012-2013 Red Hat, Inc.
-dnl
-dnl This library is free software; you can redistribute it and/or
-dnl modify it under the terms of the GNU Lesser General Public
-dnl License as published by the Free Software Foundation; either
-dnl version 2.1 of the License, or (at your option) any later version.
-dnl
-dnl This library is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-dnl Lesser General Public License for more details.
-dnl
-dnl You should have received a copy of the GNU Lesser General Public
-dnl License along with this library.  If not, see
-dnl <http://www.gnu.org/licenses/>.
-dnl
-
-AC_DEFUN([LIBVIRT_ARG_SSH2],[
-  LIBVIRT_ARG_WITH_FEATURE([SSH2], [libssh2], [check], [1.3])
-])
-
-AC_DEFUN([LIBVIRT_CHECK_SSH2],[
-  LIBVIRT_CHECK_PKG([SSH2], [libssh2], [1.3])
-])
-
-AC_DEFUN([LIBVIRT_RESULT_SSH2],[
-  LIBVIRT_RESULT_LIB([SSH2])
-])
diff --git a/meson.build b/meson.build
index 2ab3aa87dea..6f37862611a 100644
--- a/meson.build
+++ b/meson.build
@@ -1132,6 +1132,16 @@ else
   libssh_dep = dependency('', required: false)
 endif
 
+libssh2_version = '1.3'
+if get_option('driver_remote').enabled()
+  libssh2_dep = dependency('libssh2', version: '>=' + libssh2_version, required: get_option('libssh2'))
+  if libssh2_dep.found()
+    conf.set('WITH_SSH2', 1)
+  endif
+else
+  libssh2_dep = dependency('', required: false)
+endif
+
 use_macvtap = false
 if not get_option('macvtap').disabled()
   if (cc.has_header_symbol('linux/if_link.h', 'MACVLAN_MODE_BRIDGE') and
@@ -1299,6 +1309,7 @@ libs_summary = {
   'libnl': libnl_dep.found(),
   'libpcap': libpcap_dep.found(),
   'libssh': libssh_dep.found(),
+  'libssh2': libssh2_dep.found(),
   'macvtap': conf.has('WITH_MACVTAP'),
   'readline': readline_dep.found(),
 }
diff --git a/meson_options.txt b/meson_options.txt
index 9588db5b835..a6e53ca36dc 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -26,5 +26,6 @@ option('hal', type: 'feature', value: 'auto', description: 'hal support')
 option('libiscsi', type: 'feature', value: 'auto', description: 'libiscsi support')
 option('libpcap', type: 'feature', value: 'auto', description: 'libpcap support')
 option('libssh', type: 'feature', value: 'auto', description: 'libssh support')
+option('libssh2', type: 'feature', value: 'auto', description: 'libssh2 support')
 option('macvtap', type: 'feature', value: 'auto', description: 'enable macvtap device')
 option('readline', type: 'feature', value: 'auto', description: 'readline support')
-- 
2.26.2




More information about the libvir-list mailing list