Merge pull request #184 from mlocati/fix-build-32bit-os

Fix building ldap for 32-bit OSs
pull/186/head 1.0.2
Michele Locati 2020-11-10 17:17:56 +01:00 committed by GitHub
commit 2ba3849f9f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 3 deletions

View File

@ -27,7 +27,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Install PHP - name: Install PHP
uses: shivammathur/setup-php@v1 uses: shivammathur/setup-php@v2
with: with:
php-version: "7.4" php-version: "7.4"
tools: composer tools: composer

View File

@ -801,6 +801,18 @@ getProcessorCount() {
fi fi
fi fi
} }
# Get the build target tripled
# Output:
# The target triplet (eg x86_64-linux-gnu, i686-linux-gnu, i386-linux-gnu, ...)
getTargetTriplet() {
getTargetTriplet_tmp="$(gcc -print-multiarch 2>/dev/null || true)"
if test -z "$getTargetTriplet_tmp"; then
getTargetTriplet_tmp="$(gcc -dumpmachine 2>/dev/null || true)"
fi
printf '%s' "$getTargetTriplet_tmp"
}
# Retrieve the number of processors to be used when compiling an extension # Retrieve the number of processors to be used when compiling an extension
# #
# Arguments: # Arguments:
@ -950,7 +962,7 @@ installBundledModule() {
ldap) ldap)
case "$DISTRO" in case "$DISTRO" in
debian) debian)
docker-php-ext-configure ldap --with-libdir=lib/$(gcc -dumpmachine) docker-php-ext-configure ldap --with-libdir=lib/$(getTargetTriplet)
;; ;;
esac esac
;; ;;
@ -1302,7 +1314,7 @@ installPECLModule() {
if test $PHP_MAJMIN_VERSION -le 506; then if test $PHP_MAJMIN_VERSION -le 506; then
installPECLModule_actual="$1-4.3.0" installPECLModule_actual="$1-4.3.0"
else else
installPECLModule_machine=$(gcc -dumpmachine) installPECLModule_machine=$(getTargetTriplet)
if ! test -e /usr/include/zstd.h || ! test -e /usr/lib/libzstd.so -o -e "/usr/lib/$installPECLModule_machine/libzstd.so"; then if ! test -e /usr/include/zstd.h || ! test -e /usr/lib/libzstd.so -o -e "/usr/lib/$installPECLModule_machine/libzstd.so"; then
installPECLModule_zstdVersion=1.4.4 installPECLModule_zstdVersion=1.4.4
installPECLModule_zstdVersionMajor=$(echo $installPECLModule_zstdVersion | cut -d. -f1) installPECLModule_zstdVersionMajor=$(echo $installPECLModule_zstdVersion | cut -d. -f1)