summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2013-04-19 09:16:39 +0100
committerStefan Hajnoczi <stefanha@redhat.com>2013-04-26 13:26:27 +0200
commit4fc16838b8392a29644d4d2c01495e6ff447a6f0 (patch)
tree2cf6f06213c35808c2653b7c0619113c520d11dc /configure
parente3351000cd682200835763caca87adf708ed1c65 (diff)
downloadqemu-4fc16838b8392a29644d4d2c01495e6ff447a6f0.tar.gz
block/ssh: Require libssh2 >= 1.2.8.
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. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure24
1 files changed, 4 insertions, 20 deletions
diff --git a/configure b/configure
index ee2e7e8ad9..8188a7c05f 100755
--- a/configure
+++ b/configure
@@ -2364,35 +2364,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