Debian Codegraph @

configure.ac

raw ◀ ▶
Source reconstructed at patch state 0 of 1 — not the installed (fully patched) source.
1 Debian patch touch this file
1 AC_PREREQ([2.69])
2 AC_INIT([ppp],
3 [2.5.2],
4 [https://github.com/ppp-project/ppp])
5
6 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
7 AC_CONFIG_MACRO_DIR([m4])
8
9 AM_INIT_AUTOMAKE
10 AM_MAINTAINER_MODE([enable])
11
12 AC_LANG(C)
13 AC_CONFIG_SRCDIR([pppd/main.c])
14 AC_CONFIG_HEADERS([pppd/config.h pppd/pppdconf.h pppd/plugins/pppoe/config.h])
15 AC_ENABLE_STATIC(no)
16
17 # Checks for programs.
18 AC_PROG_CC
19 AM_PROG_CC_C_O
20 AC_PROG_INSTALL
21 AC_PROG_LN_S
22 LT_INIT
23
24 PKG_PROG_PKG_CONFIG
25
26 AC_CANONICAL_HOST
27 build_linux=no
28 build_sunos=no
29
30 case "${host_os}" in
31 linux*)
32 build_linux=yes
33 ;;
34 solaris2*)
35 build_sunos=yes
36 ;;
37 *)
38 AC_MSG_ERROR(["OS ${host_os} not supported"])
39 ;;
40 esac
41
42 AM_CONDITIONAL([LINUX], [test "x${build_linux}" = "xyes" ])
43 AM_CONDITIONAL([SUNOS], [test "x${build_sunos}" = "xyes" ])
44 AM_COND_IF([SUNOS],
45 CFLAGS="$CFLAGS -DSOL2 -DSRV4")
46
47 #
48 # Checks for header files, these will set the HAVE_[FILE]_H macros in config.h
49 AC_HEADER_STDBOOL
50 AC_CHECK_HEADERS([ \
51 asm/types.h \
52 crypt.h \
53 paths.h \
54 shadow.h \
55 stddef.h \
56 stdarg.h \
57 sys/dlpi.h \
58 sys/ioctl.h \
59 sys/socket.h \
60 sys/time.h \
61 sys/uio.h \
62 time.h \
63 unistd.h \
64 utmp.h])
65
66 #
67 # Check for linux specific headers, required by pppoe, or pppol2tp
68 AM_COND_IF([LINUX], [
69 AC_CHECK_HEADERS([ \
70 net/bpf.h \
71 net/if.h \
72 net/if_types.h \
73 net/if_arp.h \
74 linux/if.h \
75 linux/if_ether.h \
76 linux/if_packet.h \
77 netinet/if_ether.h \
78 netpacket/packet.h])
79
80 AC_MSG_CHECKING([for struct sockaddr_ll in <linux/if_packet.h>])
81 AC_COMPILE_IFELSE(
82 [AC_LANG_PROGRAM([@%:@include <linux/if_packet.h>], [sizeof(struct sockaddr_ll)])],
83 [AC_MSG_RESULT([yes])
84 AC_DEFINE(HAVE_STRUCT_SOCKADDR_LL, 1, [Struct sockaddr_ll is present on system])
85 ],
86 AC_MSG_RESULT([no]))
87 ])
88
89
90 AC_CHECK_SIZEOF(unsigned int)
91 AC_CHECK_SIZEOF(unsigned long)
92 AC_CHECK_SIZEOF(unsigned short)
93
94 # Checks for library functions.
95 AC_CHECK_FUNCS([ \
96 mmap \
97 logwtmp \
98 strerror])
99
100 #
101 # If libc doesn't provide logwtmp, check if libutil provides logwtmp(), and if so link to it.
102 AS_IF([test "x${ac_cv_func_logwtmp}" != "xyes"], [
103 AC_CHECK_LIB([util], [logwtmp], [
104 AC_DEFINE(HAVE_LOGWTMP, 1, [System provides the logwtmp() function])
105 AC_SUBST([UTIL_LIBS], ["-lutil"])
106 ])
107 ])
108
109 #
110 # Check if libcrypt have crypt() function
111 AC_CHECK_LIB([crypt], [crypt],
112 AC_SUBST([CRYPT_LIBS], ["-lcrypt"]))
113
114 #
115 # Should pppd link with -lsystemd (Linux only)
116 AC_ARG_ENABLE([systemd],
117 AS_HELP_STRING([--enable-systemd], [Enable support for systemd notification]))
118 AM_CONDITIONAL(WITH_SYSTEMD, test "x${enable_systemd}" = "xyes")
119 AM_COND_IF([WITH_SYSTEMD],
120 AC_DEFINE([SYSTEMD], 1, [Enable support for systemd notifications]))
121 AS_IF([test "x${enable_systemd}" = "xyes"], [
122 PKG_CHECK_MODULES([SYSTEMD], [libsystemd])])
123
124 #
125 # Enable Callback Protocol Support, disabled by default
126 AC_ARG_ENABLE([cbcp],
127 AS_HELP_STRING([--enable-cbcp], [Enable Callback Protocol]))
128 AM_CONDITIONAL(PPP_WITH_CBCP, test "x${enable_cbcp}" = "xyes")
129 AM_COND_IF([PPP_WITH_CBCP],
130 AC_DEFINE([PPP_WITH_CBCP], 1, [Have Callback Protocol support]))
131
132 #
133 # Disable Microsoft extensions will remove CHAP, MPPE and PEAP support
134 AC_ARG_ENABLE([microsoft-extensions],
135 AS_HELP_STRING([--disable-microsoft-extensions], [Disable Microsoft CHAP / MPPE / PEAP extensions]))
136
137 AM_CONDITIONAL(PPP_WITH_CHAPMS, test "x${enable_microsoft_extensions}" != "xno")
138 AM_COND_IF([PPP_WITH_CHAPMS],
139 AC_DEFINE([PPP_WITH_CHAPMS], 1, [Have Microsoft CHAP support]))
140
141 AM_CONDITIONAL(PPP_WITH_MPPE, test "x${build_sunos}" != "xyes" && test "x${enable_microsoft_extensions}" != "xno")
142 AM_COND_IF([PPP_WITH_MPPE],
143 AC_DEFINE([PPP_WITH_MPPE], 1, [Have Microsoft MPPE support]))
144
145 #
146 # Enable Microsoft LAN Manager support, depends on Microsoft Extensions
147 AC_ARG_ENABLE([mslanman],
148 AS_HELP_STRING([--enable-mslanman], [Enable Microsoft LAN Manager support]))
149 AS_IF([test "x${enable_mslanman}" = "xyes" && test "x${enable_microsoft_extensions}" != "xno"],
150 AC_DEFINE([PPP_WITH_MSLANMAN], 1, [Have Microsoft LAN Manager support]))
151
152 #
153 # Disable IPv6 support
154 AC_ARG_ENABLE([ipv6cp],
155 AS_HELP_STRING([--disable-ipv6cp], [Disable IPv6 Control Protocol]))
156 AM_CONDITIONAL(PPP_WITH_IPV6CP, test "x${enable_ipv6cp}" != "xno")
157 AM_COND_IF([PPP_WITH_IPV6CP],
158 AC_DEFINE(PPP_WITH_IPV6CP, 1, [Have IPv6 Control Protocol]))
159
160 #
161 # Disable Multilink support
162 AC_ARG_ENABLE([multilink],
163 AS_HELP_STRING([--enable-multilink], [Enable multilink support]))
164 AM_CONDITIONAL(PPP_WITH_MULTILINK, test "x${enable_multilink}" = "xyes")
165 AM_COND_IF([PPP_WITH_MULTILINK],
166 AC_DEFINE([PPP_WITH_MULTILINK], 1, [Have multilink support]))
167 AS_IF([test "x${build_sunos}" = "xyes" && test "x${enable_multilink}" = "xyes"],
168 [AC_MSG_ERROR([Multilink is not supported on SunOS])])
169
170 #
171 # Multilink require Trivial Database Support
172 AM_CONDITIONAL(PPP_WITH_TDB, test "x${enable_multilink}" = "xyes")
173 AM_COND_IF([PPP_WITH_TDB],
174 AC_DEFINE([PPP_WITH_TDB], 1, [Include TDB support]))
175
176 #
177 # Enable support for loadable plugins
178 AC_ARG_ENABLE([plugins],
179 AS_HELP_STRING([--disable-plugins], [Disable support for loadable plugins]))
180 AS_IF([test "x$enable_plugins" != "xno"],
181 AC_DEFINE([PPP_WITH_PLUGINS], 1, [Have support for loadable plugins]))
182 AM_CONDITIONAL(PPP_WITH_PLUGINS, test "x${enable_plugins}" != "xno")
183
184 #
185 # Disable EAP-TLS support
186 AC_ARG_ENABLE([eaptls],
187 AS_HELP_STRING([--disable-eaptls], [Disable EAP-TLS authentication support]))
188 AS_IF([test "x$enable_eaptls" != "xno"],
189 AC_DEFINE([PPP_WITH_EAPTLS], 1, [Have EAP-TLS authentication support]))
190 AM_CONDITIONAL(PPP_WITH_EAPTLS, test "x${enable_eaptls}" != "xno")
191
192 #
193 # Disable PEAP support
194 AC_ARG_ENABLE([peap],
195 AS_HELP_STRING([--disable-peap], [Disable PEAP authentication support]))
196 AS_IF([test "x${enable_peap}" != "xno" && test "x${enable_microsoft_extensions}" != "xno"],
197 AC_DEFINE([PPP_WITH_PEAP], 1, [Have PEAP authentication support]))
198 AM_CONDITIONAL([PPP_WITH_PEAP], test "x${enable_peap}" != "xno" && test "x${enable_microsoft_extensions}" != "xno")
199
200 #
201 # Disable OpenSSL engine support
202 AC_ARG_ENABLE([openssl-engine],
203 AS_HELP_STRING([--disable-openssl-engine], [Disable OpenSSL engine support]))
204 AS_IF([test "x$enable_openssl_engine" != "xno"], [],
205 AC_DEFINE([OPENSSL_NO_ENGINE], 1, [OpenSSL engine support]))
206
207 #
208 # Specify runtime directory
209 AC_ARG_WITH([plugin-dir],
210 AS_HELP_STRING([--with-plugin-dir=DIR],[Specify the plugin directory for pppd]))
211 AS_IF([test -n "$with_plugin_dir"],
212 [PPPD_PLUGIN_DIR="$with_plugin_dir"],
213 [PPPD_PLUGIN_DIR="${libdir}/pppd/$VERSION"])
214 AC_SUBST(PPPD_PLUGIN_DIR, "$PPPD_PLUGIN_DIR", [The pppd plugin directory])
215
216 #
217 # Specify runtime directory
218 AC_ARG_WITH([runtime-dir],
219 AS_HELP_STRING([--with-runtime-dir=DIR],[Specify the runtime directory for pppd]))
220 AS_IF([test -n "$with_runtime_dir"],
221 [PPPD_RUNTIME_DIR="$with_runtime_dir"],
222 [PPPD_RUNTIME_DIR="${runstatedir}/pppd"])
223 AC_SUBST(PPPD_RUNTIME_DIR)
224
225 #
226 # Specify runtime directory
227 AC_ARG_WITH([logfile-dir],
228 AS_HELP_STRING([--with-logfile-dir=DIR],[Specify the log directory for pppd]))
229 AS_IF([test -n "$with_logfile_dir"],
230 [PPPD_LOGFILE_DIR="$with_logfile_dir"],
231 [PPPD_LOGFILE_DIR="${localstatedir}/log/ppp"])
232 AC_SUBST(PPPD_LOGFILE_DIR)
233
234 #
235 # System CA certificates path
236 AC_ARG_WITH(system-ca-path,
237 AS_HELP_STRING([--with-system-ca-path=/path/to/ssl/certs], [path to system CA certificates]),
238 [
239 case "$withval" in
240 "" | y | ye | yes)
241 with_system_ca_path="${sysconfdir}/ssl/certs"
242 ;;
243 n | no)
244 ;;
245 *)
246 with_system_ca_path="$withval"
247 ;;
248 esac
249 ],[with_system_ca_path="${sysconfdir}/ssl/certs"])
250 AM_CONDITIONAL(PPP_WITH_SYSTEM_CA_PATH, [test "$with_system_ca_path" != "no"])
251 AM_COND_IF(PPP_WITH_SYSTEM_CA_PATH, [
252 SYSTEM_CA_PATH="$with_system_ca_path"
253 ])
254 AC_SUBST(SYSTEM_CA_PATH)
255
256 #
257 # Check for OpenSSL
258 AX_CHECK_OPENSSL
259 AM_CONDITIONAL(PPP_WITH_OPENSSL, test "x${with_openssl}" != "xno")
260 AM_COND_IF([PPP_WITH_OPENSSL],
261 AC_DEFINE([PPP_WITH_OPENSSL], 1, [PPP is compiled with openssl support]))
262
263 #
264 # Check if OpenSSL has compiled in support for various ciphers
265 AS_IF([test "x${with_openssl}" != "xno" ], [
266 AX_CHECK_OPENSSL_DEFINE([OPENSSL_NO_MD4], [md4])
267 AX_CHECK_OPENSSL_DEFINE([OPENSSL_NO_MD5], [md5])
268 AX_CHECK_OPENSSL_DEFINE([OPENSSL_NO_DES], [des])
269 AX_CHECK_OPENSSL_DEFINE([OPENSSL_NO_SHA], [sha])
270 ], [
271 AS_IF([test "x${enable_eaptls}" != "xno" || test "x${enable_peap}" != "xno"],
272 [AC_MSG_ERROR([OpenSSL not found, and if this is your intention then run configure --disable-eaptls and --disable-peap])])
273 ])
274
275 AM_CONDITIONAL([OPENSSL_HAVE_MD4], test "x${ac_cv_openssl_md4}" = "xyes")
276 AM_COND_IF([OPENSSL_HAVE_MD4],
277 AC_DEFINE([OPENSSL_HAVE_MD4], 1, [Use MD4 included with openssl]))
278
279 AM_CONDITIONAL([OPENSSL_HAVE_MD5], test "x${ac_cv_openssl_md5}" = "xyes")
280 AM_COND_IF([OPENSSL_HAVE_MD5],
281 AC_DEFINE([OPENSSL_HAVE_MD5], 1, [Use MD5 included with openssl]))
282
283 AM_CONDITIONAL([OPENSSL_HAVE_SHA], test "x${ac_cv_openssl_sha}" = "xyes")
284 AM_COND_IF([OPENSSL_HAVE_SHA],
285 AC_DEFINE([OPENSSL_HAVE_SHA], 1, [Use SHA included with openssl]))
286
287 AM_CONDITIONAL([OPENSSL_HAVE_DES], test "x${ac_cv_openssl_des}" = "xyes")
288 AM_COND_IF([OPENSSL_HAVE_DES],
289 AC_DEFINE([OPENSSL_HAVE_DES], 1, [Use DES included with openssl]))
290
291 #
292 # With libsrp support
293 AX_CHECK_SRP([
294 AC_DEFINE([PPP_WITH_SRP], 1, [Support for libsrp authentication module])])
295
296 #
297 # With libatm support
298 AX_CHECK_ATM
299
300 #
301 # With libpam support
302 AX_CHECK_PAM(AC_DEFINE([PPP_WITH_PAM], 1, [Support for Pluggable Authentication Modules]))
303 AM_CONDITIONAL(PPP_WITH_PAM, test "x${with_pam}" = "xyes")
304
305 #
306 # With libpcap support, activate pppd on network activity
307 AX_CHECK_PCAP
308
309 #
310 # SunOS provides a version of libpcap that would work, but SunOS has no support for activity filter
311 AM_CONDITIONAL([PPP_WITH_FILTER], [ test "x${with_pcap}" = "xyes" && test "x${build_sunos}" != "xyes" ])
312 AM_COND_IF([PPP_WITH_FILTER], [
313 AC_DEFINE([PPP_WITH_FILTER], 1, [Have packet activity filter support])], [
314 AS_IF([test "x${build_sunos}" = "xyes"], [
315 AC_MSG_WARN([Packet activity filter not supported on SunOS])
316 with_pcap="no"
317 ])
318 ])
319
320 AC_DEFINE_UNQUOTED(PPPD_VERSION, "$VERSION", [Version of pppd])
321
322 AC_CONFIG_FILES([
323 Makefile
324 chat/Makefile
325 include/Makefile
326 pppd/Makefile
327 pppd/pppd.pc
328 pppd/plugins/Makefile
329 pppd/plugins/pppoe/Makefile
330 pppd/plugins/pppoatm/Makefile
331 pppd/plugins/pppol2tp/Makefile
332 pppd/plugins/radius/Makefile
333 pppdump/Makefile
334 pppstats/Makefile
335 scripts/Makefile
336 ])
337 AC_OUTPUT
338
339
340 echo "
341 $PACKAGE_NAME version $PACKAGE_VERSION
342 Prefix...............: $prefix
343 Runtime Dir..........: $PPPD_RUNTIME_DIR
344 Logfile Dir..........: $PPPD_LOGFILE_DIR
345 Plugin Dir...........: $PPPD_PLUGIN_DIR
346 System CA Path ......: ${SYSTEM_CA_PATH:-not set}
347 With OpenSSL.........: ${with_openssl:-yes}
348 With libatm..........: ${with_atm:-no}
349 With libpam..........: ${with_pam:-no}
350 With libpcap.........: ${with_pcap:-no}
351 With libsrp..........: ${with_srp:-no}
352 C Compiler...........: $CC $CFLAGS
353 Linker...............: $LD $LDFLAGS $LIBS
354
355 Features enabled
356 Microsoft Extensions.: ${enable_microsoft_extensions:-yes}
357 Multilink............: ${enable_multilink:-no}
358 Plugins..............: ${enable_plugins:-yes}
359 CBCP.................: ${enable_cbcp:-no}
360 IPV6CP...............: ${enable_ipv6cp:-yes}
361 EAP-TLS..............: ${enable_eaptls:-yes}
362 systemd notifications: ${enable_systemd:-no}
363 "