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 pppd/plugins/pppoe/config.h])
17 # Checks for programs.
38 AC_MSG_ERROR(["OS ${host_os} not supported"])
42 AM_CONDITIONAL([LINUX], [test "x${build_linux}" = "xyes" ])
43 AM_CONDITIONAL([SUNOS], [test "x${build_sunos}" = "xyes" ])
45 CFLAGS="$CFLAGS -DSOL2 -DSRV4")
48 # Checks for header files, these will set the HAVE_[FILE]_H macros in config.h
67 # Check for linux specific headers, required by pppoe, or pppol2tp
78 netpacket/packet.h])])
80 AC_CHECK_SIZEOF(unsigned int)
81 AC_CHECK_SIZEOF(unsigned long)
82 AC_CHECK_SIZEOF(unsigned short)
84 # Checks for library functions.
91 # If libc doesn't provide logwtmp, check if libutil provides logwtmp(), and if so link to it.
92 AS_IF([test "x${ac_cv_func_logwtmp}" != "xyes"], [
93 AC_CHECK_LIB([util], [logwtmp], [
94 AC_DEFINE(HAVE_LOGWTMP, 1, [System provides the logwtmp() function])
95 AC_SUBST([UTIL_LIBS], ["-lutil"])
100 # Check if libcrypt have crypt() function
101 AC_CHECK_LIB([crypt], [crypt],
102 AC_SUBST([CRYPT_LIBS], ["-lcrypt"]))
105 # Should pppd link with -lsystemd (Linux only)
106 AC_ARG_ENABLE([systemd],
107 AS_HELP_STRING([--enable-systemd], [Enable support for systemd notification]))
108 AM_CONDITIONAL(WITH_SYSTEMD, test "x${enable_systemd}" = "xyes")
109 AM_COND_IF([WITH_SYSTEMD],
110 AC_DEFINE([SYSTEMD], 1, [Enable support for systemd notifications]))
111 AS_IF([test "x${enable_systemd}" = "xyes"], [
112 PKG_CHECK_MODULES([SYSTEMD], [libsystemd])])
115 # Enable Callback Protocol Support, disabled by default
116 AC_ARG_ENABLE([cbcp],
117 AS_HELP_STRING([--enable-cbcp], [Enable Callback Protocol]))
118 AM_CONDITIONAL(PPP_WITH_CBCP, test "x${enable_cbcp}" = "xyes")
119 AM_COND_IF([PPP_WITH_CBCP],
120 AC_DEFINE([PPP_WITH_CBCP], 1, [Have Callback Protocol support]))
123 # Disable Microsoft extensions will remove CHAP and MPPE support
124 AC_ARG_ENABLE([microsoft-extensions],
125 AS_HELP_STRING([--disable-microsoft-extensions], [Disable Microsoft CHAP / MPPE extensions]))
127 AM_CONDITIONAL(PPP_WITH_CHAPMS, test "x${enable_microsoft_extensions}" != "xno")
128 AM_COND_IF([PPP_WITH_CHAPMS],
129 AC_DEFINE([PPP_WITH_CHAPMS], 1, [Have Microsoft CHAP support]))
131 AM_CONDITIONAL(PPP_WITH_MPPE, test "x${enable_microsoft_extensions}" != "xno")
132 AM_COND_IF([PPP_WITH_MPPE],
133 AC_DEFINE([PPP_WITH_MPPE], 1, [Have Microsoft MPPE support]))
136 # Enable Microsoft LAN Manager support, depends on Microsoft Extensions
137 AC_ARG_ENABLE([mslanman],
138 AS_HELP_STRING([--enable-mslanman], [Enable Microsoft LAN Manager support]))
139 AS_IF([test "x${enable_mslanman}" = "xyes" && test "x${enable_microsoft_extensions}" != "xno"],
140 AC_DEFINE([PPP_WITH_MSLANMAN], 1, [Have Microsoft LAN Manager support]))
143 # Disable IPv6 support
144 AC_ARG_ENABLE([ipv6cp],
145 AS_HELP_STRING([--disable-ipv6cp], [Disable IPv6 Control Protocol]))
146 AM_CONDITIONAL(PPP_WITH_IPV6CP, test "x${enable_ipv6cp}" != "xno")
147 AM_COND_IF([PPP_WITH_IPV6CP],
148 AC_DEFINE(PPP_WITH_IPV6CP, 1, [Have IPv6 Control Protocol]))
151 # Disable Multilink support
152 AC_ARG_ENABLE([multilink],
153 AS_HELP_STRING([--enable-multilink], [Enable multilink support]))
154 AM_CONDITIONAL(PPP_WITH_MULTILINK, test "x${enable_multilink}" = "xyes")
155 AM_COND_IF([PPP_WITH_MULTILINK],
156 AC_DEFINE([PPP_WITH_MULTILINK], 1, [Have multilink support]))
157 AS_IF([test "x${build_sunos}" = "xyes" && test "x${enable_multilink}" = "xyes"],
158 [AC_MSG_ERROR([Multilink is not supported on SunOS])])
161 # Multilink require Trivial Database Support
162 AM_CONDITIONAL(PPP_WITH_TDB, test "x${enable_multilink}" = "xyes")
163 AM_COND_IF([PPP_WITH_TDB],
164 AC_DEFINE([PPP_WITH_TDB], 1, [Include TDB support]))
167 # Enable support for loadable plugins
168 AC_ARG_ENABLE([plugins],
169 AS_HELP_STRING([--disable-plugins], [Disable support for loadable plugins]))
170 AS_IF([test "x$enable_plugins" != "xno"],
171 AC_DEFINE([PPP_WITH_PLUGINS], 1, [Have support for loadable plugins]))
172 AM_CONDITIONAL(PPP_WITH_PLUGINS, test "x${enable_plugins}" != "xno")
175 # Disable EAP-TLS support
176 AC_ARG_ENABLE([eaptls],
177 AS_HELP_STRING([--disable-eaptls], [Disable EAP-TLS authentication support]))
178 AS_IF([test "x$enable_eaptls" != "xno"],
179 AC_DEFINE([PPP_WITH_EAPTLS], 1, [Have EAP-TLS authentication support]))
180 AM_CONDITIONAL(PPP_WITH_EAPTLS, test "x${enable_eaptls}" != "xno")
183 # Disable PEAP support
184 AC_ARG_ENABLE([peap],
185 AS_HELP_STRING([--disable-peap], [Disable PEAP authentication support]))
186 AS_IF([test "x${enable_peap}" != "xno"],
187 AC_DEFINE([PPP_WITH_PEAP], 1, [Have PEAP authentication support]))
188 AM_CONDITIONAL([PPP_WITH_PEAP], test "x${enable_peap}" != "xno")
191 # Disable OpenSSL engine support
192 AC_ARG_ENABLE([openssl-engine],
193 AS_HELP_STRING([--disable-openssl-engine], [Disable OpenSSL engine support]))
194 AS_IF([test "x$enable_openssl_engine" != "xno"], [],
195 AC_DEFINE([OPENSSL_NO_ENGINE], 1, [OpenSSL engine support]))
198 # Specify runtime directory
199 AC_ARG_WITH([plugin-dir],
200 AS_HELP_STRING([--with-plugin-dir=DIR],[Specify the plugin directory for pppd]))
201 AS_IF([test -n "$with_plugin_dir"],
202 [PPPD_PLUGIN_DIR="$with_plugin_dir"],
203 [PPPD_PLUGIN_DIR="${libdir}/pppd/$VERSION"])
204 AC_SUBST(PPPD_PLUGIN_DIR, "$PPPD_PLUGIN_DIR", [The pppd plugin directory])
207 # Specify runtime directory
208 AC_ARG_WITH([runtime-dir],
209 AS_HELP_STRING([--with-runtime-dir=DIR],[Specify the runtime directory for pppd]))
210 AS_IF([test -n "$with_runtime_dir"],
211 [PPPD_RUNTIME_DIR="$with_runtime_dir"],
212 [PPPD_RUNTIME_DIR="${runstatedir}/pppd"])
213 AC_SUBST(PPPD_RUNTIME_DIR)
216 # Specify runtime directory
217 AC_ARG_WITH([logfile-dir],
218 AS_HELP_STRING([--with-logfile-dir=DIR],[Specify the log directory for pppd]))
219 AS_IF([test -n "$with_logfile_dir"],
220 [PPPD_LOGFILE_DIR="$with_logfile_dir"],
221 [PPPD_LOGFILE_DIR="${localstatedir}/log/ppp"])
222 AC_SUBST(PPPD_LOGFILE_DIR)
227 AM_CONDITIONAL(PPP_WITH_OPENSSL, test "x${with_openssl}" != "xno")
228 AM_COND_IF([PPP_WITH_OPENSSL],
229 AC_DEFINE([PPP_WITH_OPENSSL], 1, [PPP is compiled with openssl support]))
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([OPENSSL_HAVE_MD4], 1, [Use MD4 included with openssl]))
247 AM_CONDITIONAL([OPENSSL_HAVE_MD5], test "x${ac_cv_openssl_md5}" = "xyes")
248 AM_COND_IF([OPENSSL_HAVE_MD5],
249 AC_DEFINE([OPENSSL_HAVE_MD5], 1, [Use MD5 included with openssl]))
251 AM_CONDITIONAL([OPENSSL_HAVE_SHA], test "x${ac_cv_openssl_sha}" = "xyes")
252 AM_COND_IF([OPENSSL_HAVE_SHA],
253 AC_DEFINE([OPENSSL_HAVE_SHA], 1, [Use SHA included with openssl]))
255 AM_CONDITIONAL([OPENSSL_HAVE_DES], test "x${ac_cv_openssl_des}" = "xyes")
256 AM_COND_IF([OPENSSL_HAVE_DES],
257 AC_DEFINE([OPENSSL_HAVE_DES], 1, [Use DES included with openssl]))
260 # With libsrp support
262 AC_DEFINE([PPP_WITH_SRP], 1, [Support for libsrp authentication module])])
265 # With libatm support
269 # With libpam support
270 AX_CHECK_PAM(AC_DEFINE([PPP_WITH_PAM], 1, [Support for Pluggable Authentication Modules]))
271 AM_CONDITIONAL(PPP_WITH_PAM, test "x${with_pam}" = "xyes")
274 # With libpcap support, activate pppd on network activity
278 # SunOS provides a version of libpcap that would work, but SunOS has no support for activity filter
279 AM_CONDITIONAL([PPP_WITH_FILTER], [ test "x${with_pcap}" = "xyes" && test "x${build_sunos}" != "xyes" ])
280 AM_COND_IF([PPP_WITH_FILTER], [
281 AC_DEFINE([PPP_WITH_FILTER], 1, [Have packet activity filter support])], [
282 AS_IF([test "x${build_sunos}" = "xyes"], [
283 AC_MSG_WARN([Packet activity filter not supported on SunOS])
289 # Some contributions require GTK/GLIB
290 AC_ARG_WITH([gtk], AS_HELP_STRING([--with-gtk], [Build contributions with the GTK+ interface]))
291 if test "x${with_gtk}" = "xyes"; then
292 PKG_CHECK_MODULES([GTK], [gtk+-2.0])
293 PKG_CHECK_MODULES([GLIB], [glib-2.0])
295 AM_CONDITIONAL([WITH_GTK], test "x${with_gtk}" = "xyes")
297 AC_DEFINE_UNQUOTED(PPPD_VERSION, "$VERSION", [Version of pppd])
303 contrib/pppgetpass/Makefile
309 pppd/plugins/Makefile
310 pppd/plugins/pppoe/Makefile
311 pppd/plugins/pppoatm/Makefile
312 pppd/plugins/pppol2tp/Makefile
313 pppd/plugins/radius/Makefile
321 AS_IF([test "x${build_sunos}" = "xyes" ], [[
323 Setting up SunOS kernel module(s)"
328 sed -e "s,@DESTDIR@,$prefix,g" \
329 -e "s,@SYSCONF@,$sysconfdir,g" \
331 -e "s|@CFLAGS@|$CFLAGS|g" $1 > $2
336 karch=`/usr/bin/isainfo -k`
352 if [ -x /opt/SUNWspro/bin/cc -a "$usegcc" != gcc ] &&
353 /opt/SUNWspro/bin/cc -flags >/dev/null 2>&1; then
354 if [ "$archvariant" = "-64x" ]; then
355 ( cd /tmp; echo "int x;" > ppp$$.c
356 /opt/SUNWspro/bin/cc -c -errwarn -xchip=opteron -m64 ppp$$.c >/dev/null 2>&1 || (
357 echo "WorkShop C is unable to make 64 bit modules, and your $karch system needs"
358 echo "them. Consider upgrading cc on this machine."
362 rm -f ppp$$.c ppp$$.o
365 elif gcc --version >/dev/null 2>&1; then
366 archvariant=gcc$archvariant
368 if [ "$archvariant" = "gcc-64" -o"$archvariant" = "gcc-64x" ]; then
369 ( cd /tmp; touch ppp$$.c
370 gcc -c -m64 ppp$$.c >/dev/null 2>&1 || (
371 echo "gcc is unable to make 64 bit modules, and your $karch system needs them."
372 echo "Consider upgrading gcc on this machine, or switching to Sun WorkShop."
376 rm -f ppp$$.c ppp$$.o
380 echo "C compiler not found; hoping for the best."
383 mkmkf solaris/Makedefs$compiletype Makedefs.com
384 mkmkf solaris/Makefile.sol2$archvariant solaris/Makefile
388 $PACKAGE_NAME version $PACKAGE_VERSION
389 Prefix...............: $prefix
390 Runtime Dir..........: $PPPD_RUNTIME_DIR
391 Logfile Dir..........: $PPPD_LOGFILE_DIR
392 Plugin Dir...........: $PPPD_PLUGIN_DIR
393 With OpenSSL.........: ${with_openssl:-yes}
394 With libatm..........: ${with_atm:-no}
395 With libpam..........: ${with_pam:-no}
396 With libpcap.........: ${with_pcap:-no}
397 With libsrp..........: ${with_srp:-no}
398 C Compiler...........: $CC $CFLAGS
399 Linker...............: $LD $LDFLAGS $LIBS
402 Microsoft Extensions.: ${enable_microsoft_extensions:-yes}
403 Multilink............: ${enable_multilink:-no}
404 Plugins..............: ${enable_plugins:-yes}
405 CBCP.................: ${enable_cbcp:-no}
406 IPV6CP...............: ${enable_ipv6cp:-yes}
407 EAP-TLS..............: ${enable_eaptls:-yes}
408 PEAP.................: ${enable_peap:-yes}
409 systemd notifications: ${enable_systemd:-no}