Skip to content

Commit 79d0054

Browse files
committed
PHPC-1241: OpenSSL 1.1 not found if pkg-config is not available
1 parent 942a953 commit 79d0054

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

scripts/autotools/libmongoc/CheckSSL.m4

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,24 @@ AS_IF([test "$PHP_MONGODB_SSL" = "openssl" -o "$PHP_MONGODB_SSL" = "auto"],[
8282
[have_crypto_lib="yes"],
8383
[have_crypto_lib="no"],
8484
[$OPENSSL_LIBDIR_LDFLAG])
85+
86+
87+
AC_MSG_NOTICE([checking whether OpenSSL >= 1.1.0 is available])
8588
PHP_CHECK_LIBRARY([ssl],
86-
[SSL_library_init],
89+
[OPENSSL_init_ssl],
8790
[have_ssl_lib="yes"],
8891
[have_ssl_lib="no"],
8992
[$OPENSSL_LIBDIR_LDFLAG -lcrypto])
9093
94+
if test "$have_ssl_lib" = "no"; then
95+
AC_MSG_NOTICE([checking whether OpenSSL < 1.1.0 is available])
96+
PHP_CHECK_LIBRARY([ssl],
97+
[SSL_library_init],
98+
[have_ssl_lib="yes"],
99+
[have_ssl_lib="no"],
100+
[$OPENSSL_LIBDIR_LDFLAG -lcrypto])
101+
fi
102+
91103
if test "$have_ssl_lib" = "yes" -a "$have_crypto_lib" = "yes"; then
92104
PHP_ADD_LIBRARY([ssl],,[MONGODB_SHARED_LIBADD])
93105
PHP_ADD_LIBRARY([crypto],,[MONGODB_SHARED_LIBADD])

0 commit comments

Comments
 (0)