]> granicus.if.org Git - postgresql/commitdiff
Detect presence of SSL_get_current_compression
authorMagnus Hagander <magnus@hagander.net>
Tue, 15 Jul 2014 16:04:43 +0000 (18:04 +0200)
committerMagnus Hagander <magnus@hagander.net>
Tue, 15 Jul 2014 16:07:03 +0000 (18:07 +0200)
Apparently we still build against OpenSSL so old that it doesn't
have this function, so add an autoconf check for it to make the
buildfarm happy. If the function doesn't exist, always return
that compression is disabled, since presumably the actual
compression functionality is always missing.

For now, hardcode the function as present on MSVC, since we should
hopefully be well beyond those old versions on that platform.

configure
configure.in
src/include/pg_config.h.in
src/include/pg_config.h.win32
src/include/port.h

index 75979166efe84d88312bda4366cfeb43c1b9bfa1..ac0d98e2a4de66870b64962b7ebe521996c60b65 100755 (executable)
--- a/configure
+++ b/configure
@@ -8509,6 +8509,17 @@ else
   as_fn_error $? "library 'ssl' is required for OpenSSL" "$LINENO" 5
 fi
 
+     for ac_func in SSL_get_current_compression
+do :
+  ac_fn_c_check_func "$LINENO" "SSL_get_current_compression" "ac_cv_func_SSL_get_current_compression"
+if test "x$ac_cv_func_SSL_get_current_compression" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_SSL_GET_CURRENT_COMPRESSION 1
+_ACEOF
+
+fi
+done
+
   else
      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing CRYPTO_new_ex_data" >&5
 $as_echo_n "checking for library containing CRYPTO_new_ex_data... " >&6; }
index 9d1f1187645ca2b872a2cd394e5bd1cc0b5e5873..32eda48f631ad4964eb0feb444412b956a98aac9 100644 (file)
@@ -950,6 +950,7 @@ if test "$with_openssl" = yes ; then
   if test "$PORTNAME" != "win32"; then
      AC_CHECK_LIB(crypto, CRYPTO_new_ex_data, [], [AC_MSG_ERROR([library 'crypto' is required for OpenSSL])])
      AC_CHECK_LIB(ssl,    SSL_library_init, [], [AC_MSG_ERROR([library 'ssl' is required for OpenSSL])])
+     AC_CHECK_FUNCS([SSL_get_current_compression])
   else
      AC_SEARCH_LIBS(CRYPTO_new_ex_data, eay32 crypto, [], [AC_MSG_ERROR([library 'eay32' or 'crypto' is required for OpenSSL])])
      AC_SEARCH_LIBS(SSL_library_init, ssleay32 ssl, [], [AC_MSG_ERROR([library 'ssleay32' or 'ssl' is required for OpenSSL])])
index 2a40d6140bd8f926f5bd277ab6158c5a1022dff4..4383ad5172c92c8065db34ee12cde030e932c2ad 100644 (file)
 /* Define to 1 if you have the `srandom' function. */
 #undef HAVE_SRANDOM
 
+/* Define to 1 if you have the `SSL_get_current_compression' function. */
+#undef HAVE_SSL_GET_CURRENT_COMPRESSION
+
 /* Define to 1 if you have the <stdint.h> header file. */
 #undef HAVE_STDINT_H
 
index 1c9cd82b8382f18fcfcf5498e9b29d15da5ca9dc..f7c2419252bcef89909aeeb7e4880b6ece5d0849 100644 (file)
 /* Define to 1 if you have the `srandom' function. */
 /* #undef HAVE_SRANDOM */
 
+/* Define to 1 if you have the `SSL_get_current_compression' function. */
+#define HAVE_SSL_GET_CURRENT_COMPRESSION 1
+
 /* Define to 1 if you have the <stdint.h> header file. */
 /* #undef HAVE_STDINT_H */
 
index 3d974818344b8a6d4118f1fa36d988f487a3f8ca..9f8465e78ad8a2096460ccb93b2e94acddc1c9f5 100644 (file)
@@ -420,6 +420,10 @@ extern void unsetenv(const char *name);
 extern void srandom(unsigned int seed);
 #endif
 
+#ifndef HAVE_SSL_GET_CURRENT_COMPRESSION
+#define SSL_get_current_compression(x) 0
+#endif
+
 /* thread.h */
 extern char *pqStrerror(int errnum, char *strerrbuf, size_t buflen);