Skip to content

Commit cf6bbdf

Browse files
authored
Autotools: Improve ftp and mysqlnd SSL configure options (#15164)
This makes the configure log messages and help text more intuitive what is being enabled and when.
1 parent 4f07cdc commit cf6bbdf

File tree

4 files changed

+29
-27
lines changed

4 files changed

+29
-27
lines changed

ext/ftp/config.m4

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,27 @@ PHP_ARG_ENABLE([ftp],
33
[AS_HELP_STRING([--enable-ftp],
44
[Enable FTP support])])
55

6+
dnl Empty variable means 'no' (for phpize builds).
7+
AS_VAR_IF([PHP_OPENSSL],, [PHP_OPENSSL=no])
8+
69
PHP_ARG_WITH([ftp-ssl],
7-
[whether to explicitly enable FTP SSL support],
10+
[whether to enable FTP over SSL support],
811
[AS_HELP_STRING([--with-ftp-ssl],
9-
[Explicitly enable SSL support in ext/ftp when not building with
10-
ext/openssl. If ext/openssl is enabled at the configure step, SSL is enabled
11-
implicitly.])],
12-
[no],
12+
[Explicitly enable FTP over SSL support when building without openssl
13+
extension or when using phpize. If the openssl extension is enabled at the
14+
configure step (--with-openssl), FTP-SSL is enabled implicitly regardless of
15+
this option.])],
16+
[$PHP_OPENSSL],
1317
[no])
1418

1519
if test "$PHP_FTP" = "yes"; then
1620
AC_DEFINE([HAVE_FTP], [1],
1721
[Define to 1 if the PHP extension 'ftp' is available.])
1822
PHP_NEW_EXTENSION([ftp], [php_ftp.c ftp.c], [$ext_shared])
1923

20-
dnl Empty variable means 'no' (for phpize builds).
21-
test -z "$PHP_OPENSSL" && PHP_OPENSSL=no
22-
23-
if test "$PHP_OPENSSL" != "no" || test "$PHP_FTP_SSL" != "no"; then
24+
AS_VAR_IF([PHP_FTP_SSL], [no],, [
2425
PHP_SETUP_OPENSSL([FTP_SHARED_LIBADD])
2526
PHP_SUBST([FTP_SHARED_LIBADD])
26-
AC_DEFINE(HAVE_FTP_SSL,1,[Whether FTP over SSL is supported])
27-
fi
27+
AC_DEFINE([HAVE_FTP_SSL], [1], [Define to 1 if FTP over SSL is enabled.])
28+
])
2829
fi

ext/ftp/config.w32

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ if (PHP_FTP != "no") {
1010

1111
if (ret >= 2) {
1212
MESSAGE("Enabling SSL support for ext\\ftp");
13-
AC_DEFINE('HAVE_FTP_SSL', 1, 'Have FTP over SSL support');
13+
AC_DEFINE('HAVE_FTP_SSL', 1, 'Define to 1 if FTP over SSL is enabled.');
1414
}
1515

1616
AC_DEFINE('HAVE_FTP', 1, "Define to 1 if the PHP extension 'ftp' is available.");

ext/mysqlnd/config.w32

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ if (PHP_MYSQLND != "no") {
3535
)
3636
{
3737
AC_DEFINE("MYSQLND_COMPRESSION_ENABLED", 1, "Define to 1 if mysqlnd has compressed protocol support.");
38-
AC_DEFINE("MYSQLND_SSL_SUPPORTED", 1, "SSL support");
38+
AC_DEFINE("MYSQLND_SSL_SUPPORTED", 1, "Define to 1 if mysqlnd core SSL is enabled.");
3939
if (CHECK_LIB("crypt32.lib", "mysqlnd")) {
40-
AC_DEFINE("MYSQLND_HAVE_SSL", 1, "Define to 1 if mysqlnd has extended SSL support through OpenSSL.");
40+
AC_DEFINE("MYSQLND_HAVE_SSL", 1, "Define to 1 if mysqlnd extended SSL is enabled through OpenSSL.");
4141
}
4242
}
4343
PHP_INSTALL_HEADERS("", "ext/mysqlnd");

ext/mysqlnd/config9.m4

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,17 @@ PHP_ARG_ENABLE([mysqlnd],
66
[no],
77
[yes])
88

9+
dnl Empty variable means 'no' (for phpize builds).
10+
AS_VAR_IF([PHP_OPENSSL],, [PHP_OPENSSL=no])
11+
912
PHP_ARG_WITH([mysqlnd-ssl],
10-
[whether to explicitly enable SSL support in mysqlnd],
13+
[whether to enable extended SSL support in mysqlnd],
1114
[AS_HELP_STRING([--with-mysqlnd-ssl],
12-
[Explicitly enable SSL support in ext/mysqlnd when not building with
13-
ext/openssl. If ext/openssl is enabled at the configure step, SSL is enabled
14-
implicitly.])],
15-
[no],
15+
[Explicitly enable extended SSL support in the mysqlnd extension when
16+
building without openssl extension or when using phpize. If the openssl
17+
extension is enabled at the configure step (--with-openssl), extended SSL is
18+
enabled implicitly regardless of this option.])],
19+
[$PHP_OPENSSL],
1620
[no])
1721

1822
PHP_ARG_ENABLE([mysqlnd-compression-support],
@@ -29,16 +33,13 @@ if test "$PHP_MYSQLND" != "no" || test "$PHP_MYSQLND_ENABLED" = "yes"; then
2933
[AC_DEFINE([MYSQLND_COMPRESSION_ENABLED], [1],
3034
[Define to 1 if mysqlnd has compressed protocol support.])])])
3135

32-
AC_DEFINE([MYSQLND_SSL_SUPPORTED], 1, [Enable core mysqlnd SSL code])
33-
34-
dnl Empty variable means 'no' (for phpize builds).
35-
test -z "$PHP_OPENSSL" && PHP_OPENSSL=no
36+
AC_DEFINE([MYSQLND_SSL_SUPPORTED], [1],
37+
[Define to 1 if mysqlnd core SSL is enabled.])
3638

37-
if test "$PHP_OPENSSL" != "no" || test "$PHP_MYSQLND_SSL" != "no"; then
38-
PHP_SETUP_OPENSSL([MYSQLND_SHARED_LIBADD],
39+
AS_VAR_IF([PHP_MYSQLND_SSL], [no],,
40+
[PHP_SETUP_OPENSSL([MYSQLND_SHARED_LIBADD],
3941
[AC_DEFINE([MYSQLND_HAVE_SSL], [1],
40-
[Define to 1 if mysqlnd has extended SSL support through OpenSSL.])])
41-
fi
42+
[Define to 1 if mysqlnd extended SSL is enabled through OpenSSL.])])])
4243

4344
PHP_NEW_EXTENSION([mysqlnd], m4_normalize([
4445
mysqlnd_alloc.c

0 commit comments

Comments
 (0)