Skip to content

Commit cb81027

Browse files
committed
PHPC-1156: Prefer Secure Transport over OpenSSL with --with-mongodb-ssl on Darwin
1 parent cf0982b commit cb81027

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

scripts/build/autotools/CheckSSL.m4

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,20 @@ PHP_ARG_WITH([openssl-dir],
1212
[auto],
1313
[no])
1414

15+
AS_IF([test "$PHP_MONGODB_SSL" = "darwin" -o \( "$PHP_MONGODB_SSL" = "auto" -a "$os_darwin" = "yes" \)],[
16+
if test "$os_darwin" = "no"; then
17+
AC_MSG_ERROR([Darwin SSL is only supported on macOS])
18+
fi
19+
dnl PHP_FRAMEWORKS is only used for SAPI builds, so use MONGODB_SHARED_LIBADD for shared builds
20+
if test "$ext_shared" = "yes"; then
21+
MONGODB_SHARED_LIBADD="-framework Security -framework CoreFoundation $MONGODB_SHARED_LIBADD"
22+
else
23+
PHP_ADD_FRAMEWORK([Security])
24+
PHP_ADD_FRAMEWORK([CoreFoundation])
25+
fi
26+
PHP_MONGODB_SSL="darwin"
27+
])
28+
1529
AS_IF([test "$PHP_MONGODB_SSL" = "openssl" -o "$PHP_MONGODB_SSL" = "auto"],[
1630
found_openssl="no"
1731
@@ -129,20 +143,6 @@ AS_IF([test "$PHP_MONGODB_SSL" = "libressl" -o "$PHP_MONGODB_SSL" = "auto"],[
129143
fi
130144
])
131145

132-
AS_IF([test "$PHP_MONGODB_SSL" = "darwin" -o \( "$PHP_MONGODB_SSL" = "auto" -a "$os_darwin" = "yes" \)],[
133-
if test "$os_darwin" = "no"; then
134-
AC_MSG_ERROR([Darwin SSL is only supported on macOS])
135-
fi
136-
dnl PHP_FRAMEWORKS is only used for SAPI builds, so use MONGODB_SHARED_LIBADD for shared builds
137-
if test "$ext_shared" = "yes"; then
138-
MONGODB_SHARED_LIBADD="-framework Security -framework CoreFoundation $MONGODB_SHARED_LIBADD"
139-
else
140-
PHP_ADD_FRAMEWORK([Security])
141-
PHP_ADD_FRAMEWORK([CoreFoundation])
142-
fi
143-
PHP_MONGODB_SSL="darwin"
144-
])
145-
146146
AS_IF([test "$PHP_MONGODB_SSL" = "auto"],[
147147
PHP_MONGODB_SSL="no"
148148
])

0 commit comments

Comments
 (0)