summaryrefslogtreecommitdiffhomepage
path: root/auto/modules
diff options
context:
space:
mode:
Diffstat (limited to 'auto/modules')
-rw-r--r--auto/modules/python/conf26
-rw-r--r--auto/modules/python/make4
2 files changed, 13 insertions, 17 deletions
diff --git a/auto/modules/python/conf b/auto/modules/python/conf
index 0d9fb1c9..7ab29857 100644
--- a/auto/modules/python/conf
+++ b/auto/modules/python/conf
@@ -1,33 +1,29 @@
-# Copyright (C) NGINX, Inc.
# Copyright (C) Valentin V. Bartenev
+# Copyright (C) NGINX, Inc.
-NXT_PYTHON_VERSION=`${NXT_PYTHON} -c \
- 'import sysconfig, sys; \
- sys.stdout.write(sysconfig.get_python_version())'`
+NXT_PYTHON_CONFIG="${NXT_PYTHON}-config"
-NXT_PYTHON_INCLUDE=`${NXT_PYTHON} -c \
- 'import sysconfig, sys; \
- sys.stdout.write(sysconfig.get_config_var("INCLUDEPY"))'`
+NXT_PYTHON_VERSION=`${NXT_PYTHON} -c \
+ 'import sys; \
+ sys.stdout.write(sys.version[:3])'`
-NXT_PYTHON_LIB="-lpython${NXT_PYTHON_VERSION}"
+NXT_PYTHON_INCLUDE=`${NXT_PYTHON_CONFIG} --includes`
-NXT_PYTHON_LIBS=`${NXT_PYTHON} -c \
- 'import sysconfig, sys; \
- sys.stdout.write(sysconfig.get_config_var("SYSLIBS") \
- + " " + sysconfig.get_config_var("LIBS"))'`
+NXT_PYTHON_LIBS=`${NXT_PYTHON_CONFIG} --ldflags`
nxt_feature="Python"
nxt_feature_name=NXT_HAVE_PYTHON
nxt_feature_run=no
-nxt_feature_incs="-I${NXT_PYTHON_INCLUDE}"
-nxt_feature_libs="$NXT_PYTHON_LIB $NXT_PYTHON_LIBS"
+nxt_feature_incs="${NXT_PYTHON_INCLUDE}"
+nxt_feature_libs="${NXT_PYTHON_LIBS}"
nxt_feature_test="#include <Python.h>
int main() {
Py_Initialize();
+ return 0;
}"
. auto/feature
@@ -51,4 +47,4 @@ NXT_PYTHON_MODULE_SRCS=" \
NXT_MODULES_INIT="$NXT_MODULES_INIT nxt_python_wsgi_init"
NXT_MODULES_SRCS="$NXT_MODULES_SRCS $NXT_PYTHON_MODULE_SRCS"
-NXT_LIB_AUX_LIBS="$NXT_LIB_AUX_LIBS $NXT_PYTHON_LIB $NXT_PYTHON_LIBS"
+NXT_LIB_AUX_LIBS="$NXT_LIB_AUX_LIBS $NXT_PYTHON_LIBS"
diff --git a/auto/modules/python/make b/auto/modules/python/make
index edb8f0c0..b405a03a 100644
--- a/auto/modules/python/make
+++ b/auto/modules/python/make
@@ -1,6 +1,6 @@
-# Copyright (C) NGINX, Inc.
# Copyright (C) Valentin V. Bartenev
+# Copyright (C) NGINX, Inc.
$echo >> $NXT_MAKEFILE
@@ -15,7 +15,7 @@ do
cat << END >> $NXT_MAKEFILE
$NXT_BUILD_DIR/$nxt_obj: $nxt_src
- \$(CC) -c \$(CFLAGS) \$(NXT_INCS) -I $NXT_PYTHON_INCLUDE \\
+ \$(CC) -c \$(CFLAGS) \$(NXT_INCS) $NXT_PYTHON_INCLUDE \\
$NXT_LIB_AUX_CFLAGS \\
-o $NXT_BUILD_DIR/$nxt_obj \\
$nxt_src