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 UTMPHEADER = "\#include <utmp.h>"
84 ifeq ($(shell echo $(UTMPHEADER) | $(CC) -E - 2>/dev/null | grep -q logwtmp && echo yes),yes)
88 # Enable EAP-TLS authentication (requires MPPE support, libssl and libcrypto)
93 INCLUDE_DIRS= -I../include
95 COMPILE_FLAGS= -DHAVE_PATHS_H -DIPX_CHANGE -DHAVE_MMAP -pipe
97 CFLAGS= $(COPTS) $(COMPILE_FLAGS) $(INCLUDE_DIRS) '-DDESTDIR="@DESTDIR@"'
102 PPPDOBJS += md4.o chap_ms.o
103 HEADERS += md4.h chap_ms.h
105 CFLAGS += -DMSLANMAN=1
115 CFLAGS += -DUSE_SRP -DOPENSSL -I/usr/local/ssl/include
116 LIBS += -lsrp -L/usr/local/ssl/lib
119 EXTRAINSTALL = $(INSTALL) -c -m 555 srp-entry $(BINDIR)/srp-entry
120 MANPAGES += srp-entry.8
121 EXTRACLEAN += srp-entry.o
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.
134 CFLAGS += -DUSE_EAPTLS=1
139 PPPDOBJS += eap-tls.o
143 CFLAGS += -DHAS_SHADOW
144 #LIBS += -lshadow $(LIBS)
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
154 CFLAGS += -DHAVE_LOGWTMP=1
160 CFLAGS += -I$(shell $(CC) --print-sysroot)/usr/include/openssl
163 CFLAGS += -DUSE_CRYPT=1
165 PPPDOBJS += pppcrypt.o
166 HEADERS += pppcrypt.h
173 # For "Pluggable Authentication Modules", see ftp.redhat.com:/pub/pam/.
181 # Multilink implies the use of TDB
184 CFLAGS += -DHAVE_MULTILINK
185 PPPDSRCS += multilink.c
186 PPPDOBJS += multilink.o
191 CFLAGS += -DUSE_TDB=1
192 PPPDSRCS += tdb.c spinlock.c
193 PPPDOBJS += tdb.o spinlock.o
194 HEADERS += tdb.h spinlock.h
197 # Lock library binary for Linux is included in 'linux' subdirectory.
200 CFLAGS += -DLOCKLIB=1
205 CFLAGS += -DSYSTEMD=1
210 LDFLAGS_PLUGIN += -Wl,-E
216 CFLAGS += -DPPP_FILTER
220 PPPDSRCS += ipv6cp.c eui64.c
221 HEADERS += ipv6cp.h eui64.h
222 PPPDOBJS += ipv6cp.o eui64.o
229 CFLAGS += -DCBCP_SUPPORT
234 CFLAGS += -DMAXOCTETS
242 mkdir -p $(BINDIR) $(MANDIR)
244 $(INSTALL) -c -m 755 pppd $(BINDIR)/pppd
245 if chgrp pppusers $(BINDIR)/pppd 2>/dev/null; then \
246 chmod o-rx,u+s $(BINDIR)/pppd; fi
247 $(INSTALL) -c -m 644 pppd.8 $(MANDIR)
250 $(CC) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_PLUGIN) -o pppd $(PPPDOBJS) $(LIBS)
252 srp-entry: srp-entry.c
253 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ srp-entry.c $(LIBS)
256 mkdir -p $(INCDIR)/pppd
257 $(INSTALL) -c -m 644 $(HEADERS) $(INCDIR)/pppd
260 rm -f $(PPPDOBJS) $(EXTRACLEAN) $(TARGETS) *~ #* core
263 $(CPP) -M $(CFLAGS) $(PPPDSRCS) >.depend