diff options
author | Romain Geissler <romain.geissler@amadeus.com> | 2020-11-06 17:47:21 +0000 |
---|---|---|
committer | Andrew Burgess <andrew.burgess@embecosm.com> | 2020-11-06 18:01:47 +0000 |
commit | 3fed4c0b7adeae7b2bfd9aa59818bb8f3f381031 (patch) | |
tree | fc2e22cedade6047b56e972929eff54105c46a68 | |
parent | ac3d4064096ecd4b012e5db91b1530df5cb4a7cc (diff) | |
download | gdb-3fed4c0b7adeae7b2bfd9aa59818bb8f3f381031.zip gdb-3fed4c0b7adeae7b2bfd9aa59818bb8f3f381031.tar.gz gdb-3fed4c0b7adeae7b2bfd9aa59818bb8f3f381031.tar.bz2 |
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.
-rw-r--r-- | gdb/ChangeLog | 7 | ||||
-rwxr-xr-x | gdb/configure | 2 | ||||
-rw-r--r-- | gdb/configure.ac | 2 |
3 files changed, 9 insertions, 2 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index b846426..93de188 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -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 diff --git a/gdb/configure b/gdb/configure index aa89158..4a03cd9 100755 --- a/gdb/configure +++ b/gdb/configure @@ -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; ; diff --git a/gdb/configure.ac b/gdb/configure.ac index bfc053e..1b9548e 100644 --- a/gdb/configure.ac +++ b/gdb/configure.ac @@ -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]) |