blob: e53081d0c0b060f239c0688b76870128c41546b5 [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 \
9 virtual/${HOST_PREFIX}gcc-crosssdk virtual/${HOST_PREFIX}binutils-crosssdk virtual/nativesdk-${HOST_PREFIX}libc-for-gcc"
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
14PACKAGECONFIG ??= "python readline"
Patrick Williamsc0f7c042017-02-23 20:41:17 -060015PACKAGECONFIG[python] = "--with-python=${WORKDIR}/python,--without-python,nativesdk-python3, \
16 nativesdk-python3-core nativesdk-python3-lang nativesdk-python3-re \
17 nativesdk-python3-codecs nativesdk-python3-netclient"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050018PACKAGECONFIG[readline] = "--with-system-readline,--without-system-readline,nativesdk-readline"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050019
20SSTATE_DUPWHITELIST += "${STAGING_DATADIR}/gdb"
21
22do_configure_prepend() {
23cat > ${WORKDIR}/python << EOF
24#! /bin/sh
25case "\$2" in
Patrick Williamsc0f7c042017-02-23 20:41:17 -060026 --includes) echo "-I${STAGING_INCDIR}/${PYTHON_DIR}${PYTHON_ABI}/" ;;
27 --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 -050028 --exec-prefix) echo "${exec_prefix}" ;;
29 *) exit 1 ;;
30esac
31exit 0
32EOF
33 chmod +x ${WORKDIR}/python
34}
35
36# we don't want gdb to provide bfd/iberty/opcodes, which instead will override the
37# right bits installed by binutils.
38do_install_append() {
39 rm -rf ${D}${exec_prefix}/lib
40 cross_canadian_bindirlinks
41}
42