summaryrefslogtreecommitdiff
path: root/devel/psptoolchain-gcc-stage1/Makefile
blob: e510bfb6830b996013c51c3aec79842774b6ba2f (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
# New ports collection makefile for: psptoolchain-gcc-stage1
# Date created:        19 July 2009
# Whom:                Tassilo Philipp <tphilipp@potion-studios.com>
#
# $FreeBSD$
#

PORTNAME=		gcc
PORTVERSION=		4.6.2
CATEGORIES=		devel
MASTER_SITES=		${MASTER_SITE_GCC}
MASTER_SITE_SUBDIR=	releases/${DISTNAME}/
PKGNAMEPREFIX=		psptoolchain-
PKGNAMESUFFIX?=		-stage1

MAINTAINER=		tphilipp@potion-studios.com
COMMENT=		PlayStation Portable development toolchain ${PORTNAME}

ONLY_FOR_ARCHS=		amd64 i386

PSP_GCC_STAGE_PREFIX=	psp/stage1

LIB_DEPENDS=		gmp.10:${PORTSDIR}/math/gmp \
			mpfr.4:${PORTSDIR}/math/mpfr \
			mpc.2:${PORTSDIR}/math/mpc

BUILD_DEPENDS+=		psp-addr2line:${PORTSDIR}/devel/psptoolchain-binutils \
			psp-ar:${PORTSDIR}/devel/psptoolchain-binutils \
			psp-as:${PORTSDIR}/devel/psptoolchain-binutils \
			psp-c++filt:${PORTSDIR}/devel/psptoolchain-binutils \
			psp-ld:${PORTSDIR}/devel/psptoolchain-binutils \
			psp-nm:${PORTSDIR}/devel/psptoolchain-binutils \
			psp-objcopy:${PORTSDIR}/devel/psptoolchain-binutils \
			psp-objdump:${PORTSDIR}/devel/psptoolchain-binutils \
			psp-ranlib:${PORTSDIR}/devel/psptoolchain-binutils \
			psp-readelf:${PORTSDIR}/devel/psptoolchain-binutils \
			psp-size:${PORTSDIR}/devel/psptoolchain-binutils \
			psp-strings:${PORTSDIR}/devel/psptoolchain-binutils \
			psp-strip:${PORTSDIR}/devel/psptoolchain-binutils

USE_BZIP2=		yes
USE_GMAKE=		yes

PATCH_WRKSRC=		${SRCDIR}
CONFIGURE_SCRIPT=	../${SRCDIR:S/${WRKDIR}\///}/configure

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

MAKE_ENV+=		PATH=${LOCALBASE}/${PSP_GCC_STAGE_PREFIX}/bin:${PREFIX}/bin:${PATH}
HAS_CONFIGURE=		yes
CONFIGURE_ARGS?=	--prefix=${PREFIX}/${PSP_GCC_STAGE_PREFIX} \
			--target="psp" \
			--enable-languages="c" \
			--enable-lto \
			--with-newlib \
			--with-gmp=${LOCALBASE} \
			--with-mpfr \
			--without-headers \
			--disable-libssp \
			--disable-nls \
			--with-ld=${LOCALBASE}/bin/psp-ld \
			--with-as=${LOCALBASE}/bin/psp-as \
			--mandir=${PREFIX}/man

pre-configure:
	@${MKDIR} ${CONFIGURE_WRKSRC}

# Don't install any documentation for psptoolchain's gcc stage 1 - makes no sense.
# Disable installation of .info files and libiberty for both stages.
post-patch:
	@${REINPLACE_CMD} -E "s/^(install-data-am:)(.*)install-info-am(.*)/\1 \2 \3/" \
		${SRCDIR}/libquadmath/Makefile.in
	@${REINPLACE_CMD} -E "s/^(install:)(.*)/\1#\2/" ${SRCDIR}/libiberty/Makefile.in
	@${REINPLACE_CMD} -E \
		-e "/^	\\$$\(mkinstalldirs\) \\$$\(DESTDIR\)\\$$\((infodir|man7dir)\)/d" \
		-e "s/^(install-info:)(.*)/\1#\2/" \
		-e "/^	\\$$\(DESTDIR\)\\$$\(man7dir\)\/(fsf-funding|gfdl|gpl)\\$$\(man7ext\)/d" \
		${SRCDIR}/gcc/Makefile.in
.if ${PKGNAMESUFFIX} == "-stage1"
	@${REINPLACE_CMD} -E "s/^(install-man:)(.*)/\1#\2/" ${SRCDIR}/gcc/Makefile.in
.endif

# Stage 2 installs (1) man pages.
.if ${PKGNAMESUFFIX} != "-stage1"

MAN1+=			psp-cpp.1 \
			psp-gcc.1 \
			psp-gcov.1

.endif

PLIST_SUB+=		PSP_GCC_STAGE_PREFIX=${PSP_GCC_STAGE_PREFIX}

.include <bsd.port.mk>