summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2018-01-15 15:05:22 +0300
committerIgor Sysoev <igor@sysoev.ru>2018-01-15 15:05:22 +0300
commita35732bf057bd7d04a2b675589679af000f88169 (patch)
treedc1c8677168453d8ebae2ad1bdeda9dce587663d
parent845b373bda88f2321b1c1870426e0f1a5afe4462 (diff)
downloadunit-a35732bf057bd7d04a2b675589679af000f88169.tar.gz
unit-a35732bf057bd7d04a2b675589679af000f88169.tar.bz2
PHP: "--lib-static" option uses "--lib-path" option.
-rw-r--r--auto/modules/php24
1 files changed, 18 insertions, 6 deletions
diff --git a/auto/modules/php b/auto/modules/php
index 0d540bf2..6ca17b06 100644
--- a/auto/modules/php
+++ b/auto/modules/php
@@ -77,15 +77,27 @@ if /bin/sh -c "${NXT_PHP_CONFIG} --version" >> $NXT_AUTOCONF_ERR 2>&1; then
$echo " + PHP SAPI: [`${NXT_PHP_CONFIG} --php-sapis`]"
NXT_PHP_INCLUDE="`${NXT_PHP_CONFIG} --includes`"
- NXT_PHP_LIB="-lphp${NXT_PHP_VERSION%%.*}"
if [ $NXT_PHP_LIB_STATIC = yes ]; then
- NXT_PHP_LIB="${NXT_PHP_LIB} `${NXT_PHP_CONFIG} --libs`"
- fi
- if [ "$NXT_PHP_LIB_PATH" != "" ]; then
- # "php-config --ldflags" does not contain path to libphp.
- NXT_PHP_LDFLAGS="-L${NXT_PHP_LIB_PATH} -Wl,-rpath ${NXT_PHP_LIB_PATH}"
+ if [ "$NXT_PHP_LIB_PATH" = "" ]; then
+ $echo
+ $echo $0: error: --lib-static option requires --lib-path option.
+ $echo
+ exit 1;
+ fi
+
+ NXT_PHP_LIB="$NXT_PHP_LIB_PATH/libphp${NXT_PHP_VERSION%%.*}.a"
+ NXT_PHP_LDFLAGS="`${NXT_PHP_CONFIG} --libs`"
+
+ else
+ NXT_PHP_LIB="-lphp${NXT_PHP_VERSION%%.*}"
+
+ if [ "$NXT_PHP_LIB_PATH" != "" ]; then
+ # "php-config --ldflags" does not contain path to libphp.
+ NXT_PHP_LDFLAGS="-L${NXT_PHP_LIB_PATH} \
+ -Wl,-rpath ${NXT_PHP_LIB_PATH}"
+ fi
fi
nxt_feature="PHP embed SAPI"