@@ -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/"