From patchwork Fri Apr 26 11:44:22 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 239816 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 6D4BF2C010D for ; Fri, 26 Apr 2013 21:45:27 +1000 (EST) Received: from localhost ([::1]:41327 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UVh5h-0007Fq-LP for incoming@patchwork.ozlabs.org; Fri, 26 Apr 2013 07:45:25 -0400 Received: from eggs.gnu.org ([208.118.235.92]:49333) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UVh5C-00076q-2q for qemu-devel@nongnu.org; Fri, 26 Apr 2013 07:44:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UVh59-00014A-FI for qemu-devel@nongnu.org; Fri, 26 Apr 2013 07:44:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43895) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UVh59-000143-0j for qemu-devel@nongnu.org; Fri, 26 Apr 2013 07:44:51 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r3QBiooZ030060 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 26 Apr 2013 07:44:50 -0400 Received: from localhost (ovpn-112-51.ams2.redhat.com [10.36.112.51]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r3QBinuk021418; Fri, 26 Apr 2013 07:44:49 -0400 From: Stefan Hajnoczi To: Date: Fri, 26 Apr 2013 13:44:22 +0200 Message-Id: <1366976682-10251-3-git-send-email-stefanha@redhat.com> In-Reply-To: <1366976682-10251-1-git-send-email-stefanha@redhat.com> References: <1366976682-10251-1-git-send-email-stefanha@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Anthony Liguori , "Richard W.M. Jones" , Stefan Hajnoczi Subject: [Qemu-devel] [PATCH 01/11] block/ssh: Require libssh2 >= 1.2.8. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: "Richard W.M. Jones" 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 --- configure | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/configure b/configure index ee2e7e8..8188a7c 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 < -#include -#include -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