]> git.ozlabs.org Git - ppp.git/blob - pppd/Makefile.linux
pppd: Check tdb pointer before closing
[ppp.git] / pppd / Makefile.linux
1 #
2 # pppd makefile for Linux
3 # $Id: Makefile.linux,v 1.70 2007/06/19 02:08:34 carlsonj Exp $
4 #
5
6 # Default installation locations
7 DESTDIR = $(INSTROOT)@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 session.c
17
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 \
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 session.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 line 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 # 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.
66 #SYSTEMD=y
67
68 HAS_SHADOW=y
69 #USE_PAM=y
70 HAVE_INET6=y
71
72 # Enable plugins
73 PLUGIN=y
74
75 # Enable Microsoft proprietary Callback Control Protocol
76 #CBCP=y
77
78 # Enable EAP SRP-SHA1 authentication (requires libsrp)
79 #USE_SRP=y
80
81 # Use libutil
82 USE_LIBUTIL=y
83
84 MAXOCTETS=y
85
86 INCLUDE_DIRS= -I../include
87
88 COMPILE_FLAGS= -DHAVE_PATHS_H -DIPX_CHANGE -DHAVE_MMAP
89
90 CFLAGS= $(COPTS) $(COMPILE_FLAGS) $(INCLUDE_DIRS) '-DDESTDIR="@DESTDIR@"'
91
92 ifdef CHAPMS
93 CFLAGS   += -DCHAPMS=1
94 NEEDDES=y
95 PPPDOBJS += md4.o chap_ms.o
96 HEADERS += md4.h chap_ms.h
97 ifdef MSLANMAN
98 CFLAGS   += -DMSLANMAN=1
99 endif
100 ifdef MPPE
101 CFLAGS   += -DMPPE=1
102 endif
103 endif
104
105 # EAP SRP-SHA1
106 ifdef USE_SRP
107 CFLAGS  += -DUSE_SRP -DOPENSSL -I/usr/local/ssl/include
108 LIBS    += -lsrp -L/usr/local/ssl/lib -lcrypto
109 TARGETS += srp-entry
110 EXTRAINSTALL = $(INSTALL) -s -c -m 555 srp-entry $(BINDIR)/srp-entry
111 MANPAGES += srp-entry.8
112 EXTRACLEAN += srp-entry.o
113 NEEDDES=y
114 else
115 # OpenSSL has an integrated version of SHA-1, and its implementation
116 # is incompatible with this local SHA-1 implementation.  We must use
117 # one or the other, not both.
118 PPPDSRCS += sha1.c
119 HEADERS += sha1.h
120 PPPDOBJS += sha1.o
121 endif
122
123 ifdef HAS_SHADOW
124 CFLAGS   += -DHAS_SHADOW
125 #LIBS     += -lshadow $(LIBS)
126 endif
127
128 ifneq ($(wildcard $(shell $CC --print-sysroot)/usr/include/crypt.h),)
129 CFLAGS  += -DHAVE_CRYPT_H=1
130 LIBS    += -lcrypt
131 endif
132
133 ifdef USE_LIBUTIL
134 CFLAGS  += -DHAVE_LOGWTMP=1
135 LIBS    += -lutil
136 endif
137
138 ifdef NEEDDES
139 ifndef USE_CRYPT
140 CFLAGS   += -I$(shell $CC --print-sysroot)/usr/include/openssl
141 LIBS     += -lcrypto
142 else
143 CFLAGS   += -DUSE_CRYPT=1
144 endif
145 PPPDOBJS += pppcrypt.o
146 HEADERS += pppcrypt.h
147 endif
148
149 # For "Pluggable Authentication Modules", see ftp.redhat.com:/pub/pam/.
150 ifdef USE_PAM
151 CFLAGS   += -DUSE_PAM
152 LIBS     += -lpam -ldl
153 endif
154
155 # Multi-linnk
156 ifdef HAVE_MULTILINK
157         # Multilink implies the use of TDB
158         USE_TDB=y
159
160         CFLAGS += -DHAVE_MULTILINK
161         PPPDSRCS += multilink.c
162         PPPDOBJS += multilink.o
163 endif
164
165 # TDB
166 ifdef USE_TDB
167         CFLAGS += -DUSE_TDB=1
168         PPPDSRCS += tdb.c spinlock.c
169         PPPDOBJS += tdb.o spinlock.o
170         HEADERS += tdb.h spinlock.h
171 endif
172
173 # Lock library binary for Linux is included in 'linux' subdirectory.
174 ifdef LOCKLIB
175 LIBS     += -llock
176 CFLAGS   += -DLOCKLIB=1
177 endif
178
179 ifdef SYSTEMD
180 LIBS += -lsystemd
181 CFLAGS   += -DSYSTEMD=1
182 endif
183
184 ifdef PLUGIN
185 CFLAGS  += -DPLUGIN
186 LDFLAGS_PLUGIN  += -Wl,-E
187 LIBS    += -ldl
188 endif
189
190 ifdef FILTER
191 ifneq ($(wildcard /usr/include/pcap-bpf.h),)
192 LIBS    += -lpcap
193 CFLAGS  += -DPPP_FILTER
194 endif
195 endif
196
197 ifdef HAVE_INET6
198      PPPDSRCS += ipv6cp.c eui64.c
199      HEADERS  += ipv6cp.h eui64.h
200      PPPDOBJS += ipv6cp.o eui64.o
201      CFLAGS   += -DINET6=1
202 endif
203
204 ifdef CBCP
205      PPPDSRCS += cbcp.c
206      PPPDOBJS += cbcp.o
207      CFLAGS += -DCBCP_SUPPORT
208      HEADERS += cbcp.h
209 endif
210
211 ifdef MAXOCTETS
212      CFLAGS += -DMAXOCTETS
213 endif
214
215 INSTALL= install
216
217 all: $(TARGETS)
218
219 install: pppd
220         mkdir -p $(BINDIR) $(MANDIR)
221         $(EXTRAINSTALL)
222         $(INSTALL) -s -c -m 555 pppd $(BINDIR)/pppd
223         if chgrp pppusers $(BINDIR)/pppd 2>/dev/null; then \
224           chmod o-rx,u+s $(BINDIR)/pppd; fi
225         $(INSTALL) -c -m 444 pppd.8 $(MANDIR)
226
227 pppd: $(PPPDOBJS)
228         $(CC) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_PLUGIN) -o pppd $(PPPDOBJS) $(LIBS)
229
230 srp-entry:      srp-entry.c
231         $(CC) $(CFLAGS) $(LDFLAGS) -o $@ srp-entry.c $(LIBS)
232
233 install-devel:
234         mkdir -p $(INCDIR)/pppd
235         $(INSTALL) -c -m 644 $(HEADERS) $(INCDIR)/pppd
236
237 clean:
238         rm -f $(PPPDOBJS) $(EXTRACLEAN) $(TARGETS) *~ #* core
239
240 depend:
241         $(CPP) -M $(CFLAGS) $(PPPDSRCS) >.depend