aboutsummaryrefslogtreecommitdiffstats
path: root/devel/gccxml/Makefile
blob: 178b562a1a2f96e5d9fc381eb71371969fd4fc25 (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
# New ports collection makefile for:    gccxml
# Date created:         2003-07-16
# Whom:             Volker Stolz <stolz@i2.informatik.rwth-aachen.de>
#
# $FreeBSD$
#

PORTNAME=   gccxml
PORTVERSION=    0.6.0
CATEGORIES= devel
MASTER_SITES=   http://www.gccxml.org/files/v0.6/

MAINTAINER= vs@FreeBSD.org
COMMENT=    XML output extension to GCC

BUILD_DEPENDS=  cmake:${PORTSDIR}/devel/cmake

PATCH_WRKSRC=   ${WRKDIR}/${PORTNAME}-${PORTVERSION}
WRKSRC=     ${WRKDIR}/${PORTNAME}-build

MAN1=   gccxml.1

PLIST_SUB=  PORTVERSION=0.6

post-extract:
    ${MKDIR} ${WRKSRC}

do-configure:
    ${CP} ${TEMPLATES}/config.guess ${WRKSRC}/../gccxml-0.6.0/GCC/
    ${CP} ${TEMPLATES}/config.sub ${WRKSRC}/../gccxml-0.6.0/GCC/
    ${REINPLACE_CMD} -e "s,x86_64,amd64," \
        ${WRKSRC}/../gccxml-0.6.0/GCC/gcc/config.gcc
    cd ${WRKSRC} && \
    ${SETENV} ${CONFIGURE_ENV} \
    ${LOCALBASE}/bin/cmake ../${DISTNAME} -DCMAKE_INSTALL_PREFIX:PATH=${PREFIX} \
      -DGCCXML_MAN_DIR:PATH="/man"

.include <bsd.port.pre.mk>

.if ${ARCH} == "alpha"
BROKEN=     Build fails on alpha
.elif ${OSVERSION} >= 700042
# GCC-XML has some constructs that GCC 4.2 does not like. Namely,
# the use of casted-pointer-dereferences as an lvalue to post-increment
# operations.
USE_GCC= 3.4
CONFIGURE_ENV+= CC=${LOCALBASE}/bin/gcc34 \
        CPP="${CC} -E" \
        CXX=${LOCALBASE}/bin/g++34
MAKE_ENV+=  CC=${LOCALBASE}/bin/gcc34 \
        CPP="${CC} -E" \
        CXX=${LOCALBASE}/bin/g++34
.endif

.if ${OSVERSION} >= 700000
OSMAJOR=${OSREL:C|^([0-9]+)\..*|\1|}
GCC_CONFIG=${PATCH_WRKSRC}/GCC/gcc/config

post-patch:
    ${SED} -e "s,MAJOR 6,MAJOR ${OSMAJOR}," \
        ${GCC_CONFIG}/freebsd6.h > ${GCC_CONFIG}/freebsd${OSMAJOR}.h
    ${REINPLACE_CMD} -e "s,FBSD_MAJOR == 6,FBSD_MAJOR == ${OSMAJOR},g" \
             -e "s,__FreeBSD__=6,__FreeBSD__=${OSMAJOR},g" \
        ${GCC_CONFIG}/freebsd-spec.h
.endif

.include <bsd.port.post.mk>