aboutsummaryrefslogtreecommitdiff
path: root/Mk/Uses/gperf.mk
blob: cf66063ba50e9b5bed404f5d9bbae10df2c6f126 (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
# $FreeBSD$
#
# handle dependency on gperf
#
# Feature:	gperf
# Usage:	USES=gperf
#
# Take no arguments

.if !defined(_INCLUDE_USES_GPERF_MK)
_INCLUDE_USES_GPERF_MK=	yes

.if !exists(/usr/bin/gperf)
BUILD_DEPENDS+=	${LOCALBASE}/bin/gperf:devel/gperf
GPERF=	${LOCALBASE}/bin/gperf
.else
_GPERF_VERSION!=	/usr/bin/gperf --version | head -1 || true
_GPERF_MAJ_VERSION=	${_GPERF_VERSION:M[0-9].[0-9].[0-9]:C/.*([0-9]).[0-9].[0-9].*/\1/g}

.if empty(_GPERF_MAJ_VERSION)
_GPERF_MAJ_VERSION=	0
.endif

.if ${_GPERF_MAJ_VERSION} < 3
BUILD_DEPENDS+=	${LOCALBASE}/bin/gperf:devel/gperf
GPERF=	${LOCALBASE}/bin/gperf
.else
GPERF=	/usr/bin/gperf
.endif
.endif

CONFIGURE_ENV+=	GPERF=${GPERF}
MAKE_ENV+=	GPERF=${GPERF}

.endif