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
11 DESTDIR = $(INSTROOT)@DESTDIR@
12 BINDIR = $(DESTDIR)/sbin
13 MANDIR = $(DESTDIR)/share/man/man8
14 INCDIR = $(DESTDIR)/include
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
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 \
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
32 # include dependencies if present
33 ifeq (.depend,$(wildcard .depend))
39 # Uncomment the next line to include support for Microsoft's
40 # MS-CHAP authentication protocol. Also, edit plugins/radius/Makefile.linux.
43 # Don't use MSLANMAN unless you really know what you're doing.
45 # Uncomment the next line to include support for MPPE. CHAPMS (above) must
46 # also be enabled. Also, edit plugins/radius/Makefile.linux.
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.
54 # Uncomment the next line to enable multilink PPP (enabled by default)
55 # Linux distributions: Please leave multilink ENABLED in your builds
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.
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.
76 # Enable Microsoft proprietary Callback Control Protocol
79 # Enable EAP SRP-SHA1 authentication (requires libsrp)
82 # Use libutil; test if logwtmp is declared in <utmp.h> to detect
83 ifeq ($(shell echo '\#include <utmp.h>' | $(CC) -E - 2>/dev/null | grep -q logwtmp && echo yes),yes)
87 # Enable EAP-TLS authentication (requires MPPE support, libssl and libcrypto)
92 INCLUDE_DIRS= -I../include
94 COMPILE_FLAGS= -DHAVE_PATHS_H -DIPX_CHANGE -DHAVE_MMAP -pipe
96 CFLAGS= $(COPTS) $(COMPILE_FLAGS) $(INCLUDE_DIRS) '-DDESTDIR="@DESTDIR@"'
101 PPPDOBJS += md4.o chap_ms.o
102 HEADERS += md4.h chap_ms.h
104 CFLAGS += -DMSLANMAN=1
114 CFLAGS += -DUSE_SRP -DOPENSSL -I/usr/local/ssl/include
115 LIBS += -lsrp -L/usr/local/ssl/lib
118 EXTRAINSTALL = $(INSTALL) -c -m 555 srp-entry $(BINDIR)/srp-entry
119 MANPAGES += srp-entry.8
120 EXTRACLEAN += srp-entry.o
123 # OpenSSL has an integrated version of SHA-1, and its implementation
124 # is incompatible with this local SHA-1 implementation. We must use
125 # one or the other, not both.
133 CFLAGS += -DUSE_EAPTLS=1
138 PPPDOBJS += eap-tls.o
142 CFLAGS += -DHAS_SHADOW
143 #LIBS += -lshadow $(LIBS)
146 ifeq ($(shell echo '\#include <crypt.h>' | $(CC) -E - >/dev/null 2>&1 && echo yes),yes)
147 CFLAGS += -DHAVE_CRYPT_H=1
152 CFLAGS += -DHAVE_LOGWTMP=1
158 CFLAGS += -I$(shell $(CC) --print-sysroot)/usr/include/openssl
161 CFLAGS += -DUSE_CRYPT=1
163 PPPDOBJS += pppcrypt.o
164 HEADERS += pppcrypt.h
171 # For "Pluggable Authentication Modules", see ftp.redhat.com:/pub/pam/.
179 # Multilink implies the use of TDB
182 CFLAGS += -DHAVE_MULTILINK
183 PPPDSRCS += multilink.c
184 PPPDOBJS += multilink.o
189 CFLAGS += -DUSE_TDB=1
190 PPPDSRCS += tdb.c spinlock.c
191 PPPDOBJS += tdb.o spinlock.o
192 HEADERS += tdb.h spinlock.h
195 # Lock library binary for Linux is included in 'linux' subdirectory.
198 CFLAGS += -DLOCKLIB=1
203 CFLAGS += -DSYSTEMD=1
208 LDFLAGS_PLUGIN += -Wl,-E
214 CFLAGS += -DPPP_FILTER
218 PPPDSRCS += ipv6cp.c eui64.c
219 HEADERS += ipv6cp.h eui64.h
220 PPPDOBJS += ipv6cp.o eui64.o
227 CFLAGS += -DCBCP_SUPPORT
232 CFLAGS += -DMAXOCTETS
240 mkdir -p $(BINDIR) $(MANDIR)
242 $(INSTALL) -c -m 555 pppd $(BINDIR)/pppd
243 if chgrp pppusers $(BINDIR)/pppd 2>/dev/null; then \
244 chmod o-rx,u+s $(BINDIR)/pppd; fi
245 $(INSTALL) -c -m 444 pppd.8 $(MANDIR)
248 $(CC) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_PLUGIN) -o pppd $(PPPDOBJS) $(LIBS)
250 srp-entry: srp-entry.c
251 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ srp-entry.c $(LIBS)
254 mkdir -p $(INCDIR)/pppd
255 $(INSTALL) -c -m 644 $(HEADERS) $(INCDIR)/pppd
258 rm -f $(PPPDOBJS) $(EXTRACLEAN) $(TARGETS) *~ #* core
261 $(CPP) -M $(CFLAGS) $(PPPDSRCS) >.depend