blob: dfacba29a01e42e9c12debd852b5f0401e92eeaa [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001inherit cross-canadian
Patrick Williamsc0f7c042017-02-23 20:41:17 -06002inherit python3-dir
Andrew Geissler5199d832021-09-24 16:47:35 -05003inherit pkgconfig
Patrick Williamsc124f4f2015-09-15 14:41:29 -05004
5SUMMARY = "GNU debugger (cross-canadian gdb for ${TARGET_ARCH} target)"
6PN = "gdb-cross-canadian-${TRANSLATED_TARGET_ARCH}"
7BPN = "gdb"
8
Patrick Williamsd8c66bc2016-06-20 12:57:21 -05009DEPENDS = "nativesdk-ncurses nativesdk-expat nativesdk-gettext \
Brad Bishop19323692019-04-05 15:28:33 -040010 virtual/${HOST_PREFIX}gcc-crosssdk virtual/${HOST_PREFIX}binutils-crosssdk virtual/nativesdk-libc"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050011
12GDBPROPREFIX = "--program-prefix='${TARGET_PREFIX}'"
13
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050014# Overrides PACKAGECONFIG variables in gdb-common.inc
Andrew Geissler09036742021-06-25 14:25:14 -050015PACKAGECONFIG ??= "python readline ${@bb.utils.filter('DISTRO_FEATURES', 'debuginfod', d)}"
Patrick Williamsc0f7c042017-02-23 20:41:17 -060016PACKAGECONFIG[python] = "--with-python=${WORKDIR}/python,--without-python,nativesdk-python3, \
Brad Bishop316dfdd2018-06-25 12:45:53 -040017 nativesdk-python3-core \
Brad Bishop37a0e4d2017-12-04 01:01:44 -050018 nativesdk-python3-codecs nativesdk-python3-netclient \
Brad Bishop316dfdd2018-06-25 12:45:53 -040019 "
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050020PACKAGECONFIG[readline] = "--with-system-readline,--without-system-readline,nativesdk-readline"
Andrew Geissler09036742021-06-25 14:25:14 -050021PACKAGECONFIG[debuginfod] = "--with-debuginfod, --without-debuginfod, nativesdk-elfutils"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050022
23SSTATE_DUPWHITELIST += "${STAGING_DATADIR}/gdb"
24
Patrick Williams213cb262021-08-07 19:21:33 -050025do_configure:prepend() {
Patrick Williamsc124f4f2015-09-15 14:41:29 -050026cat > ${WORKDIR}/python << EOF
27#! /bin/sh
28case "\$2" in
Patrick Williamsc0f7c042017-02-23 20:41:17 -060029 --includes) echo "-I${STAGING_INCDIR}/${PYTHON_DIR}${PYTHON_ABI}/" ;;
30 --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 -050031 --exec-prefix) echo "${exec_prefix}" ;;
32 *) exit 1 ;;
33esac
34exit 0
35EOF
36 chmod +x ${WORKDIR}/python
37}
38
39# we don't want gdb to provide bfd/iberty/opcodes, which instead will override the
40# right bits installed by binutils.
Patrick Williams213cb262021-08-07 19:21:33 -050041do_install:append() {
Patrick Williamsc124f4f2015-09-15 14:41:29 -050042 rm -rf ${D}${exec_prefix}/lib
43 cross_canadian_bindirlinks
44}