aboutsummaryrefslogtreecommitdiffstats
path: root/lang/gcc27/Makefile
blob: d9b9d48bd0720047b5d5ab6979189049a05c3293 (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
# ex:ts=8
# Ports collection makefile for:    gcc
# Date created:             17 Jan 1998
# Whom:                 David O'Brien <obrien@NUXI.com>
#
# $FreeBSD$
#

PORTNAME=   gcc
PORTVERSION=    2.7.2.3
CATEGORIES= lang
MASTER_SITES=   ${MASTER_SITE_GNU}  \
        ftp://ftp.gnu.org/gnu/libg++/  \
        ftp://ftp.duke.edu/pub/gnu/libg++/  \
        ftp://ftp.net.ohio-state.edu/disk/c/gnu/gnu-0.2/src/
MASTER_SITE_SUBDIR= gcc
DISTFILES=  ${DISTNAME}${EXTRACT_SUFX} libg++-2.7.2${EXTRACT_SUFX}

MAINTAINER= obrien@FreeBSD.org

NO_CDROM=   'old version, not worth the cost in real estate'

.include <bsd.port.pre.mk>

GCC_VER=    2.7.2.3
CONFIGURE_TARGET=   ${ARCH}-portbld-freebsd${OSREL}
PLIST_SUB=  GNUHOST=${CONFIGURE_TARGET} GCC_VER=${GCC_VER}
CONFIGURE_ARGS= --with-gnu-as --with-gnu-ld --with-stabs  \
        --with-gxx-include-dir=${PREFIX}/lib/gcc-lib/${CONFIGURE_TARGET}/${GCC_VER}/include/g++
GNU_CONFIGURE=  yes
USE_GMAKE=  yes
ALL_TARGET= bootstrap
MAN1=       cccp27.1 g++27.1 gcc27.1

pre-fetch:
    @${ECHO} "GCC ${DISTNAME:S/^gcc-//} for ${OPSYS} ${OSREL} ${PORTOBJFORMAT}"

pre-patch:
    @${MV} ${WRKSRC}/config/i386/freebsd.h ${WRKSRC}/config/i386/freebsd-aout.h

pre-configure:
    @(MAJ=`sysctl -n kern.osreldate | ${SED} -e '/.....$$/s///'` ; \
    ${SED} -e "s:__FreeBSD__[0-9=]*:__FreeBSD__=$${MAJ}:" ${FILESDIR}/freebsd.h.${ARCH} \
        >${WRKSRC}/config/${ARCH}/freebsd.h )

XGCC=   "${WRKSRC}/stage2/xgcc -B${WRKSRC}/stage2/"
post-build:
    cd ${WRKDIR}/libg++-2.7.2 ; env CC=${XGCC} CXX=${XGCC} ./configure ${CONFIGURE_ARGS}
    cd ${WRKDIR}/libg++-2.7.2 ; ${SETENV} ${MAKE_ENV} ${GMAKE} CC=${XGCC} CXX=${XGCC}

post-install:
    cd ${WRKDIR}/libg++-2.7.2 ; ${SETENV} ${MAKE_ENV} ${GMAKE} CC=${XGCC} CXX=${XGCC} install
    @${RM} -f ${PREFIX}/bin/c++ \
        ${PREFIX}/bin/genclass ${PREFIX}/bin/gperf  \
        ${PREFIX}/bin/protoize ${PREFIX}/bin/unprotoize  \
        ${PREFIX}/man/man1/gperf.1 ${PREFIX}/man/man1/configure.1
    @${RM} -rf ${PREFIX}/bin/c++ ${PREFIX}/${CONFIGURE_TARGET}
    @(for prog in ${PREFIX}/bin/gcc ${PREFIX}/bin/g++ \
        ${PREFIX}/bin/${CONFIGURE_TARGET}-gcc \
        ${PREFIX}/lib/gcc-lib/${CONFIGURE_TARGET}/${GCC_VER}/cc1 \
        ${PREFIX}/lib/gcc-lib/${CONFIGURE_TARGET}/${GCC_VER}/cc1obj \
        ${PREFIX}/lib/gcc-lib/${CONFIGURE_TARGET}/${GCC_VER}/cc1plus \
        ${PREFIX}/lib/gcc-lib/${CONFIGURE_TARGET}/${GCC_VER}/cpp ; \
        do strip $$prog ; \
    done)
    @${MV} -f ${PREFIX}/bin/gcc ${PREFIX}/bin/gcc27
    @${MV} -f ${PREFIX}/bin/g++ ${PREFIX}/bin/g++27
    @${MV} ${PREFIX}/man/man1/cccp.1 ${PREFIX}/man/man1/cccp27.1
    @${MV} ${PREFIX}/man/man1/g++.1 ${PREFIX}/man/man1/g++27.1
    @${MV} ${PREFIX}/man/man1/gcc.1 ${PREFIX}/man/man1/gcc27.1
    @${RM} -rf ${PREFIX}/lib/gcc-lib/${CONFIGURE_TARGET}/${GCC_VER}/g++-include
    @${MV}  ${PREFIX}/lib/libg++.a ${PREFIX}/lib/libiberty.a  \
        ${PREFIX}/lib/libstdc++.a ${PREFIX}/lib/g++-include  \
            ${PREFIX}/lib/gcc-lib/${CONFIGURE_TARGET}/${GCC_VER}

.include <bsd.port.post.mk>