summaryrefslogtreecommitdiff
path: root/Mk/Uses/fpc.mk
blob: dd9a3137e3f9bd064a196df3ecd198ed616c8fef (plain)
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
# Support for FPC-based ports. This automatically will install free pascal 
# compiler and units.
#
# Feature:      fpc
# Usage:        USES=fpc
# Valid ARGS:   (none), run
#
# run			- Free pascal compiler and units will be registered also
#			  as run dependencies.
#
# Example:
#	
#	USES+=	fpc:run
#

.if !defined(_INCLUDE_USES_FPC_MK)

FPC_Include_MAINTAINER= acm@FreeBSD.org

_INCLUDE_USES_FPC_MK=   yes

.  if defined(DEFAULT_FPC_VER)
WARNING+=	"DEFAULT_FPC_VER is defined, consider using DEFAULT_VERSIONS=fpc=${DEFAULT_FPC_VER} instead"
.  endif

.  if ${fpc_ARGS:Nrun}
IGNORE=		Unknown argument for USES=fpc: ${fpc_ARGS:Nrun}
.  endif

DEFAULT_FPC_VER=	${FPC_DEFAULT}
# When adding a version, please keep the comment in
# Mk/bsd.default-versions.mk in sync.
FPC_VER=		${DEFAULT_FPC_VER}
FPC_ARCH=		${ARCH:S/amd64/x86_64/}

.  if exists(${LOCALBASE}/bin/fpc)
FPC_CURRENT_VER!=	${LOCALBASE}/bin/fpc -iV
.    if ${FPC_CURRENT_VER} != ${FPC_VER}
IGNORE=	incompatible fpc ${FPC_CURRENT_VER} compiler, please install ${FPC_VER} version
.    endif
.  endif

.  if ${ARCH} == "i386"
PPNAME=			ppc386
.  elif ${ARCH} == "amd64"
PPNAME=			ppcx64
.  else
PPNAME=			ppc_not_yet_ported
ONLY_FOR_ARCHS=		i386 amd64
ONLY_FOR_ARCHS_REASON=	not yet ported to anything other than i386 and amd64
.  endif

.  if !defined(WANT_FPC_DEVEL)
FPC_DEVELSUFFIX=	#
.  else
FPC_DEVELSUFFIX=	-devel
.  endif

BUILD_DEPENDS+=		${LOCALBASE}/bin/as:devel/binutils \
			${LOCALBASE}/lib/fpc/${FPC_VER}/${PPNAME}:lang/fpc${FPC_DEVELSUFFIX}

.  if ${fpc_ARGS:Mrun}
RUN_DEPENDS+=		${LOCALBASE}/bin/as:devel/binutils \
			${LOCALBASE}/lib/fpc/${FPC_VER}/${PPNAME}:lang/fpc${FPC_DEVELSUFFIX}
.  endif

BUILDNAME=		${FPC_ARCH}-${OPSYS:tl}
UNITSDIR=		${LOCALBASE}/lib/fpc/${FPC_VER}/units/${BUILDNAME}
MKINSTDIR=		${LOCALBASE}/lib/fpc/${FPC_VER}/fpmkinst/${BUILDNAME}

.endif