Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 13c98bd

Browse files
committed
Fix assorted portability issues in commit 896fcdb.
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.
1 parent 896fcdb commit 13c98bd

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

src/include/libpq/libpq-be.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ extern char *be_tls_get_certificate_hash(Port *port, size_t *len);
289289

290290
/* init hook for SSL, the default sets the password callback if appropriate */
291291
typedef void(* openssl_tls_init_hook_typ)(SSL_CTX *context, bool isServerStart);
292-
extern openssl_tls_init_hook_typ openssl_tls_init_hook;
292+
extern PGDLLIMPORT openssl_tls_init_hook_typ openssl_tls_init_hook;
293293

294294
#endif /* USE_SSL */
295295

src/include/libpq/libpq.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ extern char *ssl_key_file;
8383
extern char *ssl_ca_file;
8484
extern char *ssl_crl_file;
8585
extern char *ssl_dh_params_file;
86-
extern char *ssl_passphrase_command;
87-
extern bool ssl_passphrase_command_supports_reload;
86+
extern PGDLLIMPORT char *ssl_passphrase_command;
87+
extern PGDLLIMPORT bool ssl_passphrase_command_supports_reload;
8888
#ifdef USE_SSL
8989
extern bool ssl_loaded_verify_locations;
9090
#endif

src/test/modules/Makefile

+3-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ SUBDIRS = \
2727

2828
ifeq ($(with_openssl),yes)
2929
SUBDIRS += ssl_passphrase_callback
30+
else
31+
ALWAYS_SUBDIRS += ssl_passphrase_callback
3032
endif
3133

32-
3334
$(recurse)
35+
$(recurse_always)

src/test/modules/ssl_passphrase_callback/Makefile

+2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ include $(top_builddir)/src/Makefile.global
1717
include $(top_srcdir)/contrib/contrib-global.mk
1818
endif
1919

20+
SHLIB_LINK += $(filter -lssl -lcrypto -lssleay32 -leay32, $(LIBS))
21+
2022
check: prove-check
2123

2224
prove-check: ssl_passphrase_func$(DLSUFFIX) | temp-install

0 commit comments

Comments
 (0)