K2.6 patches and update.
[tomato.git] / release / src / router / pptpd / configure.in
blob30f51459ca1bad3aa270230b384c2eb9c3e38018
1 AC_INIT(pptpmanager.c)
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)
10 AC_ARG_WITH(bsdppp,
11         [  --with-bsdppp           Use BSD user-space ppp ],
12         [ 
13             case "$withval" in
14                 yes)
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")
19                     break;
20                     ;;
21                 no)
22                     AC_MSG_RESULT(explicit standard pppd)
23                     ;;
24                 *)
25                     # only yes or no are expected for this option
26                     AC_MSG_RESULT(unrecognised... terminating)
27                     exit 1
28                     ;;
29             esac
30         ], [AC_MSG_RESULT(default standard pppd)])
32 AC_MSG_CHECKING(command line for use of SLIRP)
33 AC_ARG_WITH(slirp,
34         [  --with-slirp            Use SLIRP instead of pppd ],
35         [ 
36             case "$withval" in
37                 yes)
38                     AC_MSG_RESULT(yes)
39                     AC_DEFINE(SLIRP)
40                     SLIRP=$with_slirp
41                     AC_DEFINE(PPP_BINARY, "/bin/slirp")
42                     break;
43                     ;;
44                 no)
45                     AC_MSG_RESULT(explicit no)
46                     ;;
47                 *)
48                     # only yes or no are expected for this option
49                     AC_MSG_RESULT(unrecognised... terminating)
50                     exit 1
51                     ;;
52             esac
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 ],
58     [
59         AC_MSG_RESULT($enableval)
60         AC_DEFINE_UNQUOTED(PPTP_FACILITY, $enableval)
61         ],
62     [
63         AC_MSG_RESULT(default LOG_DAEMON)
64         AC_DEFINE_UNQUOTED(PPTP_FACILITY, LOG_DAEMON)
65     ])
67 AC_MSG_CHECKING(command line for bcrelay build)
68 AC_ARG_ENABLE(bcrelay,
69         [  --enable-bcrelay          Enable broadcast relay function ],
70         [ 
71             case "$enableval" in
72                 yes)
73                     AC_MSG_RESULT(yes)
74                     AC_DEFINE(BCRELAY)
75                     BCRELAY=$enableval
76                     break;
77                     ;;
78                 no)
79                     AC_MSG_RESULT(explicit no)
80                     ;;
81                 *)
82                     # only yes or no are expected for this option
83                     AC_MSG_RESULT(unrecognised... terminating)
84                     exit 1
85                     ;;
86             esac
87         ], [AC_MSG_RESULT(default no)])
89 AC_PROG_CC
90 AC_PROG_RANLIB
91 AC_PROG_INSTALL
92 AC_PROG_LN_S
93 AC_PROG_MAKE_SET
95 AC_C_CONST
96 AC_C_INLINE
98 AC_EXEEXT
99 AC_OBJEXT
100 AC_SYS_INTERPRETER
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>
121 #if STDC_HEADERS
122 #include <stdlib.h>
123 #include <stddef.h>
124 #endif],
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)
133 AC_ARG_WITH(libwrap,
134         [  --with-libwrap          Use libwrap (tcp wrappers) ],
136  if test "$with_libwrap" = "yes"; then
137  XYZZY_LIBS="$LIBS"
138  AC_MSG_CHECKING(for libwrap alone)
139  LIBS="$XYZZY_LIBS -lwrap"
140  AC_TRY_LINK([ int allow_severity, deny_severity; ],
141              [ hosts_access(); ],
142              [ AC_MSG_RESULT(yes)
143                AC_DEFINE(HAVE_LIBWRAP)
144                LIBWRAP="yes"
145                XTRALIBS_MGR="-lwrap" ],
146              [ AC_MSG_RESULT(no)
147    LIBS="$XYZZY_LIBS -lwrap -lnsl"
148    AC_MSG_CHECKING(for libwrap with libnsl)
149    AC_TRY_LINK([ int allow_severity, deny_severity; ],
150                [ hosts_access(); ],
151                [ AC_MSG_RESULT(yes)
152                  AC_DEFINE(HAVE_LIBWRAP)
153                  LIBWRAP="yes"
154                  XTRALIBS_MGR="-lwrap -lnsl" ],
155                [ AC_MSG_RESULT(no) ])
156  ])
157  LIBS="$XYZZY_LIBS"
158  fi
161 dnl More ugliness; -lnsl, -lutil and -lsocket
162 XYZZY_LIBS="$LIBS"
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)
171 LIBS="$XYZZY_LIBS"
172 if test "$ac_cv_lib_c_accept" = no; then
173   if test "$ac_cv_lib_socket_accept" = yes; then
174         LIBS="$LIBS -lsocket"
175   else
176         echo "Couldn't find a usable accept!" 1>&2
177         exit 1
178   fi
180 if test "$ac_cv_lib_c_gethostbyname" = no; then
181   if test "$ac_cv_lib_nsl_gethostbyname" = yes; then
182         LIBS="$LIBS -lnsl"
183         if test "$XTRALIBS_MGR" = "-lwrap -lnsl"; then
184           XTRALIBS_MGR="-lwrap"
185         fi
186   else
187         echo "Couldn't find a usable gethostbyname!" 1>&2
188         exit 1
189   fi
191 if test "$ac_cv_lib_c_openpty" = yes; then
192   AC_DEFINE(HAVE_OPENPTY)
193 else
194   if test "$ac_cv_lib_util_openpty" = yes; then
195     AC_DEFINE(HAVE_OPENPTY)
196     XTRALIBS_CTRL="-lutil"
197   fi
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"
203     else
204       echo "Have libintl.h but no usable gettext!" 1>&2
205       exit 1
206     fi
207   fi
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
216     XTRA_PROG="bcrelay"
217     true
218   else
219     echo "No BCrelay selected." 1>&2
220   fi
223 AC_SUBST(XTRA_PROG)
225 echo '==============================================================================='
227 echo 'Configuration chosen:'
229 echo -n '   PPPd:               '
230 if test "$BSDUSER_PPP" = "yes"; then
231   echo 'BSD user-space PPPd.'
232 else
233   if test "$SLIRP" = "yes"; then
234     echo 'SLIRP.'
235   else
236     echo 'Standard.'
237   fi
240 echo -n '   LIBWRAP security:   '
241 if test "$LIBWRAP" = "yes"; then
242   echo 'Yes.'
243 else
244   echo 'No.'
247 echo -n '   Broadcast Relay:    '
248 if test "$BCRELAY" = "yes"; then
249   echo 'Yes.'
250 else
251   echo 'No.'
254 AC_CACHE_SAVE
255 AC_OUTPUT(Makefile)