Improved PHP configure test.
# Copyright (C) NGINX, Inc.
+$echo "checking for PHP ..." >> $NXT_AUTOCONF_ERR
+
+nxt_found=no
+
NXT_PHP_CONFIG="${NXT_PHP}-config"
+
+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%%.*}"
@@ -14,7 +21,8 @@ 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>
+ nxt_feature_test="
+ #include <php.h>
#include <php_main.h>
int main() {
@@ -23,15 +31,17 @@ nxt_feature_test="#include <php.h>
}"
. 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 \
