2016-03-18 18:52:43 +01:00
|
|
|
#!/bin/sh
|
2014-11-11 21:17:28 +01:00
|
|
|
set -e
|
|
|
|
|
2016-08-09 23:32:13 +02:00
|
|
|
srcExists=
|
|
|
|
if [ -d /usr/src/php ]; then
|
|
|
|
srcExists=1
|
|
|
|
fi
|
|
|
|
docker-php-source extract
|
|
|
|
if [ -z "$srcExists" ]; then
|
|
|
|
touch /usr/src/php/.docker-delete-me
|
|
|
|
fi
|
|
|
|
|
2014-11-11 21:17:28 +01:00
|
|
|
ext="$1"
|
2016-08-09 23:32:13 +02:00
|
|
|
extDir="/usr/src/php/ext/$ext"
|
|
|
|
if [ -z "$ext" ] || [ ! -d "$extDir" ]; then
|
2014-11-11 21:17:28 +01:00
|
|
|
echo >&2 "usage: $0 ext-name [configure flags]"
|
|
|
|
echo >&2 " ie: $0 gd --with-jpeg-dir=/usr/local/something"
|
|
|
|
echo >&2
|
|
|
|
echo >&2 'Possible values for ext-name:'
|
2016-08-09 23:32:13 +02:00
|
|
|
find /usr/src/php/ext \
|
|
|
|
-mindepth 2 \
|
|
|
|
-maxdepth 2 \
|
|
|
|
-type f \
|
|
|
|
-name 'config.m4' \
|
|
|
|
| xargs -n1 dirname \
|
|
|
|
| xargs -n1 basename \
|
|
|
|
| sort \
|
|
|
|
| xargs
|
2014-11-11 21:17:28 +01:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
shift
|
|
|
|
|
2016-06-12 10:58:09 +02:00
|
|
|
pm='unknown'
|
|
|
|
if [ -e /lib/apk/db/installed ]; then
|
|
|
|
pm='apk'
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$pm" = 'apk' ]; then
|
|
|
|
if \
|
|
|
|
[ -n "$PHPIZE_DEPS" ] \
|
|
|
|
&& ! apk info --installed .phpize-deps > /dev/null \
|
|
|
|
&& ! apk info --installed .phpize-deps-configure > /dev/null \
|
|
|
|
; then
|
|
|
|
apk add --no-cache --virtual .phpize-deps-configure $PHPIZE_DEPS
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2014-11-11 21:17:28 +01:00
|
|
|
set -x
|
2016-08-09 23:32:13 +02:00
|
|
|
cd "$extDir"
|
2014-11-11 21:17:28 +01:00
|
|
|
phpize
|
|
|
|
./configure "$@"
|