]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb: better static python detection in configure machinery
authorRomain Geissler <romain.geissler@amadeus.com>
Fri, 6 Nov 2020 17:47:21 +0000 (17:47 +0000)
committerAndrew Burgess <andrew.burgess@embecosm.com>
Fri, 6 Nov 2020 18:02:24 +0000 (18:02 +0000)
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.

gdb/ChangeLog
gdb/configure
gdb/configure.ac

index 080895cb1a8fc2b08ce0a90bf33ad5e425c5503a..3e7f5675fe1c8e2f3e121f648c14acc8578c3bfd 100644 (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-10-24  Joel Brobecker  <brobecker@adacore.com>
 
        * version.in: Set GDB version number to 10.1.90.DATE-git.
index e7811e807a6b42db1b28f46bdf43afb321f0ae05..03464ae50a2d3c9cb83b271a658ef6b22e22cf6b 100755 (executable)
@@ -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;
   ;
index 620ae23e3435a60861d8ea5c17f8a90e809b5ed4..f05052cf90151025b62e6285cbd898995ab7aad6 100644 (file)
@@ -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])