summaryrefslogtreecommitdiffhomepage
path: root/auto
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2017-07-26 12:17:41 +0300
committerIgor Sysoev <igor@sysoev.ru>2017-07-26 12:17:41 +0300
commit145eeb84764109841b03ba3eba25ac30b287c781 (patch)
tree1ff1349e399020b9f9bac4b656dc12fb2b7d73c5 /auto
parent237bd6b1c25aa9221e80521f837b47e1b5c73972 (diff)
downloadunit-145eeb84764109841b03ba3eba25ac30b287c781.tar.gz
unit-145eeb84764109841b03ba3eba25ac30b287c781.tar.bz2
Improved PHP configure test.
Diffstat (limited to '')
-rw-r--r--auto/modules/php/conf52
1 files changed, 31 insertions, 21 deletions
diff --git a/auto/modules/php/conf b/auto/modules/php/conf
index 9eef65fb..79b330a8 100644
--- a/auto/modules/php/conf
+++ b/auto/modules/php/conf
@@ -3,35 +3,45 @@
# Copyright (C) NGINX, Inc.
+$echo "checking for PHP ..." >> $NXT_AUTOCONF_ERR
+
+nxt_found=no
+
NXT_PHP_CONFIG="${NXT_PHP}-config"
-NXT_PHP_VERSION="`${NXT_PHP_CONFIG} --version`"
-NXT_PHP_INCLUDE="`${NXT_PHP_CONFIG} --includes`"
-NXT_PHP_LIB="-lphp${NXT_PHP_VERSION%%.*}"
-NXT_PHP_LIBS="`${NXT_PHP_CONFIG} --ldflags`"
-
-nxt_feature="PHP"
-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_test="#include <php.h>
- #include <php_main.h>
-
- int main() {
- php_request_startup();
- return 0;
- }"
-
-. auto/feature
+
+if /bin/sh -c "${NXT_PHP_CONFIG} --version" >> $NXT_AUTOCONF_ERR 2>&1; then
+
+ NXT_PHP_VERSION="`${NXT_PHP_CONFIG} --version`"
+ NXT_PHP_INCLUDE="`${NXT_PHP_CONFIG} --includes`"
+ NXT_PHP_LIB="-lphp${NXT_PHP_VERSION%%.*}"
+ NXT_PHP_LIBS="`${NXT_PHP_CONFIG} --ldflags`"
+
+ nxt_feature="PHP"
+ 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_test="
+ #include <php.h>
+ #include <php_main.h>
+
+ int main() {
+ php_request_startup();
+ return 0;
+ }"
+
+ . auto/feature
+fi
if [ $nxt_found = no ]; then
+ $echo "checking for PHP ..."
$echo
- $echo $0: error: no php found.
+ $echo $0: error: no PHP found.
$echo
exit 1;
fi
-$echo " + php version: ${NXT_PHP_VERSION}"
+$echo " + PHP version: ${NXT_PHP_VERSION}"
NXT_PHP_MODULE_SRCS=" \
src/nxt_php_sapi.c \