root/src/router/pppd.new/pppd/Makefile.linux

Revision 12192, 5.2 kB (checked in by BrainSlayer, 6 months ago)

experimental pppd bandwidth management via radius

Line 
1 #
2 # pppd makefile for Linux
3 # $Id: Makefile.linux,v 1.69 2006/06/04 05:07:46 paulus Exp $
4 #
5
6 # Default installation locations
7 DESTDIR = @DESTDIR@
8 BINDIR = $(DESTDIR)/sbin
9 MANDIR = $(DESTDIR)/share/man/man8
10 INCDIR = $(DESTDIR)/include
11
12 TARGETS = pppd
13
14 PPPDSRCS = main.c magic.c fsm.c lcp.c ipcp.c upap.c chap-new.c md5.c ccp.c \
15            ecp.c ipxcp.c auth.c options.c sys-linux.c md4.c chap_ms.c \
16            demand.c utils.c tty.c eap.c chap-md5.c
17
18 HEADERS = ccp.h chap-new.h ecp.h fsm.h ipcp.h \
19         ipxcp.h lcp.h magic.h md5.h patchlevel.h pathnames.h pppd.h \
20         upap.h eap.h
21
22 MANPAGES = pppd.8
23 PPPDOBJS = main.o magic.o fsm.o lcp.o ipcp.o upap.o chap-new.o md5.o ccp.o \
24            ecp.o auth.o options.o demand.o utils.o sys-linux.o ipxcp.o tty.o \
25            eap.o chap-md5.o
26
27 #
28 # include dependencies if present
29 ifeq (.depend,$(wildcard .depend))
30 include .depend
31 endif
32
33 # CC = gcc
34 #
35 #COPTS = -O2 -pipe -Wall -g
36 LIBS =
37
38 # Uncomment the next 2 lines to include support for Microsoft's
39 # MS-CHAP authentication protocol.  Also, edit plugins/radius/Makefile.linux.
40 CHAPMS=y
41 USE_CRYPT=y
42 # Don't use MSLANMAN unless you really know what you're doing.
43 #MSLANMAN=y
44 # Uncomment the next line to include support for MPPE.  CHAPMS (above) must
45 # also be enabled.  Also, edit plugins/radius/Makefile.linux.
46 MPPE=y
47
48 # Uncomment the next line to include support for PPP packet filtering.
49 # This requires that the libpcap library and headers be installed
50 # and that the kernel driver support PPP packet filtering.
51 #FILTER=y
52
53 # Uncomment the next line to enable multilink PPP (enabled by default)
54 # Linux distributions: Please leave multilink ENABLED in your builds
55 # of pppd!
56 include ../../.config
57 ifneq ($(CONFIG_DIST),"micro")
58 ifneq ($(CONFIG_DIST),"micro-special")
59 HAVE_MULTILINK=y
60 endif
61 endif
62
63 ifeq ($(CONFIG_AQOS),y)
64 CFLAGS += -DHAVE_AQOS
65 endif
66
67 # Uncomment the next line to enable the TDB database (enabled by default.)
68 # If you enable multilink, then TDB is automatically enabled also.
69 # Linux distributions: Please leave TDB ENABLED in your builds.
70 #USE_TDB=y
71
72 #HAS_SHADOW=y
73 #USE_PAM=y
74 #HAVE_INET6=y
75
76 # Enable plugins
77 PLUGIN=y
78
79 # Enable Microsoft proprietary Callback Control Protocol
80 #CBCP=y
81
82 # Enable EAP SRP-SHA1 authentication (requires libsrp)
83 #USE_SRP=y
84
85 MAXOCTETS=y
86
87 INCLUDE_DIRS= -I../include
88
89 COMPILE_FLAGS= -DHAVE_PATHS_H -DHAVE_MMAP
90
91 ifeq ($(ARCHITECTURE),broadcom)
92 CFLAGS= -DBROADCOM
93 endif
94
95 CFLAGS+= -O2 $(COMPILE_FLAGS) $(INCLUDE_DIRS) '-DDESTDIR="@DESTDIR@"' -ffunction-sections -fdata-sections -Wl,--gc-sections
96
97
98
99 ifdef CHAPMS
100 CFLAGS   += -DCHAPMS=1
101 NEEDDES=y
102 PPPDOBJS += md4.o chap_ms.o
103 HEADERS += md4.h chap_ms.h
104 ifdef MSLANMAN
105 CFLAGS   += -DMSLANMAN=1
106 endif
107 ifdef MPPE
108 CFLAGS   += -DMPPE=1
109 endif
110 endif
111
112 # EAP SRP-SHA1
113 ifdef USE_SRP
114 CFLAGS  += -DUSE_SRP -DOPENSSL -I/usr/local/ssl/include
115 LIBS    += -lsrp -L/usr/local/ssl/lib -lcrypto -ffunction-sections -fdata-sections -Wl,--gc-sections
116 TARGETS += srp-entry
117 EXTRAINSTALL = $(INSTALL) -c -m 555 srp-entry $(BINDIR)/srp-entry
118 MANPAGES += srp-entry.8
119 EXTRACLEAN += srp-entry.o
120 NEEDDES=y
121 else
122 # OpenSSL has an integrated version of SHA-1, and its implementation
123 # is incompatible with this local SHA-1 implementation.  We must use
124 # one or the other, not both.
125 PPPDSRCS += sha1.c
126 HEADERS += sha1.h
127 PPPDOBJS += sha1.o
128 endif
129
130 ifdef HAS_SHADOW
131 CFLAGS   += -DHAS_SHADOW
132 #LIBS     += -lshadow $(LIBS)
133 endif
134
135 #ifneq ($(wildcard /usr/include/crypt.h),)
136 CFLAGS   += -DHAVE_CRYPT_H=1
137 #endif
138 #ifneq ($(wildcard /usr/lib/libcrypt.*),)
139 LIBS    += -lcrypt
140 #endif
141
142 ifdef NEEDDES
143 ifndef USE_CRYPT
144 LIBS     += -ldes $(LIBS)
145 else
146 CFLAGS   += -DUSE_CRYPT=1
147 endif
148 PPPDOBJS += pppcrypt.o
149 HEADERS += pppcrypt.h
150 endif
151
152 # For "Pluggable Authentication Modules", see ftp.redhat.com:/pub/pam/.
153 ifdef USE_PAM
154 CFLAGS   += -DUSE_PAM
155 LIBS     += -lpam -ldl
156 endif
157
158 # Multi-linnk
159 ifdef HAVE_MULTILINK
160         # Multilink implies the use of TDB
161         USE_TDB=y
162
163         CFLAGS += -DHAVE_MULTILINK
164         PPPDSRCS += multilink.c
165         PPPDOBJS += multilink.o
166 endif
167
168 # TDB
169 ifdef USE_TDB
170         CFLAGS += -DUSE_TDB=1
171         PPPDSRCS += tdb.c spinlock.c
172         PPPDOBJS += tdb.o spinlock.o
173         HEADERS += tdb.h spinlock.h
174 endif
175
176 # Lock library binary for Linux is included in 'linux' subdirectory.
177 ifdef LOCKLIB
178 LIBS     += -llock
179 CFLAGS   += -DLOCKLIB=1
180 endif
181
182 ifdef PLUGIN
183 CFLAGS  += -DPLUGIN
184 LDFLAGS += -Wl,-E
185 LIBS    += -ldl
186 endif
187
188 ifdef FILTER
189 ifneq ($(wildcard /usr/include/pcap-bpf.h),)
190 LIBS    += -lpcap
191 CFLAGS  += -DPPP_FILTER
192 endif
193 endif
194
195 ifdef HAVE_INET6
196      PPPDSRCS += ipv6cp.c eui64.c
197      HEADERS  += ipv6cp.h eui64.h
198      PPPDOBJS += ipv6cp.o eui64.o
199      CFLAGS   += -DINET6=1
200 endif
201
202 ifdef CBCP
203      PPPDSRCS += cbcp.c
204      PPPDOBJS += cbcp.o
205      CFLAGS += -DCBCP_SUPPORT
206      HEADERS += cbcp.h
207 endif
208
209 ifdef MAXOCTETS
210      CFLAGS += -DMAXOCTETS
211 endif
212
213 INSTALL= install
214
215 all: $(TARGETS)
216
217 install: pppd
218         mkdir -p $(BINDIR) $(MANDIR)
219         $(EXTRAINSTALL)
220         $(INSTALL) -c -m 555 pppd $(BINDIR)/pppd
221         if chgrp pppusers $(BINDIR)/pppd 2>/dev/null; then \
222           chmod o-rx,u+s $(BINDIR)/pppd; fi
223         $(INSTALL) -c -m 444 pppd.8 $(MANDIR)
224
225 pppd: $(PPPDOBJS)
226         $(CC) $(CFLAGS) $(LDFLAGS) -o pppd $(PPPDOBJS) $(LIBS)
227
228 srp-entry:      srp-entry.c
229         $(CC) $(CFLAGS) $(LDFLAGS) -o $@ srp-entry.c $(LIBS)
230
231 install-devel:
232         mkdir -p $(INCDIR)/pppd
233         $(INSTALL) -c -m 644 $(HEADERS) $(INCDIR)/pppd
234
235 clean:
236         rm -f $(PPPDOBJS) $(EXTRACLEAN) $(TARGETS) *~ #* core
237
238 depend:
239         $(CPP) -M $(CFLAGS) $(PPPDSRCS) >.depend
Note: See TracBrowser for help on using the browser.