gdb: better static python detection in configure machinery

In python 3, itertools is a builtin module, so whether or not the
python you link against is a shared or a static one, importing it
works.

Change the import test to use ctypes which is a dynamic module in both
python 2 and 3.

gdb/ChangeLog:

	PR python/26832
	* configure: Regenerate.
	* configure.ac: Check for python modules ctypes instead of
	itertools.
This commit is contained in:
Romain Geissler 2020-11-06 17:47:21 +00:00 committed by Andrew Burgess
parent ac3d406409
commit 3fed4c0b7a
3 changed files with 9 additions and 2 deletions

View File

@ -1,3 +1,10 @@
2020-11-06 Romain Geissler <romain.geissler@amadeus.com>
PR python/26832
* configure: Regenerate.
* configure.ac: Check for python modules ctypes instead of
itertools.
2020-11-06 Pedro Alves <pedro@palves.net>
* macroexp.c (struct macro_buffer): Split in two classes. Add

2
gdb/configure vendored
View File

@ -16076,7 +16076,7 @@ main ()
{
int err;
Py_Initialize ();
err = PyRun_SimpleString ("import itertools\n");
err = PyRun_SimpleString ("import ctypes\n");
Py_Finalize ();
return err == 0 ? 0 : 1;
;

View File

@ -1686,7 +1686,7 @@ if test "${gdb_native}" = yes; then
[#include "Python.h"],
[int err;
Py_Initialize ();
err = PyRun_SimpleString ("import itertools\n");
err = PyRun_SimpleString ("import ctypes\n");
Py_Finalize ();
return err == 0 ? 0 : 1;])],
[dynamic_list=true], [], [true])