@@ -12,7 +12,15 @@ PHP_ARG_WITH([openssl-dir],
12
12
[ auto] ,
13
13
[ no] )
14
14
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
+
15
21
AS_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
+
16
24
if test "$os_darwin" = "no"; then
17
25
AC_MSG_ERROR ( [ Darwin SSL is only supported on macOS] )
18
26
fi
@@ -27,6 +35,7 @@ AS_IF([test "$PHP_MONGODB_SSL" = "darwin" -o \( "$PHP_MONGODB_SSL" = "auto" -a "
27
35
] )
28
36
29
37
AS_IF ( [ test "$PHP_MONGODB_SSL" = "openssl" -o "$PHP_MONGODB_SSL" = "auto"] ,[
38
+ AC_MSG_NOTICE ( [ checking whether OpenSSL is available] )
30
39
found_openssl="no"
31
40
32
41
PKG_CHECK_MODULES([ PHP_MONGODB_SSL] ,[ openssl] ,[
@@ -112,6 +121,7 @@ AS_IF([test "$PHP_MONGODB_SSL" = "openssl" -o "$PHP_MONGODB_SSL" = "auto"],[
112
121
] )
113
122
114
123
AS_IF ( [ test "$PHP_MONGODB_SSL" = "libressl" -o "$PHP_MONGODB_SSL" = "auto"] ,[
124
+ AC_MSG_NOTICE ( [ checking whether LibreSSL is available] )
115
125
found_libressl="no"
116
126
117
127
PKG_CHECK_MODULES([ PHP_MONGODB_SSL] ,[ libtls libcrypto] ,[
@@ -144,6 +154,9 @@ AS_IF([test "$PHP_MONGODB_SSL" = "libressl" -o "$PHP_MONGODB_SSL" = "auto"],[
144
154
] )
145
155
146
156
AS_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
147
160
PHP_MONGODB_SSL="no"
148
161
] )
149
162
0 commit comments