Fix assorted portability issues in commit 896fcdb23.
authorTom Lane <tgl@sss.pgh.pa.us>
Wed, 25 Mar 2020 23:37:30 +0000 (19:37 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 25 Mar 2020 23:37:30 +0000 (19:37 -0400)
Some platforms require libssl to be linked explicitly in the new
SSL test module.  Borrow contrib/sslinfo's code for that.

Since src/test/modules/Makefile now has a variable SUBDIRS list,
it needs to follow the ALWAYS_SUBDIRS protocol for that (cf.
comments in Makefile.global.in).

Blindly try to fix MSVC build failures by adding PGDLLIMPORT.

src/include/libpq/libpq-be.h
src/include/libpq/libpq.h
src/test/modules/Makefile
src/test/modules/ssl_passphrase_callback/Makefile

index ee57fdc301b1d0ebb70927b5066f28f3ed85ac42..67697836bafbd66994028d53bf005e0752fa9229 100644 (file)
@@ -289,7 +289,7 @@ extern char *be_tls_get_certificate_hash(Port *port, size_t *len);
 
 /* init hook for SSL, the default sets the password callback if appropriate */
 typedef void(* openssl_tls_init_hook_typ)(SSL_CTX *context, bool isServerStart);
-extern openssl_tls_init_hook_typ openssl_tls_init_hook;
+extern PGDLLIMPORT openssl_tls_init_hook_typ openssl_tls_init_hook;
 
 #endif                                                 /* USE_SSL */
 
index 4d3a0bef63ee037d4d4fda487245122e52c3707e..b1152475ace58c355524044685d135d99070b275 100644 (file)
@@ -83,8 +83,8 @@ extern char *ssl_key_file;
 extern char *ssl_ca_file;
 extern char *ssl_crl_file;
 extern char *ssl_dh_params_file;
-extern char *ssl_passphrase_command;
-extern bool ssl_passphrase_command_supports_reload;
+extern PGDLLIMPORT char *ssl_passphrase_command;
+extern PGDLLIMPORT bool ssl_passphrase_command_supports_reload;
 #ifdef USE_SSL
 extern bool ssl_loaded_verify_locations;
 #endif
index 5f975ebcbac43018e630df2f55cae1e8792d11e0..29de73c06062980642ef5a9907d031d0db8d3a51 100644 (file)
@@ -27,7 +27,9 @@ SUBDIRS = \
 
 ifeq ($(with_openssl),yes)
 SUBDIRS += ssl_passphrase_callback
+else
+ALWAYS_SUBDIRS += ssl_passphrase_callback
 endif
 
-
 $(recurse)
+$(recurse_always)
index e2d19f131a6ab25177d3509e9921f70d9cbc2468..1c4f79807e29d0c002dd2a6ded49bbf8a15efb29 100644 (file)
@@ -17,6 +17,8 @@ include $(top_builddir)/src/Makefile.global
 include $(top_srcdir)/contrib/contrib-global.mk
 endif
 
+SHLIB_LINK += $(filter -lssl -lcrypto -lssleay32 -leay32, $(LIBS))
+
 check: prove-check
 
 prove-check: ssl_passphrase_func$(DLSUFFIX) | temp-install