mirror of
https://github.com/danog/php.git
synced 2024-11-30 04:29:16 +01:00
53 lines
957 B
Bash
Executable File
53 lines
957 B
Bash
Executable File
#!/bin/sh
|
|
set -e
|
|
|
|
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
|
|
|
|
cd /usr/src/php/ext
|
|
|
|
ext="$1"
|
|
if [ -z "$ext" ] || [ ! -d "$ext" ]; then
|
|
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:'
|
|
find /usr/src/php/ext \
|
|
-mindepth 2 \
|
|
-maxdepth 2 \
|
|
-type f \
|
|
-name 'config.m4' \
|
|
| xargs -n1 dirname \
|
|
| xargs -n1 basename \
|
|
| sort \
|
|
| xargs
|
|
exit 1
|
|
fi
|
|
shift
|
|
|
|
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
|
|
|
|
set -x
|
|
cd "$ext"
|
|
phpize
|
|
./configure "$@"
|