From: Romain Geissler Date: Fri, 6 Nov 2020 17:47:21 +0000 (+0000) Subject: gdb: better static python detection in configure machinery X-Git-Tag: gdb-10.2-release~214 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=60714c0fc0cc7cc873440b4b9362c11f28daf585;p=thirdparty%2Fbinutils-gdb.git 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. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 080895cb1a8..3e7f5675fe1 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,10 @@ +2020-11-06 Romain Geissler + + PR python/26832 + * configure: Regenerate. + * configure.ac: Check for python modules ctypes instead of + itertools. + 2020-10-24 Joel Brobecker * version.in: Set GDB version number to 10.1.90.DATE-git. diff --git a/gdb/configure b/gdb/configure index e7811e807a6..03464ae50a2 100755 --- a/gdb/configure +++ b/gdb/configure @@ -16159,7 +16159,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; ; diff --git a/gdb/configure.ac b/gdb/configure.ac index 620ae23e343..f05052cf901 100644 --- a/gdb/configure.ac +++ b/gdb/configure.ac @@ -1599,7 +1599,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])