2 # pppd makefile for Linux
3 # Processed by configure to produce pppd/Makefile
6 CROSS_COMPILE=@CROSS_COMPILE@
7 CC=$(CROSS_COMPILE)@CC@
10 # Default installation locations
12 DESTDIR = $(INSTROOT)$(PREFIX)
13 BINDIR = $(DESTDIR)/sbin
14 MANDIR = $(DESTDIR)/share/man/man8
15 INCDIR = $(INSTROOT)@INCDIR@
16 LIBDIR = $(INSTROOT)@LIBDIR@
17 PKGCONFDIR = $(LIBDIR)/pkgconfig
21 PPPDSRCS = main.c magic.c fsm.c lcp.c ipcp.c upap.c chap-new.c md5.c ccp.c \
22 ecp.c ipxcp.c auth.c options.c sys-linux.c md4.c chap_ms.c \
23 demand.c utils.c tty.c eap.c chap-md5.c session.c
25 HEADERS = ccp.h session.h chap-new.h ecp.h fsm.h ipcp.h \
26 ipxcp.h lcp.h magic.h md5.h patchlevel.h pathnames.h pppd.h \
30 PPPDOBJS = main.o magic.o fsm.o lcp.o ipcp.o upap.o chap-new.o md5.o ccp.o \
31 ecp.o auth.o options.o demand.o utils.o sys-linux.o ipxcp.o tty.o \
32 eap.o chap-md5.o session.o
35 # include dependencies if present
36 ifeq (.depend,$(wildcard .depend))
42 # Uncomment the next line to include support for Microsoft's
43 # MS-CHAP authentication protocol. Also, edit plugins/radius/Makefile.linux.
46 # Don't use MSLANMAN unless you really know what you're doing.
48 # Uncomment the next line to include support for MPPE. CHAPMS (above) must
49 # also be enabled. Also, edit plugins/radius/Makefile.linux.
52 # Uncomment the next line to include support for PPP packet filtering.
53 # This requires that the libpcap library and headers be installed
54 # and that the kernel driver support PPP packet filtering.
57 # Uncomment the next line to enable multilink PPP (enabled by default)
58 # Linux distributions: Please leave multilink ENABLED in your builds
62 # Uncomment the next line to enable the TDB database (enabled by default.)
63 # If you enable multilink, then TDB is automatically enabled also.
64 # Linux distributions: Please leave TDB ENABLED in your builds.
67 # Uncomment the next line to enable Type=notify services in systemd
68 # If enabled, and the user sets the up_sdnotify option, then
69 # pppd will not detach and will notify systemd when up.
79 # Enable Microsoft proprietary Callback Control Protocol
82 # Enable EAP SRP-SHA1 authentication (requires libsrp)
85 # Use libutil; test if logwtmp is declared in <utmp.h> to detect
86 UTMPHEADER = "\#include <utmp.h>"
87 ifeq ($(shell echo $(UTMPHEADER) | $(CC) -E - 2>/dev/null | grep -q logwtmp && echo yes),yes)
91 # Enable EAP-TLS authentication (requires MPPE support, libssl and libcrypto)
96 INCLUDE_DIRS= -I../include
98 COMPILE_FLAGS= -DHAVE_PATHS_H -DIPX_CHANGE -DHAVE_MMAP -pipe
100 CFLAGS= $(COPTS) $(COMPILE_FLAGS) $(INCLUDE_DIRS) '-DDESTDIR="@DESTDIR@"'
105 PPPDOBJS += md4.o chap_ms.o
106 HEADERS += md4.h chap_ms.h
108 CFLAGS += -DMSLANMAN=1
120 CFLAGS += -DUSE_SRP -DOPENSSL -I/usr/local/ssl/include
121 LIBS += -lsrp -L/usr/local/ssl/lib
124 EXTRAINSTALL = $(INSTALL) -c -m 555 srp-entry $(BINDIR)/srp-entry
125 MANPAGES += srp-entry.8
126 EXTRACLEAN += srp-entry.o
129 # OpenSSL has an integrated version of SHA-1, and its implementation
130 # is incompatible with this local SHA-1 implementation. We must use
131 # one or the other, not both.
139 CFLAGS += -DUSE_EAPTLS=1
144 PPPDOBJS += eap-tls.o
148 CFLAGS += -DHAS_SHADOW
149 #LIBS += -lshadow $(LIBS)
152 CRYPTHEADER = "\#include <crypt.h>"
153 ifeq ($(shell echo $(CRYPTHEADER) | $(CC) -E - >/dev/null 2>&1 && echo yes),yes)
154 CFLAGS += -DHAVE_CRYPT_H=1
159 CFLAGS += -DHAVE_LOGWTMP=1
167 CFLAGS += -DUSE_CRYPT=1
169 PPPDOBJS += pppcrypt.o
170 HEADERS += pppcrypt.h
177 # For "Pluggable Authentication Modules", see ftp.redhat.com:/pub/pam/.
185 # Multilink implies the use of TDB
188 CFLAGS += -DHAVE_MULTILINK
189 PPPDSRCS += multilink.c
190 PPPDOBJS += multilink.o
195 CFLAGS += -DUSE_TDB=1
196 PPPDSRCS += tdb.c spinlock.c
197 PPPDOBJS += tdb.o spinlock.o
198 HEADERS += tdb.h spinlock.h
201 # Lock library binary for Linux is included in 'linux' subdirectory.
204 CFLAGS += -DLOCKLIB=1
209 CFLAGS += -DSYSTEMD=1
214 LDFLAGS_PLUGIN += -Wl,-E
220 CFLAGS += -DPPP_FILTER
224 PPPDSRCS += ipv6cp.c eui64.c
225 HEADERS += ipv6cp.h eui64.h
226 PPPDOBJS += ipv6cp.o eui64.o
233 CFLAGS += -DCBCP_SUPPORT
238 CFLAGS += -DMAXOCTETS
246 $(INSTALL) -d $(BINDIR)
247 $(INSTALL) -d $(MANDIR)
248 $(INSTALL) -d $(PKGCONFDIR)
250 $(INSTALL) -c -m 755 pppd $(BINDIR)/pppd
251 if chgrp pppusers $(BINDIR)/pppd 2>/dev/null; then \
252 chmod o-rx,u+s $(BINDIR)/pppd; fi
253 $(INSTALL) -c -m 644 pppd.pc $(PKGCONFDIR)
254 $(INSTALL) -c -m 644 pppd.8 $(MANDIR)
257 $(CC) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_PLUGIN) -o pppd $(PPPDOBJS) $(LIBS)
259 srp-entry: srp-entry.c
260 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ srp-entry.c $(LIBS)
263 mkdir -p $(INCDIR)/pppd
264 $(INSTALL) -c -m 644 $(HEADERS) $(INCDIR)/pppd
267 rm -f $(PPPDOBJS) $(EXTRACLEAN) $(TARGETS) *~ #* core
270 $(CPP) -M $(CFLAGS) $(PPPDSRCS) >.depend