From 96fedafb8d233911be102cb00bd6f5782c777fb6 Mon Sep 17 00:00:00 2001 From: Michele Locati Date: Tue, 12 Jul 2022 11:04:43 +0200 Subject: [PATCH] Enable c-ares for swoole 4.8.11+ (#608) Test: swoole --- install-php-extensions | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/install-php-extensions b/install-php-extensions index b3e6104..964018d 100755 --- a/install-php-extensions +++ b/install-php-extensions @@ -1192,10 +1192,18 @@ buildRequiredPackageLists() { swoole@alpine) buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent postgresql-libs libstdc++ $buildRequiredPackageLists_libssl" buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile curl-dev postgresql-dev linux-headers $buildRequiredPackageLists_libssldev" + if test $PHP_MAJMIN_VERSION -ge 702; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent c-ares" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile c-ares-dev" + fi ;; swoole@debian) buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libcurl3-gnutls libpq5" buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile $buildRequiredPackageLists_libssldev libcurl4-gnutls-dev libpq-dev" + if test $PHP_MAJMIN_VERSION -ge 702; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libc-ares2" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libc-ares-dev" + fi ;; sybase_ct@alpine) buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent freetds" @@ -3145,6 +3153,9 @@ installRemoteModule() { # https://github.com/swoole/swoole-src/issues/3977#issuecomment-754755521 addConfigureOption enable-swoole-curl no fi + if test -z "$installRemoteModule_version" || test $(compareVersions "$installRemoteModule_version" 4.8.11) -ge 0; then + addConfigureOption enable-cares yes + fi elif test $(compareVersions "$installRemoteModule_version" 4.4.0) -ge 0; then # enable sockets supports? addConfigureOption enable-sockets $installRemoteModule_sockets