]> git.ozlabs.org Git - ppp.git/blob - pppd/Makefile.linux
Makefile.am: Add explicit openssl directory to pppd include path
[ppp.git] / pppd / Makefile.linux
1 #
2 # pppd makefile for Linux
3 # Processed by configure to produce pppd/Makefile
4 #
5
6 CROSS_COMPILE=@CROSS_COMPILE@
7 CC=$(CROSS_COMPILE)@CC@
8 COPTS=@CFLAGS@
9
10 # Default installation locations
11 DESTDIR = $(INSTROOT)@DESTDIR@
12 BINDIR = $(DESTDIR)/sbin
13 MANDIR = $(DESTDIR)/share/man/man8
14 INCDIR = $(DESTDIR)/include
15
16 TARGETS = pppd
17
18 PPPDSRCS = main.c magic.c fsm.c lcp.c ipcp.c upap.c chap-new.c md5.c ccp.c \
19            ecp.c ipxcp.c auth.c options.c sys-linux.c md4.c chap_ms.c \
20            demand.c utils.c tty.c eap.c chap-md5.c session.c
21
22 HEADERS = ccp.h session.h chap-new.h ecp.h fsm.h ipcp.h \
23         ipxcp.h lcp.h magic.h md5.h patchlevel.h pathnames.h pppd.h \
24         upap.h eap.h
25
26 MANPAGES = pppd.8
27 PPPDOBJS = main.o magic.o fsm.o lcp.o ipcp.o upap.o chap-new.o md5.o ccp.o \
28            ecp.o auth.o options.o demand.o utils.o sys-linux.o ipxcp.o tty.o \
29            eap.o chap-md5.o session.o
30
31 #
32 # include dependencies if present
33 ifeq (.depend,$(wildcard .depend))
34 include .depend
35 endif
36
37 LIBS = -lrt
38
39 # Uncomment the next line to include support for Microsoft's
40 # MS-CHAP authentication protocol.  Also, edit plugins/radius/Makefile.linux.
41 CHAPMS=y
42 #USE_CRYPT=y
43 # Don't use MSLANMAN unless you really know what you're doing.
44 #MSLANMAN=y
45 # Uncomment the next line to include support for MPPE.  CHAPMS (above) must
46 # also be enabled.  Also, edit plugins/radius/Makefile.linux.
47 MPPE=y
48
49 # Uncomment the next line to include support for PPP packet filtering.
50 # This requires that the libpcap library and headers be installed
51 # and that the kernel driver support PPP packet filtering.
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 # Uncomment the next line to enable Type=notify services in systemd
65 # If enabled, and the user sets the up_sdnotify option, then
66 # pppd will not detach and will notify systemd when up.
67 #SYSTEMD=y
68
69 HAS_SHADOW=y
70 #USE_PAM=y
71 HAVE_INET6=y
72
73 # Enable plugins
74 PLUGIN=y
75
76 # Enable Microsoft proprietary Callback Control Protocol
77 #CBCP=y
78
79 # Enable EAP SRP-SHA1 authentication (requires libsrp)
80 #USE_SRP=y
81
82 # Use libutil; test if logwtmp is declared in <utmp.h> to detect
83 UTMPHEADER = "\#include <utmp.h>"
84 ifeq ($(shell echo $(UTMPHEADER) | $(CC) -E - 2>/dev/null | grep -q logwtmp && echo yes),yes)
85 USE_LIBUTIL=y
86 endif
87
88 # Enable EAP-TLS authentication (requires MPPE support, libssl and libcrypto)
89 USE_EAPTLS=y
90
91 MAXOCTETS=y
92
93 INCLUDE_DIRS= -I../include
94
95 COMPILE_FLAGS= -DHAVE_PATHS_H -DIPX_CHANGE -DHAVE_MMAP -pipe
96
97 CFLAGS= $(COPTS) $(COMPILE_FLAGS) $(INCLUDE_DIRS) '-DDESTDIR="@DESTDIR@"'
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 HEADERS  += mppe.h
110 endif
111 endif
112
113 # EAP SRP-SHA1
114 ifdef USE_SRP
115 CFLAGS  += -DUSE_SRP -DOPENSSL -I/usr/local/ssl/include
116 LIBS    += -lsrp -L/usr/local/ssl/lib
117 NEEDCRYPTOLIB = y
118 TARGETS += srp-entry
119 EXTRAINSTALL = $(INSTALL) -c -m 555 srp-entry $(BINDIR)/srp-entry
120 MANPAGES += srp-entry.8
121 EXTRACLEAN += srp-entry.o
122 NEEDDES=y
123 else
124 # OpenSSL has an integrated version of SHA-1, and its implementation
125 # is incompatible with this local SHA-1 implementation.  We must use
126 # one or the other, not both.
127 PPPDSRCS += sha1.c
128 HEADERS += sha1.h
129 PPPDOBJS += sha1.o
130 endif
131
132 # EAP-TLS
133 ifdef USE_EAPTLS
134 CFLAGS += -DUSE_EAPTLS=1
135 LIBS += -lssl
136 NEEDCRYPTOLIB = y
137 PPPDSRC += eap-tls.c
138 HEADERS += eap-tls.h
139 PPPDOBJS += eap-tls.o
140 endif
141
142 ifdef HAS_SHADOW
143 CFLAGS   += -DHAS_SHADOW
144 #LIBS     += -lshadow $(LIBS)
145 endif
146
147 CRYPTHEADER = "\#include <crypt.h>"
148 ifeq ($(shell echo $(CRYPTHEADER) | $(CC) -E - >/dev/null 2>&1 && echo yes),yes)
149 CFLAGS  += -DHAVE_CRYPT_H=1
150 LIBS    += -lcrypt
151 endif
152
153 ifdef USE_LIBUTIL
154 CFLAGS  += -DHAVE_LOGWTMP=1
155 LIBS    += -lutil
156 endif
157
158 ifdef NEEDDES
159 ifndef USE_CRYPT
160 NEEDCRYPTOLIB = y
161 else
162 CFLAGS   += -DUSE_CRYPT=1
163 endif
164 PPPDOBJS += pppcrypt.o
165 HEADERS += pppcrypt.h
166 endif
167
168 ifdef NEEDCRYPTOLIB
169 LIBS     += -lcrypto
170 endif
171
172 # For "Pluggable Authentication Modules", see ftp.redhat.com:/pub/pam/.
173 ifdef USE_PAM
174 CFLAGS   += -DUSE_PAM
175 LIBS     += -lpam -ldl
176 endif
177
178 # Multi-linnk
179 ifdef HAVE_MULTILINK
180         # Multilink implies the use of TDB
181         USE_TDB=y
182
183         CFLAGS += -DHAVE_MULTILINK
184         PPPDSRCS += multilink.c
185         PPPDOBJS += multilink.o
186 endif
187
188 # TDB
189 ifdef USE_TDB
190         CFLAGS += -DUSE_TDB=1
191         PPPDSRCS += tdb.c spinlock.c
192         PPPDOBJS += tdb.o spinlock.o
193         HEADERS += tdb.h spinlock.h
194 endif
195
196 # Lock library binary for Linux is included in 'linux' subdirectory.
197 ifdef LOCKLIB
198 LIBS     += -llock
199 CFLAGS   += -DLOCKLIB=1
200 endif
201
202 ifdef SYSTEMD
203 LIBS += -lsystemd
204 CFLAGS   += -DSYSTEMD=1
205 endif
206
207 ifdef PLUGIN
208 CFLAGS  += -DPLUGIN
209 LDFLAGS_PLUGIN  += -Wl,-E
210 LIBS    += -ldl
211 endif
212
213 ifdef FILTER
214 LIBS    += -lpcap
215 CFLAGS  += -DPPP_FILTER
216 endif
217
218 ifdef HAVE_INET6
219      PPPDSRCS += ipv6cp.c eui64.c
220      HEADERS  += ipv6cp.h eui64.h
221      PPPDOBJS += ipv6cp.o eui64.o
222      CFLAGS   += -DINET6=1
223 endif
224
225 ifdef CBCP
226      PPPDSRCS += cbcp.c
227      PPPDOBJS += cbcp.o
228      CFLAGS += -DCBCP_SUPPORT
229      HEADERS += cbcp.h
230 endif
231
232 ifdef MAXOCTETS
233      CFLAGS += -DMAXOCTETS
234 endif
235
236 INSTALL= install
237
238 all: $(TARGETS)
239
240 install: pppd
241         mkdir -p $(BINDIR) $(MANDIR)
242         $(EXTRAINSTALL)
243         $(INSTALL) -c -m 755 pppd $(BINDIR)/pppd
244         if chgrp pppusers $(BINDIR)/pppd 2>/dev/null; then \
245           chmod o-rx,u+s $(BINDIR)/pppd; fi
246         $(INSTALL) -c -m 644 pppd.8 $(MANDIR)
247
248 pppd: $(PPPDOBJS)
249         $(CC) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_PLUGIN) -o pppd $(PPPDOBJS) $(LIBS)
250
251 srp-entry:      srp-entry.c
252         $(CC) $(CFLAGS) $(LDFLAGS) -o $@ srp-entry.c $(LIBS)
253
254 install-devel:
255         mkdir -p $(INCDIR)/pppd
256         $(INSTALL) -c -m 644 $(HEADERS) $(INCDIR)/pppd
257
258 clean:
259         rm -f $(PPPDOBJS) $(EXTRACLEAN) $(TARGETS) *~ #* core
260
261 depend:
262         $(CPP) -M $(CFLAGS) $(PPPDSRCS) >.depend