Skip to content

Commit 83ae04e

Browse files
authored
Merge pull request #429 from infosiftr/multiarch
Add explicit "--build" to our "./configure" invocations
2 parents 3712f02 + 6844e71 commit 83ae04e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+327
-10
lines changed

5.6/Dockerfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ FROM debian:jessie
99
# persistent / runtime deps
1010
ENV PHPIZE_DEPS \
1111
autoconf \
12+
dpkg-dev \
1213
file \
1314
g++ \
1415
gcc \
@@ -88,6 +89,7 @@ RUN set -xe \
8889
$PHP_EXTRA_BUILD_DEPS \
8990
libcurl4-openssl-dev \
9091
libedit-dev \
92+
libpcre3-dev \
9193
libsqlite3-dev \
9294
libssl-dev \
9395
libxml2-dev \
@@ -99,7 +101,9 @@ RUN set -xe \
99101
LDFLAGS="$PHP_LDFLAGS" \
100102
&& docker-php-source extract \
101103
&& cd /usr/src/php \
104+
&& gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
102105
&& ./configure \
106+
--build="$gnuArch" \
103107
--with-config-file-path="$PHP_INI_DIR" \
104108
--with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \
105109
\
@@ -117,6 +121,11 @@ RUN set -xe \
117121
--with-openssl \
118122
--with-zlib \
119123
\
124+
# bundled pcre is too old for s390x (which isn't exactly a good sign)
125+
# /usr/src/php/ext/pcre/pcrelib/pcre_jit_compile.c:65:2: error: #error Unsupported architecture
126+
--with-pcre-regex=/usr \
127+
--with-libdir="lib/$gnuArch" \
128+
\
120129
$PHP_EXTRA_CONFIGURE_ARGS \
121130
&& make -j "$(nproc)" \
122131
&& make install \

5.6/alpine/Dockerfile

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ FROM alpine:3.4
99
# persistent / runtime deps
1010
ENV PHPIZE_DEPS \
1111
autoconf \
12+
dpkg-dev dpkg \
1213
file \
1314
g++ \
1415
gcc \
@@ -89,18 +90,22 @@ COPY docker-php-source /usr/local/bin/
8990
RUN set -xe \
9091
&& apk add --no-cache --virtual .build-deps \
9192
$PHPIZE_DEPS \
93+
coreutils \
9294
curl-dev \
9395
libedit-dev \
9496
libxml2-dev \
9597
openssl-dev \
98+
pcre-dev \
9699
sqlite-dev \
97100
\
98101
&& export CFLAGS="$PHP_CFLAGS" \
99102
CPPFLAGS="$PHP_CPPFLAGS" \
100103
LDFLAGS="$PHP_LDFLAGS" \
101104
&& docker-php-source extract \
102105
&& cd /usr/src/php \
106+
&& gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
103107
&& ./configure \
108+
--build="$gnuArch" \
104109
--with-config-file-path="$PHP_INI_DIR" \
105110
--with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \
106111
\
@@ -118,8 +123,12 @@ RUN set -xe \
118123
--with-openssl \
119124
--with-zlib \
120125
\
126+
# bundled pcre is too old for s390x (which isn't exactly a good sign)
127+
# /usr/src/php/ext/pcre/pcrelib/pcre_jit_compile.c:65:2: error: #error Unsupported architecture
128+
--with-pcre-regex=/usr \
129+
\
121130
$PHP_EXTRA_CONFIGURE_ARGS \
122-
&& make -j "$(getconf _NPROCESSORS_ONLN)" \
131+
&& make -j "$(nproc)" \
123132
&& make install \
124133
&& { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; } \
125134
&& make clean \

5.6/alpine/docker-php-ext-configure

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@ if [ "$pm" = 'apk' ]; then
5252
fi
5353
fi
5454

55+
if command -v dpkg-architecture > /dev/null; then
56+
gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"
57+
set -- --build="$gnuArch" "$@"
58+
fi
59+
5560
set -x
5661
cd "$ext"
5762
phpize

5.6/apache/Dockerfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ FROM debian:jessie
99
# persistent / runtime deps
1010
ENV PHPIZE_DEPS \
1111
autoconf \
12+
dpkg-dev \
1213
file \
1314
g++ \
1415
gcc \
@@ -147,6 +148,7 @@ RUN set -xe \
147148
$PHP_EXTRA_BUILD_DEPS \
148149
libcurl4-openssl-dev \
149150
libedit-dev \
151+
libpcre3-dev \
150152
libsqlite3-dev \
151153
libssl-dev \
152154
libxml2-dev \
@@ -158,7 +160,9 @@ RUN set -xe \
158160
LDFLAGS="$PHP_LDFLAGS" \
159161
&& docker-php-source extract \
160162
&& cd /usr/src/php \
163+
&& gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
161164
&& ./configure \
165+
--build="$gnuArch" \
162166
--with-config-file-path="$PHP_INI_DIR" \
163167
--with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \
164168
\
@@ -176,6 +180,11 @@ RUN set -xe \
176180
--with-openssl \
177181
--with-zlib \
178182
\
183+
# bundled pcre is too old for s390x (which isn't exactly a good sign)
184+
# /usr/src/php/ext/pcre/pcrelib/pcre_jit_compile.c:65:2: error: #error Unsupported architecture
185+
--with-pcre-regex=/usr \
186+
--with-libdir="lib/$gnuArch" \
187+
\
179188
$PHP_EXTRA_CONFIGURE_ARGS \
180189
&& make -j "$(nproc)" \
181190
&& make install \

