diff options
author | Igor Sysoev <igor@sysoev.ru> | 2018-01-12 18:15:58 +0300 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2018-01-12 18:15:58 +0300 |
commit | c9ae1980161add744af9076f57078fd26c1342ec (patch) | |
tree | bfee3a30ecaa61198a7f5122c2fdcd4bda5076df | |
parent | 059695eeed9a494be5ed41bc6b9db265edc89280 (diff) | |
download | unit-c9ae1980161add744af9076f57078fd26c1342ec.tar.gz unit-c9ae1980161add744af9076f57078fd26c1342ec.tar.bz2 |
PHP: added "--lib-static" configure option.
The libraries returned by "php-config --libs" are required to link with
static libphp.a. Dynamic libphp.so contains the required libraries names.
-rw-r--r-- | auto/modules/php | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/auto/modules/php b/auto/modules/php index e5eb60f0..0d540bf2 100644 --- a/auto/modules/php +++ b/auto/modules/php @@ -17,6 +17,7 @@ for nxt_option; do --config=*) NXT_PHP_CONFIG="$value" ;; --module=*) NXT_PHP_MODULE="$value" ;; --lib-path=*) NXT_PHP_LIB_PATH="$value" ;; + --lib-static) NXT_PHP_LIB_STATIC=yes ;; --help) cat << END @@ -24,6 +25,7 @@ for nxt_option; do --config=FILE set php-config filename --module=NAME set unit php module name --lib-path=DIRECTORY set directory path to libphp.so library + --lib-static enable linking with static libphp.a library END exit 0 @@ -55,6 +57,7 @@ NXT_PHP_CONFIG=${NXT_PHP_CONFIG=php-config} NXT_PHP=${NXT_PHP_CONFIG%-config*} 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} $echo "configuring PHP module" @@ -76,6 +79,10 @@ if /bin/sh -c "${NXT_PHP_CONFIG} --version" >> $NXT_AUTOCONF_ERR 2>&1; then 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}" |