Update mail/postfix-current to version 3.2.20161008,4
[dports.git] / mail / sendmail / bsd.milter.mk
1 # makefile for use of:  sendmail milter lib
2 # Date created:         08 Nov 2006
3 # Whom:                 dinoex
4 #
5 # $FreeBSD$
6 #
7 # a port shall includes this file after bsd.ports.pre.mk
8 # .include "${PORTSDIR}/${PKGCATEGORY}/sendmail/bsd.milter.mk"
9 #
10 # the user/port can now set this options in the makefiles.
11 #
12 # WITH_SENDMAIL_STATIC_MILTER=  - Use static milter lib
13 #
14 # WITH_SENDMAIL_BASE=yes        - Use milter in the base
15 # WITH_SENDMAIL_PORT=yes        - Use milter from ports
16 #
17 # If unspecified, check for the lib exist in the base system,
18 # but gives an installed port preference over it.
19 #
20 #
21 # Overrideable defaults:
22 #
23 # SENDMAIL_MILTER_PORT?=        libmilter
24 #
25 # The makefile sets this variables:
26 # MILTERBASE            - "/usr" or ${LOCALBASE}
27 # MILTERINC             - path to the matching includes
28 # MILTERLIB             - path to the libs
29 # MILTERRPATH           - rpath for dynamic linker
30
31 # The makefile extend this variables:
32 # LIB_DEPENDS
33 # BUILD_DEPENDS
34 # CFLAGS
35 # LDFLAGS
36 #
37 # MAKE_ENV              - extended with the variables above
38 # CONFIGURE_ENV         - extended with LDFLAGS
39 # BUILD_DEPENDS         - are added if needed
40 # RUN_DEPENDS           - are added if needed
41
42 Milter_Include_MAINTAINER=      dinoex@FreeBSD.org
43
44 .if     !defined(WITH_SENDMAIL_BASE) && \
45         !defined(WITH_SENDMAIL_PORT)
46 .if     exists(${LOCALBASE}/lib/libmilter.a) || \
47         !exists(/usr/lib/libmilter.a)
48 WITH_SENDMAIL_PORT=yes
49 .else
50 WITH_SENDMAIL_BASE=yes
51 .endif
52 .endif
53
54 .if defined(WITH_SENDMAIL_PORT)
55
56 .if defined(WITH_SENDMAIL_STATIC_MILTER)
57 BUILD_DEPENDS+= ${LOCALBASE}/lib/libmilter.a:mail/${SENDMAIL_MILTER_PORT}
58 .else
59 LIB_DEPENDS+=   libmilter.so.${MILTER_SOVER}:mail/${SENDMAIL_MILTER_PORT}
60 .endif
61
62 SENDMAIL_MILTER_PORT?=  libmilter
63 MILTER_SOVER?=  6
64 MILTERBASE?=    ${LOCALBASE}
65 MILTERINC=      -I${MILTERBASE}/include
66 MILTERRPATH=    ${MILTERBASE}/lib
67 MILTERLIB=      -L${MILTERBASE}/lib -Wl,-rpath,${MILTERRPATH}
68
69 .if !defined(WITHOUT_MILTER_CFLAGS)
70 .if defined(CFLAGS)
71 CFLAGS+=${MILTERINC}
72 .else
73 CFLAGS=${MILTERINC}
74 .endif
75 .endif
76
77 .endif
78
79 .if defined(WITH_SENDMAIL_BASE)
80 MILTERBASE?=    /usr
81 MILTERRPATH=    ${DESTDIR}/usr/lib:${LOCALBASE}/lib
82 MILTERLIB=      -Wl,-rpath,${MILTERRPATH}
83 .endif
84
85 .if !defined(WITHOUT_MILTER_LDFLAGS)
86 LDFLAGS+=${MILTERLIB}
87 .endif
88
89 # eof