e6aaac03a7656a707d537be073bae1b93c8cfc68
[ppp.git] / pppd / Makefile.am
1 sbin_PROGRAMS = pppd
2 dist_man8_MANS = pppd.8
3 check_PROGRAMS =
4
5 utest_chap_SOURCES = chap_ms.c pppcrypt.c utils.c
6 utest_chap_CPPFLAGS = -DUNIT_TEST
7 utest_chap_LDFLAGS =
8
9 utest_peap_SOURCES = peap.c utils.c mppe.c
10 utest_peap_CPPFLAGS = -DUNIT_TEST -I${top_srcdir}/include
11 utest_peap_LDFLAGS =
12
13 if WITH_SRP
14 sbin_PROGRAMS += srp-entry
15 dist_man8_MANS += srp-entry.8
16 endif
17
18 pkgconfigdir   = $(libdir)/pkgconfig
19 pkgconfig_DATA = pppd.pc
20
21 pppd_includedir = $(includedir)/pppd
22 pppd_include_HEADERS = \
23     cbcp.h \
24     ccp.h \
25     chap-md5.h \
26     chap_ms.h \
27     chap-new.h \
28     eap.h \
29     eap-tls.h \
30     ecp.h \
31     eui64.h \
32     fsm.h \
33     ipcp.h \
34     ipv6cp.h \
35     ipxcp.h \
36     lcp.h \
37     magic.h \
38     md4.h \
39     md5.h \
40     mppe.h \
41     patchlevel.h \
42     pathnames.h \
43     peap.h \
44     pppcrypt.h \
45     pppd.h \
46     pppdconf.h \
47     session.h \
48     sha1.h \
49     spinlock.h \
50     tls.h \
51     tdb.h \
52     upap.h 
53
54 pppd_SOURCES = \
55     auth.c \
56     ccp.c \
57     chap-md5.c \
58     chap-new.c \
59     demand.c \
60     eap.c \
61     ecp.c \
62     fsm.c \
63     ipcp.c \
64     lcp.c \
65     magic.c \
66     main.c \
67     options.c \
68     session.c \
69     tty.c \
70     upap.c \
71     utils.c
72
73 pppd_CPPFLAGS = -I${top_srcdir}/include -DPPPD_RUNTIME_DIR='"@PPPD_RUNTIME_DIR@"' -DPPPD_LOGFILE_DIR='"@PPPD_LOGFILE_DIR@"'
74 pppd_LDFLAGS =
75 pppd_LIBS =
76
77 if LINUX
78 pppd_SOURCES += sys-linux.c termios_linux.h
79 pppd_LIBS += $(CRYPT_LIBS) $(UTIL_LIBS)
80 endif
81
82 if SUNOS
83 pppd_SOURCES += sys-solaris.c
84 pppd_LIBS += -lsocket -lnsl
85 endif
86
87 if WITH_CHAPMS
88 pppd_SOURCES += chap_ms.c
89 pppd_SOURCES += pppcrypt.c
90 check_PROGRAMS += utest_chap
91 else
92 if WITH_SRP
93 pppd_SOURCES += pppcrypt.c
94 endif
95 endif
96
97 if WITH_CBCP
98 pppd_SOURCES += cbcp.c
99 endif
100
101 if WITH_IPXCP
102 pppd_SOURCES += ipxcp.c
103 endif
104
105 if WITH_MPPE
106 pppd_SOURCES += mppe.c
107 endif
108
109 if WITH_FILTER
110 pppd_CPPFLAGS += $(PCAP_CFLAGS)
111 pppd_LDFLAGS += $(PCAP_LDFLAGS)
112 pppd_LIBS += $(PCAP_LIBS)
113 endif
114
115 if WITH_PLUGINS
116 pppd_CPPFLAGS += -DPPPD_PLUGIN_DIR='"@PPPD_PLUGIN_DIR@"'
117 pppd_LIBS += -ldl
118 if LINUX
119 pppd_LDFLAGS += -Wl,-E
120 endif
121 endif
122
123 if WITH_MULTILINK
124 pppd_SOURCES += multilink.c
125 endif
126
127 if WITH_TDB
128 pppd_SOURCES += tdb.c spinlock.c
129 endif
130
131 if WITH_INET6
132 pppd_SOURCES += ipv6cp.c eui64.c
133 endif
134
135 if WITH_PAM
136 pppd_LIBS += -lpam -ldl
137 endif
138
139 if WITH_EAPTLS
140 pppd_SOURCES += eap-tls.c tls.c
141 else
142 if WITH_PEAP
143 pppd_SOURCES += tls.c
144 endif
145 endif
146
147 if WITH_PEAP
148 pppd_SOURCES += peap.c
149 check_PROGRAMS += utest_peap
150 endif
151
152 noinst_LTLIBRARIES = libppp_crypt.la
153 libppp_crypt_la_SOURCES=
154
155 if !WITH_OPENSSL
156 libppp_crypt_la_SOURCES += md4.c md5.c sha1.c
157 else
158 libppp_crypt_la_CPPFLAGS=$(OPENSSL_INCLUDES)
159 libppp_crypt_la_LDFLAGS=$(OPENSSL_LDFLAGS)
160 libppp_crypt_la_LIBADD=$(OPENSSL_LIBS)
161 if !OPENSSL_HAVE_SHA
162 libppp_crypt_la_SOURCES += sha1.c
163 endif
164 if !OPENSSL_HAVE_MD5
165 libppp_crypt_la_SOURCES += md5.c
166 endif
167 if !OPENSSL_HAVE_MD4
168 libppp_crypt_la_SOURCES += md4.c
169 endif
170 endif
171
172 utest_peap_LDADD = libppp_crypt.la
173 utest_chap_LDADD = libppp_crypt.la
174 pppd_LIBS += libppp_crypt.la
175
176 if WITH_SYSTEMD
177 pppd_LIBS += -lsystemd
178 endif
179
180 if WITH_SRP
181 srp_entry_SOURCES = srp-entry.c
182 srp_entry_CPPFLAGS = $(OPENSSL_INCLUDES) $(SRP_CFLAGS)
183 srp_entry_LDADD = $(SRP_LIBS) $(OPENSSL_LIBS)
184 srp_entry_LDFLAGS = $(OPENSSL_LDFLAGS) $(SRP_LDFLAGS)
185
186 pppd_CPPFLAGS += $(SRP_CFLAGS)
187 pppd_LDFLAGS += $(SRP_LDFLAGS)
188 pppd_LIBS += $(SRP_LIBS)
189 endif
190
191 pppd_LDADD = $(pppd_LIBS)
192
193 EXTRA_DIST = \
194     ppp.pam
195
196 TESTS = $(check_PROGRAMS)
197