summaryrefslogtreecommitdiff
path: root/mail/libmilter/buildlink2.mk
blob: c1d5790f352b6c1fb018e3d9dddce88d18544ac0 (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
# $NetBSD: buildlink2.mk,v 1.7 2004/02/12 01:59:38 jlam Exp $
#
# This Makefile fragment is included by packages that use libmilter.
#

.if !defined(LIBMILTER_BUILDLINK2_MK)
LIBMILTER_BUILDLINK2_MK=	# defined

.include "../../mk/bsd.prefs.mk"

BUILDLINK_DEPENDS.libmilter?=		libmilter>=8.12.9nb1
BUILDLINK_PKGSRCDIR.libmilter?=		../../mail/libmilter

.if exists(/usr/lib/libmilter.a)
_MILTER_FILELIST!= ar t /usr/lib/libmilter.a
.  if empty(_MILTER_FILELIST:Merrstring.o)
_BUILTIN_LIBMILTER=	NO
.  else
_BUILTIN_LIBMILTER=	YES
.  endif
.else
_BUILTIN_LIBMILTER=	NO
.endif

.if ${_BUILTIN_LIBMILTER} == "YES"
_NEED_LIBMILTER=	NO
.else
_NEED_LIBMILTER=	YES
.endif

.if !empty(PREFER_PKGSRC:M[yY][eE][sS]) || \
    !empty(PREFER_PKGSRC:Mlibmilter)
_NEED_LIBMILTER=	YES
.endif

.if ${_NEED_LIBMILTER} == "YES"
BUILDLINK_PACKAGES+=		libmilter
EVAL_PREFIX+=	BUILDLINK_PREFIX.libmilter=libmilter
BUILDLINK_PREFIX.libmilter_DEFAULT=	${LOCALBASE}
.else
BUILDLINK_PREFIX.libmilter=	/usr
.endif

BUILDLINK_FILES.libmilter+=	include/libmilter/mfapi.h
BUILDLINK_FILES.libmilter+=	include/libmilter/mfdef.h
BUILDLINK_FILES.libmilter+=	lib/libmilter.*

BUILDLINK_TARGETS+=	libmilter-buildlink

libmilter-buildlink: _BUILDLINK_USE

.endif	# LIBMILTER_BUILDLINK2_MK