From c9ae1980161add744af9076f57078fd26c1342ec Mon Sep 17 00:00:00 2001 From: Igor Sysoev Date: Fri, 12 Jan 2018 18:15:58 +0300 Subject: 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. --- auto/modules/php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'auto/modules') 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}" -- cgit