@@ -12,7 +12,15 @@ PHP_ARG_WITH([openssl-dir],
1212 [ auto] ,
1313 [ no] )
1414
15+ dnl PHP_ARG_WITH without a value assigns "yes". Treat it like "auto" but required.
16+ AS_IF ( [ test "$PHP_MONGODB_SSL" = "yes"] ,[
17+ crypto_required="yes"
18+ PHP_MONGODB_SSL="auto"
19+ ] )
20+
1521AS_IF ( [ test "$PHP_MONGODB_SSL" = "darwin" -o \( "$PHP_MONGODB_SSL" = "auto" -a "$os_darwin" = "yes" \)] ,[
22+ AC_MSG_NOTICE ( [ checking whether Darwin SSL is available] )
23+
1624 if test "$os_darwin" = "no"; then
1725 AC_MSG_ERROR ( [ Darwin SSL is only supported on macOS] )
1826 fi
@@ -27,6 +35,7 @@ AS_IF([test "$PHP_MONGODB_SSL" = "darwin" -o \( "$PHP_MONGODB_SSL" = "auto" -a "
2735] )
2836
2937AS_IF ( [ test "$PHP_MONGODB_SSL" = "openssl" -o "$PHP_MONGODB_SSL" = "auto"] ,[
38+ AC_MSG_NOTICE ( [ checking whether OpenSSL is available] )
3039 found_openssl="no"
3140
3241 PKG_CHECK_MODULES([ PHP_MONGODB_SSL] ,[ openssl] ,[
@@ -112,6 +121,7 @@ AS_IF([test "$PHP_MONGODB_SSL" = "openssl" -o "$PHP_MONGODB_SSL" = "auto"],[
112121] )
113122
114123AS_IF ( [ test "$PHP_MONGODB_SSL" = "libressl" -o "$PHP_MONGODB_SSL" = "auto"] ,[
124+ AC_MSG_NOTICE ( [ checking whether LibreSSL is available] )
115125 found_libressl="no"
116126
117127 PKG_CHECK_MODULES([ PHP_MONGODB_SSL] ,[ libtls libcrypto] ,[
@@ -144,6 +154,9 @@ AS_IF([test "$PHP_MONGODB_SSL" = "libressl" -o "$PHP_MONGODB_SSL" = "auto"],[
144154] )
145155
146156AS_IF ( [ test "$PHP_MONGODB_SSL" = "auto"] ,[
157+ if test "x$crypto_required" = "xyes"; then
158+ AC_MSG_ERROR ( [ crypto and TLS libraries not found] )
159+ fi
147160 PHP_MONGODB_SSL="no"
148161] )
149162
0 commit comments