]> xenbits.xensource.com Git - libvirt.git/commitdiff
m4: checking if ssh_get_server_publickey() exists.
authorJulio Faracco <jcfaracco@gmail.com>
Thu, 10 May 2018 20:38:56 +0000 (17:38 -0300)
committerAndrea Bolognani <abologna@redhat.com>
Fri, 11 May 2018 08:38:08 +0000 (10:38 +0200)
This commit adds some checks inside libssh m4 checking to verify if
ssh_get_server_publickey is available. This new function scope replaces
the old ssh_get_publickey() from libssh 0.7.5 and below. Assuming that
some distros are not showing the right version of libssh. This is a
simple way to check which function is available.

Signed-off-by: Julio Faracco <jcfaracco@gmail.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
m4/virt-libssh.m4

index 7e39277e1010c63d2f2edf84424320c35ecd17ae..01c3b75c72bcc138c313a71fe9a61137bcff042e 100644 (file)
@@ -23,6 +23,19 @@ AC_DEFUN([LIBVIRT_ARG_LIBSSH],[
 
 AC_DEFUN([LIBVIRT_CHECK_LIBSSH],[
   LIBVIRT_CHECK_PKG([LIBSSH], [libssh], [0.7])
+
+  if test "$with_libssh" = "yes" ; then
+    old_CFLAGS="$CFLAGS"
+    old_LIBS="$LIBS"
+    CFLAGS="$CFLAGS $LIBSSH_CFLAGS"
+    LIBS="$LIBS $LIBSSH_LIBS"
+    AC_CHECK_FUNC([ssh_get_server_publickey],
+      [],
+      [AC_DEFINE_UNQUOTED([ssh_get_server_publickey], [ssh_get_publickey],
+            [ssh_get_publickey is deprecated and replaced by ssh_get_server_publickey.])])
+    CFLAGS="$old_CFLAGS"
+    LIBS="$old_LIBS"
+  fi
 ])
 
 AC_DEFUN([LIBVIRT_RESULT_LIBSSH],[