]> git.ozlabs.org Git - ppp.git/blob - pppd/Makefile.linux
pppd/Makefile.linux: Fix reproducibility issue with differing make versions (#234)
[ppp.git] / pppd / Makefile.linux
1 #
2 # pppd makefile for Linux
3 # Processed by configure to produce pppd/Makefile
4 #
5
6 CROSS_COMPILE=@CROSS_COMPILE@
7 CC=$(CROSS_COMPILE)@CC@
8 COPTS=@CFLAGS@
9
10 # Default installation locations
11 DESTDIR = $(INSTROOT)@DESTDIR@
12 BINDIR = $(DESTDIR)/sbin
13 MANDIR = $(DESTDIR)/share/man/man8
14 INCDIR = $(DESTDIR)/include
15
16 TARGETS = pppd
17
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
21
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 \
24         upap.h eap.h
25
26 MANPAGES = pppd.8
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
30
31 #
32 # include dependencies if present
33 ifeq (.depend,$(wildcard .depend))
34 include .depend
35 endif
36
37 LIBS = -lrt
38
39 # Uncomment the next line to include support for Microsoft's
40 # MS-CHAP authentication protocol.  Also, edit plugins/radius/Makefile.linux.
41 CHAPMS=y
42 #USE_CRYPT=y
43 # Don't use MSLANMAN unless you really know what you're doing.
44 #MSLANMAN=y
45 # Uncomment the next line to include support for MPPE.  CHAPMS (above) must
46 # also be enabled.  Also, edit plugins/radius/Makefile.linux.
47 MPPE=y
48
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.
52 FILTER=y
53
54 # Uncomment the next line to enable multilink PPP (enabled by default)
55 # Linux distributions: Please leave multilink ENABLED in your builds
56 # of pppd!
57 HAVE_MULTILINK=y
58
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.
62 USE_TDB=y
63
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.
67 #SYSTEMD=y
68
69 HAS_SHADOW=y
70 #USE_PAM=y
71 HAVE_INET6=y
72
73 # Enable plugins
74 PLUGIN=y
75
76 # Enable Microsoft proprietary Callback Control Protocol
77 #CBCP=y
78
79 # Enable EAP SRP-SHA1 authentication (requires libsrp)
80 #USE_SRP=y
81
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)
85 USE_LIBUTIL=y
86 endif
87
88 # Enable EAP-TLS authentication (requires MPPE support, libssl and libcrypto)
89 USE_EAPTLS=y
90
91 MAXOCTETS=y
92
93 INCLUDE_DIRS= -I../include
94
95 COMPILE_FLAGS= -DHAVE_PATHS_H -DIPX_CHANGE -DHAVE_MMAP -pipe
96
97 CFLAGS= $(COPTS) $(COMPILE_FLAGS) $(INCLUDE_DIRS) '-DDESTDIR="@DESTDIR@"'
98
99 ifdef CHAPMS
100 CFLAGS   += -DCHAPMS=1
101 NEEDDES=y
102 PPPDOBJS += md4.o chap_ms.o
103 HEADERS += md4.h chap_ms.h
104 ifdef MSLANMAN
105 CFLAGS   += -DMSLANMAN=1
106 endif
107 ifdef MPPE
108 CFLAGS   += -DMPPE=1
109 HEADERS  += mppe.h
110 endif
111 endif
112
113 # EAP SRP-SHA1
114 ifdef USE_SRP
115 CFLAGS  += -DUSE_SRP -DOPENSSL -I/usr/local/ssl/include
116 LIBS    += -lsrp -L/usr/local/ssl/lib
117 NEEDCRYPTOLIB = y
118 TARGETS += srp-entry
119 EXTRAINSTALL = $(INSTALL) -c -m 555 srp-entry $(BINDIR)/srp-entry
120 MANPAGES += srp-entry.8
121 EXTRACLEAN += srp-entry.o
122 NEEDDES=y
123 else
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.
127 PPPDSRCS += sha1.c
128 HEADERS += sha1.h
129 PPPDOBJS += sha1.o
130 endif
131
132 # EAP-TLS
133 ifdef USE_EAPTLS
134 CFLAGS += -DUSE_EAPTLS=1
135 LIBS += -lssl
136 NEEDCRYPTOLIB = y
137 PPPDSRC += eap-tls.c
138 HEADERS += eap-tls.h
139 PPPDOBJS += eap-tls.o
140 endif
141
142 ifdef HAS_SHADOW
143 CFLAGS   += -DHAS_SHADOW
144 #LIBS     += -lshadow $(LIBS)
145 endif
146
147 CRYPTHEADER = "\#include <utmp.h>"
148 ifeq ($(shell echo $(CRYPTHEADER) | $(CC) -E - >/dev/null 2>&1 && echo yes),yes)
149 CFLAGS  += -DHAVE_CRYPT_H=1
150 LIBS    += -lcrypt
151 endif
152
153 ifdef USE_LIBUTIL
154 CFLAGS  += -DHAVE_LOGWTMP=1
155 LIBS    += -lutil
156 endif
157
158 ifdef NEEDDES
159 ifndef USE_CRYPT
160 CFLAGS   += -I$(shell $(CC) --print-sysroot)/usr/include/openssl
161 NEEDCRYPTOLIB = y
162 else
163 CFLAGS   += -DUSE_CRYPT=1
164 endif
165 PPPDOBJS += pppcrypt.o
166 HEADERS += pppcrypt.h
167 endif
168
169 ifdef NEEDCRYPTOLIB
170 LIBS     += -lcrypto
171 endif
172
173 # For "Pluggable Authentication Modules", see ftp.redhat.com:/pub/pam/.
174 ifdef USE_PAM
175 CFLAGS   += -DUSE_PAM
176 LIBS     += -lpam -ldl
177 endif
178
179 # Multi-linnk
180 ifdef HAVE_MULTILINK
181         # Multilink implies the use of TDB
182         USE_TDB=y
183
184         CFLAGS += -DHAVE_MULTILINK
185         PPPDSRCS += multilink.c
186         PPPDOBJS += multilink.o
187 endif
188
189 # TDB
190 ifdef USE_TDB
191         CFLAGS += -DUSE_TDB=1
192         PPPDSRCS += tdb.c spinlock.c
193         PPPDOBJS += tdb.o spinlock.o
194         HEADERS += tdb.h spinlock.h
195 endif
196
197 # Lock library binary for Linux is included in 'linux' subdirectory.
198 ifdef LOCKLIB
199 LIBS     += -llock
200 CFLAGS   += -DLOCKLIB=1
201 endif
202
203 ifdef SYSTEMD
204 LIBS += -lsystemd
205 CFLAGS   += -DSYSTEMD=1
206 endif
207
208 ifdef PLUGIN
209 CFLAGS  += -DPLUGIN
210 LDFLAGS_PLUGIN  += -Wl,-E
211 LIBS    += -ldl
212 endif
213
214 ifdef FILTER
215 LIBS    += -lpcap
216 CFLAGS  += -DPPP_FILTER
217 endif
218
219 ifdef HAVE_INET6
220      PPPDSRCS += ipv6cp.c eui64.c
221      HEADERS  += ipv6cp.h eui64.h
222      PPPDOBJS += ipv6cp.o eui64.o
223      CFLAGS   += -DINET6=1
224 endif
225
226 ifdef CBCP
227      PPPDSRCS += cbcp.c
228      PPPDOBJS += cbcp.o
229      CFLAGS += -DCBCP_SUPPORT
230      HEADERS += cbcp.h
231 endif
232
233 ifdef MAXOCTETS
234      CFLAGS += -DMAXOCTETS
235 endif
236
237 INSTALL= install
238
239 all: $(TARGETS)
240
241 install: pppd
242         mkdir -p $(BINDIR) $(MANDIR)
243         $(EXTRAINSTALL)
244         $(INSTALL) -c -m 555 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 444 pppd.8 $(MANDIR)
248
249 pppd: $(PPPDOBJS)
250         $(CC) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_PLUGIN) -o pppd $(PPPDOBJS) $(LIBS)
251
252 srp-entry:      srp-entry.c
253         $(CC) $(CFLAGS) $(LDFLAGS) -o $@ srp-entry.c $(LIBS)
254
255 install-devel:
256         mkdir -p $(INCDIR)/pppd
257         $(INSTALL) -c -m 644 $(HEADERS) $(INCDIR)/pppd
258
259 clean:
260         rm -f $(PPPDOBJS) $(EXTRACLEAN) $(TARGETS) *~ #* core
261
262 depend:
263         $(CPP) -M $(CFLAGS) $(PPPDSRCS) >.depend