]> granicus.if.org Git - curl/commitdiff
- Use libssh2_version() to present the libssh2 version in case the libssh2
authorDaniel Stenberg <daniel@haxx.se>
Fri, 13 Mar 2009 09:58:15 +0000 (09:58 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 13 Mar 2009 09:58:15 +0000 (09:58 +0000)
  library is found to support it.

CHANGES
RELEASE-NOTES
configure.ac
lib/version.c

diff --git a/CHANGES b/CHANGES
index 4694033645ae0e0f759c015776a54e1a9fb93066..8c5230532bd81573550b1f995c1d749b800d6ef3 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -6,6 +6,10 @@
 
                                   Changelog
 
+Daniel Stenberg (13 Mar 2009)
+- Use libssh2_version() to present the libssh2 version in case the libssh2
+  library is found to support it.
+
 Yang Tse (12 Mar 2009)
 - Added missing Curl_read() return code checking in TELNET transfers.
 
index f8e97a528c4818169ca98837a09df25f02403c2e..6323e36c2f0ed4a84c0f5403c02e9c6ad154abd0 100644 (file)
@@ -11,6 +11,8 @@ This release includes the following changes:
 
  o libcurl now closes all dead connections whenever you attempt to open a new
    connection
+ o libssh2's version number can now be figured out run-time instead of using
+   the build-time fixed number
 
 This release includes the following bugfixes:
 
index af652655aaea6a403115a26224354c418c837193..d9ff3de8c2f30e699cc2956ab1056a15bf052bfd 100644 (file)
@@ -1494,6 +1494,9 @@ if test X"$OPT_LIBSSH2" != Xno; then
        dnl linker doesn't search through, we need to add it to LD_LIBRARY_PATH
        dnl to prevent further configure tests to fail due to this
 
+       dnl libssh2_version is a post 1.0 addition
+       AC_CHECK_FUNCS( libssh2_version )
+
        LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$LIB_LIBSSH2"
        export LD_LIBRARY_PATH
        AC_MSG_NOTICE([Added $LIB_LIBSSH2 to LD_LIBRARY_PATH])
index 2e8f1b410c7c749bc47dbcd05014e0e3ec014b7d..61a3b3287c28b45312f6e8d73b1280ebb8577113 100644 (file)
@@ -5,7 +5,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 1998 - 2007, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2009, Daniel Stenberg, <daniel@haxx.se>, et al.
  *
  * This software is licensed as described in the file COPYING, which
  * you should have received as part of this distribution. The terms
 #include <libssh2.h>
 #endif
 
+#ifdef HAVE_LIBSSH2_VERSION
+/* get it run-time if possible */
+#define CURL_LIBSSH2_VERSION libssh2_version(0)
+#else
+/* use build-time if run-time not possible */
+#define CURL_LIBSSH2_VERSION LIBSSH2_VERSION
+#endif
 
 char *curl_version(void)
 {
@@ -101,7 +108,7 @@ char *curl_version(void)
   ptr += len;
 #endif
 #ifdef USE_LIBSSH2
-  len = snprintf(ptr, left, " libssh2/%s", LIBSSH2_VERSION);
+  len = snprintf(ptr, left, " libssh2/%s", CURL_LIBSSH2_VERSION);
   left -= len;
   ptr += len;
 #endif