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