summaryrefslogtreecommitdiffstats
path: root/src/auto
diff options
context:
space:
mode:
authorIllia Bobyr <illia.bobyr@gmail.com>2023-08-27 18:26:54 +0200
committerChristian Brabandt <cb@256bit.org>2023-08-27 18:26:54 +0200
commit74e1dada4199b2d9e68ccaafdb7895c85b4b08f1 (patch)
tree0f6e566de334ebcb26182c6c9c73773f8a483fa4 /src/auto
parentf39842f148c9a8112432644b7f4a0129315de771 (diff)
patch 9.0.1794: autoconf: not correctly detecing include dirsv9.0.1794
Problem: autoconf: not correctly detecing include dirs Solution: make use of python3 to generate includedirs configure: Python3: Use sysconfig for -I It seems better to use tools provided by Python for determining the include directories, rather than construct them "manually". Current system is broken when using virtual environments for python 3.11.4. It used to work before, but now it detects a incorrect value for `-I`. It would probably make sense to switch to a similar logic for lib folders, that is for the `-l` switch. There are also `sysconfig.get_config_h_filename()` and `sysconfig.get_makefile_filename()`, that could replace more Python specific logic in the current `configure{.ac,}`. sysconfig provides the necessary tools since Python 2.7. closes: #12889 Signed-off-by: Christian Brabandt <cb@256bit.org> Co-authored-by: Illia Bobyr <illia.bobyr@gmail.com>
Diffstat (limited to 'src/auto')
-rwxr-xr-xsrc/auto/configure30
1 files changed, 27 insertions, 3 deletions
diff --git a/src/auto/configure b/src/auto/configure
index 60b4e8d565..b3985d59db 100755
--- a/src/auto/configure
+++ b/src/auto/configure
@@ -6775,6 +6775,30 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $vi_cv_path_python3_epfx" >&5
$as_echo "$vi_cv_path_python3_epfx" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking Python's include path" >&5
+$as_echo_n "checking Python's include path... " >&6; }
+if ${vi_cv_path_python3_include+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ vi_cv_path_python3_include=`
+ ${vi_cv_path_python3} -c \
+ "import sysconfig; print(sysconfig.get_path(\"include\"))"`
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $vi_cv_path_python3_include" >&5
+$as_echo "$vi_cv_path_python3_include" >&6; }
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking Python's include path" >&5
+$as_echo_n "checking Python's include path... " >&6; }
+if ${vi_cv_path_python3_platinclude+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ vi_cv_path_python3_platinclude=`
+ ${vi_cv_path_python3} -c \
+ "import sysconfig; print(sysconfig.get_path(\"platinclude\"))"`
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $vi_cv_path_python3_platinclude" >&5
+$as_echo "$vi_cv_path_python3_platinclude" >&6; }
+
if ${vi_cv_path_python3path+:} false; then :
$as_echo_n "(cached) " >&6
@@ -6873,10 +6897,10 @@ fi
$as_echo "$vi_cv_dll_name_python3" >&6; }
PYTHON3_LIBS="${vi_cv_path_python3_plibs}"
- if test "${vi_cv_path_python3_pfx}" = "${vi_cv_path_python3_epfx}"; then
- PYTHON3_CFLAGS="-I${vi_cv_path_python3_pfx}/include/python${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags}"
+ if test "${vi_cv_path_python3_include}" = "${vi_cv_path_python3_platinclude}"; then
+ PYTHON3_CFLAGS="-I${vi_cv_path_python3_include}"
else
- PYTHON3_CFLAGS="-I${vi_cv_path_python3_pfx}/include/python${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags} -I${vi_cv_path_python3_epfx}/include/python${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags}"
+ PYTHON3_CFLAGS="-I${vi_cv_path_python3_include} -I${vi_cv_path_python3_platinclude}"
fi
if test "X$have_python3_config_dir" = "X1" -a "$enable_python3interp" = "dynamic"; then
PYTHON3_CFLAGS="${PYTHON3_CFLAGS} -DPYTHON3_HOME='L\"${vi_cv_path_python3_pfx}\"'"