Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 08 Nov 2010 22:23:33 +0300
From:      Anonymous <swell.k@gmail.com>
To:        Steven Kreuzer <skreuzer@freebsd.org>
Cc:        mi@aldan.algebra.com, freebsd-ports@freebsd.org
Subject:   Re: devel/gdb Port
Message-ID:  <86d3qf62mi.fsf@gmail.com>
References:  <0C4F959A-6AD4-414A-AEB0-C15F3BF245D6@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Steven Kreuzer <skreuzer@freebsd.org> writes:

> With the help of jhb@, I have a port of gdb 7.1 that has been modified
> to recognize freebsd threads. I would like to get this added to the
> ports tree but I would like some feedback as to how it should be
> added.
>
> Currently, the latest version of gdb in the ports tree is 6.6 and its
> under devel/gdb66. I was thinking of adding this as gdb71 but the
> latest version of the 7.x branch is 7.2 and someone already created a
> port for it (ports/151077) but it doesn't recognize threads.
>
> So, for the 7 branch, would it make sense to check in version 7.1 as
> devel/gdb7 and eventually update it to 7.2, or should it be checked in
> as devel/gdb71?
>
> shar file can be found at http://exit2shell.com/~skreuzer/patches/gdb71.shar

- fix build with devel/readline[*]
- explicitly disable xml/unwind/python support
- drop gettext dep, unused

Note, lang/gcc* (and lang/clang) searches in LOCALBASE by default unlike
gcc in base. Having it in *FLAGS by default reduces difference between
build using ports compiler and base one.

[*] http://docs.freebsd.org/cgi/mid.cgi?AANLkTinkwsFXpXE=CxcDjTGPVo3aa8EQ1_ve0h3NiB5E

%%
--- gdb71/Makefile
+++ gdb71/Makefile
@@ -17,15 +17,21 @@ COMMENT=	GNU GDB of newer version than comes with the system
 
 USE_BZIP2=	yes
 USE_GMAKE=	yes
-USE_GETTEXT=	yes
 USE_ICONV=	yes
 GNU_CONFIGURE=	yes
-CONFIGURE_ENV+=	CONFIGURED_M4=m4 CONFIGURED_BISON=byacc
+CONFIGURE_ENV+=	CONFIGURED_M4=m4 CONFIGURED_BISON=byacc LDFLAGS="${LDFLAGS}"
 CONFIGURE_ARGS=	--program-suffix=${PORTVERSION:S/.//g} \
+		--with-libiconv-prefix=${LOCALBASE} \
+		--with-system-readline \
+		--without-expat \
+		--without-libunwind \
+		--without-python \
 		--enable-target=all \
-		--enable-tui --with-libiconv-prefix=${LOCALBASE}
+		--enable-tui
 CFLAGS:=	${CFLAGS:C/ +$//}	# blanks at EOL creep in sometimes
+CFLAGS+=	-I${LOCALBASE}/include
 CFLAGS+=	-DRL_NO_COMPAT
+LDFLAGS+=	-L${LOCALBASE}/lib
 EXCLUDE=	dejagnu expect readline sim texinfo intl
 EXTRACT_AFTER_ARGS=| ${TAR} -xf - ${EXCLUDE:S/^/--exclude /}
 VER=	${PORTVERSION:S/.//}
@@ -36,6 +42,11 @@ ONLY_FOR_ARCHS=	i386 amd64	# untested elsewhere, might work
 
 .include <bsd.port.pre.mk>
 
+# XXX: add OSVERSION check after readline is removed from base
+.if exists(${LOCALBASE}/lib/libreadline.so)
+LIB_DEPENDS+=	readline.6:${PORTSDIR}/devel/readline
+.endif
+
 .if ${ARCH} == "amd64"
 CONFIGURE_TARGET=	x86_64-portbld-freebsd${OSREL}
 .endif
@@ -43,11 +54,6 @@ CONFIGURE_TARGET=	x86_64-portbld-freebsd${OSREL}
 post-patch:
 	@${REINPLACE_CMD} -e 's/$$/ [GDB v${PORTVERSION} for FreeBSD]/' \
 		${WRKSRC}/gdb/version.in
-	@${REINPLACE_CMD} -e 's/^READLINE/#READLINE/' \
-		-e 's/^readline/#readline/' \
-		-e 's,^LIBICONV =.*,LIBICONV=-L${LOCALBASE}/lib -liconv,' \
-		${WRKSRC}/gdb/Makefile.in
-	${ECHO} 'READLINE = -lreadline' >> ${WRKSRC}/gdb/Makefile.in
 	@${CP} ${FILESDIR}/fbsd-threads.c ${WRKSRC}/gdb
 
 do-install:
%%



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?86d3qf62mi.fsf>