1 # 2 # pppd makefile for Linux 3 # $Id: Makefile.linux,v 1.66 2004/11/13 12:02:22 paulus Exp $ 4 # 5 6 # Default installation locations 7 DESTDIR = @DESTDIR@ 8 BINDIR = $(DESTDIR)/sbin 9 MANDIR = $(DESTDIR)/share/man/man8 10 INCDIR = $(DESTDIR)/include 11 12 TARGETS = pppd 13 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 17 18 HEADERS = ccp.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 \ 20 upap.h eap.h 21 22 MANPAGES = pppd.8 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 26 27 # 28 # include dependencies if present 29 ifeq (.depend,$(wildcard .depend)) 30 include .depend 31 endif 32 33 # CC = gcc 34 # 35 COPTS = -O2 -pipe -Wall -g 36 LIBS = 37 38 # Uncomment the next 2 lines to include support for Microsoft's 39 # MS-CHAP authentication protocol. Also, edit plugins/radius/Makefile.linux. 40 CHAPMS=y 41 USE_CRYPT=y 42 # Don't use MSLANMAN unless you really know what you're doing. 43 #MSLANMAN=y 44 # Uncomment the next line to include support for MPPE. CHAPMS (above) must 45 # also be enabled. Also, edit plugins/radius/Makefile.linux. 46 MPPE=y 47 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. 51 FILTER=y 52 53 # Uncomment the next line to enable multilink PPP (enabled by default) 54 # Linux distributions: Please leave multilink ENABLED in your builds 55 # of pppd! 56 HAVE_MULTILINK=y 57 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. 61 USE_TDB=y 62 63 HAS_SHADOW=y 64 #USE_PAM=y 65 #HAVE_INET6=y 66 67 # Enable plugins 68 PLUGIN=y 69 70 # Enable Microsoft proprietary Callback Control Protocol 71 #CBCP=y 72 73 # Enable EAP SRP-SHA1 authentication (requires libsrp) 74 #USE_SRP=y 75 76 MAXOCTETS=y 77 78 INCLUDE_DIRS= -I../include 79 80 COMPILE_FLAGS= -DHAVE_PATHS_H -DIPX_CHANGE -DHAVE_MMAP 81 82 CFLAGS= $(COPTS) $(COMPILE_FLAGS) $(INCLUDE_DIRS) 83 84 ifdef CHAPMS 85 CFLAGS += -DCHAPMS=1 86 NEEDDES=y 87 PPPDOBJS += md4.o chap_ms.o 88 HEADERS += md4.h chap_ms.h 89 ifdef MSLANMAN 90 CFLAGS += -DMSLANMAN=1 91 endif 92 ifdef MPPE 93 CFLAGS += -DMPPE=1 94 endif 95 endif 96 97 # EAP SRP-SHA1 98 ifdef USE_SRP 99 CFLAGS += -DUSE_SRP -DOPENSSL -I/usr/local/ssl/include 100 LIBS += -lsrp -L/usr/local/ssl/lib -lcrypto 101 TARGETS += srp-entry 102 EXTRAINSTALL = $(INSTALL) -s -c -m 555 srp-entry $(BINDIR)/srp-entry 103 MANPAGES += srp-entry.8 104 EXTRACLEAN += srp-entry.o 105 NEEDDES=y 106 else 107 # OpenSSL has an integrated version of SHA-1, and its implementation 108 # is incompatible with this local SHA-1 implementation. We must use 109 # one or the other, not both. 110 PPPDSRCS += sha1.c 111 HEADERS += sha1.h 112 PPPDOBJS += sha1.o 113 endif 114 115 ifdef HAS_SHADOW 116 CFLAGS += -DHAS_SHADOW 117 #LIBS += -lshadow $(LIBS) 118 endif 119 120 ifneq ($(wildcard /usr/include/crypt.h),) 121 CFLAGS += -DHAVE_CRYPT_H=1 122 endif 123 ifneq ($(wildcard /usr/lib/libcrypt.*),) 124 LIBS += -lcrypt 125 endif 126 127 ifdef NEEDDES 128 ifndef USE_CRYPT 129 LIBS += -ldes $(LIBS) 130 else 131 CFLAGS += -DUSE_CRYPT=1 132 endif 133 PPPDOBJS += pppcrypt.o 134 HEADERS += pppcrypt.h 135 endif 136 137 # For "Pluggable Authentication Modules", see ftp.redhat.com:/pub/pam/. 138 ifdef USE_PAM 139 CFLAGS += -DUSE_PAM 140 LIBS += -lpam -ldl 141 endif 142 143 # Multi-linnk 144 ifdef HAVE_MULTILINK 145 # Multilink implies the use of TDB 146 USE_TDB=y 147 148 CFLAGS += -DHAVE_MULTILINK 149 PPPDSRCS += multilink.c 150 PPPDOBJS += multilink.o 151 endif 152 153 # TDB 154 ifdef USE_TDB 155 CFLAGS += -DUSE_TDB=1 156 PPPDSRCS += tdb.c spinlock.c 157 PPPDOBJS += tdb.o spinlock.o 158 HEADERS += tdb.h spinlock.h 159 endif 160 161 # Lock library binary for Linux is included in 'linux' subdirectory. 162 ifdef LOCKLIB 163 LIBS += -llock 164 CFLAGS += -DLOCKLIB=1 165 endif 166 167 ifdef PLUGIN 168 CFLAGS += -DPLUGIN 169 LDFLAGS += -Wl,-E 170 LIBS += -ldl 171 endif 172 173 ifdef FILTER 174 ifneq ($(wildcard /usr/include/pcap-bpf.h),) 175 LIBS += -lpcap 176 CFLAGS += -DPPP_FILTER 177 endif 178 endif 179 180 ifdef HAVE_INET6 181 PPPDSRCS += ipv6cp.c eui64.c 182 HEADERS += ipv6cp.h eui64.h 183 PPPDOBJS += ipv6cp.o eui64.o 184 CFLAGS += -DINET6=1 185 endif 186 187 ifdef CBCP 188 PPPDSRCS += cbcp.c 189 PPPDOBJS += cbcp.o 190 CFLAGS += -DCBCP_SUPPORT 191 HEADERS += cbcp.h 192 endif 193 194 ifdef MAXOCTETS 195 CFLAGS += -DMAXOCTETS 196 endif 197 198 INSTALL= install 199 200 all: $(TARGETS) 201 202 install: pppd 203 mkdir -p $(BINDIR) $(MANDIR) 204 $(EXTRAINSTALL) 205 $(INSTALL) -s -c -m 555 pppd $(BINDIR)/pppd 206 if chgrp pppusers $(BINDIR)/pppd 2>/dev/null; then \ 207 chmod o-rx,u+s $(BINDIR)/pppd; fi 208 $(INSTALL) -c -m 444 pppd.8 $(MANDIR) 209 210 pppd: $(PPPDOBJS) 211 $(CC) $(CFLAGS) $(LDFLAGS) -o pppd $(PPPDOBJS) $(LIBS) 212 213 srp-entry: srp-entry.c 214 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ srp-entry.c $(LIBS) 215 216 install-devel: 217 mkdir -p $(INCDIR)/pppd 218 $(INSTALL) -c -m 644 $(HEADERS) $(INCDIR)/pppd 219 220 clean: 221 rm -f $(PPPDOBJS) $(EXTRACLEAN) $(TARGETS) *~ #* core 222 223 depend: 224 $(CPP) -M $(CFLAGS) $(PPPDSRCS) >.depend 225