4 [https://github.com/ppp-project/ppp])
6 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
7 AC_CONFIG_MACRO_DIR([m4])
10 AM_MAINTAINER_MODE([enable])
13 AC_CONFIG_SRCDIR([pppd/main.c])
14 AC_CONFIG_HEADERS([pppd/config.h pppd/pppdconf.h])
16 # Checks for programs.
37 AC_MSG_ERROR(["OS ${host_os} not supported"])
41 AM_CONDITIONAL([LINUX], [test "${build_linux}" = "yes" ])
42 AM_CONDITIONAL([SUNOS], [test "${build_sunos}" = "yes" ])
44 CFLAGS="$CFLAGS -DSOL2 -DSRV4")
47 # Checks for header files, these will set the HAVE_[FILE]_H macros in config.h
64 # Check for linux specific headers, required by pppoe, or pppol2tp
75 netpacket/packet.h])])
77 AC_CHECK_SIZEOF(unsigned int)
78 AC_CHECK_SIZEOF(unsigned long)
79 AC_CHECK_SIZEOF(unsigned short)
81 # Checks for library functions.
88 # If libc doesn't provide logwtmp, check if libutil provides logwtmp(), and if so link to it.
89 AS_IF([test "x${ac_cv_func_logwtmp}" != "xyes"], [
90 AC_CHECK_LIB([util], [logwtmp], [
91 AC_DEFINE(HAVE_LOGWTMP, 1, ["System provides the logwtmp() function"])
92 AC_SUBST([UTIL_LIBS], ["-lutil"])
97 # Check if libcrypt have crypt() function
98 AC_CHECK_LIB([crypt], [crypt],
99 AC_SUBST([CRYPT_LIBS], ["-lcrypt"]))
102 # Should pppd link with -lsystemd (Linux only)
103 AC_ARG_ENABLE([systemd],
104 AS_HELP_STRING([--enable-systemd], [Enable support for systemd notification]))
105 AM_CONDITIONAL(WITH_SYSTEMD, test "x${enable_systemd}" = "xyes")
106 AM_COND_IF([WITH_SYSTEMD],
107 AC_DEFINE([SYSTEMD], 1, [Enable support for systemd notifications]))
110 # Enable Callback Protocol Support, disabled by default
111 AC_ARG_ENABLE([cbcp],
112 AS_HELP_STRING([--enable-cbcp], [Enable Callback Protocol]))
113 AM_CONDITIONAL(WITH_CBCP, test "x${enable_cbcp}" = "xyes")
114 AM_COND_IF([WITH_CBCP],
115 AC_DEFINE([CBCP_SUPPORT], 1, [Have Callback Protocol support]))
118 # Disable support for limiting session duration by maximum octets
119 AC_ARG_ENABLE([maxoctets],
120 AS_HELP_STRING([--disable-maxoctets], [Disable support for limiting session by maximum octets]))
121 AS_IF([test "x$enable_maxoctets" != "xno"],
122 AC_DEFINE([MAXOCTETS], 1, ["Limit sessions by maximum number of octets"]))
125 # Disable Microsoft extensions will remove CHAP and MPPE support
126 AC_ARG_ENABLE([microsoft-extensions],
127 AS_HELP_STRING([--disable-microsoft-extensions], [Disable Microsoft CHAP / MPPE extensions]))
129 AM_CONDITIONAL(WITH_CHAPMS, test "x${enable_microsoft_extensions}" != "xno")
130 AM_COND_IF([WITH_CHAPMS],
131 AC_DEFINE([CHAPMS], 1, ["Have Microsoft CHAP support"]))
133 AM_CONDITIONAL(WITH_MPPE, test "x${enable_microsoft_extensions}" != "xno")
134 AM_COND_IF([WITH_MPPE],
135 AC_DEFINE([MPPE], 1, ["Have Microsoft MPPE support"]))
138 # Enable Microsoft LAN Manager support, depends on Microsoft Extensions
139 AC_ARG_ENABLE([mslanman],
140 AS_HELP_STRING([--enable-mslanman], [Enable Microsoft LAN Manager support]))
141 AS_IF([test "x${enable_mslanman}" = "xyes" && test "x${enable_microsoft_extensions}" != "xno"],
142 AC_DEFINE([MSLANMAN], 1, ["Have Microsoft LAN Manager support"]))
145 # Disable IPv6 support
146 AC_ARG_ENABLE([ipv6-support],
147 AS_HELP_STRING([--disable-ipv6-support], [Disable IPv6 support]))
148 AM_CONDITIONAL(WITH_INET6, test "x${enable_ipv6_support}" != "xno")
149 AM_COND_IF([WITH_INET6],
150 AC_DEFINE(INET6, 1, ["Have IPv6 support"]))
153 # Disable Multilink support
154 AC_ARG_ENABLE([multilink],
155 AS_HELP_STRING([--enable-multilink], [Enable multilink support]))
156 AM_CONDITIONAL(WITH_MULTILINK, test "x${enable_multilink}" = "xyes")
157 AM_COND_IF([WITH_MULTILINK],
158 AC_DEFINE([HAVE_MULTILINK], 1, ["Have multilink support"]))
159 AS_IF([test "x${build_sunos}" = "xyes" && test "x${enable_multilink}" = "xyes"],
160 [AC_MSG_ERROR([Multilink is not supported on SunOS])])
163 # Multilink require Trivial Database Support
164 AM_CONDITIONAL(WITH_TDB, test "x${enable_multilink}" = "xyes")
165 AM_COND_IF([WITH_TDB],
166 AC_DEFINE([USE_TDB], 1, ["Include TDB support"]))
169 # Enable support for loadable plugins
170 AC_ARG_ENABLE([plugins],
171 AS_HELP_STRING([--disable-plugins], [Disable support for loadable plugins]))
172 AS_IF([test "x$enable_plugins" != "xno"],
173 AC_DEFINE([PLUGIN], 1, ["Have support for loadable plugins"]))
174 AM_CONDITIONAL(WITH_PLUGINS, test "${enable_plugins}" != "no")
177 # Disable EAP-TLS support
178 AC_ARG_ENABLE([eaptls],
179 AS_HELP_STRING([--disable-eaptls], [Disable EAP-TLS authentication support]))
180 AS_IF([test "x$enable_eaptls" != "xno"],
181 AC_DEFINE([USE_EAPTLS], 1, ["Have EAP-TLS authentication support"]))
182 AM_CONDITIONAL(WITH_EAPTLS, test "x${enable_eaptls}" != "xno")
185 # Disable PEAP support
186 AC_ARG_ENABLE([peap],
187 AS_HELP_STRING([--disable-peap], [Disable PEAP authentication support]))
188 AS_IF([test "x${enable_peap}" != "xno"],
189 AC_DEFINE([USE_PEAP], 1, ["Have PEAP authentication support"]))
190 AM_CONDITIONAL([WITH_PEAP], test "x${enable_peap}" != "xno")
193 # Disable OpenSSL engine support
194 AC_ARG_ENABLE([openssl-engine],
195 AS_HELP_STRING([--disable-openssl-engine], [Disable OpenSSL engine support]))
196 AS_IF([test "x$enable_openssl_engine" != "xno"], [],
197 AC_DEFINE([OPENSSL_NO_ENGINE], 1, ["OpenSSL engine support"]))
200 # Specify runtime directory
201 AC_ARG_WITH([plugin-dir],
202 AC_HELP_STRING([--with-plugin-dir=DIR], [Specify the plugin directory for pppd]))
203 AS_IF([test -n "$with_plugin_dir"],
204 [PPPD_PLUGIN_DIR="$with_plugin_dir"],
205 [PPPD_PLUGIN_DIR="${libdir}/pppd/$VERSION"])
206 AC_SUBST(PPPD_PLUGIN_DIR, "$PPPD_PLUGIN_DIR", [The pppd plugin directory])
209 # Specify runtime directory
210 AC_ARG_WITH([runtime-dir],
211 AC_HELP_STRING([--with-runtime-dir=DIR], [Specify the runtime directory for pppd]))
212 AS_IF([test -n "$with_runtime_dir"],
213 [PPPD_RUNTIME_DIR="$with_runtime_dir"],
214 [PPPD_RUNTIME_DIR="${localstatedir}/run/pppd"])
215 AC_SUBST(PPPD_RUNTIME_DIR)
218 # Specify runtime directory
219 AC_ARG_WITH([logfile-dir],
220 AC_HELP_STRING([--with-logfile-dir=DIR], [Specify the log directory for pppd]))
221 AS_IF([test -n "$with_logfile_dir"],
222 [PPPD_LOGFILE_DIR="$with_logfile_dir"],
223 [PPPD_LOGFILE_DIR="${localstatedir}/log/pppd"])
224 AC_SUBST(PPPD_LOGFILE_DIR)
229 AM_CONDITIONAL(WITH_OPENSSL, test "${with_openssl}" != "no")
232 # Check if OpenSSL has compiled in support for various ciphers
233 AS_IF([test "x${with_openssl}" != "xno" ], [
234 AX_CHECK_OPENSSL_DEFINE([OPENSSL_NO_MD4], [md4])
235 AX_CHECK_OPENSSL_DEFINE([OPENSSL_NO_MD5], [md5])
236 AX_CHECK_OPENSSL_DEFINE([OPENSSL_NO_DES], [des])
237 AX_CHECK_OPENSSL_DEFINE([OPENSSL_NO_SHA], [sha])
239 AS_IF([test "x${enable_eaptls}" != "xno" || test "x${enable_peap}" != "xno"],
240 [AC_MSG_ERROR([OpenSSL not found, and if this is your intention then run configure --disable-eaptls and --disable-peap])])
243 AM_CONDITIONAL([OPENSSL_HAVE_MD4], test "x${ac_cv_openssl_md4}" = "xyes")
244 AM_COND_IF([OPENSSL_HAVE_MD4],,
245 AC_DEFINE([USE_MD4], 1, [Use included md4 included with pppd]))
247 AM_CONDITIONAL([OPENSSL_HAVE_MD5], test "x${ac_cv_openssl_md5}" = "xyes")
248 AM_COND_IF([OPENSSL_HAVE_MD5],,
249 AC_DEFINE([USE_MD5], 1, [Use included md5 included with pppd]))
251 AM_CONDITIONAL([OPENSSL_HAVE_SHA], test "x${ac_cv_openssl_sha}" = "xyes")
252 AM_COND_IF([OPENSSL_HAVE_SHA],,
253 AC_DEFINE([USE_SHA], 1, [Use included sha included with pppd]))
255 AM_CONDITIONAL([OPENSSL_HAVE_DES], test "x${ac_cv_openssl_des}" = "xyes")
256 AM_COND_IF([OPENSSL_HAVE_DES],,
257 AC_DEFINE([USE_CRYPT], 1, [Use included des included with pppd]))
260 # If OpenSSL doesn't support DES, then use the one from libcrypt (glibc dropped support for this in 2.27).
261 AS_IF([test "${ac_cv_openssl_des}" = "no" ], [
262 AC_CHECK_LIB([crypt], [encrypt],
263 [LIBS="$LIBS -lcrypt"],
264 [AC_MSG_ERROR([OpenSSL not found or does not support DES, and libcrypt also doesn't support encrypt])]
269 # With libsrp support
273 # With libatm support
277 # With libpam support
278 AX_CHECK_PAM(AC_DEFINE([USE_PAM], 1, ["Support for Pluggable Authentication Modules"]))
279 AM_CONDITIONAL(WITH_PAM, test "x${with_pam}" = "xyes")
282 # With libpcap support, activate pppd on network activity
286 # SunOS provides a version of libpcap that would work, but SunOS has no support for activity filter
287 AM_CONDITIONAL([WITH_FILTER], [ test "x${with_pcap}" = "xyes" && test "x${build_sunos}" != "xyes" ])
288 AM_COND_IF([WITH_FILTER], [
289 AC_DEFINE([PPP_FILTER], 1, ["Have packet activity filter support"])], [
290 AS_IF([test "x${build_sunos}" = "xyes"], [
291 AC_MSG_WARN([Packet activity filter not supported on SunOS])
297 # Some contributions require GTK/GLIB
298 AC_ARG_WITH([gtk], AS_HELP_STRING([--with-gtk], [Build contributions with the GTK+ interface]))
299 if test "x${with_gtk}" = "xyes"; then
300 PKG_CHECK_MODULES([GTK], [gtk+-2.0])
301 PKG_CHECK_MODULES([GLIB], [glib-2.0])
303 AM_CONDITIONAL([WITH_GTK], test "x${with_gtk}" = "xyes")
310 contrib/pppgetpass/Makefile
316 pppd/plugins/Makefile
317 pppd/plugins/pppoe/Makefile
318 pppd/plugins/pppoatm/Makefile
319 pppd/plugins/pppol2tp/Makefile
320 pppd/plugins/radius/Makefile
328 AS_IF([test "x${build_sunos}" = "xyes" ], [[
330 Setting up SunOS kernel module(s)"
335 sed -e "s,@DESTDIR@,$prefix,g" \
336 -e "s,@SYSCONF@,$sysconfdir,g" \
338 -e "s|@CFLAGS@|$CFLAGS|g" $1 > $2
343 karch=`/usr/bin/isainfo -k`
359 if [ -x /opt/SUNWspro/bin/cc -a "$usegcc" != gcc ] &&
360 /opt/SUNWspro/bin/cc -flags >/dev/null 2>&1; then
361 if [ "$archvariant" = "-64x" ]; then
362 ( cd /tmp; echo "int x;" > ppp$$.c
363 /opt/SUNWspro/bin/cc -c -errwarn -xchip=opteron -m64 ppp$$.c >/dev/null 2>&1 || (
364 echo "WorkShop C is unable to make 64 bit modules, and your $karch system needs"
365 echo "them. Consider upgrading cc on this machine."
369 rm -f ppp$$.c ppp$$.o
372 elif gcc --version >/dev/null 2>&1; then
373 archvariant=gcc$archvariant
375 if [ "$archvariant" = "gcc-64" -o"$archvariant" = "gcc-64x" ]; then
376 ( cd /tmp; touch ppp$$.c
377 gcc -c -m64 ppp$$.c >/dev/null 2>&1 || (
378 echo "gcc is unable to make 64 bit modules, and your $karch system needs them."
379 echo "Consider upgrading gcc on this machine, or switching to Sun WorkShop."
383 rm -f ppp$$.c ppp$$.o
387 echo "C compiler not found; hoping for the best."
390 mkmkf solaris/Makedefs$compiletype Makedefs.com
391 mkmkf solaris/Makefile.sol2$archvariant solaris/Makefile
395 $PACKAGE_NAME version $PACKAGE_VERSION
396 Prefix...............: $prefix
397 Runtime Dir..........: $PPPD_RUNTIME_DIR
398 Logfile Dir..........: $PPPD_LOGFILE_DIR
399 Plugin Dir...........: $PPPD_PLUGIN_DIR
400 With OpenSSL.........: ${with_openssl:-yes}
401 With libatm..........: ${with_atm:-no}
402 With libpam..........: ${with_pam:-no}
403 With libpcap.........: ${with_pcap:-no}
404 With libsrp..........: ${with_srp:-no}
405 C Compiler...........: $CC $CFLAGS
406 Linker...............: $LD $LDFLAGS $LIBS
409 Microsoft Extensions.: ${enable_microsoft_extensions:-yes}
410 Multilink............: ${enable_multilink:-no}
411 Plugins..............: ${enable_plugins:-yes}
412 CBCP.................: ${enable_cbcp:-no}
413 EAP-TLS..............: ${enable_eaptls:-yes}
414 PEAP.................: ${enable_peap:-yes}