2 # pppd makefile for Linux
3 # $Id: Makefile.linux,v 1.70 2007/06/19 02:08:34 carlsonj Exp $
6 # Default installation locations
7 DESTDIR = $(INSTROOT)@DESTDIR@
8 BINDIR = $(DESTDIR)/sbin
9 MANDIR = $(DESTDIR)/share/man/man8
10 INCDIR = $(DESTDIR)/include
14 PPPDSRCS = main.c magic.c fsm.c lcp.c ipcp.c upap.c chap-new.c md5.c ccp.c \
15 ecp.c ipxcp.c auth.c options.c sys-linux.c md4.c chap_ms.c \
16 demand.c utils.c tty.c eap.c chap-md5.c session.c
18 HEADERS = ccp.h session.h chap-new.h ecp.h fsm.h ipcp.h \
19 ipxcp.h lcp.h magic.h md5.h patchlevel.h pathnames.h pppd.h \
23 PPPDOBJS = main.o magic.o fsm.o lcp.o ipcp.o upap.o chap-new.o md5.o ccp.o \
24 ecp.o auth.o options.o demand.o utils.o sys-linux.o ipxcp.o tty.o \
25 eap.o chap-md5.o session.o
28 # include dependencies if present
29 ifeq (.depend,$(wildcard .depend))
35 COPTS = -O2 -pipe -Wall -g
38 # Uncomment the next line to include support for Microsoft's
39 # MS-CHAP authentication protocol. Also, edit plugins/radius/Makefile.linux.
42 # Don't use MSLANMAN unless you really know what you're doing.
44 # Uncomment the next line to include support for MPPE. CHAPMS (above) must
45 # also be enabled. Also, edit plugins/radius/Makefile.linux.
48 # Uncomment the next line to include support for PPP packet filtering.
49 # This requires that the libpcap library and headers be installed
50 # and that the kernel driver support PPP packet filtering.
53 # Uncomment the next line to enable multilink PPP (enabled by default)
54 # Linux distributions: Please leave multilink ENABLED in your builds
58 # Uncomment the next line to enable the TDB database (enabled by default.)
59 # If you enable multilink, then TDB is automatically enabled also.
60 # Linux distributions: Please leave TDB ENABLED in your builds.
63 # Uncomment the next line to enable Type=notify services in systemd
64 # If enabled, and the user sets the up_sdnotify option, then
65 # pppd will not detach and will notify systemd when up.
75 # Enable Microsoft proprietary Callback Control Protocol
78 # Enable EAP SRP-SHA1 authentication (requires libsrp)
84 # Enable EAP-TLS authentication (requires MPPE support, libssl and libcrypto)
89 INCLUDE_DIRS= -I../include
91 COMPILE_FLAGS= -DHAVE_PATHS_H -DIPX_CHANGE -DHAVE_MMAP
93 CFLAGS= $(COPTS) $(COMPILE_FLAGS) $(INCLUDE_DIRS) '-DDESTDIR="@DESTDIR@"'
98 PPPDOBJS += md4.o chap_ms.o
99 HEADERS += md4.h chap_ms.h
101 CFLAGS += -DMSLANMAN=1
111 CFLAGS += -DUSE_SRP -DOPENSSL -I/usr/local/ssl/include
112 LIBS += -lsrp -L/usr/local/ssl/lib
115 EXTRAINSTALL = $(INSTALL) -s -c -m 555 srp-entry $(BINDIR)/srp-entry
116 MANPAGES += srp-entry.8
117 EXTRACLEAN += srp-entry.o
120 # OpenSSL has an integrated version of SHA-1, and its implementation
121 # is incompatible with this local SHA-1 implementation. We must use
122 # one or the other, not both.
130 CFLAGS += -DUSE_EAPTLS=1
135 PPPDOBJS += eap-tls.o
139 CFLAGS += -DHAS_SHADOW
140 #LIBS += -lshadow $(LIBS)
143 ifneq ($(wildcard $(shell $(CC) --print-sysroot)/usr/include/crypt.h),)
144 CFLAGS += -DHAVE_CRYPT_H=1
149 CFLAGS += -DHAVE_LOGWTMP=1
155 CFLAGS += -I$(shell $(CC) --print-sysroot)/usr/include/openssl
158 CFLAGS += -DUSE_CRYPT=1
160 PPPDOBJS += pppcrypt.o
161 HEADERS += pppcrypt.h
168 # For "Pluggable Authentication Modules", see ftp.redhat.com:/pub/pam/.
176 # Multilink implies the use of TDB
179 CFLAGS += -DHAVE_MULTILINK
180 PPPDSRCS += multilink.c
181 PPPDOBJS += multilink.o
186 CFLAGS += -DUSE_TDB=1
187 PPPDSRCS += tdb.c spinlock.c
188 PPPDOBJS += tdb.o spinlock.o
189 HEADERS += tdb.h spinlock.h
192 # Lock library binary for Linux is included in 'linux' subdirectory.
195 CFLAGS += -DLOCKLIB=1
200 CFLAGS += -DSYSTEMD=1
205 LDFLAGS_PLUGIN += -Wl,-E
210 ifneq ($(wildcard /usr/include/pcap-bpf.h),)
212 CFLAGS += -DPPP_FILTER
217 PPPDSRCS += ipv6cp.c eui64.c
218 HEADERS += ipv6cp.h eui64.h
219 PPPDOBJS += ipv6cp.o eui64.o
226 CFLAGS += -DCBCP_SUPPORT
231 CFLAGS += -DMAXOCTETS
239 mkdir -p $(BINDIR) $(MANDIR)
241 $(INSTALL) -s -c -m 555 pppd $(BINDIR)/pppd
242 if chgrp pppusers $(BINDIR)/pppd 2>/dev/null; then \
243 chmod o-rx,u+s $(BINDIR)/pppd; fi
244 $(INSTALL) -c -m 444 pppd.8 $(MANDIR)
247 $(CC) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_PLUGIN) -o pppd $(PPPDOBJS) $(LIBS)
249 srp-entry: srp-entry.c
250 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ srp-entry.c $(LIBS)
253 mkdir -p $(INCDIR)/pppd
254 $(INSTALL) -c -m 644 $(HEADERS) $(INCDIR)/pppd
257 rm -f $(PPPDOBJS) $(EXTRACLEAN) $(TARGETS) *~ #* core
260 $(CPP) -M $(CFLAGS) $(PPPDSRCS) >.depend