]> git.ozlabs.org Git - ppp.git/blob - pppd/Makefile.linux
5b2f6950bd5a5838571c69be95c5b445e05dd96a
[ppp.git] / pppd / Makefile.linux
1 #
2 # pppd makefile for Linux
3 # $Id: Makefile.linux,v 1.49 2002/06/01 08:47:03 mjb Exp $
4 #
5
6 # Default installation locations
7 BINDIR = /usr/sbin
8 MANDIR = /usr/man
9
10 PPPDSRCS = main.c magic.c fsm.c lcp.c ipcp.c upap.c chap.c md5.c ccp.c ecp.c \
11            ipxcp.c auth.c options.c sys-linux.c md4.c chap_ms.c cbcp.c \
12            demand.c utils.c tty.c sha1.c
13 HEADERS =  callout.h pathnames.h patchlevel.h chap.h md5.h chap_ms.h md4.h \
14            ipxcp.h cbcp.h tdb.h sha1.h
15 MANPAGES = pppd.8
16 PPPDOBJS = main.o magic.o fsm.o lcp.o ipcp.o upap.o chap.o md5.o ccp.o ecp.o \
17            auth.o options.o demand.o utils.o sys-linux.o ipxcp.o tty.o sha1.o
18
19 all: pppd
20
21 #
22 # include dependencies if present
23 ifeq (.depend,$(wildcard .depend))
24 include .depend
25 endif
26
27 # CC = gcc
28 #
29 COPTS = -O2 -pipe -Wall -g
30 LIBS =
31
32 ifneq ($(wildcard /usr/lib/libcrypt.*),)
33 LIBS += -lcrypt
34 endif
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 # Uncomment the next line to include support for MPPE.  CHAPMS (above) must
41 # also be enabled.  Also, edit plugins/radius/Makefile.linux.
42 MPPE=y
43 ifneq ($(wildcard /usr/lib/libcrypt.*),)
44 HAVE_CRYPT_H=y
45 endif
46
47 # Uncomment the next line to include support for PPP packet filtering.
48 # This requires that the libpcap library and headers be installed
49 # and that the kernel driver support PPP packet filtering, which it
50 # doesn't yet.
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 PLUGIN=y
68
69 #CBCP=y
70
71 INCLUDE_DIRS= -I../include
72
73 COMPILE_FLAGS= -D_linux_=1 -DHAVE_PATHS_H -DIPX_CHANGE -DHAVE_MMAP
74
75 CFLAGS= $(COPTS) $(COMPILE_FLAGS) $(INCLUDE_DIRS)
76
77 ifdef CHAPMS
78 CFLAGS   += -DCHAPMS=1
79 ifndef USE_CRYPT
80 LIBS     := -ldes $(LIBS)
81 else
82 CFLAGS   += -DUSE_CRYPT=1
83 ifneq ($(wildcard /usr/include/crypt.h),)
84 CFLAGS   += -DHAVE_CRYPT_H=1
85 endif
86 endif
87 PPPDOBJS += md4.o chap_ms.o
88 ifdef MSLANMAN
89 CFLAGS   += -DMSLANMAN=1
90 endif
91 ifdef MPPE
92 CFLAGS   += -DMPPE=1
93 endif
94 endif
95
96 ifdef HAS_SHADOW
97 CFLAGS   += -DHAS_SHADOW
98 #LIBS     := -lshadow $(LIBS)
99 endif
100
101 # For "Pluggable Authentication Modules", see ftp.redhat.com:/pub/pam/.
102 ifdef USE_PAM
103 CFLAGS   += -DUSE_PAM
104 LIBS     := -lpam -ldl $(LIBS)
105 endif
106
107 # Multi-linnk
108 ifdef HAVE_MULTILINK
109         # Multilink implies the use of TDB
110         USE_TDB=y
111
112         CFLAGS += -DHAVE_MULTILINK
113         PPPDSRCS += multilink.c
114         PPPDOBJS += multilink.o
115 endif
116
117 # TDB
118 ifdef USE_TDB
119         CFLAGS += -DUSE_TDB=1
120         PPPDSRCS += tdb.c
121         PPPDOBJS += tdb.o
122 endif
123
124 # Lock library binary for Linux is included in 'linux' subdirectory.
125 ifdef LOCKLIB
126 LIBS     := -llock $(LIBS)
127 CFLAGS   += -DLOCKLIB=1
128 endif
129
130 ifdef PLUGIN
131 CFLAGS  += -DPLUGIN
132 LDFLAGS += -Wl,-E
133 LIBS    += -ldl
134 endif
135
136 ifdef FILTER
137 LIBS    += -lpcap
138 CFLAGS  += -DPPP_FILTER -I/usr/include/pcap
139 endif
140
141 ifdef HAVE_INET6
142      PPPDSRCS += ipv6cp.c eui64.c
143      HEADERS  += ipv6cp.h eui64.h
144      PPPDOBJS += ipv6cp.o eui64.o
145      CFLAGS   += -DINET6=1
146 endif
147
148 ifdef CBCP
149      PPPDOBJS += cbcp.o
150      CFLAGS += -DCBCP_SUPPORT
151 endif
152
153 INSTALL= install -o root
154
155 install: pppd
156         mkdir -p $(BINDIR) $(MANDIR)
157         $(INSTALL) -s -c -m 555 pppd $(BINDIR)/pppd
158         if chgrp pppusers $(BINDIR)/pppd 2>/dev/null; then \
159           chmod o-rx,u+s $(BINDIR)/pppd; fi
160         $(INSTALL) -c -m 444 pppd.8 $(MANDIR)/man8
161
162 pppd: $(PPPDOBJS)
163         $(CC) $(CFLAGS) $(LDFLAGS) -o pppd $(PPPDOBJS) $(LIBS)
164
165 clean:
166         rm -f $(PPPDOBJS) pppd *~ #* core
167
168 depend:
169         $(CPP) -M $(CFLAGS) $(PPPDSRCS) >.depend