Skip to content

Autotools: Improve ftp and mysqlnd SSL configure options #15164

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions ext/ftp/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,26 @@ PHP_ARG_ENABLE([ftp],
[AS_HELP_STRING([--enable-ftp],
[Enable FTP support])])

dnl Empty variable means 'no' (for phpize builds).
AS_VAR_IF([PHP_OPENSSL],, [PHP_OPENSSL=no])

PHP_ARG_WITH([ftp-ssl],
[whether to explicitly enable FTP SSL support],
[whether to enable FTP over SSL support],
[AS_HELP_STRING([--with-ftp-ssl],
[Explicitly enable SSL support in ext/ftp when not building with
ext/openssl. If ext/openssl is enabled at the configure step, SSL is enabled
implicitly.])],
[no],
[Explicitly enable FTP over SSL support when building without openssl
extension or when using phpize. If the openssl extension is enabled at the
configure step (--with-openssl), FTP-SSL is enabled implicitly regardless of
this option.])],
[$PHP_OPENSSL],
[no])

if test "$PHP_FTP" = "yes"; then
AC_DEFINE(HAVE_FTP,1,[Whether you want FTP support])
PHP_NEW_EXTENSION([ftp], [php_ftp.c ftp.c], [$ext_shared])

dnl Empty variable means 'no' (for phpize builds).
test -z "$PHP_OPENSSL" && PHP_OPENSSL=no

if test "$PHP_OPENSSL" != "no" || test "$PHP_FTP_SSL" != "no"; then
AS_VAR_IF([PHP_FTP_SSL], [no],, [
PHP_SETUP_OPENSSL([FTP_SHARED_LIBADD])
PHP_SUBST([FTP_SHARED_LIBADD])
AC_DEFINE(HAVE_FTP_SSL,1,[Whether FTP over SSL is supported])
fi
AC_DEFINE([HAVE_FTP_SSL], [1], [Define to 1 if FTP over SSL is enabled.])
])
fi
2 changes: 1 addition & 1 deletion ext/ftp/config.w32
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ if (PHP_FTP != "no") {

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

AC_DEFINE('HAVE_FTP', 1, 'Have FTP support');
Expand Down
4 changes: 2 additions & 2 deletions ext/mysqlnd/config.w32
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ if (PHP_MYSQLND != "no") {
)
{
AC_DEFINE("MYSQLND_COMPRESSION_ENABLED", 1, "Define to 1 if mysqlnd has compressed protocol support.");
AC_DEFINE("MYSQLND_SSL_SUPPORTED", 1, "SSL support");
AC_DEFINE("MYSQLND_SSL_SUPPORTED", 1, "Define to 1 if mysqlnd core SSL is enabled.");
if (CHECK_LIB("crypt32.lib", "mysqlnd")) {
AC_DEFINE("MYSQLND_HAVE_SSL", 1, "Define to 1 if mysqlnd has extended SSL support through OpenSSL.");
AC_DEFINE("MYSQLND_HAVE_SSL", 1, "Define to 1 if mysqlnd extended SSL is enabled through OpenSSL.");
}
}
PHP_INSTALL_HEADERS("", "ext/mysqlnd");
Expand Down
27 changes: 14 additions & 13 deletions ext/mysqlnd/config9.m4
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,17 @@ PHP_ARG_ENABLE([mysqlnd],
[no],
[yes])

dnl Empty variable means 'no' (for phpize builds).
AS_VAR_IF([PHP_OPENSSL],, [PHP_OPENSSL=no])

PHP_ARG_WITH([mysqlnd-ssl],
[whether to explicitly enable SSL support in mysqlnd],
[whether to enable extended SSL support in mysqlnd],
[AS_HELP_STRING([--with-mysqlnd-ssl],
[Explicitly enable SSL support in ext/mysqlnd when not building with
ext/openssl. If ext/openssl is enabled at the configure step, SSL is enabled
implicitly.])],
[no],
[Explicitly enable extended SSL support in the mysqlnd extension when
building without openssl extension or when using phpize. If the openssl
extension is enabled at the configure step (--with-openssl), extended SSL is
enabled implicitly regardless of this option.])],
[$PHP_OPENSSL],
[no])

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

AC_DEFINE([MYSQLND_SSL_SUPPORTED], 1, [Enable core mysqlnd SSL code])

dnl Empty variable means 'no' (for phpize builds).
test -z "$PHP_OPENSSL" && PHP_OPENSSL=no
AC_DEFINE([MYSQLND_SSL_SUPPORTED], [1],
[Define to 1 if mysqlnd core SSL is enabled.])

if test "$PHP_OPENSSL" != "no" || test "$PHP_MYSQLND_SSL" != "no"; then
PHP_SETUP_OPENSSL([MYSQLND_SHARED_LIBADD],
AS_VAR_IF([PHP_MYSQLND_SSL], [no],,
[PHP_SETUP_OPENSSL([MYSQLND_SHARED_LIBADD],
[AC_DEFINE([MYSQLND_HAVE_SSL], [1],
[Define to 1 if mysqlnd has extended SSL support through OpenSSL.])])
fi
[Define to 1 if mysqlnd extended SSL is enabled through OpenSSL.])])])

PHP_NEW_EXTENSION([mysqlnd], m4_normalize([
mysqlnd_alloc.c
Expand Down
Loading