From 6e520b57ed4dd850f8351da94fe9836be563d2d9 Mon Sep 17 00:00:00 2001 From: Michele Locati Date: Tue, 10 Nov 2020 16:54:39 +0100 Subject: [PATCH 1/2] Fix building ldap for 32-bit OSs Test: ldap, redis --- install-php-extensions | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/install-php-extensions b/install-php-extensions index 8e058df..110a0e5 100755 --- a/install-php-extensions +++ b/install-php-extensions @@ -801,6 +801,18 @@ getProcessorCount() { 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 # # Arguments: @@ -950,7 +962,7 @@ installBundledModule() { ldap) case "$DISTRO" in debian) - docker-php-ext-configure ldap --with-libdir=lib/$(gcc -dumpmachine) + docker-php-ext-configure ldap --with-libdir=lib/$(getTargetTriplet) ;; esac ;; @@ -1302,7 +1314,7 @@ installPECLModule() { if test $PHP_MAJMIN_VERSION -le 506; then installPECLModule_actual="$1-4.3.0" 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 installPECLModule_zstdVersion=1.4.4 installPECLModule_zstdVersionMajor=$(echo $installPECLModule_zstdVersion | cut -d. -f1) From b9991ceacc47fa935b71c05b03e5dadd7a2b8742 Mon Sep 17 00:00:00 2001 From: Michele Locati Date: Tue, 10 Nov 2020 17:03:30 +0100 Subject: [PATCH 2/2] Upgrade setup-php GitHub Action --- .github/workflows/test-extensions.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-extensions.yml b/.github/workflows/test-extensions.yml index 2533327..aaaca03 100644 --- a/.github/workflows/test-extensions.yml +++ b/.github/workflows/test-extensions.yml @@ -27,7 +27,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Install PHP - uses: shivammathur/setup-php@v1 + uses: shivammathur/setup-php@v2 with: php-version: "7.4" tools: composer