diff mbox

[5/6] gdb: Fixup dependencies and add USE_gdb_tui flag

Message ID 4bafc84f5af7e62b8f647cb5fd822d0b251cec23.1409312414.git.kibo@prevas.dk
State Under Review
Delegated to: Kim
Headers show

Commit Message

Kim Bøndergaard Aug. 29, 2014, 12:30 p.m. UTC
From: Esben Haabendal <esben.haabendal@prevas.dk>

Add USE_gdb_tui flag to enable gdb TUI support (curses based user
interface).  Default value is enabled on all platforms except mingw, where
it is disabled for now.  When pdcurses is added, it should also be enabled
by default for mingw.

Signed-off-by: Esben Haabendal <esben.haabendal@prevas.dk>
---
 recipes/gdb/gdb.inc | 32 ++++++++++++++++++++++++--------
 1 file changed, 24 insertions(+), 8 deletions(-)
diff mbox

Patch

diff --git a/recipes/gdb/gdb.inc b/recipes/gdb/gdb.inc
index ae5096b..d40dc56 100644
--- a/recipes/gdb/gdb.inc
+++ b/recipes/gdb/gdb.inc
@@ -4,8 +4,9 @@  LICENSE = "GPLv2 & GPLv3 & LGPLv2 & LGPLv3"
 
 RECIPE_TYPES = "machine canadian-cross"
 
-GDB_DEPENDS = "host:libexpat host:libtermcap \
-	host:libncurses host:libreadline host:libdl host:libm host:libc"
+GDB_DEPENDS = "host:libc host:libm ${DEPENDS_HOST_OS} host:libexpat host:libreadline"
+DEPENDS_HOST_OS = "host:libdl"
+DEPENDS_HOST_OS:HOST_LIBC_mingw = ""
 DEPENDS = "${GDB_DEPENDS}"
 RDEPENDS_${PN} = "${GDB_DEPENDS}"
 
@@ -14,17 +15,32 @@  inherit autotools auto-package-utils
 require conf/fetch/gnu.conf
 SRC_URI = "${GNU_MIRROR}/gdb/gdb-${PV}.tar.gz"
 
-EXTRA_OECONF = "--enable-tui --disable-gdbtk --disable-x --disable-werror \
+EXTRA_OECONF = "--disable-gdbtk --disable-x --disable-werror \
 	--disable-multilib --disable-sim \
-	--with-system-readline --with-curses --with-expat \
+	--with-system-readline --with-expat \
 	--without-lzma --without-python"
 
+RECIPE_FLAGS += "gdb_tui"
+DEFAULT_USE_gdb_tui = "1"
+DEFAULT_USE_gdb_tui:HOST_LIBC_mingw = "0"
+GDB_DEPENDS += "${DEPENDS_TUI}"
+DEPENDS_TERMCAP = "host:libtermcap"
+DEPENDS_TERMCAP:HOST_LIBC_mingw = ""
+DEPENDS_CURSES = "host:libncurses"
+DEPENDS_TERMCAP:HOST_LIBC_mingw = ""
+DEPENDS_TUI = "${DEPENDS_TERMCAP}"
+DEPENDS_TUI:USE_gdb_tui = "${DEPENDS_CURSES}"
+
+EXTRA_OECONF_TUI:USE_gdb_tui = "--enable-tui --with-curses"
+EXTRA_OECONF_TUI = "--disable-tui --without-curses"
+EXTRA_OECONF += "${EXTRA_OECONF_TUI}"
+
 AUTO_PACKAGE_UTILS = "gdb gdbserver gcore"
 AUTO_PACKAGE_UTILS:canadian-cross = "gdb"
-AUTO_PACKAGE_UTILS_DEPENDS += "host:libc host:libdl"
-AUTO_PACKAGE_UTILS_RDEPENDS += "host:libc host:libdl"
-RDEPENDS_${PN}-gdb += "host:libreadline host:libncurses host:libm host:libexpat"
-
+AUTO_PACKAGE_UTILS_DEPENDS += "host:libc ${DEPENDS_HOST_OS}"
+AUTO_PACKAGE_UTILS_RDEPENDS += "host:libc ${DEPENDS_HOST_OS}"
+RDEPENDS_${PN}-gdb += "host:libreadline host:libm host:libexpat"
+RDEPENDS_${PN}-gdb:>USE_gdb_tui = " host:libncurses"
 PACKAGES =+ "${PN}-python ${PN}-syscalls ${PN}-system-gdbinit"
 FILES_${PN}-python = "${datadir}/gdb/python/"
 FILES_${PN}-syscalls = "${datadir}/gdb/syscalls/"