Patchwork [PATCHv2,3/5] gdb-cross-canadian: build gdb with python support

login
register
mail settings
Submitter Martin Jansa
Date Feb. 26, 2012, 7:49 a.m.
Message ID <4f9ef690b7dcf5931be1f20c4257283eb9a9a0ce.1330242184.git.Martin.Jansa@gmail.com>
Download mbox | patch
Permalink /patch/22057/
State Accepted
Commit 73a90b88541c373aa5b83a939dd3b5f1fe05b9b8
Headers show

Comments

Martin Jansa - Feb. 26, 2012, 7:49 a.m.
From: Eric BENARD <eric@eukrea.com>

* python support is needed for providing finer scripting control
in gdb, and for remote controling gdb for example from qtcreator
* gdb/configure tries to autodetect python using python executable
with --includes --ldflags --exec-prefix to get the right flags
As it's difficult to achieve in OE's context, we generate a
script which will return the right values and make gdb's build
system happy. This idea was taken from the following article :
http://www.mentby.com/doug-evans-2/python-enabled-gdb-on-windows-and-relocation.html
* tested using angstrom & armv7 target & qtcreator 201005 & 2.4.0

* MJ: updated paths to python as disscussed here
  http://lists.linuxtogo.org/pipermail/openembedded-core/2012-February/018222.html
  now it's easier with cross-canadian staging dir and SDKPATH fixed :)

Signed-off-by: Eric BĂ©nard <eric@eukrea.com>
Cc: fcooper@ti.com
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
 meta/recipes-devtools/gdb/gdb-cross-canadian.inc   |   20 +++++++++++++++++++-
 .../recipes-devtools/gdb/gdb-cross-canadian_7.4.bb |    2 +-
 2 files changed, 20 insertions(+), 2 deletions(-)

Patch

diff --git a/meta/recipes-devtools/gdb/gdb-cross-canadian.inc b/meta/recipes-devtools/gdb/gdb-cross-canadian.inc
index ec0748e..a7cac61 100644
--- a/meta/recipes-devtools/gdb/gdb-cross-canadian.inc
+++ b/meta/recipes-devtools/gdb/gdb-cross-canadian.inc
@@ -4,4 +4,22 @@  DESCRIPTION = "cross-canadian gdb for ${TARGET_ARCH} target - GNU debugger"
 PN = "gdb-cross-canadian-${TRANSLATED_TARGET_ARCH}"
 BPN = "gdb"
 
-DEPENDS = "ncurses-nativesdk expat-nativesdk gettext-nativesdk readline-nativesdk"
+DEPENDS = "ncurses-nativesdk expat-nativesdk gettext-nativesdk readline-nativesdk python-nativesdk"
+RDEPENDS += "python-nativesdk-core python-nativesdk-lang python-nativesdk-re \
+             python-nativesdk-codecs python-nativesdk-netclient"
+
+EXTRA_OECONF_append = "--with-python=${WORKDIR}/python"
+
+do_configure_prepend() {
+cat > ${WORKDIR}/python << EOF
+#! /bin/sh
+case "\$2" in
+        --includes) echo "-I${STAGING_INCDIR}/python${PYTHON_BASEVERSION}/" ;;
+        --ldflags) echo "-L${STAGING_LIBDIR}/../python${PYTHON_BASEVERSION}/config -lpthread -ldl -lutil -lm -lpython${PYTHON_BASEVERSION}" ;;
+        --exec-prefix) echo "/usr" ;;
+        *) exit 1 ;;
+esac
+exit 0
+EOF
+        chmod +x ${WORKDIR}/python
+}
diff --git a/meta/recipes-devtools/gdb/gdb-cross-canadian_7.4.bb b/meta/recipes-devtools/gdb/gdb-cross-canadian_7.4.bb
index a4714e7..dbcffde 100644
--- a/meta/recipes-devtools/gdb/gdb-cross-canadian_7.4.bb
+++ b/meta/recipes-devtools/gdb/gdb-cross-canadian_7.4.bb
@@ -1,7 +1,7 @@ 
 require gdb-common.inc
 require gdb-cross-canadian.inc
 
-PR = "${INC_PR}.1"
+PR = "${INC_PR}.3"
 
 GDBPROPREFIX = "--program-prefix='${TARGET_PREFIX}'"
 EXPAT = "--with-expat"