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
79 AC_CHECK_TYPES([struct sockaddr_ll], [], [], [#include <linux/if_packet.h>])])
81 AC_CHECK_SIZEOF(unsigned int)
82 AC_CHECK_SIZEOF(unsigned long)
83 AC_CHECK_SIZEOF(unsigned short)
85 # Checks for library functions.
92 # If libc doesn't provide logwtmp, check if libutil provides logwtmp(), and if so link to it.
93 AS_IF([test "x${ac_cv_func_logwtmp}" != "xyes"], [
94 AC_CHECK_LIB([util], [logwtmp], [
95 AC_DEFINE(HAVE_LOGWTMP, 1, [System provides the logwtmp() function])
96 AC_SUBST([UTIL_LIBS], ["-lutil"])
101 # Check if libcrypt have crypt() function
102 AC_CHECK_LIB([crypt], [crypt],
103 AC_SUBST([CRYPT_LIBS], ["-lcrypt"]))
106 # Should pppd link with -lsystemd (Linux only)
107 AC_ARG_ENABLE([systemd],
108 AS_HELP_STRING([--enable-systemd], [Enable support for systemd notification]))
109 AM_CONDITIONAL(WITH_SYSTEMD, test "x${enable_systemd}" = "xyes")
110 AM_COND_IF([WITH_SYSTEMD],
111 AC_DEFINE([SYSTEMD], 1, [Enable support for systemd notifications]))
112 AS_IF([test "x${enable_systemd}" = "xyes"], [
113 PKG_CHECK_MODULES([SYSTEMD], [libsystemd])])
116 # Enable Callback Protocol Support, disabled by default
117 AC_ARG_ENABLE([cbcp],
118 AS_HELP_STRING([--enable-cbcp], [Enable Callback Protocol]))
119 AM_CONDITIONAL(PPP_WITH_CBCP, test "x${enable_cbcp}" = "xyes")
120 AM_COND_IF([PPP_WITH_CBCP],
121 AC_DEFINE([PPP_WITH_CBCP], 1, [Have Callback Protocol support]))
124 # Disable Microsoft extensions will remove CHAP and MPPE support
125 AC_ARG_ENABLE([microsoft-extensions],
126 AS_HELP_STRING([--disable-microsoft-extensions], [Disable Microsoft CHAP / MPPE extensions]))
128 AM_CONDITIONAL(PPP_WITH_CHAPMS, test "x${enable_microsoft_extensions}" != "xno")
129 AM_COND_IF([PPP_WITH_CHAPMS],
130 AC_DEFINE([PPP_WITH_CHAPMS], 1, [Have Microsoft CHAP support]))
132 AM_CONDITIONAL(PPP_WITH_MPPE, test "x${enable_microsoft_extensions}" != "xno")
133 AM_COND_IF([PPP_WITH_MPPE],
134 AC_DEFINE([PPP_WITH_MPPE], 1, [Have Microsoft MPPE support]))
137 # Enable Microsoft LAN Manager support, depends on Microsoft Extensions
138 AC_ARG_ENABLE([mslanman],
139 AS_HELP_STRING([--enable-mslanman], [Enable Microsoft LAN Manager support]))
140 AS_IF([test "x${enable_mslanman}" = "xyes" && test "x${enable_microsoft_extensions}" != "xno"],
141 AC_DEFINE([PPP_WITH_MSLANMAN], 1, [Have Microsoft LAN Manager support]))
144 # Disable IPv6 support
145 AC_ARG_ENABLE([ipv6cp],
146 AS_HELP_STRING([--disable-ipv6cp], [Disable IPv6 Control Protocol]))
147 AM_CONDITIONAL(PPP_WITH_IPV6CP, test "x${enable_ipv6cp}" != "xno")
148 AM_COND_IF([PPP_WITH_IPV6CP],
149 AC_DEFINE(PPP_WITH_IPV6CP, 1, [Have IPv6 Control Protocol]))
152 # Disable Multilink support
153 AC_ARG_ENABLE([multilink],
154 AS_HELP_STRING([--enable-multilink], [Enable multilink support]))
155 AM_CONDITIONAL(PPP_WITH_MULTILINK, test "x${enable_multilink}" = "xyes")
156 AM_COND_IF([PPP_WITH_MULTILINK],
157 AC_DEFINE([PPP_WITH_MULTILINK], 1, [Have multilink support]))
158 AS_IF([test "x${build_sunos}" = "xyes" && test "x${enable_multilink}" = "xyes"],
159 [AC_MSG_ERROR([Multilink is not supported on SunOS])])
162 # Multilink require Trivial Database Support
163 AM_CONDITIONAL(PPP_WITH_TDB, test "x${enable_multilink}" = "xyes")
164 AM_COND_IF([PPP_WITH_TDB],
165 AC_DEFINE([PPP_WITH_TDB], 1, [Include TDB support]))
168 # Enable support for loadable plugins
169 AC_ARG_ENABLE([plugins],
170 AS_HELP_STRING([--disable-plugins], [Disable support for loadable plugins]))
171 AS_IF([test "x$enable_plugins" != "xno"],
172 AC_DEFINE([PPP_WITH_PLUGINS], 1, [Have support for loadable plugins]))
173 AM_CONDITIONAL(PPP_WITH_PLUGINS, test "x${enable_plugins}" != "xno")
176 # Disable EAP-TLS support
177 AC_ARG_ENABLE([eaptls],
178 AS_HELP_STRING([--disable-eaptls], [Disable EAP-TLS authentication support]))
179 AS_IF([test "x$enable_eaptls" != "xno"],
180 AC_DEFINE([PPP_WITH_EAPTLS], 1, [Have EAP-TLS authentication support]))
181 AM_CONDITIONAL(PPP_WITH_EAPTLS, test "x${enable_eaptls}" != "xno")
184 # Disable PEAP support
185 AC_ARG_ENABLE([peap],
186 AS_HELP_STRING([--disable-peap], [Disable PEAP authentication support]))
187 AS_IF([test "x${enable_peap}" != "xno"],
188 AC_DEFINE([PPP_WITH_PEAP], 1, [Have PEAP authentication support]))
189 AM_CONDITIONAL([PPP_WITH_PEAP], test "x${enable_peap}" != "xno")
192 # Disable OpenSSL engine support
193 AC_ARG_ENABLE([openssl-engine],
194 AS_HELP_STRING([--disable-openssl-engine], [Disable OpenSSL engine support]))
195 AS_IF([test "x$enable_openssl_engine" != "xno"], [],
196 AC_DEFINE([OPENSSL_NO_ENGINE], 1, [OpenSSL engine support]))
199 # Specify runtime directory
200 AC_ARG_WITH([plugin-dir],
201 AS_HELP_STRING([--with-plugin-dir=DIR],[Specify the plugin directory for pppd]))
202 AS_IF([test -n "$with_plugin_dir"],
203 [PPPD_PLUGIN_DIR="$with_plugin_dir"],
204 [PPPD_PLUGIN_DIR="${libdir}/pppd/$VERSION"])
205 AC_SUBST(PPPD_PLUGIN_DIR, "$PPPD_PLUGIN_DIR", [The pppd plugin directory])
208 # Specify runtime directory
209 AC_ARG_WITH([runtime-dir],
210 AS_HELP_STRING([--with-runtime-dir=DIR],[Specify the runtime directory for pppd]))
211 AS_IF([test -n "$with_runtime_dir"],
212 [PPPD_RUNTIME_DIR="$with_runtime_dir"],
213 [PPPD_RUNTIME_DIR="${runstatedir}/pppd"])
214 AC_SUBST(PPPD_RUNTIME_DIR)
217 # Specify runtime directory
218 AC_ARG_WITH([logfile-dir],
219 AS_HELP_STRING([--with-logfile-dir=DIR],[Specify the log directory for pppd]))
220 AS_IF([test -n "$with_logfile_dir"],
221 [PPPD_LOGFILE_DIR="$with_logfile_dir"],
222 [PPPD_LOGFILE_DIR="${localstatedir}/log/ppp"])
223 AC_SUBST(PPPD_LOGFILE_DIR)
226 # System CA certificates path
227 AC_ARG_WITH(system-ca-path,
228 AS_HELP_STRING([--with-system-ca-path=/path/to/ssl/certs], [path to system CA certificates]),
232 with_system_ca_path="${sysconfdir}/ssl/certs"
237 with_system_ca_path="$withval"
240 ],[with_system_ca_path="${sysconfdir}/ssl/certs"])
241 AM_CONDITIONAL(PPP_WITH_SYSTEM_CA_PATH, [test "$with_system_ca_path" != "no"])
242 AM_COND_IF(PPP_WITH_SYSTEM_CA_PATH, [
243 SYSTEM_CA_PATH="$with_system_ca_path"
245 AC_SUBST(SYSTEM_CA_PATH)
250 AM_CONDITIONAL(PPP_WITH_OPENSSL, test "x${with_openssl}" != "xno")
251 AM_COND_IF([PPP_WITH_OPENSSL],
252 AC_DEFINE([PPP_WITH_OPENSSL], 1, [PPP is compiled with openssl support]))
255 # Check if OpenSSL has compiled in support for various ciphers
256 AS_IF([test "x${with_openssl}" != "xno" ], [
257 AX_CHECK_OPENSSL_DEFINE([OPENSSL_NO_MD4], [md4])
258 AX_CHECK_OPENSSL_DEFINE([OPENSSL_NO_MD5], [md5])
259 AX_CHECK_OPENSSL_DEFINE([OPENSSL_NO_DES], [des])
260 AX_CHECK_OPENSSL_DEFINE([OPENSSL_NO_SHA], [sha])
262 AS_IF([test "x${enable_eaptls}" != "xno" || test "x${enable_peap}" != "xno"],
263 [AC_MSG_ERROR([OpenSSL not found, and if this is your intention then run configure --disable-eaptls and --disable-peap])])
266 AM_CONDITIONAL([OPENSSL_HAVE_MD4], test "x${ac_cv_openssl_md4}" = "xyes")
267 AM_COND_IF([OPENSSL_HAVE_MD4],
268 AC_DEFINE([OPENSSL_HAVE_MD4], 1, [Use MD4 included with openssl]))
270 AM_CONDITIONAL([OPENSSL_HAVE_MD5], test "x${ac_cv_openssl_md5}" = "xyes")
271 AM_COND_IF([OPENSSL_HAVE_MD5],
272 AC_DEFINE([OPENSSL_HAVE_MD5], 1, [Use MD5 included with openssl]))
274 AM_CONDITIONAL([OPENSSL_HAVE_SHA], test "x${ac_cv_openssl_sha}" = "xyes")
275 AM_COND_IF([OPENSSL_HAVE_SHA],
276 AC_DEFINE([OPENSSL_HAVE_SHA], 1, [Use SHA included with openssl]))
278 AM_CONDITIONAL([OPENSSL_HAVE_DES], test "x${ac_cv_openssl_des}" = "xyes")
279 AM_COND_IF([OPENSSL_HAVE_DES],
280 AC_DEFINE([OPENSSL_HAVE_DES], 1, [Use DES included with openssl]))
283 # With libsrp support
285 AC_DEFINE([PPP_WITH_SRP], 1, [Support for libsrp authentication module])])
288 # With libatm support
292 # With libpam support
293 AX_CHECK_PAM(AC_DEFINE([PPP_WITH_PAM], 1, [Support for Pluggable Authentication Modules]))
294 AM_CONDITIONAL(PPP_WITH_PAM, test "x${with_pam}" = "xyes")
297 # With libpcap support, activate pppd on network activity
301 # SunOS provides a version of libpcap that would work, but SunOS has no support for activity filter
302 AM_CONDITIONAL([PPP_WITH_FILTER], [ test "x${with_pcap}" = "xyes" && test "x${build_sunos}" != "xyes" ])
303 AM_COND_IF([PPP_WITH_FILTER], [
304 AC_DEFINE([PPP_WITH_FILTER], 1, [Have packet activity filter support])], [
305 AS_IF([test "x${build_sunos}" = "xyes"], [
306 AC_MSG_WARN([Packet activity filter not supported on SunOS])
312 # Some contributions require GTK/GLIB
313 AC_ARG_WITH([gtk], AS_HELP_STRING([--with-gtk], [Build contributions with the GTK+ interface]))
314 if test "x${with_gtk}" = "xyes"; then
315 PKG_CHECK_MODULES([GTK], [gtk+-2.0])
316 PKG_CHECK_MODULES([GLIB], [glib-2.0])
318 AM_CONDITIONAL([WITH_GTK], test "x${with_gtk}" = "xyes")
320 AC_DEFINE_UNQUOTED(PPPD_VERSION, "$VERSION", [Version of pppd])
326 contrib/pppgetpass/Makefile
332 pppd/plugins/Makefile
333 pppd/plugins/pppoe/Makefile
334 pppd/plugins/pppoatm/Makefile
335 pppd/plugins/pppol2tp/Makefile
336 pppd/plugins/radius/Makefile
344 AS_IF([test "x${build_sunos}" = "xyes" ], [[
346 Setting up SunOS kernel module(s)"
351 sed -e "s,@DESTDIR@,$prefix,g" \
352 -e "s,@SYSCONF@,$sysconfdir,g" \
354 -e "s|@CFLAGS@|$CFLAGS|g" $1 > $2
359 karch=`/usr/bin/isainfo -k`
375 if [ -x /opt/SUNWspro/bin/cc -a "$usegcc" != gcc ] &&
376 /opt/SUNWspro/bin/cc -flags >/dev/null 2>&1; then
377 if [ "$archvariant" = "-64x" ]; then
378 ( cd /tmp; echo "int x;" > ppp$$.c
379 /opt/SUNWspro/bin/cc -c -errwarn -xchip=opteron -m64 ppp$$.c >/dev/null 2>&1 || (
380 echo "WorkShop C is unable to make 64 bit modules, and your $karch system needs"
381 echo "them. Consider upgrading cc on this machine."
385 rm -f ppp$$.c ppp$$.o
388 elif gcc --version >/dev/null 2>&1; then
389 archvariant=gcc$archvariant
391 if [ "$archvariant" = "gcc-64" -o"$archvariant" = "gcc-64x" ]; then
392 ( cd /tmp; touch ppp$$.c
393 gcc -c -m64 ppp$$.c >/dev/null 2>&1 || (
394 echo "gcc is unable to make 64 bit modules, and your $karch system needs them."
395 echo "Consider upgrading gcc on this machine, or switching to Sun WorkShop."
399 rm -f ppp$$.c ppp$$.o
403 echo "C compiler not found; hoping for the best."
406 mkmkf solaris/Makedefs$compiletype Makedefs.com
407 mkmkf solaris/Makefile.sol2$archvariant solaris/Makefile
411 $PACKAGE_NAME version $PACKAGE_VERSION
412 Prefix...............: $prefix
413 Runtime Dir..........: $PPPD_RUNTIME_DIR
414 Logfile Dir..........: $PPPD_LOGFILE_DIR
415 Plugin Dir...........: $PPPD_PLUGIN_DIR
416 System CA Path ......: ${SYSTEM_CA_PATH:-not set}
417 With OpenSSL.........: ${with_openssl:-yes}
418 With libatm..........: ${with_atm:-no}
419 With libpam..........: ${with_pam:-no}
420 With libpcap.........: ${with_pcap:-no}
421 With libsrp..........: ${with_srp:-no}
422 C Compiler...........: $CC $CFLAGS
423 Linker...............: $LD $LDFLAGS $LIBS
426 Microsoft Extensions.: ${enable_microsoft_extensions:-yes}
427 Multilink............: ${enable_multilink:-no}
428 Plugins..............: ${enable_plugins:-yes}
429 CBCP.................: ${enable_cbcp:-no}
430 IPV6CP...............: ${enable_ipv6cp:-yes}
431 EAP-TLS..............: ${enable_eaptls:-yes}
432 PEAP.................: ${enable_peap:-yes}
433 systemd notifications: ${enable_systemd:-no}