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