Merge pull request #354 from pali/register-with-name
[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     lcp.h \
36     magic.h \
37     md4.h \
38     md5.h \
39     mppe.h \
40     patchlevel.h \
41     pathnames.h \
42     peap.h \
43     pppcrypt.h \
44     pppd.h \
45     pppdconf.h \
46     session.h \
47     sha1.h \
48     spinlock.h \
49     tls.h \
50     tdb.h \
51     upap.h 
52
53 pppd_SOURCES = \
54     auth.c \
55     ccp.c \
56     chap-md5.c \
57     chap-new.c \
58     demand.c \
59     eap.c \
60     ecp.c \
61     fsm.c \
62     ipcp.c \
63     lcp.c \
64     magic.c \
65     main.c \
66     options.c \
67     session.c \
68     tty.c \
69     upap.c \
70     utils.c
71
72 pppd_CPPFLAGS = -I${top_srcdir}/include -DPPPD_RUNTIME_DIR='"@PPPD_RUNTIME_DIR@"' -DPPPD_LOGFILE_DIR='"@PPPD_LOGFILE_DIR@"'
73 pppd_LDFLAGS =
74 pppd_LIBS =
75
76 if LINUX
77 pppd_SOURCES += sys-linux.c termios_linux.h
78 pppd_LIBS += $(CRYPT_LIBS) $(UTIL_LIBS)
79 endif
80
81 if SUNOS
82 pppd_SOURCES += sys-solaris.c
83 pppd_LIBS += -lsocket -lnsl
84 endif
85
86 if WITH_CHAPMS
87 pppd_SOURCES += chap_ms.c
88 pppd_SOURCES += pppcrypt.c
89 check_PROGRAMS += utest_chap
90 else
91 if WITH_SRP
92 pppd_SOURCES += pppcrypt.c
93 endif
94 endif
95
96 if WITH_CBCP
97 pppd_SOURCES += cbcp.c
98 endif
99
100 if WITH_MPPE
101 pppd_SOURCES += mppe.c
102 endif
103
104 if WITH_FILTER
105 pppd_CPPFLAGS += $(PCAP_CFLAGS)
106 pppd_LDFLAGS += $(PCAP_LDFLAGS)
107 pppd_LIBS += $(PCAP_LIBS)
108 endif
109
110 if WITH_PLUGINS
111 pppd_CPPFLAGS += -DPPPD_PLUGIN_DIR='"@PPPD_PLUGIN_DIR@"'
112 pppd_LIBS += -ldl
113 if LINUX
114 pppd_LDFLAGS += -Wl,-E
115 endif
116 endif
117
118 if WITH_MULTILINK
119 pppd_SOURCES += multilink.c
120 endif
121
122 if WITH_TDB
123 pppd_SOURCES += tdb.c spinlock.c
124 endif
125
126 if WITH_INET6
127 pppd_SOURCES += ipv6cp.c eui64.c
128 endif
129
130 if WITH_PAM
131 pppd_LIBS += -lpam -ldl
132 endif
133
134 if WITH_EAPTLS
135 pppd_SOURCES += eap-tls.c tls.c
136 else
137 if WITH_PEAP
138 pppd_SOURCES += tls.c
139 endif
140 endif
141
142 if WITH_PEAP
143 pppd_SOURCES += peap.c
144 check_PROGRAMS += utest_peap
145 endif
146
147 noinst_LTLIBRARIES = libppp_crypt.la
148 libppp_crypt_la_SOURCES=
149
150 if !WITH_OPENSSL
151 libppp_crypt_la_SOURCES += md4.c md5.c sha1.c
152 else
153 libppp_crypt_la_CPPFLAGS=$(OPENSSL_INCLUDES)
154 libppp_crypt_la_LDFLAGS=$(OPENSSL_LDFLAGS)
155 libppp_crypt_la_LIBADD=$(OPENSSL_LIBS)
156 if !OPENSSL_HAVE_SHA
157 libppp_crypt_la_SOURCES += sha1.c
158 endif
159 if !OPENSSL_HAVE_MD5
160 libppp_crypt_la_SOURCES += md5.c
161 endif
162 if !OPENSSL_HAVE_MD4
163 libppp_crypt_la_SOURCES += md4.c
164 endif
165 endif
166
167 utest_peap_LDADD = libppp_crypt.la
168 utest_chap_LDADD = libppp_crypt.la
169 pppd_LIBS += libppp_crypt.la
170
171 if WITH_SYSTEMD
172 pppd_LIBS += -lsystemd
173 endif
174
175 if WITH_SRP
176 srp_entry_SOURCES = srp-entry.c
177 srp_entry_CPPFLAGS = $(OPENSSL_INCLUDES) $(SRP_CFLAGS)
178 srp_entry_LDADD = $(SRP_LIBS) $(OPENSSL_LIBS)
179 srp_entry_LDFLAGS = $(OPENSSL_LDFLAGS) $(SRP_LDFLAGS)
180
181 pppd_CPPFLAGS += $(SRP_CFLAGS)
182 pppd_LDFLAGS += $(SRP_LDFLAGS)
183 pppd_LIBS += $(SRP_LIBS)
184 endif
185
186 pppd_LDADD = $(pppd_LIBS)
187
188 EXTRA_DIST = \
189     ppp.pam
190
191 TESTS = $(check_PROGRAMS)
192