freebsd-ports/devel/gdb/Makefile
John Baldwin 756b49d46f Various fixes to kgdb. Port revision bumped since kgdb is enabled by
default.
- kgdb -n now permits any valid string to be used instead of only
  permitting numbers.  In particular, this allows 'kgdb -n last' to be
  used to open the most recent vmcore.
- kgdb will now try to determine the list of kernel modules even if the
  kernel binary does not include debug symbols.  This works fine in kernels
  that have the changes in r290728.
- Mark trapframes as "signal trampoline frames".  GDB assumes that "normal"
  frames will never call into a NULL PC.  Instead, it assumes that calling a
  NULL PC will result in an exception (and thus a signal being posted
  resulting in a signal frame).  A trap for a NULL function pointer would
  thus stop unwinding once it hit the frame with a NULL PC.  Marking the
  trapframes as a signal frame tells GDB it is ok to unwind past a NULL PC.
  One side effect is that frames in the asm handler now display as "signal
  handler called" instead of the raw line in assembly.  Perhaps at some
  point it would be nice to mark these up the way ddb does with the trap
  number, etc. but GDB's stack code doesn't support custom frame printers.

PR:		206044
Reviewed by:	luca.pizzamiglio@gmail.com (maintainer)
Approved by:	koobs
2016-01-11 17:36:13 +00:00

131 lines
3.9 KiB
Makefile

# Created by: Steven Kreuzer <skreuzer@FreeBSD.org>
# $FreeBSD$
PORTNAME= gdb
PORTVERSION= 7.10
PORTREVISION= 5
CATEGORIES= devel
MASTER_SITES= GNU
MAINTAINER= luca.pizzamiglio@gmail.com
COMMENT= GNU GDB of newer version than comes with the system
LICENSE= GPLv3
TEST_DEPENDS= runtest:${PORTSDIR}/misc/dejagnu
TEST_TARGET= check
USES= cpe iconv gmake libtool tar:xz
USE_CSTD= gnu89
CPE_VENDOR= gnu
GNU_CONFIGURE= yes
CONFIGURE_ENV= CONFIGURED_M4=m4 CONFIGURED_BISON=byacc
CONFIGURE_ARGS= --program-suffix=${PORTVERSION:S/.//g} \
--enable-targets=all --enable-64-bit-bfd \
--with-gdb-datadir=${PREFIX}/share/gdb${PORTVERSION:S/.//g} \
--with-separate-debug-dir=/usr/lib/debug \
${ICONV_CONFIGURE_ARG} \
--without-libunwind-ia64
CFLAGS:= ${CFLAGS:C/ +$//} # blanks at EOL creep in sometimes
CFLAGS+= -DRL_NO_COMPAT -Wno-unused-function -Wno-unused-variable
EXCLUDE= dejagnu expect sim texinfo intl
EXTRACT_AFTER_ARGS= ${EXCLUDE:S/^/--exclude /}
VER= ${PORTVERSION:S/.//g}
PLIST_SUB= VER=${VER}
ONLY_FOR_ARCHS= i386 amd64 powerpc powerpc64 # untested elsewhere, might work
OPTIONS_DEFINE= DEBUG EXPAT GDB_LINK GUILE KGDB PYTHON THREADS TUI
OPTIONS_DEFAULT= GDB_LINK KGDB THREADS TUI PORT_READLINE
OPTIONS_SINGLE= READLINE
OPTIONS_SINGLE_READLINE= BASE_READLINE BUNDLED_READLINE PORT_READLINE
GDB_LINK_DESC= Create ${PREFIX}/bin/gdb symlink
KGDB_DESC= Kernel Debugging Support
BASE_READLINE_DESC= from base system (experimental)
BUNDLED_READLINE_DESC= from gdb distfile
PORT_READLINE_DESC= from devel/readline port
TUI_DESC= Text User Interface enabled
OPTIONS_SUB= yes
BASE_READLINE_USES= readline
BASE_READLINE_CFLAGS= -D_rl_echoing_p=readline_echoing_p
BUNDLED_READLINE_CONFIGURE_OFF= --with-system-readline
DEBUG_CFLAGS= -g
EXPAT_CONFIGURE_WITH= expat
EXPAT_LIB_DEPENDS= libexpat.so:${PORTSDIR}/textproc/expat2
GUILE_CONFIGURE_WITH= guile
GUILE_USES= pkgconfig
GUILE_LIB_DEPENDS= libguile-2.0.so:${PORTSDIR}/lang/guile2
PORT_READLINE_USES= readline:port
PYTHON_CONFIGURE_ON= --with-python=${PYTHON_CMD}
PYTHON_CONFIGURE_OFF= --without-python
PYTHON_USES= python:2
TUI_CONFIGURE_ENABLE= tui
.include <bsd.port.options.mk>
.if ! ${PORT_OPTIONS:MBUNDLED_READLINE}
EXCLUDE+= readline
.endif
.if ${ARCH} == "amd64"
CONFIGURE_TARGET= x86_64-portbld-freebsd${OSREL}
.endif
post-patch:
@${REINPLACE_CMD} -e 's|$$| [GDB v${PORTVERSION} for FreeBSD]|' \
${WRKSRC}/gdb/version.in
.if ${PORT_OPTIONS:MTHREADS}
@${CP} ${FILESDIR}/fbsd-threads.c ${WRKSRC}/gdb/
@${PATCH} ${PATCH_ARGS} < ${FILESDIR}/extrapatch-threads
.endif
.if ${PORT_OPTIONS:MKGDB}
@${CP} -r ${FILESDIR}/kgdb/*.[ch] ${WRKSRC}/gdb/
@${PATCH} ${PATCH_ARGS} < ${FILESDIR}/extrapatch-kgdb
.if ${PORT_OPTIONS:MTHREADS}
@${PATCH} ${PATCH_ARGS} < \
${FILESDIR}/extrapatch-kgdb-configure.tgt-threads
.else
@${PATCH} ${PATCH_ARGS} < \
${FILESDIR}/extrapatch-kgdb-configure.tgt-plain
.endif
.endif
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/gdb/gdb \
${STAGEDIR}${PREFIX}/bin/gdb${VER}
${INSTALL_MAN} ${WRKSRC}/gdb/doc/gdb.1 \
${STAGEDIR}${MAN1PREFIX}/man/man1/gdb${VER}.1
do-install-KGDB-on:
${INSTALL_PROGRAM} ${WRKSRC}/gdb/kgdb \
${STAGEDIR}${PREFIX}/bin/kgdb${VER}
do-install-TUI-on:
${LN} -sf gdb${VER} ${STAGEDIR}${PREFIX}/bin/gdbtui${VER}
do-install-GDB_LINK-on:
${LN} -sf gdb${VER} ${STAGEDIR}${PREFIX}/bin/gdb
.if ${PORT_OPTIONS:MKGDB}
${LN} -sf kgdb${VER} ${STAGEDIR}${PREFIX}/bin/kgdb
.endif
do-install-PYTHON-on:
(cd ${WRKSRC}/gdb; ${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_ARGS} install-python )
(cd ${WRKSRC}/gdb/data-directory ; \
${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_ARGS} install-python )
. for f in gdb gdb/command gdb/function
@(cd ${STAGEDIR}${PREFIX}/share/gdb${VER}/python/${f} ; ${CHMOD} 644 *.py* )
. endfor
do-install-GUILE-on:
(cd ${WRKSRC}/gdb; ${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_ARGS} install-guile )
(cd ${WRKSRC}/gdb/data-directory ; \
${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_ARGS} install-guile )
.include <bsd.port.mk>