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])
16 # Checks for programs.
37 AC_MSG_ERROR(["OS ${host_os} not supported"])
41 AM_CONDITIONAL([LINUX], [test "x${build_linux}" = "xyes" ])
42 AM_CONDITIONAL([SUNOS], [test "x${build_sunos}" = "xyes" ])
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]))
108 AS_IF([test "x${enable_systemd}" = "xyes"], [
109 PKG_CHECK_MODULES([systemd], [systemd])])
112 # Enable Callback Protocol Support, disabled by default
113 AC_ARG_ENABLE([cbcp],
114 AS_HELP_STRING([--enable-cbcp], [Enable Callback Protocol]))
115 AM_CONDITIONAL(PPP_WITH_CBCP, test "x${enable_cbcp}" = "xyes")
116 AM_COND_IF([PPP_WITH_CBCP],
117 AC_DEFINE([PPP_WITH_CBCP], 1, [Have Callback Protocol support]))
120 # Disable support for limiting session duration by maximum octets
121 AC_ARG_ENABLE([maxoctets],
122 AS_HELP_STRING([--disable-maxoctets], [Disable support for limiting session by maximum octets]))
123 AS_IF([test "x$enable_maxoctets" != "xno"],
124 AC_DEFINE([PPP_WITH_MAXOCTETS], 1, [Limit sessions by maximum number of octets]))
127 # Disable Microsoft extensions will remove CHAP and MPPE support
128 AC_ARG_ENABLE([microsoft-extensions],
129 AS_HELP_STRING([--disable-microsoft-extensions], [Disable Microsoft CHAP / MPPE extensions]))
131 AM_CONDITIONAL(PPP_WITH_CHAPMS, test "x${enable_microsoft_extensions}" != "xno")
132 AM_COND_IF([PPP_WITH_CHAPMS],
133 AC_DEFINE([PPP_WITH_CHAPMS], 1, [Have Microsoft CHAP support]))
135 AM_CONDITIONAL(PPP_WITH_MPPE, test "x${enable_microsoft_extensions}" != "xno")
136 AM_COND_IF([PPP_WITH_MPPE],
137 AC_DEFINE([PPP_WITH_MPPE], 1, [Have Microsoft MPPE support]))
140 # Enable Microsoft LAN Manager support, depends on Microsoft Extensions
141 AC_ARG_ENABLE([mslanman],
142 AS_HELP_STRING([--enable-mslanman], [Enable Microsoft LAN Manager support]))
143 AS_IF([test "x${enable_mslanman}" = "xyes" && test "x${enable_microsoft_extensions}" != "xno"],
144 AC_DEFINE([PPP_WITH_MSLANMAN], 1, [Have Microsoft LAN Manager support]))
147 # Disable IPv6 support
148 AC_ARG_ENABLE([ipv6cp],
149 AS_HELP_STRING([--disable-ipv6cp], [Disable IPv6 Control Protocol]))
150 AM_CONDITIONAL(PPP_WITH_IPV6CP, test "x${enable_ipv6cp}" != "xno")
151 AM_COND_IF([PPP_WITH_IPV6CP],
152 AC_DEFINE(PPP_WITH_IPV6CP, 1, [Have IPv6 Control Protocol]))
155 # Disable Multilink support
156 AC_ARG_ENABLE([multilink],
157 AS_HELP_STRING([--enable-multilink], [Enable multilink support]))
158 AM_CONDITIONAL(PPP_WITH_MULTILINK, test "x${enable_multilink}" = "xyes")
159 AM_COND_IF([PPP_WITH_MULTILINK],
160 AC_DEFINE([PPP_WITH_MULTILINK], 1, [Have multilink support]))
161 AS_IF([test "x${build_sunos}" = "xyes" && test "x${enable_multilink}" = "xyes"],
162 [AC_MSG_ERROR([Multilink is not supported on SunOS])])
165 # Multilink require Trivial Database Support
166 AM_CONDITIONAL(PPP_WITH_TDB, test "x${enable_multilink}" = "xyes")
167 AM_COND_IF([PPP_WITH_TDB],
168 AC_DEFINE([PPP_WITH_TDB], 1, [Include TDB support]))
171 # Enable support for loadable plugins
172 AC_ARG_ENABLE([plugins],
173 AS_HELP_STRING([--disable-plugins], [Disable support for loadable plugins]))
174 AS_IF([test "x$enable_plugins" != "xno"],
175 AC_DEFINE([PPP_WITH_PLUGINS], 1, [Have support for loadable plugins]))
176 AM_CONDITIONAL(PPP_WITH_PLUGINS, test "x${enable_plugins}" != "xno")
179 # Disable EAP-TLS support
180 AC_ARG_ENABLE([eaptls],
181 AS_HELP_STRING([--disable-eaptls], [Disable EAP-TLS authentication support]))
182 AS_IF([test "x$enable_eaptls" != "xno"],
183 AC_DEFINE([PPP_WITH_EAPTLS], 1, [Have EAP-TLS authentication support]))
184 AM_CONDITIONAL(PPP_WITH_EAPTLS, test "x${enable_eaptls}" != "xno")
187 # Disable PEAP support
188 AC_ARG_ENABLE([peap],
189 AS_HELP_STRING([--disable-peap], [Disable PEAP authentication support]))
190 AS_IF([test "x${enable_peap}" != "xno"],
191 AC_DEFINE([PPP_WITH_PEAP], 1, [Have PEAP authentication support]))
192 AM_CONDITIONAL([PPP_WITH_PEAP], test "x${enable_peap}" != "xno")
195 # Disable OpenSSL engine support
196 AC_ARG_ENABLE([openssl-engine],
197 AS_HELP_STRING([--disable-openssl-engine], [Disable OpenSSL engine support]))
198 AS_IF([test "x$enable_openssl_engine" != "xno"], [],
199 AC_DEFINE([OPENSSL_NO_ENGINE], 1, [OpenSSL engine support]))
202 # Specify runtime directory
203 AC_ARG_WITH([plugin-dir],
204 AC_HELP_STRING([--with-plugin-dir=DIR], [Specify the plugin directory for pppd]))
205 AS_IF([test -n "$with_plugin_dir"],
206 [PPPD_PLUGIN_DIR="$with_plugin_dir"],
207 [PPPD_PLUGIN_DIR="${libdir}/pppd/$VERSION"])
208 AC_SUBST(PPPD_PLUGIN_DIR, "$PPPD_PLUGIN_DIR", [The pppd plugin directory])
211 # Specify runtime directory
212 AC_ARG_WITH([runtime-dir],
213 AC_HELP_STRING([--with-runtime-dir=DIR], [Specify the runtime directory for pppd]))
214 AS_IF([test -n "$with_runtime_dir"],
215 [PPPD_RUNTIME_DIR="$with_runtime_dir"],
216 [PPPD_RUNTIME_DIR="${localstatedir}/run/pppd"])
217 AC_SUBST(PPPD_RUNTIME_DIR)
220 # Specify runtime directory
221 AC_ARG_WITH([logfile-dir],
222 AC_HELP_STRING([--with-logfile-dir=DIR], [Specify the log directory for pppd]))
223 AS_IF([test -n "$with_logfile_dir"],
224 [PPPD_LOGFILE_DIR="$with_logfile_dir"],
225 [PPPD_LOGFILE_DIR="${localstatedir}/log/pppd"])
226 AC_SUBST(PPPD_LOGFILE_DIR)
231 AM_CONDITIONAL(WITH_OPENSSL, test "x${with_openssl}" != "xno")
234 # Check if OpenSSL has compiled in support for various ciphers
235 AS_IF([test "x${with_openssl}" != "xno" ], [
236 AX_CHECK_OPENSSL_DEFINE([OPENSSL_NO_MD4], [md4])
237 AX_CHECK_OPENSSL_DEFINE([OPENSSL_NO_MD5], [md5])
238 AX_CHECK_OPENSSL_DEFINE([OPENSSL_NO_DES], [des])
239 AX_CHECK_OPENSSL_DEFINE([OPENSSL_NO_SHA], [sha])
241 AS_IF([test "x${enable_eaptls}" != "xno" || test "x${enable_peap}" != "xno"],
242 [AC_MSG_ERROR([OpenSSL not found, and if this is your intention then run configure --disable-eaptls and --disable-peap])])
245 AM_CONDITIONAL([OPENSSL_HAVE_MD4], test "x${ac_cv_openssl_md4}" = "xyes")
246 AM_COND_IF([OPENSSL_HAVE_MD4],,
247 AC_DEFINE([USE_MD4], 1, [Use MD4 included with pppd]))
249 AM_CONDITIONAL([OPENSSL_HAVE_MD5], test "x${ac_cv_openssl_md5}" = "xyes")
250 AM_COND_IF([OPENSSL_HAVE_MD5],,
251 AC_DEFINE([USE_MD5], 1, [Use MD5 included with pppd]))
253 AM_CONDITIONAL([OPENSSL_HAVE_SHA], test "x${ac_cv_openssl_sha}" = "xyes")
254 AM_COND_IF([OPENSSL_HAVE_SHA],,
255 AC_DEFINE([USE_SHA], 1, [Use SHA included with pppd]))
257 AM_CONDITIONAL([OPENSSL_HAVE_DES], test "x${ac_cv_openssl_des}" = "xyes")
258 AM_COND_IF([OPENSSL_HAVE_DES],,
259 AC_DEFINE([USE_CRYPT], 1, [Use DES included with pppd]))
262 # If OpenSSL doesn't support DES, then use the one from libcrypt (glibc dropped support for this in 2.27).
263 AS_IF([test "x${ac_cv_openssl_des}" = "xno" ], [
264 AC_CHECK_LIB([crypt], [encrypt],
265 [LIBS="$LIBS -lcrypt"],
266 [AC_MSG_ERROR([OpenSSL not found or does not support DES, and libcrypt also doesn't support encrypt])]
271 # With libsrp support
273 AC_DEFINE([PPP_WITH_SRP], 1, [Support for libsrp authentication module])])
276 # With libatm support
280 # With libpam support
281 AX_CHECK_PAM(AC_DEFINE([PPP_WITH_PAM], 1, [Support for Pluggable Authentication Modules]))
282 AM_CONDITIONAL(PPP_WITH_PAM, test "x${with_pam}" = "xyes")
285 # With libpcap support, activate pppd on network activity
289 # SunOS provides a version of libpcap that would work, but SunOS has no support for activity filter
290 AM_CONDITIONAL([PPP_WITH_FILTER], [ test "x${with_pcap}" = "xyes" && test "x${build_sunos}" != "xyes" ])
291 AM_COND_IF([PPP_WITH_FILTER], [
292 AC_DEFINE([PPP_WITH_FILTER], 1, [Have packet activity filter support])], [
293 AS_IF([test "x${build_sunos}" = "xyes"], [
294 AC_MSG_WARN([Packet activity filter not supported on SunOS])
300 # Some contributions require GTK/GLIB
301 AC_ARG_WITH([gtk], AS_HELP_STRING([--with-gtk], [Build contributions with the GTK+ interface]))
302 if test "x${with_gtk}" = "xyes"; then
303 PKG_CHECK_MODULES([GTK], [gtk+-2.0])
304 PKG_CHECK_MODULES([GLIB], [glib-2.0])
306 AM_CONDITIONAL([WITH_GTK], test "x${with_gtk}" = "xyes")
308 AC_DEFINE_UNQUOTED(PPPD_VERSION, "$VERSION", [Version of pppd])
314 contrib/pppgetpass/Makefile
320 pppd/plugins/Makefile
321 pppd/plugins/pppoe/Makefile
322 pppd/plugins/pppoatm/Makefile
323 pppd/plugins/pppol2tp/Makefile
324 pppd/plugins/radius/Makefile
332 AS_IF([test "x${build_sunos}" = "xyes" ], [[
334 Setting up SunOS kernel module(s)"
339 sed -e "s,@DESTDIR@,$prefix,g" \
340 -e "s,@SYSCONF@,$sysconfdir,g" \
342 -e "s|@CFLAGS@|$CFLAGS|g" $1 > $2
347 karch=`/usr/bin/isainfo -k`
363 if [ -x /opt/SUNWspro/bin/cc -a "$usegcc" != gcc ] &&
364 /opt/SUNWspro/bin/cc -flags >/dev/null 2>&1; then
365 if [ "$archvariant" = "-64x" ]; then
366 ( cd /tmp; echo "int x;" > ppp$$.c
367 /opt/SUNWspro/bin/cc -c -errwarn -xchip=opteron -m64 ppp$$.c >/dev/null 2>&1 || (
368 echo "WorkShop C is unable to make 64 bit modules, and your $karch system needs"
369 echo "them. Consider upgrading cc on this machine."
373 rm -f ppp$$.c ppp$$.o
376 elif gcc --version >/dev/null 2>&1; then
377 archvariant=gcc$archvariant
379 if [ "$archvariant" = "gcc-64" -o"$archvariant" = "gcc-64x" ]; then
380 ( cd /tmp; touch ppp$$.c
381 gcc -c -m64 ppp$$.c >/dev/null 2>&1 || (
382 echo "gcc is unable to make 64 bit modules, and your $karch system needs them."
383 echo "Consider upgrading gcc on this machine, or switching to Sun WorkShop."
387 rm -f ppp$$.c ppp$$.o
391 echo "C compiler not found; hoping for the best."
394 mkmkf solaris/Makedefs$compiletype Makedefs.com
395 mkmkf solaris/Makefile.sol2$archvariant solaris/Makefile
399 $PACKAGE_NAME version $PACKAGE_VERSION
400 Prefix...............: $prefix
401 Runtime Dir..........: $PPPD_RUNTIME_DIR
402 Logfile Dir..........: $PPPD_LOGFILE_DIR
403 Plugin Dir...........: $PPPD_PLUGIN_DIR
404 With OpenSSL.........: ${with_openssl:-yes}
405 With libatm..........: ${with_atm:-no}
406 With libpam..........: ${with_pam:-no}
407 With libpcap.........: ${with_pcap:-no}
408 With libsrp..........: ${with_srp:-no}
409 C Compiler...........: $CC $CFLAGS
410 Linker...............: $LD $LDFLAGS $LIBS
413 Microsoft Extensions.: ${enable_microsoft_extensions:-yes}
414 Multilink............: ${enable_multilink:-no}
415 Plugins..............: ${enable_plugins:-yes}
416 CBCP.................: ${enable_cbcp:-no}
417 IPV6CP...............: ${enable_ipv6cp:-yes}
418 EAP-TLS..............: ${enable_eaptls:-yes}
419 PEAP.................: ${enable_peap:-yes}
420 systemd notifications: ${enable_systemd:-no}