Skip to content

Commit f0eb438

Browse files
committed
Merged pull request #867
2 parents 679ef27 + ab2f578 commit f0eb438

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

scripts/autotools/libmongoc/CheckSSL.m4

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
1521
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+
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

2937
AS_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

114123
AS_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

146156
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
147160
PHP_MONGODB_SSL="no"
148161
])
149162

scripts/autotools/libmongoc/CheckSasl.m4

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ PHP_ARG_WITH([mongodb-sasl],
55
[auto],
66
[no])
77

8-
AS_IF([test "$PHP_MONGODB_SASL" = "cyrus" -o "$PHP_MONGODB_SASL" = "auto"],[
8+
dnl PHP_ARG_WITH without a value assigns "yes". Treat it like "auto" but required.
9+
AS_IF([test "$PHP_MONGODB_SASL" = "cyrus" -o "$PHP_MONGODB_SASL" = "auto" -o "$PHP_MONGODB_SASL" = "yes"],[
910
found_cyrus="no"
1011
1112
PKG_CHECK_MODULES([PHP_MONGODB_SASL],[libsasl2],[
@@ -38,7 +39,7 @@ AS_IF([test "$PHP_MONGODB_SASL" = "cyrus" -o "$PHP_MONGODB_SASL" = "auto"],[
3839
$MONGODB_SHARED_LIBADD)
3940
fi
4041
41-
if test "$PHP_MONGODB_SASL" = "cyrus" -a "$found_cyrus" != "yes"; then
42+
if test \( "$PHP_MONGODB_SASL" = "cyrus" -o "$PHP_MONGODB_SASL" = "yes" \) -a "$found_cyrus" != "yes"; then
4243
AC_MSG_ERROR([Cyrus SASL libraries and development headers could not be found])
4344
fi
4445
])

0 commit comments

Comments
 (0)