File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / mpd / src / Makefile
Revision 1.1.1.5 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue Oct 22 13:49:55 2019 UTC (4 years, 8 months ago) by misho
Branches: mpd, MAIN
CVS tags: v5_8p7, HEAD
mpd ver 5.8

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