Temporarily add some information about python include paths to configure.
authorAndres Freund <andres@anarazel.de>
Mon, 24 Jan 2022 07:30:40 +0000 (23:30 -0800)
committerAndres Freund <andres@anarazel.de>
Mon, 24 Jan 2022 07:30:40 +0000 (23:30 -0800)
We're still (see e0e567a1067e0e567a1067) working on replacing use of the
deprecated distutils. This commit just makes configure print out the results
of different ways of determining the include path. Hopefully this will help us
to find a way to transition away from distutils without turning the buildfarm
red for prolonged amounts of time.

Discussion: https://postgr.es/m/20220124025301.qu36x44w6m67cnap@alap3.anarazel.de

config/python.m4
configure

index d41aeb2876a4842fa48eb8cc88d57750178e3ee1..3aa59cf6020a7c2ea24efb5191a1c636edb06f9f 100644 (file)
@@ -68,6 +68,27 @@ if test "$PORTNAME" = win32 ; then
 fi
 AC_MSG_RESULT([$python_includespec])
 
+python_ways=`${PYTHON} -c "
+import distutils.sysconfig as ds
+import os
+import sysconfig as s
+print('ds.get_python_inc(False): %s' % ds.get_python_inc(False))
+print('s path include: %s' % s.get_path('include'))
+print('ds.get_python_inc(True): %s' % ds.get_python_inc(True))
+print('s path platinclude: %s' % s.get_path('platinclude'))
+print('ds var INCLUDEPY: %s' % ds.get_config_var('INCLUDEPY'))
+print('s var INCLUDEPY: %s' % s.get_config_var('INCLUDEPY'))
+print('ds var CONFINCLUDEPY: %s' % ds.get_config_var('CONFINCLUDEPY'))
+print('s var CONFINCLUDEPY: %s' % s.get_config_var('CONFINCLUDEPY'))
+print('')
+print('ds get_python_inc(False)/Python.h exists: %s' % os.path.exists(os.path.join(ds.get_python_inc(False), 'Python.h')))
+print('ds get_python_inc(True)/Python.h exists: %s' % os.path.exists(os.path.join(ds.get_python_inc(True), 'Python.h')))
+print('s var INCLUDEPY/Python.h exists: %s' % os.path.exists(os.path.join(ds.get_config_var('INCLUDEPY'), 'Python.h')))
+print('s var CONFINCLUDEPY/Python.h exists: %s' % os.path.exists(os.path.join(ds.get_config_var('CONFINCLUDEPY'), 'Python.h')))
+"` 2>/dev/null
+AC_MSG_NOTICE([python include paths, different approaches:
+$python_ways])
+
 AC_SUBST(python_majorversion)[]dnl
 AC_SUBST(python_version)[]dnl
 AC_SUBST(python_includespec)[]dnl
index 3f2aea0d7decb2ec7043fdf5ea9a22673f07da6f..841ac41a39b2b093b874a5a9e614b2860f78d6ab 100755 (executable)
--- a/configure
+++ b/configure
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $python_includespec" >&5
 $as_echo "$python_includespec" >&6; }
 
+python_ways=`${PYTHON} -c "
+import distutils.sysconfig as ds
+import os
+import sysconfig as s
+print('ds.get_python_inc(False): %s' % ds.get_python_inc(False))
+print('s path include: %s' % s.get_path('include'))
+print('ds.get_python_inc(True): %s' % ds.get_python_inc(True))
+print('s path platinclude: %s' % s.get_path('platinclude'))
+print('ds var INCLUDEPY: %s' % ds.get_config_var('INCLUDEPY'))
+print('s var INCLUDEPY: %s' % s.get_config_var('INCLUDEPY'))
+print('ds var CONFINCLUDEPY: %s' % ds.get_config_var('CONFINCLUDEPY'))
+print('s var CONFINCLUDEPY: %s' % s.get_config_var('CONFINCLUDEPY'))
+print('')
+print('ds get_python_inc(False)/Python.h exists: %s' % os.path.exists(os.path.join(ds.get_python_inc(False), 'Python.h')))
+print('ds get_python_inc(True)/Python.h exists: %s' % os.path.exists(os.path.join(ds.get_python_inc(True), 'Python.h')))
+print('s var INCLUDEPY/Python.h exists: %s' % os.path.exists(os.path.join(ds.get_config_var('INCLUDEPY'), 'Python.h')))
+print('s var CONFINCLUDEPY/Python.h exists: %s' % os.path.exists(os.path.join(ds.get_config_var('CONFINCLUDEPY'), 'Python.h')))
+"` 2>/dev/null
+{ $as_echo "$as_me:${as_lineno-$LINENO}: python include paths, different approaches:
+$python_ways" >&5
+$as_echo "$as_me: python include paths, different approaches:
+$python_ways" >&6;}
+
 
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link an embedded Python application" >&5