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
118 CFLAGS += -DUSE_SRP -DOPENSSL -I/usr/local/ssl/include
119 LIBS += -lsrp -L/usr/local/ssl/lib
122 EXTRAINSTALL = $(INSTALL) -c -m 555 srp-entry $(BINDIR)/srp-entry
123 MANPAGES += srp-entry.8
124 EXTRACLEAN += srp-entry.o
127 # OpenSSL has an integrated version of SHA-1, and its implementation
128 # is incompatible with this local SHA-1 implementation. We must use
129 # one or the other, not both.
137 CFLAGS += -DUSE_EAPTLS=1
142 PPPDOBJS += eap-tls.o
146 CFLAGS += -DHAS_SHADOW
147 #LIBS += -lshadow $(LIBS)
150 CRYPTHEADER = "\#include <crypt.h>"
151 ifeq ($(shell echo $(CRYPTHEADER) | $(CC) -E - >/dev/null 2>&1 && echo yes),yes)
152 CFLAGS += -DHAVE_CRYPT_H=1
157 CFLAGS += -DHAVE_LOGWTMP=1
165 CFLAGS += -DUSE_CRYPT=1
167 PPPDOBJS += pppcrypt.o
168 HEADERS += pppcrypt.h
175 # For "Pluggable Authentication Modules", see ftp.redhat.com:/pub/pam/.
183 # Multilink implies the use of TDB
186 CFLAGS += -DHAVE_MULTILINK
187 PPPDSRCS += multilink.c
188 PPPDOBJS += multilink.o
193 CFLAGS += -DUSE_TDB=1
194 PPPDSRCS += tdb.c spinlock.c
195 PPPDOBJS += tdb.o spinlock.o
196 HEADERS += tdb.h spinlock.h
199 # Lock library binary for Linux is included in 'linux' subdirectory.
202 CFLAGS += -DLOCKLIB=1
207 CFLAGS += -DSYSTEMD=1
212 LDFLAGS_PLUGIN += -Wl,-E
218 CFLAGS += -DPPP_FILTER
222 PPPDSRCS += ipv6cp.c eui64.c
223 HEADERS += ipv6cp.h eui64.h
224 PPPDOBJS += ipv6cp.o eui64.o
231 CFLAGS += -DCBCP_SUPPORT
236 CFLAGS += -DMAXOCTETS
244 $(INSTALL) -d $(BINDIR)
245 $(INSTALL) -d $(MANDIR)
246 $(INSTALL) -d $(PKGCONFDIR)
248 $(INSTALL) -c -m 755 pppd $(BINDIR)/pppd
249 if chgrp pppusers $(BINDIR)/pppd 2>/dev/null; then \
250 chmod o-rx,u+s $(BINDIR)/pppd; fi
251 $(INSTALL) -c -m 644 pppd.pc $(PKGCONFDIR)
252 $(INSTALL) -c -m 644 pppd.8 $(MANDIR)
255 $(CC) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_PLUGIN) -o pppd $(PPPDOBJS) $(LIBS)
257 srp-entry: srp-entry.c
258 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ srp-entry.c $(LIBS)
261 mkdir -p $(INCDIR)/pppd
262 $(INSTALL) -c -m 644 $(HEADERS) $(INCDIR)/pppd
265 rm -f $(PPPDOBJS) $(EXTRACLEAN) $(TARGETS) *~ #* core
268 $(CPP) -M $(CFLAGS) $(PPPDSRCS) >.depend