File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / mpd / src / Makefile
Revision 1.1.1.4 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Wed Nov 2 09:50:34 2016 UTC (7 years, 8 months ago) by misho
Branches: mpd, MAIN
CVS tags: v5_8p1_cross, v5_8p1, HEAD
mpd 5.8rc1

    1: # $Id: Makefile,v 1.1.1.4 2016/11/02 09:50:34 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: BINDIR?=		${PREFIX}/sbin
   13: VERSION=		5.8
   14: NOMAN=
   15: MK_MAN=no
   16: 
   17: BINOWN!=		/usr/bin/id -n -u
   18: BINGRP!=		/usr/bin/id -n -g
   19: 
   20: # Default configuration directory
   21: 
   22: MPD_CONF_DIR?=		/etc/mpd5
   23: 
   24: # Define supported physical layer types
   25: 
   26: PHYSTYPE_MODEM=		yes
   27: PHYSTYPE_TCP=		yes
   28: PHYSTYPE_UDP=		yes
   29: PHYSTYPE_NG_SOCKET=	yes
   30: PHYSTYPE_PPTP=		yes
   31: PHYSTYPE_PPPOE=		yes
   32: PHYSTYPE_L2TP=		yes
   33: 
   34: # Define supported CCP types
   35: 
   36: CCP_DEFLATE=		yes
   37: CCP_MPPC=		yes
   38: CCP_PRED1=		yes
   39: 
   40: # Define supported ECP types
   41: 
   42: ECP_DES=		yes
   43: 
   44: # Define system features wanted to use (if present)
   45: 
   46: USE_NG_BPF=		yes
   47: USE_NG_CAR=		yes
   48: USE_NG_DEFLATE=		yes
   49: USE_NG_IPACCT=		yes
   50: USE_NG_MPPC=		yes
   51: USE_NG_NAT=		yes
   52: USE_NG_NETFLOW=		yes
   53: USE_NG_PRED1=		yes
   54: USE_NG_TCPMSS=		yes
   55: USE_NG_VJC=		yes
   56: USE_IPFW=		yes
   57: USE_FETCH=		yes
   58: USE_TCP_WRAP=		yes
   59: #USE_AUTH_OPIE=		yes
   60: USE_AUTH_PAM=		yes
   61: USE_AUTH_SYSTEM=	yes
   62: 
   63: # Build with builtin libpdel
   64: NOLIBPDEL=		yes
   65: 
   66: # Build without builtin web server.
   67: #NOWEB=			yes
   68: 
   69: # Set syslog logging facility. Change LOG_DAEMON to whatever you like.
   70: # Comment this line disable syslog (3) support
   71: SYSLOG_FACILITY=	LOG_DAEMON
   72: 
   73: # Print wide protocol names instead of short names.
   74: # Comment this line, to save about 10 KB space
   75: CFLAGS+=		-DPROTO_NAME_LIST
   76: 
   77: # Reduce some internal structures size to save more memory
   78: # This is to limit amount of active sessions
   79: SMALL_SYSTEM=		yes
   80: 
   81: # Compiler & linker flags
   82: 
   83: .if exists ( /usr/lib/libwrap.so ) && defined ( USE_TCP_WRAP )
   84: ## filter TCP accept connections
   85: LDADD+=		-lwrap
   86: DPADD+=		${LIBWRAP}
   87: CFLAGS+=	-DUSE_WRAP
   88: .endif
   89: 
   90: ## authentication methods: opie, pam, /etc/password
   91: .if defined ( USE_AUTH_OPIE )
   92: LDADD+=		-lopie
   93: DPADD+=		${LIBOPIE}
   94: CFLAGS+=	-DUSE_OPIE
   95: .endif
   96: 
   97: .if exists ( /usr/lib/libpam.so ) && defined ( USE_AUTH_PAM )
   98: LDADD+=		-lpam
   99: DPADD+=		${LIBPAM}
  100: CFLAGS+=		-DUSE_PAM
  101: .endif
  102: 
  103: .if defined ( USE_AUTH_SYSTEM )
  104: ## based on /etc/password
  105: LDADD+=		-lcrypt
  106: DPADD+=		${LIBCRYPT} ${LIBUTIL}
  107: CFLAGS+=		-DUSE_SYSTEM
  108: .endif
  109: 
  110: LDADD+=		-lnetgraph -lutil
  111: DPADD+=		${LIBNETGRAPH}
  112: 
  113: LDADD+=		-L/usr/lib -lradius
  114: DPADD+=		${LIBRADIUS}
  115: 
  116: ## libpdel needs ssl and libexpat (libxml2 cannot be used)
  117: .if !defined ( NOLIBPDEL )
  118: LDADD+=		-L${PREFIX}/lib
  119: LDADD+=		-lpdel
  120: LDADD+=		-lexpat
  121: .endif
  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: 		-I${PREFIX}/include
  140: 
  141: .if defined ( MPD_VENDOR )
  142: CFLAGS+=		-DMPD_VENDOR='"${MPD_VENDOR}"'
  143: .endif
  144: 
  145: .if defined ( SYSLOG_FACILITY )
  146: CFLAGS+=		-DSYSLOG_FACILITY='"${SYSLOG_FACILITY}"'
  147: .endif
  148: 
  149: # Standard sources
  150: 
  151: STDSRCS=        assert.c auth.c bund.c rep.c ccp.c chap.c \
  152: 		console.c command.c ecp.c event.c fsm.c iface.c input.c \
  153: 		ip.c ipcp.c ipv6cp.c lcp.c link.c log.c main.c mbuf.c mp.c \
  154: 		msg.c ngfunc.c pap.c phys.c proto.c radius.c radsrv.c timer.c \
  155: 		util.c vars.c eap.c msoft.c ippool.c
  156: 
  157: .if defined ( NOWEB )
  158: CFLAGS+=		-DNOWEB
  159: .else
  160: STDSRCS+=	web.c
  161: LDADD+=		-lssl
  162: .endif
  163: 
  164: .if defined ( NOLIBPDEL )
  165: CFLAGS+=		-DNOLIBPDEL -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: .endif
  204: 
  205: # Add sources and flags for the various physical layer types
  206: 
  207: .if defined ( PHYSTYPE_MODEM )
  208: SRCS+=		modem.c chat.c
  209: CFLAGS+=		-DPHYSTYPE_MODEM
  210: .endif
  211: .if defined ( PHYSTYPE_UDP )
  212: SRCS+=		udp.c
  213: CFLAGS+=		-DPHYSTYPE_UDP
  214: .endif
  215: .if defined ( PHYSTYPE_TCP )
  216: SRCS+=		tcp.c
  217: CFLAGS+=		-DPHYSTYPE_TCP
  218: .endif
  219: .if defined ( PHYSTYPE_NG_SOCKET )
  220: SRCS+=		ng.c
  221: CFLAGS+=		-DPHYSTYPE_NG_SOCKET
  222: .endif
  223: .if defined ( PHYSTYPE_PPTP )
  224: SRCS+=		pptp.c pptp_ctrl.c
  225: CFLAGS+=		-DPHYSTYPE_PPTP
  226: CFLAGS+=		-DRANDOMIZE_CID
  227: #CFLAGS+=		-DLOOK_LIKE_NT
  228: .endif
  229: .if defined ( PHYSTYPE_PPPOE )
  230: SRCS+=		pppoe.c
  231: CFLAGS+=		-DPHYSTYPE_PPPOE
  232: .endif
  233: .if defined ( PHYSTYPE_L2TP )
  234: SRCS+=		l2tp.c l2tp_avp.c l2tp_ctrl.c
  235: CFLAGS+=		-DPHYSTYPE_L2TP
  236: .endif
  237: 
  238: # CCP
  239: 
  240: .if defined ( CCP_DEFLATE ) && defined ( USE_NG_DEFLATE )
  241: SRCS+=		ccp_deflate.c
  242: CFLAGS+=		-DCCP_DEFLATE
  243: CFLAGS+=         -DUSE_NG_DEFLATE
  244: .endif
  245: 
  246: .if defined ( CCP_MPPC ) && defined ( USE_NG_MPPC )
  247: SRCS+=		ccp_mppc.c
  248: CFLAGS+=		-DCCP_MPPC
  249: CFLAGS+=         -DUSE_NG_MPPC
  250: .endif
  251: 
  252: .if defined ( CCP_PRED1 )
  253: SRCS+=		ccp_pred1.c
  254: CFLAGS+=		-DCCP_PRED1
  255: .if defined ( USE_NG_PRED1 )
  256: CFLAGS+=         -DUSE_NG_PRED1
  257: .endif
  258: .endif
  259: 
  260: # ECP
  261: 
  262: .if defined ( ECP_DES )
  263: SRCS+=		ecp_dese.c
  264: SRCS+=		ecp_dese_bis.c
  265: CFLAGS+=		-DECP_DES
  266: NEED_DES=	yes
  267: .endif
  268: 
  269: # Features
  270: 
  271: .if defined ( USE_NG_BPF )
  272: CFLAGS+=		-DUSE_NG_BPF
  273: LDADD+=		-lpcap
  274: DPADD+=		${LIBPCAP}
  275: .endif
  276: .if defined ( USE_NG_CAR )
  277: CFLAGS+=         -DUSE_NG_CAR
  278: .endif
  279: .if defined ( USE_NG_IPACCT )
  280: CFLAGS+=         -DUSE_NG_IPACCT
  281: .endif
  282: .if defined ( USE_NG_NAT )
  283: SRCS+=		nat.c
  284: CFLAGS+=         -DUSE_NG_NAT
  285: .endif
  286: .if defined ( USE_NG_NETFLOW )
  287: CFLAGS+=         -DUSE_NG_NETFLOW
  288: .endif
  289: .if defined ( USE_NG_TCPMSS )
  290: CFLAGS+=         -DUSE_NG_TCPMSS
  291: .endif
  292: .if defined ( USE_NG_VJC )
  293: CFLAGS+=         -DUSE_NG_VJC
  294: .endif
  295: .if defined ( USE_IPFW )
  296: CFLAGS+=         -DUSE_IPFW
  297: .endif
  298: .if defined ( USE_FETCH )
  299: CFLAGS+=         -DUSE_FETCH
  300: LDADD+=		-lfetch
  301: DPADD+=		${LIBFETCH}
  302: .endif
  303: .if defined ( SMALL_SYSTEM )
  304: CFLAGS+=         -DSMALL_SYSTEM
  305: .endif
  306: 
  307: # Add in required support files and libraries
  308: LDADD+=		-lcrypto
  309: DPADD+=		${LIBCRYPTO}
  310: 
  311: .if exists ( /usr/lib/libexecinfo.so )
  312: LDADD+=		-lexecinfo
  313: CFLAGS+=	-DUSE_BACKTRACE
  314: .endif
  315: 
  316: # Now add standard sources
  317: 
  318: SRCS+=		${STDSRCS}
  319: 
  320: .if defined ( NOLIBPDEL )
  321: SRCS+=		${PDELSRCS}
  322: .endif
  323: 
  324: .include <bsd.prog.mk>

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>