summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMagnus Hagander <magnus@hagander.net>2014-07-15 18:04:43 +0200
committerMagnus Hagander <magnus@hagander.net>2014-07-15 18:07:19 +0200
commit5e4c9b37312e7d9dcb88e1e0a1fc279c780dd89e (patch)
treeedf627c2b756536c20db6d38b052403bca6569e3
parent77b41010dbb159b77b35aef02b517ce1a130f3b6 (diff)
Detect presence of SSL_get_current_compression
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.
-rwxr-xr-xconfigure11
-rw-r--r--configure.in1
-rw-r--r--src/include/pg_config.h.in3
-rw-r--r--src/include/pg_config.h.win323
-rw-r--r--src/include/port.h4
5 files changed, 22 insertions, 0 deletions
diff --git a/configure b/configure
index f8232db05b1..dacebe0bdf6 100755
--- a/configure
+++ b/configure
@@ -8511,6 +8511,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; }
diff --git a/configure.in b/configure.in
index c95e2cd79f6..21221b336bc 100644
--- a/configure.in
+++ b/configure.in
@@ -951,6 +951,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])])
diff --git a/src/include/pg_config.h.in b/src/include/pg_config.h.in
index 4fb7288710d..d30a2a701b0 100644
--- a/src/include/pg_config.h.in
+++ b/src/include/pg_config.h.in
@@ -433,6 +433,9 @@
/* 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
diff --git a/src/include/pg_config.h.win32 b/src/include/pg_config.h.win32
index 58777caa5f2..e9fa43e49b4 100644
--- a/src/include/pg_config.h.win32
+++ b/src/include/pg_config.h.win32
@@ -340,6 +340,9 @@
/* 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 */
diff --git a/src/include/port.h b/src/include/port.h
index 3d974818344..9f8465e78ad 100644
--- a/src/include/port.h
+++ b/src/include/port.h
@@ -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);