diff options
author | Tiago Natel de Moura <t.nateldemoura@f5.com> | 2020-08-25 13:28:14 +0100 |
---|---|---|
committer | Tiago Natel de Moura <t.nateldemoura@f5.com> | 2020-08-25 13:28:14 +0100 |
commit | 30a242aa3cbfc3c3368ba0b6d2b4e579b31dc553 (patch) | |
tree | 10702c1803fec716c6e98c935781ea88bd9e7a1f /auto/modules/php | |
parent | dcfa92c161296af903fc1ebd4ddb98d1c38c59e7 (diff) | |
download | unit-30a242aa3cbfc3c3368ba0b6d2b4e579b31dc553.tar.gz unit-30a242aa3cbfc3c3368ba0b6d2b4e579b31dc553.tar.bz2 |
PHP: added bind mounts for extensions directory.
Diffstat (limited to 'auto/modules/php')
-rw-r--r-- | auto/modules/php | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/auto/modules/php b/auto/modules/php index 75d60242..0ba82eae 100644 --- a/auto/modules/php +++ b/auto/modules/php @@ -59,6 +59,12 @@ NXT_PHP_MODULE=${NXT_PHP_MODULE=${NXT_PHP##*/}} NXT_PHP_LIB_PATH=${NXT_PHP_LIB_PATH=} NXT_PHP_LIB_STATIC=${NXT_PHP_LIB_STATIC=no} NXT_PHP_ADDITIONAL_FLAGS= +NXT_PHP_REALPATH=realpath + + +if [ -z `which $NXT_PHP_REALPATH` ]; then + NXT_PHP_REALPATH="readlink -e" +fi $echo "configuring PHP module" @@ -74,6 +80,14 @@ if /bin/sh -c "${NXT_PHP_CONFIG} --version" >> $NXT_AUTOCONF_ERR 2>&1; then $echo " found" NXT_PHP_VERSION="`${NXT_PHP_CONFIG} --version`" + NXT_PHP_EXT_DIR="`${NXT_PHP_CONFIG} --extension-dir`" + NXT_PHP_LIBC_DIR="`${CC} --print-file-name=libc.so`" + NXT_PHP_LIBC_DIR="`$NXT_PHP_REALPATH $NXT_PHP_LIBC_DIR`" + NXT_PHP_LIBC_DIR="`dirname $NXT_PHP_LIBC_DIR`" + NXT_PHP_SYSLIB_DIR="`${CC} --print-file-name=libtinfo.so`" + NXT_PHP_SYSLIB_DIR="`$NXT_PHP_REALPATH $NXT_PHP_SYSLIB_DIR`" + NXT_PHP_SYSLIB_DIR="`dirname $NXT_PHP_SYSLIB_DIR`" + $echo " + PHP SAPI: [`${NXT_PHP_CONFIG} --php-sapis`]" NXT_PHP_MAJOR_VERSION=${NXT_PHP_VERSION%%.*} @@ -213,6 +227,22 @@ if grep ^$NXT_PHP_MODULE: $NXT_MAKEFILE 2>&1 > /dev/null; then exit 1; fi + +NXT_PHP_MOUNTS_HEADER=nxt_${NXT_PHP_MODULE}_mounts.h + +cat << END > $NXT_BUILD_DIR/$NXT_PHP_MOUNTS_HEADER +static const nxt_fs_mount_t nxt_php_mounts[] = { + {(u_char *) "$NXT_PHP_EXT_DIR", (u_char *) "$NXT_PHP_EXT_DIR", + (u_char *) "bind", NXT_MS_BIND | NXT_MS_REC, NULL}, + {(u_char *) "$NXT_PHP_LIBC_DIR", (u_char *) "$NXT_PHP_LIBC_DIR", + (u_char *) "bind", NXT_MS_BIND | NXT_MS_REC, NULL}, + {(u_char *) "$NXT_PHP_SYSLIB_DIR", (u_char *) "$NXT_PHP_SYSLIB_DIR", + (u_char *) "bind", NXT_MS_BIND | NXT_MS_REC, NULL}, +}; + +END + + $echo " + PHP module: ${NXT_PHP_MODULE}.unit.so" . auto/cc/deps @@ -238,7 +268,8 @@ for nxt_src in $NXT_PHP_MODULE_SRCS; do cat << END >> $NXT_MAKEFILE $NXT_BUILD_DIR/$nxt_obj: $nxt_src $NXT_VERSION_H - \$(CC) -c \$(CFLAGS) $NXT_PHP_ADDITIONAL_FLAGS \$(NXT_INCS) \\ + \$(CC) -c \$(CFLAGS) -DNXT_PHP_MOUNTS_H=\"$NXT_PHP_MOUNTS_HEADER\" \\ + $NXT_PHP_ADDITIONAL_FLAGS \$(NXT_INCS) \\ $NXT_PHP_INCLUDE -DNXT_ZEND_SIGNAL_STARTUP=$NXT_ZEND_SIGNAL_STARTUP \\ $nxt_dep_flags \\ -o $NXT_BUILD_DIR/$nxt_obj $nxt_src |