summaryrefslogtreecommitdiffhomepage
path: root/auto
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2017-08-04 08:21:22 +0300
committerIgor Sysoev <igor@sysoev.ru>2017-08-04 08:21:22 +0300
commite62840cd54895266030c7aa875263411359483ee (patch)
tree58d03b40e009edfb07f87082be13a4f689f2f08c /auto
parentfc6c4fdeb6cdfb1cd7ef80f459083ddfbdae6816 (diff)
downloadunit-e62840cd54895266030c7aa875263411359483ee.tar.gz
unit-e62840cd54895266030c7aa875263411359483ee.tar.bz2
Introducing configure option --with-php-ldflags=.
Diffstat (limited to '')
-rw-r--r--auto/modules/php/conf19
-rw-r--r--auto/options2
2 files changed, 13 insertions, 8 deletions
diff --git a/auto/modules/php/conf b/auto/modules/php/conf
index 79b330a8..445baa29 100644
--- a/auto/modules/php/conf
+++ b/auto/modules/php/conf
@@ -3,6 +3,7 @@
# Copyright (C) NGINX, Inc.
+$echo -n "checking for PHP ..."
$echo "checking for PHP ..." >> $NXT_AUTOCONF_ERR
nxt_found=no
@@ -11,16 +12,21 @@ NXT_PHP_CONFIG="${NXT_PHP}-config"
if /bin/sh -c "${NXT_PHP_CONFIG} --version" >> $NXT_AUTOCONF_ERR 2>&1; then
+ $echo " found"
+
NXT_PHP_VERSION="`${NXT_PHP_CONFIG} --version`"
+ $echo " + PHP version: ${NXT_PHP_VERSION}"
+ $echo " + PHP SAPI: [`${NXT_PHP_CONFIG} --php-sapis`]"
+
NXT_PHP_INCLUDE="`${NXT_PHP_CONFIG} --includes`"
NXT_PHP_LIB="-lphp${NXT_PHP_VERSION%%.*}"
- NXT_PHP_LIBS="`${NXT_PHP_CONFIG} --ldflags`"
+ # "php-config --ldflags" does not contain path to libphp.
- nxt_feature="PHP"
+ nxt_feature="PHP embed SAPI"
nxt_feature_name=NXT_HAVE_PHP
nxt_feature_run=no
nxt_feature_incs="${NXT_PHP_INCLUDE}"
- nxt_feature_libs="${NXT_PHP_LIB} ${NXT_PHP_LIBS}"
+ nxt_feature_libs="${NXT_PHP_LIB} ${NXT_PHP_LDFLAGS}"
nxt_feature_test="
#include <php.h>
#include <php_main.h>
@@ -34,15 +40,12 @@ if /bin/sh -c "${NXT_PHP_CONFIG} --version" >> $NXT_AUTOCONF_ERR 2>&1; then
fi
if [ $nxt_found = no ]; then
- $echo "checking for PHP ..."
$echo
- $echo $0: error: no PHP found.
+ $echo $0: error: no PHP embed SAPI found.
$echo
exit 1;
fi
-$echo " + PHP version: ${NXT_PHP_VERSION}"
-
NXT_PHP_MODULE_SRCS=" \
src/nxt_php_sapi.c \
"
@@ -50,4 +53,4 @@ NXT_PHP_MODULE_SRCS=" \
NXT_MODULES_INIT="$NXT_MODULES_INIT nxt_php_sapi_init"
NXT_MODULES_SRCS="$NXT_MODULES_SRCS $NXT_PHP_MODULE_SRCS"
-NXT_LIB_AUX_LIBS="$NXT_LIB_AUX_LIBS $NXT_PHP_LIB $NXT_PHP_LIBS"
+NXT_LIB_AUX_LIBS="$NXT_LIB_AUX_LIBS $NXT_PHP_LIB $NXT_PHP_LDFLAGS"
diff --git a/auto/options b/auto/options
index e9f41ff7..594a5ab8 100644
--- a/auto/options
+++ b/auto/options
@@ -45,6 +45,7 @@ NXT_PYTHON=python
NXT_PYTHON_MODULE=NO
NXT_PHP=php
+NXT_PHP_LDFLAGS=
NXT_PHP_MODULE=NO
NXT_GO=go
@@ -99,6 +100,7 @@ do
--with-python_module) NXT_PYTHON_MODULE=YES ;;
--with-php=*) NXT_PHP="$value" ;;
+ --with-php-ldflags=*) NXT_PHP_LDFLAGS="$value" ;;
--with-php_module) NXT_PHP_MODULE=YES ;;
--with-go=*) NXT_GO="$value" ;;