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], [libsystemd])])
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 Microsoft extensions will remove CHAP and MPPE support
121 AC_ARG_ENABLE([microsoft-extensions],
122 AS_HELP_STRING([--disable-microsoft-extensions], [Disable Microsoft CHAP / MPPE extensions]))
124 AM_CONDITIONAL(PPP_WITH_CHAPMS, test "x${enable_microsoft_extensions}" != "xno")
125 AM_COND_IF([PPP_WITH_CHAPMS],
126 AC_DEFINE([PPP_WITH_CHAPMS], 1, [Have Microsoft CHAP support]))
128 AM_CONDITIONAL(PPP_WITH_MPPE, test "x${enable_microsoft_extensions}" != "xno")
129 AM_COND_IF([PPP_WITH_MPPE],
130 AC_DEFINE([PPP_WITH_MPPE], 1, [Have Microsoft MPPE support]))
133 # Enable Microsoft LAN Manager support, depends on Microsoft Extensions
134 AC_ARG_ENABLE([mslanman],
135 AS_HELP_STRING([--enable-mslanman], [Enable Microsoft LAN Manager support]))
136 AS_IF([test "x${enable_mslanman}" = "xyes" && test "x${enable_microsoft_extensions}" != "xno"],
137 AC_DEFINE([PPP_WITH_MSLANMAN], 1, [Have Microsoft LAN Manager support]))
140 # Disable IPv6 support
141 AC_ARG_ENABLE([ipv6cp],
142 AS_HELP_STRING([--disable-ipv6cp], [Disable IPv6 Control Protocol]))
143 AM_CONDITIONAL(PPP_WITH_IPV6CP, test "x${enable_ipv6cp}" != "xno")
144 AM_COND_IF([PPP_WITH_IPV6CP],
145 AC_DEFINE(PPP_WITH_IPV6CP, 1, [Have IPv6 Control Protocol]))
148 # Disable Multilink support
149 AC_ARG_ENABLE([multilink],
150 AS_HELP_STRING([--enable-multilink], [Enable multilink support]))
151 AM_CONDITIONAL(PPP_WITH_MULTILINK, test "x${enable_multilink}" = "xyes")
152 AM_COND_IF([PPP_WITH_MULTILINK],
153 AC_DEFINE([PPP_WITH_MULTILINK], 1, [Have multilink support]))
154 AS_IF([test "x${build_sunos}" = "xyes" && test "x${enable_multilink}" = "xyes"],
155 [AC_MSG_ERROR([Multilink is not supported on SunOS])])
158 # Multilink require Trivial Database Support
159 AM_CONDITIONAL(PPP_WITH_TDB, test "x${enable_multilink}" = "xyes")
160 AM_COND_IF([PPP_WITH_TDB],
161 AC_DEFINE([PPP_WITH_TDB], 1, [Include TDB support]))
164 # Enable support for loadable plugins
165 AC_ARG_ENABLE([plugins],
166 AS_HELP_STRING([--disable-plugins], [Disable support for loadable plugins]))
167 AS_IF([test "x$enable_plugins" != "xno"],
168 AC_DEFINE([PPP_WITH_PLUGINS], 1, [Have support for loadable plugins]))
169 AM_CONDITIONAL(PPP_WITH_PLUGINS, test "x${enable_plugins}" != "xno")
172 # Disable EAP-TLS support
173 AC_ARG_ENABLE([eaptls],
174 AS_HELP_STRING([--disable-eaptls], [Disable EAP-TLS authentication support]))
175 AS_IF([test "x$enable_eaptls" != "xno"],
176 AC_DEFINE([PPP_WITH_EAPTLS], 1, [Have EAP-TLS authentication support]))
177 AM_CONDITIONAL(PPP_WITH_EAPTLS, test "x${enable_eaptls}" != "xno")
180 # Disable PEAP support
181 AC_ARG_ENABLE([peap],
182 AS_HELP_STRING([--disable-peap], [Disable PEAP authentication support]))
183 AS_IF([test "x${enable_peap}" != "xno"],
184 AC_DEFINE([PPP_WITH_PEAP], 1, [Have PEAP authentication support]))
185 AM_CONDITIONAL([PPP_WITH_PEAP], test "x${enable_peap}" != "xno")
188 # Disable OpenSSL engine support
189 AC_ARG_ENABLE([openssl-engine],
190 AS_HELP_STRING([--disable-openssl-engine], [Disable OpenSSL engine support]))
191 AS_IF([test "x$enable_openssl_engine" != "xno"], [],
192 AC_DEFINE([OPENSSL_NO_ENGINE], 1, [OpenSSL engine support]))
195 # Specify runtime directory
196 AC_ARG_WITH([plugin-dir],
197 AS_HELP_STRING([--with-plugin-dir=DIR],[Specify the plugin directory for pppd]))
198 AS_IF([test -n "$with_plugin_dir"],
199 [PPPD_PLUGIN_DIR="$with_plugin_dir"],
200 [PPPD_PLUGIN_DIR="${libdir}/pppd/$VERSION"])
201 AC_SUBST(PPPD_PLUGIN_DIR, "$PPPD_PLUGIN_DIR", [The pppd plugin directory])
204 # Specify runtime directory
205 AC_ARG_WITH([runtime-dir],
206 AS_HELP_STRING([--with-runtime-dir=DIR],[Specify the runtime directory for pppd]))
207 AS_IF([test -n "$with_runtime_dir"],
208 [PPPD_RUNTIME_DIR="$with_runtime_dir"],
209 [PPPD_RUNTIME_DIR="${runstatedir}/pppd"])
210 AC_SUBST(PPPD_RUNTIME_DIR)
213 # Specify runtime directory
214 AC_ARG_WITH([logfile-dir],
215 AS_HELP_STRING([--with-logfile-dir=DIR],[Specify the log directory for pppd]))
216 AS_IF([test -n "$with_logfile_dir"],
217 [PPPD_LOGFILE_DIR="$with_logfile_dir"],
218 [PPPD_LOGFILE_DIR="${localstatedir}/log/ppp"])
219 AC_SUBST(PPPD_LOGFILE_DIR)
224 AM_CONDITIONAL(PPP_WITH_OPENSSL, test "x${with_openssl}" != "xno")
225 AM_COND_IF([PPP_WITH_OPENSSL],
226 AC_DEFINE([PPP_WITH_OPENSSL], 1, [PPP is compiled with openssl support]))
229 # Check if OpenSSL has compiled in support for various ciphers
230 AS_IF([test "x${with_openssl}" != "xno" ], [
231 AX_CHECK_OPENSSL_DEFINE([OPENSSL_NO_MD4], [md4])
232 AX_CHECK_OPENSSL_DEFINE([OPENSSL_NO_MD5], [md5])
233 AX_CHECK_OPENSSL_DEFINE([OPENSSL_NO_DES], [des])
234 AX_CHECK_OPENSSL_DEFINE([OPENSSL_NO_SHA], [sha])
236 AS_IF([test "x${enable_eaptls}" != "xno" || test "x${enable_peap}" != "xno"],
237 [AC_MSG_ERROR([OpenSSL not found, and if this is your intention then run configure --disable-eaptls and --disable-peap])])
240 AM_CONDITIONAL([OPENSSL_HAVE_MD4], test "x${ac_cv_openssl_md4}" = "xyes")
241 AM_COND_IF([OPENSSL_HAVE_MD4],
242 AC_DEFINE([OPENSSL_HAVE_MD4], 1, [Use MD4 included with openssl]))
244 AM_CONDITIONAL([OPENSSL_HAVE_MD5], test "x${ac_cv_openssl_md5}" = "xyes")
245 AM_COND_IF([OPENSSL_HAVE_MD5],
246 AC_DEFINE([OPENSSL_HAVE_MD5], 1, [Use MD5 included with openssl]))
248 AM_CONDITIONAL([OPENSSL_HAVE_SHA], test "x${ac_cv_openssl_sha}" = "xyes")
249 AM_COND_IF([OPENSSL_HAVE_SHA],
250 AC_DEFINE([OPENSSL_HAVE_SHA], 1, [Use SHA included with openssl]))
252 AM_CONDITIONAL([OPENSSL_HAVE_DES], test "x${ac_cv_openssl_des}" = "xyes")
253 AM_COND_IF([OPENSSL_HAVE_DES],
254 AC_DEFINE([OPENSSL_HAVE_DES], 1, [Use DES included with openssl]))
257 # With libsrp support
259 AC_DEFINE([PPP_WITH_SRP], 1, [Support for libsrp authentication module])])
262 # With libatm support
266 # With libpam support
267 AX_CHECK_PAM(AC_DEFINE([PPP_WITH_PAM], 1, [Support for Pluggable Authentication Modules]))
268 AM_CONDITIONAL(PPP_WITH_PAM, test "x${with_pam}" = "xyes")
271 # With libpcap support, activate pppd on network activity
275 # SunOS provides a version of libpcap that would work, but SunOS has no support for activity filter
276 AM_CONDITIONAL([PPP_WITH_FILTER], [ test "x${with_pcap}" = "xyes" && test "x${build_sunos}" != "xyes" ])
277 AM_COND_IF([PPP_WITH_FILTER], [
278 AC_DEFINE([PPP_WITH_FILTER], 1, [Have packet activity filter support])], [
279 AS_IF([test "x${build_sunos}" = "xyes"], [
280 AC_MSG_WARN([Packet activity filter not supported on SunOS])
286 # Some contributions require GTK/GLIB
287 AC_ARG_WITH([gtk], AS_HELP_STRING([--with-gtk], [Build contributions with the GTK+ interface]))
288 if test "x${with_gtk}" = "xyes"; then
289 PKG_CHECK_MODULES([GTK], [gtk+-2.0])
290 PKG_CHECK_MODULES([GLIB], [glib-2.0])
292 AM_CONDITIONAL([WITH_GTK], test "x${with_gtk}" = "xyes")
294 AC_DEFINE_UNQUOTED(PPPD_VERSION, "$VERSION", [Version of pppd])
300 contrib/pppgetpass/Makefile
306 pppd/plugins/Makefile
307 pppd/plugins/pppoe/Makefile
308 pppd/plugins/pppoatm/Makefile
309 pppd/plugins/pppol2tp/Makefile
310 pppd/plugins/radius/Makefile
318 AS_IF([test "x${build_sunos}" = "xyes" ], [[
320 Setting up SunOS kernel module(s)"
325 sed -e "s,@DESTDIR@,$prefix,g" \
326 -e "s,@SYSCONF@,$sysconfdir,g" \
328 -e "s|@CFLAGS@|$CFLAGS|g" $1 > $2
333 karch=`/usr/bin/isainfo -k`
349 if [ -x /opt/SUNWspro/bin/cc -a "$usegcc" != gcc ] &&
350 /opt/SUNWspro/bin/cc -flags >/dev/null 2>&1; then
351 if [ "$archvariant" = "-64x" ]; then
352 ( cd /tmp; echo "int x;" > ppp$$.c
353 /opt/SUNWspro/bin/cc -c -errwarn -xchip=opteron -m64 ppp$$.c >/dev/null 2>&1 || (
354 echo "WorkShop C is unable to make 64 bit modules, and your $karch system needs"
355 echo "them. Consider upgrading cc on this machine."
359 rm -f ppp$$.c ppp$$.o
362 elif gcc --version >/dev/null 2>&1; then
363 archvariant=gcc$archvariant
365 if [ "$archvariant" = "gcc-64" -o"$archvariant" = "gcc-64x" ]; then
366 ( cd /tmp; touch ppp$$.c
367 gcc -c -m64 ppp$$.c >/dev/null 2>&1 || (
368 echo "gcc is unable to make 64 bit modules, and your $karch system needs them."
369 echo "Consider upgrading gcc on this machine, or switching to Sun WorkShop."
373 rm -f ppp$$.c ppp$$.o
377 echo "C compiler not found; hoping for the best."
380 mkmkf solaris/Makedefs$compiletype Makedefs.com
381 mkmkf solaris/Makefile.sol2$archvariant solaris/Makefile
385 $PACKAGE_NAME version $PACKAGE_VERSION
386 Prefix...............: $prefix
387 Runtime Dir..........: $PPPD_RUNTIME_DIR
388 Logfile Dir..........: $PPPD_LOGFILE_DIR
389 Plugin Dir...........: $PPPD_PLUGIN_DIR
390 With OpenSSL.........: ${with_openssl:-yes}
391 With libatm..........: ${with_atm:-no}
392 With libpam..........: ${with_pam:-no}
393 With libpcap.........: ${with_pcap:-no}
394 With libsrp..........: ${with_srp:-no}
395 C Compiler...........: $CC $CFLAGS
396 Linker...............: $LD $LDFLAGS $LIBS
399 Microsoft Extensions.: ${enable_microsoft_extensions:-yes}
400 Multilink............: ${enable_multilink:-no}
401 Plugins..............: ${enable_plugins:-yes}
402 CBCP.................: ${enable_cbcp:-no}
403 IPV6CP...............: ${enable_ipv6cp:-yes}
404 EAP-TLS..............: ${enable_eaptls:-yes}
405 PEAP.................: ${enable_peap:-yes}
406 systemd notifications: ${enable_systemd:-no}