summaryrefslogtreecommitdiffhomepage
path: root/auto
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2017-07-26 12:17:32 +0300
committerIgor Sysoev <igor@sysoev.ru>2017-07-26 12:17:32 +0300
commit237bd6b1c25aa9221e80521f837b47e1b5c73972 (patch)
tree8765774fe47d722195330c00276a8850e99150ad /auto
parent740382e36ef6ed36207093a1a6787fe02b4da578 (diff)
downloadunit-237bd6b1c25aa9221e80521f837b47e1b5c73972.tar.gz
unit-237bd6b1c25aa9221e80521f837b47e1b5c73972.tar.bz2
Improved Python configure test.
Diffstat (limited to 'auto')
-rw-r--r--auto/modules/python/conf41
1 files changed, 24 insertions, 17 deletions
diff --git a/auto/modules/python/conf b/auto/modules/python/conf
index 7ab29857..cb045bf9 100644
--- a/auto/modules/python/conf
+++ b/auto/modules/python/conf
@@ -3,32 +3,35 @@
# Copyright (C) NGINX, Inc.
-NXT_PYTHON_CONFIG="${NXT_PYTHON}-config"
+$echo "checking for Python ..." >> $NXT_AUTOCONF_ERR
-NXT_PYTHON_VERSION=`${NXT_PYTHON} -c \
- 'import sys; \
- sys.stdout.write(sys.version[:3])'`
+nxt_found=no
-NXT_PYTHON_INCLUDE=`${NXT_PYTHON_CONFIG} --includes`
+NXT_PYTHON_CONFIG="${NXT_PYTHON}-config"
-NXT_PYTHON_LIBS=`${NXT_PYTHON_CONFIG} --ldflags`
+if /bin/sh -c "$NXT_PYTHON_CONFIG --prefix" >> $NXT_AUTOCONF_ERR 2>&1; then
+ NXT_PYTHON_INCLUDE=`${NXT_PYTHON_CONFIG} --includes`
+ NXT_PYTHON_LIBS=`${NXT_PYTHON_CONFIG} --ldflags`
-nxt_feature="Python"
-nxt_feature_name=NXT_HAVE_PYTHON
-nxt_feature_run=no
-nxt_feature_incs="${NXT_PYTHON_INCLUDE}"
-nxt_feature_libs="${NXT_PYTHON_LIBS}"
-nxt_feature_test="#include <Python.h>
+ nxt_feature="Python"
+ nxt_feature_name=NXT_HAVE_PYTHON
+ nxt_feature_run=no
+ nxt_feature_incs="${NXT_PYTHON_INCLUDE}"
+ nxt_feature_libs="${NXT_PYTHON_LIBS}"
+ nxt_feature_test="
+ #include <Python.h>
- int main() {
- Py_Initialize();
- return 0;
- }"
+ int main() {
+ Py_Initialize();
+ return 0;
+ }"
-. auto/feature
+ . auto/feature
+fi
if [ $nxt_found = no ]; then
+ $echo "checking for Python ..."
$echo
$echo $0: error: no Python found.
$echo
@@ -36,6 +39,10 @@ if [ $nxt_found = no ]; then
fi
+NXT_PYTHON_VERSION=`${NXT_PYTHON} -c \
+ 'import sys; \
+ sys.stdout.write(sys.version[:3])'`
+
$echo " + Python version: ${NXT_PYTHON_VERSION}"