3 AM_CONFIG_HEADER(config.h)
4 AM_INIT_AUTOMAKE(pptpd,1.3.4)
6 # check common command line options early
8 AC_DEFINE(PPP_BINARY, "/usr/sbin/pppd")
9 AC_MSG_CHECKING(command line for use of BSD PPP)
11 [ --with-bsdppp Use BSD user-space ppp ],
15 AC_MSG_RESULT(BSD user-space ppp)
16 AC_DEFINE(BSDUSER_PPP)
17 BSDUSER_PPP=$with_bsdppp
18 AC_DEFINE(PPP_BINARY, "/usr/sbin/ppp")
22 AC_MSG_RESULT(explicit standard pppd)
25 # only yes or no are expected for this option
26 AC_MSG_RESULT(unrecognised... terminating)
30 ], [AC_MSG_RESULT(default standard pppd)])
32 AC_MSG_CHECKING(command line for use of SLIRP)
34 [ --with-slirp Use SLIRP instead of pppd ],
41 AC_DEFINE(PPP_BINARY, "/bin/slirp")
45 AC_MSG_RESULT(explicit no)
48 # only yes or no are expected for this option
49 AC_MSG_RESULT(unrecognised... terminating)
53 ], [AC_MSG_RESULT(default no)])
55 AC_MSG_CHECKING(command line for syslog facility name)
56 AC_ARG_ENABLE(facility,
57 [ --enable-facility=name Use another syslog facility, default LOG_DAEMON ],
59 AC_MSG_RESULT($enableval)
60 AC_DEFINE_UNQUOTED(PPTP_FACILITY, $enableval)
63 AC_MSG_RESULT(default LOG_DAEMON)
64 AC_DEFINE_UNQUOTED(PPTP_FACILITY, LOG_DAEMON)
67 AC_MSG_CHECKING(command line for bcrelay build)
68 AC_ARG_ENABLE(bcrelay,
69 [ --enable-bcrelay Enable broadcast relay function ],
79 AC_MSG_RESULT(explicit no)
82 # only yes or no are expected for this option
83 AC_MSG_RESULT(unrecognised... terminating)
87 ], [AC_MSG_RESULT(default no)])
102 AC_CHECK_FUNCS(setsid daemon setproctitle getservbyname strlcpy fork memmove strerror writev)
104 AC_CHECK_HEADERS(pty.h)
105 AC_CHECK_HEADERS(string.h)
106 AC_CHECK_HEADERS(syslog.h)
107 AC_CHECK_HEADERS(libintl.h)
108 AC_CHECK_HEADERS(libutil.h)
109 AC_CHECK_HEADERS(sys/uio.h)
111 AC_CHECK_TYPE(size_t, unsigned int)
112 AC_CHECK_TYPE(ssize_t, int)
113 AC_CHECK_TYPE(u_int8_t, unsigned char)
114 AC_CHECK_TYPE(u_int16_t, unsigned short)
115 AC_CHECK_TYPE(u_int32_t, unsigned int)
117 dnl Check for type in sys/socket.h - from Squid source (GPL)
118 AC_CACHE_CHECK(for socklen_t, ac_cv_type_socklen_t, [
119 AC_EGREP_CPP([socklen_t[^a-zA-Z_0-9]], [#include <sys/types.h>
120 #include <sys/socket.h>
125 ac_cv_type_socklen_t=yes,
126 ac_cv_type_socklen_t=no)
128 if test $ac_cv_type_socklen_t = no; then
129 AC_DEFINE(socklen_t, int)
132 dnl Check for libwrap (black magic check)
134 [ --with-libwrap Use libwrap (tcp wrappers) ],
136 if test "$with_libwrap" = "yes"; then
138 AC_MSG_CHECKING(for libwrap alone)
139 LIBS="$XYZZY_LIBS -lwrap"
140 AC_TRY_LINK([ int allow_severity, deny_severity; ],
143 AC_DEFINE(HAVE_LIBWRAP)
145 XTRALIBS_MGR="-lwrap" ],
147 LIBS="$XYZZY_LIBS -lwrap -lnsl"
148 AC_MSG_CHECKING(for libwrap with libnsl)
149 AC_TRY_LINK([ int allow_severity, deny_severity; ],
152 AC_DEFINE(HAVE_LIBWRAP)
154 XTRALIBS_MGR="-lwrap -lnsl" ],
155 [ AC_MSG_RESULT(no) ])
161 dnl More ugliness; -lnsl, -lutil and -lsocket
163 AC_CHECK_LIB(c, accept)
164 AC_CHECK_LIB(c, gethostbyname)
165 AC_CHECK_LIB(c, openpty)
166 AC_CHECK_LIB(c, gettext)
167 AC_CHECK_LIB(socket, accept)
168 AC_CHECK_LIB(nsl, gethostbyname)
169 AC_CHECK_LIB(util, openpty)
170 AC_CHECK_LIB(intl, gettext)
172 if test "$ac_cv_lib_c_accept" = no; then
173 if test "$ac_cv_lib_socket_accept" = yes; then
174 LIBS="$LIBS -lsocket"
176 echo "Couldn't find a usable accept!" 1>&2
180 if test "$ac_cv_lib_c_gethostbyname" = no; then
181 if test "$ac_cv_lib_nsl_gethostbyname" = yes; then
183 if test "$XTRALIBS_MGR" = "-lwrap -lnsl"; then
184 XTRALIBS_MGR="-lwrap"
187 echo "Couldn't find a usable gethostbyname!" 1>&2
191 if test "$ac_cv_lib_c_openpty" = yes; then
192 AC_DEFINE(HAVE_OPENPTY)
194 if test "$ac_cv_lib_util_openpty" = yes; then
195 AC_DEFINE(HAVE_OPENPTY)
196 XTRALIBS_CTRL="-lutil"
199 if test "$ac_cv_header_libintl_h" = yes; then
200 if test "$ac_cv_lib_c_gettext" = no; then
201 if test "$ac_cv_lib_intl_gettext" = yes; then
202 XTRALIBS_MGR = "$XTRALIBS_MGR -lintl"
204 echo "Have libintl.h but no usable gettext!" 1>&2
210 AC_SUBST(XTRALIBS_CTRL)
211 AC_SUBST(XTRALIBS_MGR)
212 AC_SUBST(HAVE_OPENPTY)
214 if test "$BCRELAY" = "yes"; then
215 if test "$BCRELAY" = "yes"; then
219 echo "No BCrelay selected." 1>&2
225 echo '==============================================================================='
227 echo 'Configuration chosen:'
230 if test "$BSDUSER_PPP" = "yes"; then
231 echo 'BSD user-space PPPd.'
233 if test "$SLIRP" = "yes"; then
240 echo -n ' LIBWRAP security: '
241 if test "$LIBWRAP" = "yes"; then
247 echo -n ' Broadcast Relay: '
248 if test "$BCRELAY" = "yes"; then