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