blob: edb05b6f1803d06a6ff857bcbdd074304beffbc5 [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001inherit cross-canadian
Patrick Williamsc0f7c042017-02-23 20:41:17 -06002inherit python3-dir
Patrick Williamsc124f4f2015-09-15 14:41:29 -05003
4SUMMARY = "GNU debugger (cross-canadian gdb for ${TARGET_ARCH} target)"
5PN = "gdb-cross-canadian-${TRANSLATED_TARGET_ARCH}"
6BPN = "gdb"
7
Patrick Williamsd8c66bc2016-06-20 12:57:21 -05008DEPENDS = "nativesdk-ncurses nativesdk-expat nativesdk-gettext \
Brad Bishop19323692019-04-05 15:28:33 -04009 virtual/${HOST_PREFIX}gcc-crosssdk virtual/${HOST_PREFIX}binutils-crosssdk virtual/nativesdk-libc"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050010
11GDBPROPREFIX = "--program-prefix='${TARGET_PREFIX}'"
12
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050013# Overrides PACKAGECONFIG variables in gdb-common.inc
Andrew Geissler09036742021-06-25 14:25:14 -050014PACKAGECONFIG ??= "python readline ${@bb.utils.filter('DISTRO_FEATURES', 'debuginfod', d)}"
Patrick Williamsc0f7c042017-02-23 20:41:17 -060015PACKAGECONFIG[python] = "--with-python=${WORKDIR}/python,--without-python,nativesdk-python3, \
Brad Bishop316dfdd2018-06-25 12:45:53 -040016 nativesdk-python3-core \
Brad Bishop37a0e4d2017-12-04 01:01:44 -050017 nativesdk-python3-codecs nativesdk-python3-netclient \
Brad Bishop316dfdd2018-06-25 12:45:53 -040018 "
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050019PACKAGECONFIG[readline] = "--with-system-readline,--without-system-readline,nativesdk-readline"
Andrew Geissler09036742021-06-25 14:25:14 -050020PACKAGECONFIG[debuginfod] = "--with-debuginfod, --without-debuginfod, nativesdk-elfutils"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050021
22SSTATE_DUPWHITELIST += "${STAGING_DATADIR}/gdb"
23
24do_configure_prepend() {
25cat > ${WORKDIR}/python << EOF
26#! /bin/sh
27case "\$2" in
Patrick Williamsc0f7c042017-02-23 20:41:17 -060028 --includes) echo "-I${STAGING_INCDIR}/${PYTHON_DIR}${PYTHON_ABI}/" ;;
29 --ldflags) echo "-Wl,-rpath-link,${STAGING_LIBDIR}/.. -Wl,-rpath,${libdir}/.. -lpthread -ldl -lutil -lm -lpython${PYTHON_BASEVERSION}${PYTHON_ABI}" ;;
Patrick Williamsc124f4f2015-09-15 14:41:29 -050030 --exec-prefix) echo "${exec_prefix}" ;;
31 *) exit 1 ;;
32esac
33exit 0
34EOF
35 chmod +x ${WORKDIR}/python
36}
37
38# we don't want gdb to provide bfd/iberty/opcodes, which instead will override the
39# right bits installed by binutils.
40do_install_append() {
41 rm -rf ${D}${exec_prefix}/lib
42 cross_canadian_bindirlinks
43}