blob: c9daf25a41715794d43edfae7559f7286c92828e [file] [log] [blame]
Andrew Geissleraaf90cd2021-02-12 15:29:51 -06001inherit cross-canadian
2inherit python3-dir
3
4SUMMARY = "GNU debugger (cross-canadian gdb for ${TARGET_ARCH} target)"
5PN = "gdb-cross-canadian-${TRANSLATED_TARGET_ARCH}"
6BPN = "gdb"
7
8DEPENDS = "nativesdk-ncurses nativesdk-expat nativesdk-gettext \
9 virtual/${HOST_PREFIX}gcc-crosssdk virtual/${HOST_PREFIX}binutils-crosssdk virtual/nativesdk-libc"
10
11GDBPROPREFIX = "--program-prefix='${TARGET_PREFIX}'"
12
13# Overrides PACKAGECONFIG variables in gdb-common.inc
14PACKAGECONFIG ??= "python readline"
15PACKAGECONFIG[python] = "--with-python=${WORKDIR}/python,--without-python,nativesdk-python3, \
16 nativesdk-python3-core \
17 nativesdk-python3-codecs nativesdk-python3-netclient \
18 "
19PACKAGECONFIG[readline] = "--with-system-readline,--without-system-readline,nativesdk-readline"
20
21SSTATE_DUPWHITELIST += "${STAGING_DATADIR}/gdb"
22
23do_configure_prepend() {
24cat > ${WORKDIR}/python << EOF
25#! /bin/sh
26case "\$2" in
27 --includes) echo "-I${STAGING_INCDIR}/${PYTHON_DIR}${PYTHON_ABI}/" ;;
28 --ldflags) echo "-Wl,-rpath-link,${STAGING_LIBDIR}/.. -Wl,-rpath,${libdir}/.. -lpthread -ldl -lutil -lm -lpython${PYTHON_BASEVERSION}${PYTHON_ABI}" ;;
29 --exec-prefix) echo "${exec_prefix}" ;;
30 *) exit 1 ;;
31esac
32exit 0
33EOF
34 chmod +x ${WORKDIR}/python
35}
36
37# we don't want gdb to provide bfd/iberty/opcodes, which instead will override the
38# right bits installed by binutils.
39do_install_append() {
40 rm -rf ${D}${exec_prefix}/lib
41 cross_canadian_bindirlinks
42}