The -D__FreeBSD__ must be -D__FreeBSD__=4 or sendmail will not be properly
[dragonfly.git] / usr.sbin / sendmail / Makefile
1 #       @(#)Makefile    8.8 (Berkeley) 3/28/97
2 # $FreeBSD: src/usr.sbin/sendmail/Makefile,v 1.15.2.13 2002/03/25 21:32:29 gshapiro Exp $
3 # $DragonFly: src/usr.sbin/sendmail/Makefile,v 1.8 2004/08/18 16:55:21 dillon Exp $
4
5 SENDMAIL_DIR=${.CURDIR}/../../contrib/sendmail
6 SMDIR=  ${SENDMAIL_DIR}/src
7 .PATH: ${SMDIR}
8
9 BINDIR= /usr/libexec/sendmail
10
11 PROG=   sendmail
12 MAN=    mailq.1 newaliases.1 aliases.5 sendmail.8 
13 SRCS=   alias.c arpadate.c bf.c collect.c conf.c control.c \
14         convtime.c daemon.c deliver.c domain.c envelope.c err.c headers.c \
15         macro.c main.c map.c mci.c milter.c mime.c parseaddr.c queue.c \
16         readcf.c recipient.c savemail.c sasl.c sfsasl.c shmticklib.c \
17         sm_resolve.c srvrsmtp.c stab.c stats.c sysexits.c timers.c \
18         tls.c trace.c udb.c usersmtp.c util.c version.c
19 BINOWN= root
20 BINGRP= smmsp
21 .ifdef SENDMAIL_SET_USER_ID
22 BINMODE=4555
23 .else
24 BINMODE=2555
25 .endif
26
27 # Define the database format to use for aliases et al.
28 DBMDEF= -DNEWDB
29 # If you don't want NIS alias/map support, comment out this line
30 NIS=    -DNIS
31 # Map extensions
32 MAPS=   -DMAP_REGEX -DDNSMAP
33
34 CFLAGS+= -I${SMDIR} -I${SENDMAIL_DIR}/include -I.
35 CFLAGS+= ${DBMDEF} ${NIS} -DMILTER -DNETINET6 -DTCPWRAPPERS ${MAPS}
36
37 # Define __FreeBSD__ as is needed when building with gcc3.
38 CFLAGS+=-D__FreeBSD__=4
39
40 DPADD=  ${LIBUTIL} ${LIBWRAP}
41 LDADD=  -lutil -lwrap
42
43 .if exists(${.OBJDIR}/../../lib/libsm)
44 LIBSMDIR:=      ${.OBJDIR}/../../lib/libsm
45 .else
46 LIBSMDIR!=      cd ${.CURDIR}/../../lib/libsm; make -V .OBJDIR
47 .endif
48 LIBSM:=         ${LIBSMDIR}/libsm.a
49
50 .if exists(${.OBJDIR}/../../lib/libsmutil)
51 LIBSMUTILDIR:=  ${.OBJDIR}/../../lib/libsmutil
52 .else
53 LIBSMUTILDIR!=  cd ${.CURDIR}/../../lib/libsmutil; make -V .OBJDIR
54 .endif
55 LIBSMUTIL:=     ${LIBSMUTILDIR}/libsmutil.a
56
57 DPADD+= ${LIBSMUTIL} ${LIBSM}
58 LDADD+= ${LIBSMUTIL} ${LIBSM}
59
60 SRCS+=  sm_os.h
61 CLEANFILES+=sm_os.h
62
63 .if exists(${.CURDIR}/../../secure) && !defined(NOCRYPT) && \
64         !defined(NO_OPENSSL) && !defined(RELEASE_CRUNCH)
65 # STARTTLS support
66 DISTRIBUTION=   crypto
67 CFLAGS+=        -DSTARTTLS -D_FFR_TLS_1
68 LDADD+=         -lssl -lcrypto
69 DPADD+=         ${LIBSSL} ${LIBCRYPTO}
70 .endif
71
72 # User customizations to the sendmail build environment
73 CFLAGS+=${SENDMAIL_CFLAGS}
74 DPADD+=${SENDMAIL_DPADD}
75 LDADD+=${SENDMAIL_LDADD}
76 LDFLAGS+=${SENDMAIL_LDFLAGS}
77
78 sm_os.h:
79         ln -sf ${SENDMAIL_DIR}/include/sm/os/sm_os_freebsd.h sm_os.h
80
81 .include <bsd.prog.mk>