aboutsummaryrefslogtreecommitdiffstats
path: root/devel/gdb6/Makefile
blob: 2ee5c8f73757182f6d3f3a532b54aa8d36587fb9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# ex:ts=8
# Ports collection makefile for:    GDB 6
# Date created:             30 March 2001
# Whom:                 David O'Brien <obrien@NUXI.com>
#
# $FreeBSD$
#

PORTNAME=   gdb
PORTVERSION=    6.6
PORTREVISION=   1
CATEGORIES= devel
MASTER_SITES=   ${MASTER_SITE_GNU:S,$,:gdb,}    \
        http://aldan.algebra.com/~mi/:gdbtk
MASTER_SITE_SUBDIR=gdb/:gdb
DISTFILES=  ${PORTNAME}-${PORTVERSION}${EXTRACT_SUFX}:gdb

MAINTAINER= mi@aldan.algebra.com
COMMENT=    GNU GDB of newer version than comes with the system

OPTIONS=    INSIGHT "Build the Tcl/Tk GUI (experimental!)" off

USE_BZIP2=  yes
USE_GMAKE=  yes
USE_GETTEXT=    yes
USE_ICONV=  yes
GNU_CONFIGURE=  yes
CONFIGURE_ENV+= CONFIGURED_M4=m4 CONFIGURED_BISON=byacc
CONFIGURE_ARGS= --program-suffix=${PORTVERSION:S/.//g} \
        --enable-target=all \
        --enable-tui --with-libiconv-prefix=${LOCALBASE}
CFLAGS:=    ${CFLAGS:C/ +$//}   # blanks at EOL creep in sometimes
CFLAGS+=    -DRL_NO_COMPAT
EXCLUDE=    dejagnu expect readline sim texinfo intl
EXTRACT_AFTER_ARGS=| ${TAR} -xf - ${EXCLUDE:S/^/--exclude /}
VER=    ${PORTVERSION:S/.//}
PLIST_SUB=  VER=${VER}
MAN1=   gdb${VER}.1

#ONLY_FOR_ARCHS=    i386 amd64  # untested elsewhere, might work

.include <bsd.port.pre.mk>

.if defined(WITH_INSIGHT)
LIB_DEPENDS=    itk:${PORTSDIR}/x11-toolkits/itk
RUN_DEPENDS=    ${LOCALBASE}/lib/iwidgets:${PORTSDIR}/x11-toolkits/iwidgets
DISTFILES+= gdbtk-6.6${EXTRACT_SUFX}:gdbtk
PLIST_SUB+= INSIGHT=''
EXTRA_PATCHES=  ${FILESDIR}/itcl33-patch
CONFIGURE_ARGS+=--enable-gdbtk \
        --with-tclconfig=${LOCALBASE}/lib/tcl8.4 \
        --with-tclinclude=${LOCALBASE}/include/tcl8.4/generic \
        --with-tkconfig=${LOCALBASE}/lib/tk8.4 \
        --with-tkinclude=${LOCALBASE}/include/tk8.4/generic \
        --with-itclconfig=${LOCALBASE}/lib/itcl3.3 \
        --with-itkconfig=${LOCALBASE}/lib/itk3.3

pre-everything::
    #
    # The Tk-based GUI (Insight) is patched to work with [incr tcl]
    # version 3.3 and is currently experimental. Bug reports should
    # be accompanied by patches.
    #

pre-configure:
    ${MKDIR} ${WRKSRC}/itcl/generic
    ${LN} -s ${LOCALBASE}/include/it*3.3/*.h ${WRKSRC}/itcl/generic/
.else
PLIST_SUB+= INSIGHT='@comment '
.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
    @${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

do-install:
    ${INSTALL_PROGRAM} ${WRKSRC}/gdb/gdb ${PREFIX}/bin/gdb${VER}
    ${LN} ${PREFIX}/bin/gdb${VER} ${PREFIX}/bin/gdbtui${VER}
    ${INSTALL_MAN} ${WRKSRC}/gdb/gdb.1 ${MAN1PREFIX}/man/man1/gdb${VER}.1
.if defined(WITH_INSIGHT)
    ${LN} ${PREFIX}/bin/gdb${VER} ${PREFIX}/bin/insight
    ${MKDIR} ${PREFIX}/share/redhat/gui
    ${CP} -p ${WRKSRC}/libgui/library/*.tcl \
        ${WRKSRC}/libgui/library/tclIndex \
            ${PREFIX}/share/redhat/gui/
    ${MKDIR} ${PREFIX}/lib/insight1.0
    ${CP} -Rp ${WRKSRC}/gdb/gdbtk/library/*.tcl \
        ${WRKSRC}/gdb/gdbtk/library/*.itcl  \
        ${WRKSRC}/gdb/gdbtk/library/*.ith   \
        ${WRKSRC}/gdb/gdbtk/library/*.itb   \
        ${WRKSRC}/gdb/gdbtk/library/help    \
        ${WRKSRC}/gdb/gdbtk/library/images* \
        ${WRKSRC}/gdb/gdbtk/library/tclIndex    \
            ${PREFIX}/lib/insight1.0
.endif

.include <bsd.port.post.mk>