1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-12 03:00:28 +00:00
freebsd-ports/Mk/Uses/gperf.mk
Baptiste Daroussin 8cea2b0147 Readd PORTSDIR for now we will only start removing them after 2016Q1 is branched
This gives more time for tools to get updated, available in packages etc before
bothering users
2015-10-15 07:36:38 +00:00

36 lines
738 B
Makefile

# $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:${PORTSDIR}/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:${PORTSDIR}/devel/gperf
GPERF= ${LOCALBASE}/bin/gperf
.else
GPERF= /usr/bin/gperf
.endif
.endif
CONFIGURE_ENV+= GPERF=${GPERF}
MAKE_ENV+= GPERF=${GPERF}
.endif