* [Qemu-devel] [PATCH] block/ssh: Require libssh2 >= 1.2.8.
@ 2013-04-19 8:16 Richard W.M. Jones
2013-04-22 13:13 ` Stefan Hajnoczi
0 siblings, 1 reply; 2+ messages in thread
From: Richard W.M. Jones @ 2013-04-19 8:16 UTC (permalink / raw)
To: qemu-devel; +Cc: sw
From: "Richard W.M. Jones" <rjones@redhat.com>
libssh2 >= 1.2.8 is required to enable this block device (because
that version introduced the libssh2_session_handshake call).
Change the test to use pkg-config exclusively. If the user requests
--enable-libssh2 and the minimum version is not available, then the
following error is displayed:
$ ./configure --enable-libssh2
ERROR: libssh2 >= 1.2.8 required for --enable-libssh2
If --enable-libssh2 is not specified, then the feature is silently
disabled if sufficiently new libssh2 is not available.
---
configure | 24 ++++--------------------
1 file changed, 4 insertions(+), 20 deletions(-)
diff --git a/configure b/configure
index ed49f91..4ec6eaa 100755
--- a/configure
+++ b/configure
@@ -2353,35 +2353,19 @@ fi
##########################################
# libssh2 probe
+min_libssh2_version=1.2.8
if test "$libssh2" != "no" ; then
- cat > $TMPC <<EOF
-#include <stdio.h>
-#include <libssh2.h>
-#include <libssh2_sftp.h>
-int main(void) {
- LIBSSH2_SESSION *session;
- session = libssh2_session_init ();
- (void) libssh2_sftp_init (session);
- return 0;
-}
-EOF
-
- if $pkg_config libssh2 --modversion >/dev/null 2>&1; then
+ if $pkg_config --atleast-version=$min_libssh2_version libssh2 >/dev/null 2>&1
+ then
libssh2_cflags=`$pkg_config libssh2 --cflags`
libssh2_libs=`$pkg_config libssh2 --libs`
- else
- libssh2_cflags=
- libssh2_libs="-lssh2"
- fi
-
- if compile_prog "$libssh2_cflags" "$libssh2_libs" ; then
libssh2=yes
libs_tools="$libssh2_libs $libs_tools"
libs_softmmu="$libssh2_libs $libs_softmmu"
QEMU_CFLAGS="$QEMU_CFLAGS $libssh2_cflags"
else
if test "$libssh2" = "yes" ; then
- feature_not_found "libssh2"
+ error_exit "libssh2 >= $min_libssh2_version required for --enable-libssh2"
fi
libssh2=no
fi
--
1.8.1.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [PATCH] block/ssh: Require libssh2 >= 1.2.8.
2013-04-19 8:16 [Qemu-devel] [PATCH] block/ssh: Require libssh2 >= 1.2.8 Richard W.M. Jones
@ 2013-04-22 13:13 ` Stefan Hajnoczi
0 siblings, 0 replies; 2+ messages in thread
From: Stefan Hajnoczi @ 2013-04-22 13:13 UTC (permalink / raw)
To: Richard W.M. Jones; +Cc: sw, qemu-devel
On Fri, Apr 19, 2013 at 09:16:39AM +0100, Richard W.M. Jones wrote:
> From: "Richard W.M. Jones" <rjones@redhat.com>
>
> libssh2 >= 1.2.8 is required to enable this block device (because
> that version introduced the libssh2_session_handshake call).
>
> Change the test to use pkg-config exclusively. If the user requests
> --enable-libssh2 and the minimum version is not available, then the
> following error is displayed:
>
> $ ./configure --enable-libssh2
>
> ERROR: libssh2 >= 1.2.8 required for --enable-libssh2
>
> If --enable-libssh2 is not specified, then the feature is silently
> disabled if sufficiently new libssh2 is not available.
> ---
> configure | 24 ++++--------------------
> 1 file changed, 4 insertions(+), 20 deletions(-)
Two comments:
1. This patch also drops non-pkgconfig support. I guess this is okay.
2. RHEL 5 and Debian stable do not have libssh2 1.2.8. Since this is a
new feature for the QEMU 1.5 release, no one is expecting it to be
available for old distros. Therefore, not a problem.
Thanks, applied to my block tree:
https://github.com/stefanha/qemu/commits/block
Stefan
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-04-22 13:13 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-19 8:16 [Qemu-devel] [PATCH] block/ssh: Require libssh2 >= 1.2.8 Richard W.M. Jones
2013-04-22 13:13 ` Stefan Hajnoczi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).