File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / mpd / src / Makefile
Revision 1.1.1.6.2.1: download - view: text, annotated - select for diffs - revision graph
Wed Sep 27 11:08:00 2023 UTC (10 months ago) by misho
Branches: v5_9p16
Diff to: branchpoint 1.1.1.6: preferred, unified
Version 5.9p16

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

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