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:01:47 +0000 (18:01 +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 b846426f89e3e1b4d0e4d7aef3d408e6af649a51..93de188b6c5905e413e9ffdbde4e443ddcb04d33 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-11-06  Pedro Alves  <pedro@palves.net>
 
        * macroexp.c (struct macro_buffer): Split in two classes.  Add
index aa89158d06d39affb2cf33fe786233eb3eb1b1c2..4a03cd9c3ec35e988d146fadad265e52faf6c94b 100755 (executable)
@@ -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;
   ;
index bfc053ed096942678028065079d93c8d7dd691b9..1b9548eef3a32d6833c8951bd315687a168bce3c 100644 (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])
This page took 0.0864 seconds and 4 git commands to generate.