1inherit cross-canadian
2inherit python3-dir
3inherit pkgconfig
4
5SUMMARY = "GNU debugger (cross-canadian gdb for ${TARGET_ARCH} target)"
6PN = "gdb-cross-canadian-${TRANSLATED_TARGET_ARCH}"
7BPN = "gdb"
8
9DEPENDS = "nativesdk-ncurses nativesdk-expat nativesdk-gettext nativesdk-gmp nativesdk-mpfr \
10           virtual/${HOST_PREFIX}gcc virtual/${HOST_PREFIX}binutils virtual/nativesdk-libc"
11
12GDBPROPREFIX = "--program-prefix='${TARGET_PREFIX}'"
13
14# Overrides PACKAGECONFIG variables in gdb-common.inc
15PACKAGECONFIG ??= "python readline ${@bb.utils.filter('DISTRO_FEATURES', 'debuginfod', d)}"
16PACKAGECONFIG[python] = "--with-python=${WORKDIR}/python,--without-python,nativesdk-python3, \
17                         nativesdk-python3-core \
18                         nativesdk-python3-codecs nativesdk-python3-netclient \
19                         "
20PACKAGECONFIG[readline] = "--with-system-readline,--without-system-readline,nativesdk-readline"
21PACKAGECONFIG[debuginfod] = "--with-debuginfod, --without-debuginfod, nativesdk-elfutils"
22
23SSTATE_ALLOW_OVERLAP_FILES += "${STAGING_DATADIR}/gdb"
24
25do_configure:prepend() {
26cat > ${WORKDIR}/python << EOF
27#! /bin/sh
28case "\$2" in
29        --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}" ;;
31        --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.
41do_install:append() {
42	rm -rf ${D}${exec_prefix}/lib
43	cross_canadian_bindirlinks
44}
45