From c23d3891b614eaabfd803b7b89dd3ae60ab3293e Mon Sep 17 00:00:00 2001 From: Michele Locati Date: Sat, 19 Jun 2021 20:58:37 +0200 Subject: [PATCH] Add support for LZF --- README.md | 8 ++++++++ data/supported-extensions | 1 + install-php-extensions | 13 +++++++++++++ 3 files changed, 22 insertions(+) diff --git a/README.md b/README.md index e938a31..a0b15a4 100644 --- a/README.md +++ b/README.md @@ -248,6 +248,14 @@ zlib [Zend Modules] ``` +## Configuration + +The compilation of some extensions may be fine-tuned to better fit your needs by using environment variables: + +| Extension | Environment variable | Description | +|---|---|---| +| lzf | IPE_LZF_BETTERCOMPRESSION=1 | By default `install-php-extensions` compiles the `lzf` extension to prefer speed over size; you can use this environment variable to compile it preferring size over speed | + ## Special requirements Some extensions have special requirements: diff --git a/data/supported-extensions b/data/supported-extensions index 4f6fa29..4571e0f 100644 --- a/data/supported-extensions +++ b/data/supported-extensions @@ -34,6 +34,7 @@ intl 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 ioncube_loader 5.5 5.6 7.0 7.1 7.2 7.3 7.4 json_post 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 ldap 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 +lzf 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 mailparse 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 maxminddb 7.2 7.3 7.4 8.0 mcrypt 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 diff --git a/install-php-extensions b/install-php-extensions index 603bf55..6e707ee 100755 --- a/install-php-extensions +++ b/install-php-extensions @@ -1703,6 +1703,19 @@ installRemoteModule() { cp "$installRemoteModule_src/$installRemoteModule_so" "$(getPHPExtensionsDir)/$installRemoteModule_module.so" installRemoteModule_manuallyInstalled=1 ;; + lzf) + if test -z "$installRemoteModule_version" || test $(compareVersions "$installRemoteModule_version" '1.5.0') -ge 0; then + # Sacrifice speed in favour of compression ratio? + case "${IPE_LZF_BETTERCOMPRESSION:-}" in + 1 | y* | Y*) + addConfigureOption 'enable-lzf-better-compression' 'yes' + ;; + *) + addConfigureOption 'enable-lzf-better-compression' 'no' + ;; + esac + fi + ;; mailparse) if test -z "$installRemoteModule_version"; then if test $PHP_MAJMIN_VERSION -le 506; then