Annotation of embedaddon/mpd/src/Makefile, revision 1.1.1.6
1.1.1.6 ! misho 1: # $Id: Makefile 2384 2020-09-06 05:17:49Z dadv $
1.1 misho 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
1.1.1.5 misho 12: LOCALBASE?= ${PREFIX}
1.1 misho 13: BINDIR?= ${PREFIX}/sbin
1.1.1.6 ! misho 14: VERSION= 5.9
! 15: NOMAN=
1.1.1.5 misho 16: MK_MAN= no
1.1 misho 17:
1.1.1.3 misho 18: BINOWN!= /usr/bin/id -n -u
19: BINGRP!= /usr/bin/id -n -g
1.1.1.2 misho 20:
1.1 misho 21: # Default configuration directory
22:
1.1.1.5 misho 23: MPD_CONF_DIR?= ${PREFIX}/etc/mpd5
1.1 misho 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
1.1.1.6 ! misho 50: USE_NG_IPACCT?= yes
1.1 misho 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:
1.1.1.2 misho 64: # Build without builtin web server.
1.1 misho 65: #NOWEB= yes
66:
67: # Set syslog logging facility. Change LOG_DAEMON to whatever you like.
1.1.1.2 misho 68: # Comment this line disable syslog (3) support
1.1 misho 69: SYSLOG_FACILITY= LOG_DAEMON
1.1.1.2 misho 70:
71: # Print wide protocol names instead of short names.
72: # Comment this line, to save about 10 KB space
1.1.1.5 misho 73: CFLAGS+= -DPROTO_NAME_LIST
1.1 misho 74:
1.1.1.2 misho 75: # Reduce some internal structures size to save more memory
76: # This is to limit amount of active sessions
1.1.1.5 misho 77: #SMALL_SYSTEM= yes
1.1.1.2 misho 78:
1.1 misho 79: # Compiler & linker flags
80:
1.1.1.3 misho 81: .if exists ( /usr/lib/libwrap.so ) && defined ( USE_TCP_WRAP )
1.1 misho 82: ## filter TCP accept connections
83: LDADD+= -lwrap
84: DPADD+= ${LIBWRAP}
1.1.1.4 misho 85: CFLAGS+= -DUSE_WRAP
1.1 misho 86: .endif
87:
88: ## authentication methods: opie, pam, /etc/password
89: .if defined ( USE_AUTH_OPIE )
90: LDADD+= -lopie
91: DPADD+= ${LIBOPIE}
1.1.1.4 misho 92: CFLAGS+= -DUSE_OPIE
1.1 misho 93: .endif
94:
1.1.1.3 misho 95: .if exists ( /usr/lib/libpam.so ) && defined ( USE_AUTH_PAM )
1.1 misho 96: LDADD+= -lpam
97: DPADD+= ${LIBPAM}
1.1.1.5 misho 98: CFLAGS+= -DUSE_PAM
1.1 misho 99: .endif
100:
101: .if defined ( USE_AUTH_SYSTEM )
102: ## based on /etc/password
1.1.1.2 misho 103: LDADD+= -lcrypt
1.1 misho 104: DPADD+= ${LIBCRYPT} ${LIBUTIL}
1.1.1.5 misho 105: CFLAGS+= -DUSE_SYSTEM
1.1 misho 106: .endif
107:
1.1.1.2 misho 108: LDADD+= -lnetgraph -lutil
1.1 misho 109: DPADD+= ${LIBNETGRAPH}
110:
111: LDADD+= -L/usr/lib -lradius
112: DPADD+= ${LIBRADIUS}
113:
1.1.1.6 ! misho 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 )
1.1 misho 122: MPD_VERSION!= echo -n "${VERSION} (`id -un`@`uname -n` `LC_TIME=C date +'%R %v'`)"
1.1.1.6 ! misho 123: .else
! 124: MPD_VERSION!= echo -n "${VERSION}"
! 125: .endif
1.1 misho 126:
1.1.1.5 misho 127: CFLAGS+= -DPATH_CONF_DIR='"${MPD_CONF_DIR}"'
128: CFLAGS+= -DMPD_VERSION='"${MPD_VERSION}"'
129: CFLAGS+= -g
130: CFLAGS+= -Wall \
1.1 misho 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 \
1.1.1.5 misho 140: -pthread
1.1 misho 141:
142: .if defined ( MPD_VENDOR )
1.1.1.5 misho 143: CFLAGS+= -DMPD_VENDOR='"${MPD_VENDOR}"'
1.1.1.3 misho 144: .endif
145:
146: .if defined ( SYSLOG_FACILITY )
1.1.1.5 misho 147: CFLAGS+= -DSYSLOG_FACILITY='"${SYSLOG_FACILITY}"'
1.1 misho 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 )
1.1.1.5 misho 159: CFLAGS+= -DNOWEB
1.1 misho 160: .else
161: STDSRCS+= web.c
1.1.1.3 misho 162: LDADD+= -lssl
1.1 misho 163: .endif
164:
1.1.1.6 ! misho 165: CFLAGS+= -DNOLIBPDEL -I. -I./contrib/libpdel
1.1 misho 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
1.1.1.5 misho 208: CFLAGS+= -DPHYSTYPE_MODEM
1.1 misho 209: .endif
210: .if defined ( PHYSTYPE_UDP )
211: SRCS+= udp.c
1.1.1.5 misho 212: CFLAGS+= -DPHYSTYPE_UDP
1.1 misho 213: .endif
214: .if defined ( PHYSTYPE_TCP )
215: SRCS+= tcp.c
1.1.1.5 misho 216: CFLAGS+= -DPHYSTYPE_TCP
1.1 misho 217: .endif
218: .if defined ( PHYSTYPE_NG_SOCKET )
219: SRCS+= ng.c
1.1.1.5 misho 220: CFLAGS+= -DPHYSTYPE_NG_SOCKET
1.1 misho 221: .endif
222: .if defined ( PHYSTYPE_PPTP )
223: SRCS+= pptp.c pptp_ctrl.c
1.1.1.5 misho 224: CFLAGS+= -DPHYSTYPE_PPTP
225: CFLAGS+= -DRANDOMIZE_CID
226: #CFLAGS+= -DLOOK_LIKE_NT
1.1 misho 227: .endif
228: .if defined ( PHYSTYPE_PPPOE )
229: SRCS+= pppoe.c
1.1.1.5 misho 230: CFLAGS+= -DPHYSTYPE_PPPOE
1.1 misho 231: .endif
232: .if defined ( PHYSTYPE_L2TP )
233: SRCS+= l2tp.c l2tp_avp.c l2tp_ctrl.c
1.1.1.5 misho 234: CFLAGS+= -DPHYSTYPE_L2TP
1.1 misho 235: .endif
236:
237: # CCP
238:
239: .if defined ( CCP_DEFLATE ) && defined ( USE_NG_DEFLATE )
240: SRCS+= ccp_deflate.c
1.1.1.5 misho 241: CFLAGS+= -DCCP_DEFLATE
242: CFLAGS+= -DUSE_NG_DEFLATE
1.1 misho 243: .endif
244:
245: .if defined ( CCP_MPPC ) && defined ( USE_NG_MPPC )
246: SRCS+= ccp_mppc.c
1.1.1.5 misho 247: CFLAGS+= -DCCP_MPPC
248: CFLAGS+= -DUSE_NG_MPPC
1.1 misho 249: .endif
250:
251: .if defined ( CCP_PRED1 )
252: SRCS+= ccp_pred1.c
1.1.1.5 misho 253: CFLAGS+= -DCCP_PRED1
1.1 misho 254: .if defined ( USE_NG_PRED1 )
1.1.1.5 misho 255: CFLAGS+= -DUSE_NG_PRED1
1.1 misho 256: .endif
257: .endif
258:
259: # ECP
260:
261: .if defined ( ECP_DES )
262: SRCS+= ecp_dese.c
263: SRCS+= ecp_dese_bis.c
1.1.1.5 misho 264: CFLAGS+= -DECP_DES
1.1 misho 265: NEED_DES= yes
266: .endif
267:
268: # Features
269:
270: .if defined ( USE_NG_BPF )
1.1.1.5 misho 271: CFLAGS+= -DUSE_NG_BPF
1.1 misho 272: LDADD+= -lpcap
273: DPADD+= ${LIBPCAP}
274: .endif
275: .if defined ( USE_NG_CAR )
1.1.1.5 misho 276: CFLAGS+= -DUSE_NG_CAR
1.1 misho 277: .endif
1.1.1.6 ! misho 278: .if defined ( USE_NG_IPACCT ) && ( ${USE_NG_IPACCT} == yes )
1.1.1.5 misho 279: CFLAGS+= -DUSE_NG_IPACCT -nostdinc -I/usr/include -I${LOCALBASE}/include
1.1 misho 280: .endif
281: .if defined ( USE_NG_NAT )
282: SRCS+= nat.c
1.1.1.5 misho 283: CFLAGS+= -DUSE_NG_NAT
1.1 misho 284: .endif
285: .if defined ( USE_NG_NETFLOW )
1.1.1.5 misho 286: CFLAGS+= -DUSE_NG_NETFLOW
1.1 misho 287: .endif
288: .if defined ( USE_NG_TCPMSS )
1.1.1.5 misho 289: CFLAGS+= -DUSE_NG_TCPMSS
1.1 misho 290: .endif
291: .if defined ( USE_NG_VJC )
1.1.1.5 misho 292: CFLAGS+= -DUSE_NG_VJC
1.1 misho 293: .endif
294: .if defined ( USE_IPFW )
1.1.1.5 misho 295: CFLAGS+= -DUSE_IPFW
1.1 misho 296: .endif
297: .if defined ( USE_FETCH )
1.1.1.5 misho 298: CFLAGS+= -DUSE_FETCH
1.1 misho 299: LDADD+= -lfetch
300: DPADD+= ${LIBFETCH}
301: .endif
1.1.1.3 misho 302: .if defined ( SMALL_SYSTEM )
1.1.1.5 misho 303: CFLAGS+= -DSMALL_SYSTEM
1.1.1.3 misho 304: .endif
1.1 misho 305:
306: # Add in required support files and libraries
307: LDADD+= -lcrypto
308: DPADD+= ${LIBCRYPTO}
1.1.1.3 misho 309:
310: .if exists ( /usr/lib/libexecinfo.so )
311: LDADD+= -lexecinfo
1.1.1.4 misho 312: CFLAGS+= -DUSE_BACKTRACE
1.1 misho 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>