package/gdb: enable python3 support
authorTitouan Christophe <titouan.christophe@railnova.eu>
Thu, 31 Dec 2020 09:53:12 +0000 (10:53 +0100)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Thu, 31 Dec 2020 13:44:04 +0000 (14:44 +0100)
gdb python support now uses Python3 if python3 is selected, otherwise
uses python(2) as before.

Signed-off-by: Titouan Christophe <titouan.christophe@railnova.eu>
[yann.morin.1998@free.fr: drop the gdb-python-config duplication]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
package/gdb/Config.in
package/gdb/gdb.mk

index 48ec3e0202ac0a1a59e66dbb002b802a93f4da1b..b1aa5e47d9a36560b585a5c8863353a5290b5ed5 100644 (file)
@@ -80,8 +80,7 @@ config BR2_PACKAGE_GDB_TUI
 
 config BR2_PACKAGE_GDB_PYTHON
        bool "Python support"
-       # Only Python 2.x is supported by gdb for now
-       depends on BR2_PACKAGE_PYTHON
+       depends on BR2_PACKAGE_PYTHON || BR2_PACKAGE_PYTHON3
        help
          This option enables Python support in the target gdb.
 
index e35ece01536e99b0a0c0cd14b08d3235870f0f79..b0d0b5fb19f93d0cd00dd4b83c592812736f6533 100644 (file)
@@ -194,11 +194,18 @@ GDB_CONF_OPTS += --disable-tui
 endif
 
 ifeq ($(BR2_PACKAGE_GDB_PYTHON),y)
+ifeq ($(BR2_PACKAGE_PYTHON3),y)
+# CONF_ENV: for top-level configure; MAKE_ENV: for sub-projects' configure.
+GDB_CONF_ENV += BR_PYTHON_VERSION=$(PYTHON3_VERSION_MAJOR)
+GDB_MAKE_ENV += BR_PYTHON_VERSION=$(PYTHON3_VERSION_MAJOR)
+GDB_DEPENDENCIES += python3
+else
 # CONF_ENV: for top-level configure; MAKE_ENV: for sub-projects' configure.
 GDB_CONF_ENV += BR_PYTHON_VERSION=$(PYTHON_VERSION_MAJOR)
 GDB_MAKE_ENV += BR_PYTHON_VERSION=$(PYTHON_VERSION_MAJOR)
-GDB_CONF_OPTS += --with-python=$(TOPDIR)/package/gdb/gdb-python-config
 GDB_DEPENDENCIES += python
+endif
+GDB_CONF_OPTS += --with-python=$(TOPDIR)/package/gdb/gdb-python-config
 else
 GDB_CONF_OPTS += --without-python
 endif