]> git.ozlabs.org Git - ppp.git/blob - pppd/Makefile.linux
First large MPPE patch from Frank Cusack.
[ppp.git] / pppd / Makefile.linux
1 #
2 # pppd makefile for Linux
3 # $Id: Makefile.linux,v 1.47 2002/04/02 13:54:59 dfs 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 \
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 \
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 INCLUDE_DIRS= -I../include
70
71 COMPILE_FLAGS= -D_linux_=1 -DHAVE_PATHS_H -DIPX_CHANGE -DHAVE_MMAP
72
73 CFLAGS= $(COPTS) $(COMPILE_FLAGS) $(INCLUDE_DIRS)
74
75 ifdef CHAPMS
76 CFLAGS   += -DCHAPMS=1
77 ifndef USE_CRYPT
78 LIBS     := -ldes $(LIBS)
79 else
80 CFLAGS   += -DUSE_CRYPT=1
81 ifneq ($(wildcard /usr/include/crypt.h),)
82 CFLAGS   += -DHAVE_CRYPT_H=1
83 endif
84 endif
85 PPPDOBJS += md4.o chap_ms.o
86 ifdef MSLANMAN
87 CFLAGS   += -DMSLANMAN=1
88 endif
89 ifdef MPPE
90 CFLAGS   += -DMPPE=1
91 endif
92 endif
93
94 ifdef HAS_SHADOW
95 CFLAGS   += -DHAS_SHADOW
96 #LIBS     := -lshadow $(LIBS)
97 endif
98
99 # For "Pluggable Authentication Modules", see ftp.redhat.com:/pub/pam/.
100 ifdef USE_PAM
101 CFLAGS   += -DUSE_PAM
102 LIBS     := -lpam -ldl $(LIBS)
103 endif
104
105 # Multi-linnk
106 ifdef HAVE_MULTILINK
107         # Multilink implies the use of TDB
108         USE_TDB=y
109
110         CFLAGS += -DHAVE_MULTILINK
111         PPPDSRCS += multilink.c
112         PPPDOBJS += multilink.o
113 endif
114
115 # TDB
116 ifdef USE_TDB
117         CFLAGS += -DUSE_TDB=1
118         PPPDSRCS += tdb.c
119         PPPDOBJS += tdb.o
120 endif
121
122 # Lock library binary for Linux is included in 'linux' subdirectory.
123 ifdef LOCKLIB
124 LIBS     := -llock $(LIBS)
125 CFLAGS   += -DLOCKLIB=1
126 endif
127
128 ifdef PLUGIN
129 CFLAGS  += -DPLUGIN
130 LDFLAGS += -Wl,-E
131 LIBS    += -ldl
132 endif
133
134 ifdef FILTER
135 LIBS    += -lpcap
136 CFLAGS  += -DPPP_FILTER -I/usr/include/pcap
137 endif
138
139 ifdef HAVE_INET6
140      PPPDSRCS += ipv6cp.c eui64.c
141      HEADERS  += ipv6cp.h eui64.h
142      PPPDOBJS += ipv6cp.o eui64.o
143      CFLAGS   += -DINET6=1
144 endif
145
146
147 INSTALL= install -o root
148
149 install: pppd
150         mkdir -p $(BINDIR) $(MANDIR)
151         $(INSTALL) -s -c -m 555 pppd $(BINDIR)/pppd
152         if chgrp pppusers $(BINDIR)/pppd 2>/dev/null; then \
153           chmod o-rx,u+s $(BINDIR)/pppd; fi
154         $(INSTALL) -c -m 444 pppd.8 $(MANDIR)/man8
155
156 pppd: $(PPPDOBJS)
157         $(CC) $(CFLAGS) $(LDFLAGS) -o pppd $(PPPDOBJS) $(LIBS)
158
159 clean:
160         rm -f $(PPPDOBJS) pppd *~ #* core
161
162 depend:
163         $(CPP) -M $(CFLAGS) $(PPPDSRCS) >.depend