On Thu, Jul 16, 2020 at 11:54:54 +0200, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
configure.ac | 4 ----
m4/virt-libssh.m4 | 51 -----------------------------------------------
meson.build | 22 ++++++++++++++++++++
meson_options.txt | 1 +
4 files changed, 23 insertions(+), 55 deletions(-)
delete mode 100644 m4/virt-libssh.m4
diff --git a/meson.build b/meson.build
index 2346ae31d5a..2ab3aa87dea 100644
--- a/meson.build
+++ b/meson.build
@@ -1111,6 +1111,27 @@ if libpcap_dep.found()
conf.set('HAVE_LIBPCAP', 1)
endif
+libssh_version = '0.7'
+if get_option('driver_remote').enabled()
+ libssh_dep = dependency('libssh', version: '>=' + libssh_version,
required: get_option('libssh'))
+ if libssh_dep.found()
+ conf.set('WITH_LIBSSH', 1)
+
+ functions = [
+ [ 'ssh_get_server_publickey', 'ssh_get_publickey' ],
+ [ 'ssh_session_is_known_server', 'ssh_is_server_known' ],
+ [ 'ssh_session_update_known_hosts', 'ssh_write_knownhost' ],
IMO using a dictionary here would be great for clarity to see which are
the old and which are the new symbols. Or at least a comment similarly
to what we had before.
+ ]
+ foreach name : functions
+ if not cc.has_function(name[0], dependencies: libssh_dep)
+ conf.set(name[0], name[1])
+ endif
+ endforeach