5.6/apache/docker-php-ext-configure

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@ if [ "$pm" = 'apk' ]; then
5252
fi
5353
fi
5454

55+
if command -v dpkg-architecture > /dev/null; then
56+
gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"
57+
set -- --build="$gnuArch" "$@"
58+
fi
59+
5560
set -x
5661
cd "$ext"
5762
phpize

5.6/docker-php-ext-configure

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@ if [ "$pm" = 'apk' ]; then
5252
fi
5353
fi
5454

55+
if command -v dpkg-architecture > /dev/null; then
56+
gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"
57+
set -- --build="$gnuArch" "$@"
58+
fi
59+
5560
set -x
5661
cd "$ext"
5762
phpize

5.6/fpm/Dockerfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ FROM debian:jessie
99
# persistent / runtime deps
1010
ENV PHPIZE_DEPS \
1111
autoconf \
12+
dpkg-dev \
1213
file \
1314
g++ \
1415
gcc \
@@ -89,6 +90,7 @@ RUN set -xe \
8990
$PHP_EXTRA_BUILD_DEPS \
9091
libcurl4-openssl-dev \
9192
libedit-dev \
93+
libpcre3-dev \
9294
libsqlite3-dev \
9395
libssl-dev \
9496
libxml2-dev \
@@ -100,7 +102,9 @@ RUN set -xe \
100102
LDFLAGS="$PHP_LDFLAGS" \
101103
&& docker-php-source extract \
102104
&& cd /usr/src/php \
105+
&& gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
103106
&& ./configure \
107+
--build="$gnuArch" \
104108
--with-config-file-path="$PHP_INI_DIR" \
105109
--with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \
106110
\
@@ -118,6 +122,11 @@ RUN set -xe \
118122
--with-openssl \
119123
--with-zlib \
120124
\
125+
# bundled pcre is too old for s390x (which isn't exactly a good sign)
126+
# /usr/src/php/ext/pcre/pcrelib/pcre_jit_compile.c:65:2: error: #error Unsupported architecture
127+
--with-pcre-regex=/usr \
128+
--with-libdir="lib/$gnuArch" \
129+
\
121130
$PHP_EXTRA_CONFIGURE_ARGS \
122131
&& make -j "$(nproc)" \
123132
&& make install \

5.6/fpm/alpine/Dockerfile

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ FROM alpine:3.4
99
# persistent / runtime deps
1010
ENV PHPIZE_DEPS \
1111
autoconf \
12+
dpkg-dev dpkg \
1213
file \
1314
g++ \
1415
gcc \
@@ -90,18 +91,22 @@ COPY docker-php-source /usr/local/bin/
9091
RUN set -xe \
9192
&& apk add --no-cache --virtual .build-deps \
9293
$PHPIZE_DEPS \
94+
coreutils \
9395
curl-dev \
9496
libedit-dev \
9597
libxml2-dev \
9698
openssl-dev \
99+
pcre-dev \
97100
sqlite-dev \
98101
\
99102
&& export CFLAGS="$PHP_CFLAGS" \
100103
CPPFLAGS="$PHP_CPPFLAGS" \
101104
LDFLAGS="$PHP_LDFLAGS" \
102105
&& docker-php-source extract \
103106
&& cd /usr/src/php \
107+
&& gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
104108
&& ./configure \
109+
--build="$gnuArch" \
105110
--with-config-file-path="$PHP_INI_DIR" \
106111
--with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \
107112
\
@@ -119,8 +124,12 @@ RUN set -xe \
119124
--with-openssl \
120125
--with-zlib \
121126
\
127+
# bundled pcre is too old for s390x (which isn't exactly a good sign)
128+
# /usr/src/php/ext/pcre/pcrelib/pcre_jit_compile.c:65:2: error: #error Unsupported architecture
129+
--with-pcre-regex=/usr \
130+
\
122131
$PHP_EXTRA_CONFIGURE_ARGS \
123-
&& make -j "$(getconf _NPROCESSORS_ONLN)" \
132+
&& make -j "$(nproc)" \
124133
&& make install \
125134
&& { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; } \
126135
&& make clean \

5.6/fpm/alpine/docker-php-ext-configure

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@ if [ "$pm" = 'apk' ]; then
5252
fi
5353
fi
5454

55+
if command -v dpkg-architecture > /dev/null; then
56+
gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"
57+
set -- --build="$gnuArch" "$@"
58+
fi
59+
5560
set -x
5661
cd "$ext"
5762
phpize

5.6/fpm/docker-php-ext-configure

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@ if [ "$pm" = 'apk' ]; then
5252
fi
5353
fi
5454

55+
if command -v dpkg-architecture > /dev/null; then
56+
gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"
57+
set -- --build="$gnuArch" "$@"
58+
fi
59+
5560
set -x
5661
cd "$ext"
5762
phpize

0 commit comments

Comments
 (0)