1
1
PHP_ARG_WITH([ mongodb-ssl] ,
2
2
[ whether to enable crypto and TLS] ,
3
- [ AS_HELP_STRING ( [ --with-mongodb-ssl=@<:@ auto/openssl/libressl/ darwin/no@:>@ ] ,
3
+ [ AS_HELP_STRING ( [ --with-mongodb-ssl=@<:@ auto/openssl/darwin/no@:>@ ] ,
4
4
[ MongoDB: Enable TLS connections and SCRAM-SHA-1 authentication [ default=auto] ] ) ] ,
5
5
[ auto] ,
6
6
[ no] )
7
7
8
+ dnl PHP_ARG_WITH without a value assigns "yes". Treat it like "auto" but
9
+ dnl require a crypto library.
10
+ if test "$PHP_MONGODB_SSL" = "yes"; then
11
+ PHP_MONGODB_SSL="auto"
12
+ fi
13
+
14
+ dnl TODO 3.0: Remove libressl from valid options
15
+ PHP_MONGODB_VALIDATE_ARG([ PHP_MONGODB_SSL] , [ auto openssl libressl darwin no] )
16
+
17
+ if test "$PHP_MONGODB_SSL" = "libressl"; then
18
+ dnl libressl is a valid option, but it is not supported by libmongoc
19
+ dnl Warn users that it is not supported and treat it like "auto"
20
+ PHP_MONGODB_SSL="auto"
21
+ AC_MSG_WARN ( [ Building with libressl is not supported by libmongoc. Falling back to "auto".] )
22
+ fi
23
+
8
24
if test "$PHP_MONGODB_SSL" = "auto" -o "$PHP_MONGODB_SSL" = "no"; then
9
25
crypto_required="no"
10
26
else
11
27
crypto_required="yes"
12
-
13
- dnl PHP_ARG_WITH without a value assigns "yes". Treat it like "auto" but
14
- dnl require a crypto library.
15
- if test "$PHP_MONGODB_SSL" = "yes"; then
16
- PHP_MONGODB_SSL="auto"
17
- fi
18
28
fi
19
29
20
- PHP_MONGODB_VALIDATE_ARG([ PHP_MONGODB_SSL] , [ auto openssl libressl darwin no] )
21
-
22
30
AS_IF ( [ test "$PHP_MONGODB_SSL" = "openssl" -o "$PHP_MONGODB_SSL" = "auto"] ,[
23
31
found_openssl="no"
24
32
@@ -130,38 +138,6 @@ AS_IF([test "$PHP_MONGODB_SSL" = "darwin" -o \( "$PHP_MONGODB_SSL" = "auto" -a "
130
138
PHP_MONGODB_SSL="darwin"
131
139
] )
132
140
133
- AS_IF ( [ test "$PHP_MONGODB_SSL" = "libressl" -o "$PHP_MONGODB_SSL" = "auto"] ,[
134
- found_libressl="no"
135
-
136
- PKG_CHECK_MODULES([ PHP_MONGODB_SSL] ,[ libtls libcrypto] ,[
137
- PHP_MONGODB_BUNDLED_CFLAGS="$PHP_MONGODB_BUNDLED_CFLAGS $PHP_MONGODB_SSL_CFLAGS"
138
- PHP_EVAL_LIBLINE([ $PHP_MONGODB_SSL_LIBS] ,[ MONGODB_SHARED_LIBADD] )
139
- PHP_MONGODB_SSL="libressl"
140
- found_libressl="yes"
141
- ] ,[
142
- PHP_CHECK_LIBRARY([ crypto] ,
143
- [ EVP_DigestInit_ex] ,
144
- [ have_crypto_lib="yes"] ,
145
- [ have_crypto_lib="no"] )
146
- PHP_CHECK_LIBRARY([ tls] ,
147
- [ tls_init] ,
148
- [ have_ssl_lib="yes"] ,
149
- [ have_ssl_lib="no"] ,
150
- [ -lcrypto] )
151
-
152
- if test "$have_ssl_lib" = "yes" -a "$have_crypto_lib" = "yes"; then
153
- PHP_ADD_LIBRARY([ tls] ,,[ MONGODB_SHARED_LIBADD] )
154
- PHP_ADD_LIBRARY([ crypto] ,,[ MONGODB_SHARED_LIBADD] )
155
- PHP_MONGODB_SSL="libressl"
156
- found_libressl="yes"
157
- fi
158
- ] )
159
-
160
- if test "$PHP_MONGODB_SSL" = "libressl" -a "$found_libressl" != "yes"; then
161
- AC_MSG_ERROR ( [ LibreSSL libraries and development headers could not be found] )
162
- fi
163
- ] )
164
-
165
141
AS_IF ( [ test "$PHP_MONGODB_SSL" = "auto"] ,[
166
142
if test "$crypto_required" = "yes"; then
167
143
AC_MSG_ERROR ( [ crypto and TLS libraries not found] )
@@ -177,28 +153,18 @@ AC_SUBST(MONGOC_ENABLE_SSL_SECURE_CHANNEL, 0)
177
153
AC_SUBST ( MONGOC_ENABLE_CRYPTO_CNG , 0 )
178
154
AC_SUBST ( MONGOC_HAVE_BCRYPT_PBKDF2 , 0 )
179
155
180
- if test "$PHP_MONGODB_SSL" = "openssl" -o "$PHP_MONGODB_SSL" = "libressl" -o "$PHP_MONGODB_SSL" = " darwin"; then
156
+ if test "$PHP_MONGODB_SSL" = "openssl" -o "$PHP_MONGODB_SSL" = "darwin"; then
181
157
AC_SUBST ( MONGOC_ENABLE_SSL , 1 )
182
158
AC_SUBST ( MONGOC_ENABLE_CRYPTO , 1 )
183
159
if test "$PHP_MONGODB_SSL" = "darwin"; then
184
160
AC_SUBST ( MONGOC_ENABLE_SSL_OPENSSL , 0 )
185
- AC_SUBST ( MONGOC_ENABLE_SSL_LIBRESSL , 0 )
186
161
AC_SUBST ( MONGOC_ENABLE_SSL_SECURE_TRANSPORT , 1 )
187
162
AC_SUBST ( MONGOC_ENABLE_CRYPTO_LIBCRYPTO , 0 )
188
163
AC_SUBST ( MONGOC_ENABLE_CRYPTO_COMMON_CRYPTO , 1 )
189
164
190
165
PHP_MONGODB_BUNDLED_CFLAGS="$PHP_MONGODB_BUNDLED_CFLAGS -DKMS_MESSAGE_ENABLE_CRYPTO=1 -DKMS_MESSAGE_ENABLE_CRYPTO_COMMON_CRYPTO=1"
191
166
elif test "$PHP_MONGODB_SSL" = "openssl"; then
192
167
AC_SUBST ( MONGOC_ENABLE_SSL_OPENSSL , 1 )
193
- AC_SUBST ( MONGOC_ENABLE_SSL_LIBRESSL , 0 )
194
- AC_SUBST ( MONGOC_ENABLE_SSL_SECURE_TRANSPORT , 0 )
195
- AC_SUBST ( MONGOC_ENABLE_CRYPTO_LIBCRYPTO , 1 )
196
- AC_SUBST ( MONGOC_ENABLE_CRYPTO_COMMON_CRYPTO , 0 )
197
-
198
- PHP_MONGODB_BUNDLED_CFLAGS="$PHP_MONGODB_BUNDLED_CFLAGS -DKMS_MESSAGE_ENABLE_CRYPTO=1 -DKMS_MESSAGE_ENABLE_CRYPTO_LIBCRYPTO=1"
199
- elif test "$PHP_MONGODB_SSL" = "libressl"; then
200
- AC_SUBST ( MONGOC_ENABLE_SSL_OPENSSL , 0 )
201
- AC_SUBST ( MONGOC_ENABLE_SSL_LIBRESSL , 1 )
202
168
AC_SUBST ( MONGOC_ENABLE_SSL_SECURE_TRANSPORT , 0 )
203
169
AC_SUBST ( MONGOC_ENABLE_CRYPTO_LIBCRYPTO , 1 )
204
170
AC_SUBST ( MONGOC_ENABLE_CRYPTO_COMMON_CRYPTO , 0 )
@@ -207,7 +173,6 @@ if test "$PHP_MONGODB_SSL" = "openssl" -o "$PHP_MONGODB_SSL" = "libressl" -o "$P
207
173
fi
208
174
else
209
175
AC_SUBST ( MONGOC_ENABLE_SSL , 0 )
210
- AC_SUBST ( MONGOC_ENABLE_SSL_LIBRESSL , 0 )
211
176
AC_SUBST ( MONGOC_ENABLE_SSL_OPENSSL , 0 )
212
177
AC_SUBST ( MONGOC_ENABLE_SSL_SECURE_TRANSPORT , 0 )
213
178
AC_SUBST ( MONGOC_ENABLE_CRYPTO , 0 )
0 commit comments