1: # $Id: Makefile,v 1.1.1.6 2021/03/17 00:39:23 misho Exp $
2: #
3: # Makefile for mpd, multi-link PPP daemon for FreeBSD
4: #
5: # Written by Archie Cobbs <archie@freebsd.org>
6: # Copyright (c) 1995-1999 Whistle Communications, Inc. All rights reserved.
7: # See ``COPYRIGHT.whistle''
8: #
9:
10: PROG?= mpd5
11: PREFIX?= /usr/local
12: LOCALBASE?= ${PREFIX}
13: BINDIR?= ${PREFIX}/sbin
14: VERSION= 5.9
15: NOMAN=
16: MK_MAN= no
17:
18: BINOWN!= /usr/bin/id -n -u
19: BINGRP!= /usr/bin/id -n -g
20:
21: # Default configuration directory
22:
23: MPD_CONF_DIR?= ${PREFIX}/etc/mpd5
24:
25: # Define supported physical layer types
26:
27: PHYSTYPE_MODEM= yes
28: PHYSTYPE_TCP= yes
29: PHYSTYPE_UDP= yes
30: PHYSTYPE_NG_SOCKET= yes
31: PHYSTYPE_PPTP= yes
32: PHYSTYPE_PPPOE= yes
33: PHYSTYPE_L2TP= yes
34:
35: # Define supported CCP types
36:
37: CCP_DEFLATE= yes
38: CCP_MPPC= yes
39: CCP_PRED1= yes
40:
41: # Define supported ECP types
42:
43: ECP_DES= yes
44:
45: # Define system features wanted to use (if present)
46:
47: USE_NG_BPF= yes
48: USE_NG_CAR= yes
49: USE_NG_DEFLATE= yes
50: USE_NG_IPACCT?= yes
51: USE_NG_MPPC= yes
52: USE_NG_NAT= yes
53: USE_NG_NETFLOW= yes
54: USE_NG_PRED1= yes
55: USE_NG_TCPMSS= yes
56: USE_NG_VJC= yes
57: USE_IPFW= yes
58: USE_FETCH= yes
59: USE_TCP_WRAP= yes
60: #USE_AUTH_OPIE= yes
61: USE_AUTH_PAM= yes
62: USE_AUTH_SYSTEM= yes
63:
64: # Build without builtin web server.
65: #NOWEB= yes
66:
67: # Set syslog logging facility. Change LOG_DAEMON to whatever you like.
68: # Comment this line disable syslog (3) support
69: SYSLOG_FACILITY= LOG_DAEMON
70:
71: # Print wide protocol names instead of short names.
72: # Comment this line, to save about 10 KB space
73: CFLAGS+= -DPROTO_NAME_LIST
74:
75: # Reduce some internal structures size to save more memory
76: # This is to limit amount of active sessions
77: #SMALL_SYSTEM= yes
78:
79: # Compiler & linker flags
80:
81: .if exists ( /usr/lib/libwrap.so ) && defined ( USE_TCP_WRAP )
82: ## filter TCP accept connections
83: LDADD+= -lwrap
84: DPADD+= ${LIBWRAP}
85: CFLAGS+= -DUSE_WRAP
86: .endif
87:
88: ## authentication methods: opie, pam, /etc/password
89: .if defined ( USE_AUTH_OPIE )
90: LDADD+= -lopie
91: DPADD+= ${LIBOPIE}
92: CFLAGS+= -DUSE_OPIE
93: .endif
94:
95: .if exists ( /usr/lib/libpam.so ) && defined ( USE_AUTH_PAM )
96: LDADD+= -lpam
97: DPADD+= ${LIBPAM}
98: CFLAGS+= -DUSE_PAM
99: .endif
100:
101: .if defined ( USE_AUTH_SYSTEM )
102: ## based on /etc/password
103: LDADD+= -lcrypt
104: DPADD+= ${LIBCRYPT} ${LIBUTIL}
105: CFLAGS+= -DUSE_SYSTEM
106: .endif
107:
108: LDADD+= -lnetgraph -lutil
109: DPADD+= ${LIBNETGRAPH}
110:
111: LDADD+= -L/usr/lib -lradius
112: DPADD+= ${LIBRADIUS}
113:
114: # Obtained from bsd.port.mk
115: .if !defined ( OSVERSION )
116: OSVERSION!= awk '/^\#define[[:blank:]]__FreeBSD_version/ {print $$3}' < /usr/include/sys/param.h
117: .endif
118:
119: .sinclude "/etc/src.conf"
120:
121: .if ${OSVERSION} < 1200084 || defined ( WITHOUT_REPRODUCIBLE_BUILD )
122: MPD_VERSION!= echo -n "${VERSION} (`id -un`@`uname -n` `LC_TIME=C date +'%R %v'`)"
123: .else
124: MPD_VERSION!= echo -n "${VERSION}"
125: .endif
126:
127: CFLAGS+= -DPATH_CONF_DIR='"${MPD_CONF_DIR}"'
128: CFLAGS+= -DMPD_VERSION='"${MPD_VERSION}"'
129: CFLAGS+= -g
130: CFLAGS+= -Wall \
131: -Wcast-align \
132: -Wchar-subscripts \
133: -Wformat \
134: -Winline \
135: -Wmissing-declarations \
136: -Wmissing-prototypes \
137: -Wnested-externs \
138: -Wpointer-arith \
139: -Wwrite-strings \
140: -pthread
141:
142: .if defined ( MPD_VENDOR )
143: CFLAGS+= -DMPD_VENDOR='"${MPD_VENDOR}"'
144: .endif
145:
146: .if defined ( SYSLOG_FACILITY )
147: CFLAGS+= -DSYSLOG_FACILITY='"${SYSLOG_FACILITY}"'
148: .endif
149:
150: # Standard sources
151:
152: STDSRCS= assert.c auth.c bund.c rep.c ccp.c chap.c \
153: console.c command.c ecp.c event.c fsm.c iface.c input.c \
154: ip.c ipcp.c ipv6cp.c lcp.c link.c log.c main.c mbuf.c mp.c \
155: msg.c ngfunc.c pap.c phys.c proto.c radius.c radsrv.c timer.c \
156: util.c vars.c eap.c msoft.c ippool.c
157:
158: .if defined ( NOWEB )
159: CFLAGS+= -DNOWEB
160: .else
161: STDSRCS+= web.c
162: LDADD+= -lssl
163: .endif
164:
165: CFLAGS+= -DNOLIBPDEL -I. -I./contrib/libpdel
166: PDPATH1= contrib/libpdel/util:contrib/libpdel/structs
167: PDPATH2= contrib/libpdel/structs/type
168: .if defined ( NOWEB )
169: VPATH+= $(PDPATH1):$(PDPATH2)
170: .else
171: PDPATH3= contrib/libpdel/http:contrib/libpdel/http/servlet
172: PDPATH4= contrib/libpdel/io
173: VPATH+= $(PDPATH1):$(PDPATH2):$(PDPATH3):$(PDPATH4)
174: .endif
175: PDELSRCS= typed_mem.c \
176: pevent.c \
177: paction.c \
178: ghash.c \
179: gtree.c \
180: mesg_port.c \
181: structs.c \
182: structs_generic.c \
183: structs_type_array.c \
184: structs_type_int.c \
185: structs_type_string.c \
186: structs_type_struct.c
187: .if !defined ( NOWEB )
188: PDELSRCS+= http_connection.c \
189: http_head.c \
190: http_message.c \
191: http_mime.c \
192: http_request.c \
193: http_response.c \
194: http_server.c \
195: http_servlet_basicauth.c \
196: http_ssl.c \
197: http_status.c \
198: boundary_fp.c \
199: ssl_fp.c \
200: string_fp.c \
201: timeout_fp.c
202: .endif
203:
204: # Add sources and flags for the various physical layer types
205:
206: .if defined ( PHYSTYPE_MODEM )
207: SRCS+= modem.c chat.c
208: CFLAGS+= -DPHYSTYPE_MODEM
209: .endif
210: .if defined ( PHYSTYPE_UDP )
211: SRCS+= udp.c
212: CFLAGS+= -DPHYSTYPE_UDP
213: .endif
214: .if defined ( PHYSTYPE_TCP )
215: SRCS+= tcp.c
216: CFLAGS+= -DPHYSTYPE_TCP
217: .endif
218: .if defined ( PHYSTYPE_NG_SOCKET )
219: SRCS+= ng.c
220: CFLAGS+= -DPHYSTYPE_NG_SOCKET
221: .endif
222: .if defined ( PHYSTYPE_PPTP )
223: SRCS+= pptp.c pptp_ctrl.c
224: CFLAGS+= -DPHYSTYPE_PPTP
225: CFLAGS+= -DRANDOMIZE_CID
226: #CFLAGS+= -DLOOK_LIKE_NT
227: .endif
228: .if defined ( PHYSTYPE_PPPOE )
229: SRCS+= pppoe.c
230: CFLAGS+= -DPHYSTYPE_PPPOE
231: .endif
232: .if defined ( PHYSTYPE_L2TP )
233: SRCS+= l2tp.c l2tp_avp.c l2tp_ctrl.c
234: CFLAGS+= -DPHYSTYPE_L2TP
235: .endif
236:
237: # CCP
238:
239: .if defined ( CCP_DEFLATE ) && defined ( USE_NG_DEFLATE )
240: SRCS+= ccp_deflate.c
241: CFLAGS+= -DCCP_DEFLATE
242: CFLAGS+= -DUSE_NG_DEFLATE
243: .endif
244:
245: .if defined ( CCP_MPPC ) && defined ( USE_NG_MPPC )
246: SRCS+= ccp_mppc.c
247: CFLAGS+= -DCCP_MPPC
248: CFLAGS+= -DUSE_NG_MPPC
249: .endif
250:
251: .if defined ( CCP_PRED1 )
252: SRCS+= ccp_pred1.c
253: CFLAGS+= -DCCP_PRED1
254: .if defined ( USE_NG_PRED1 )
255: CFLAGS+= -DUSE_NG_PRED1
256: .endif
257: .endif
258:
259: # ECP
260:
261: .if defined ( ECP_DES )
262: SRCS+= ecp_dese.c
263: SRCS+= ecp_dese_bis.c
264: CFLAGS+= -DECP_DES
265: NEED_DES= yes
266: .endif
267:
268: # Features
269:
270: .if defined ( USE_NG_BPF )
271: CFLAGS+= -DUSE_NG_BPF
272: LDADD+= -lpcap
273: DPADD+= ${LIBPCAP}
274: .endif
275: .if defined ( USE_NG_CAR )
276: CFLAGS+= -DUSE_NG_CAR
277: .endif
278: .if defined ( USE_NG_IPACCT ) && ( ${USE_NG_IPACCT} == yes )
279: CFLAGS+= -DUSE_NG_IPACCT -nostdinc -I/usr/include -I${LOCALBASE}/include
280: .endif
281: .if defined ( USE_NG_NAT )
282: SRCS+= nat.c
283: CFLAGS+= -DUSE_NG_NAT
284: .endif
285: .if defined ( USE_NG_NETFLOW )
286: CFLAGS+= -DUSE_NG_NETFLOW
287: .endif
288: .if defined ( USE_NG_TCPMSS )
289: CFLAGS+= -DUSE_NG_TCPMSS
290: .endif
291: .if defined ( USE_NG_VJC )
292: CFLAGS+= -DUSE_NG_VJC
293: .endif
294: .if defined ( USE_IPFW )
295: CFLAGS+= -DUSE_IPFW
296: .endif
297: .if defined ( USE_FETCH )
298: CFLAGS+= -DUSE_FETCH
299: LDADD+= -lfetch
300: DPADD+= ${LIBFETCH}
301: .endif
302: .if defined ( SMALL_SYSTEM )
303: CFLAGS+= -DSMALL_SYSTEM
304: .endif
305:
306: # Add in required support files and libraries
307: LDADD+= -lcrypto
308: DPADD+= ${LIBCRYPTO}
309:
310: .if exists ( /usr/lib/libexecinfo.so )
311: LDADD+= -lexecinfo
312: CFLAGS+= -DUSE_BACKTRACE
313: .endif
314:
315: # Now add standard sources
316:
317: SRCS+= ${STDSRCS}
318: SRCS+= ${PDELSRCS}
319:
320: .include <bsd.prog.mk>
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>