mirror of
https://github.com/danog/docker-php-extension-installer.git
synced 2025-01-22 13:51:29 +01:00
Merge pull request #160 from mlocati/parallel-compilation
Enable parallel compilation for many pecl extensions
This commit is contained in:
commit
4811e7961f
@ -759,6 +759,23 @@ expandPackagesToBeInstalled() {
|
|||||||
printf '%s' "${expandPackagesToBeInstalled_result# }"
|
printf '%s' "${expandPackagesToBeInstalled_result# }"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Retrieve the number of processors to be used when compiling an extension
|
||||||
|
#
|
||||||
|
# Arguments:
|
||||||
|
# $1: the handle of the PHP extension to be compiled
|
||||||
|
# Output:
|
||||||
|
# The number of processors to be used
|
||||||
|
getCompilationProcessorCount() {
|
||||||
|
case "$1" in
|
||||||
|
amqp | bcmath | bz2 | calendar | exif | gd | gettext | grpc | imagick | intl | mysqli | opcache | pcntl | pdo_mysql | protobuf | redis | soap | sockets | tidy | xdebug | xsl | yaml | zip)
|
||||||
|
nproc
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
# Install the required APT/APK packages
|
# Install the required APT/APK packages
|
||||||
#
|
#
|
||||||
# Arguments:
|
# Arguments:
|
||||||
@ -1339,7 +1356,7 @@ installPECLModule() {
|
|||||||
printf ' (installing version %s)\n' "$installPECLModule_actual"
|
printf ' (installing version %s)\n' "$installPECLModule_actual"
|
||||||
fi
|
fi
|
||||||
pecl channel-update pecl.php.net || true
|
pecl channel-update pecl.php.net || true
|
||||||
printf "$installPECLModule_stdin" | pecl install "$installPECLModule_actual"
|
printf "$installPECLModule_stdin" | MAKE="make -j$(getCompilationProcessorCount $1)" pecl install "$installPECLModule_actual"
|
||||||
fi
|
fi
|
||||||
case "$1" in
|
case "$1" in
|
||||||
apcu_bc)
|
apcu_bc)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user