blob: b55685ae578bb93c52fad82a9080bd295c600e9b [file] [log] [blame]
paul7ea487b2003-03-17 02:05:07 +00001##
paule8f29842003-08-12 13:08:31 +00002## Configure template file for Quagga.
paul7ea487b2003-03-17 02:05:07 +00003## autoconf will generate configure script.
4##
5## Copyright (c) 1996, 97, 98, 99, 2000 Kunihiro Ishiguro <kunihiro@zebra.org>
paule8f29842003-08-12 13:08:31 +00006## Portions Copyright (c) 2003 Paul Jakma <paul@dishone.st>
paul7ea487b2003-03-17 02:05:07 +00007##
paule8f29842003-08-12 13:08:31 +00008AC_PREREQ(2.53)
paul7ea487b2003-03-17 02:05:07 +00009
hassoeb260372004-02-20 18:40:38 +000010AC_INIT(quagga, 0.96.4, [http://bugzilla.quagga.net])
paulfa1253d2003-09-24 05:09:26 +000011AC_CONFIG_SRCDIR(lib/zebra.h)
gdt1666d352004-03-30 13:45:58 +000012AM_INIT_AUTOMAKE(1.7)
paul7ea487b2003-03-17 02:05:07 +000013AM_CONFIG_HEADER(config.h)
14
gdtd6b72f72003-12-03 17:24:27 +000015dnl default is to match previous behavior
gdtc4f0efe2003-12-04 15:39:25 +000016exampledir=${sysconfdir}
gdtd6b72f72003-12-03 17:24:27 +000017AC_ARG_ENABLE([exampledir],
18 AC_HELP_STRING([--enable-exampledir],
19 [specify alternate directory for examples]),
20 exampledir="$enableval",)
gdtc4f0efe2003-12-04 15:39:25 +000021dnl XXX add --exampledir to autoconf standard directory list somehow
gdtd6b72f72003-12-03 17:24:27 +000022AC_SUBST(exampledir)
23
paul7ea487b2003-03-17 02:05:07 +000024dnl -----------------------------------
25dnl Get hostname and other information.
26dnl -----------------------------------
27AC_CANONICAL_HOST
28
29dnl ------------
30dnl Check CFLAGS
31dnl ------------
32AC_ARG_WITH(cflags,
33[ --with-cflags Set CFLAGS for use in compilation.])
34if test "x$with_cflags" != "x" ; then
35 CFLAGS="$with_cflags" ; cflags_specified=yes ;
36elif test -n "$CFLAGS" ; then
37 cflags_specified=yes ;
38fi
39
40dnl --------
41dnl Check CC
42dnl --------
43AC_PROG_CC
44
45dnl -----------------------------------------
46dnl If CLFAGS doesn\'t exist set default value
47dnl -----------------------------------------
48if test "x$cflags_specified" = "x" ; then
49 CFLAGS="$CFLAGS -Wall"
50fi
51
52dnl --------------
53dnl Check programs
54dnl --------------
55AC_PROG_CPP
56AC_PROG_INSTALL
57AC_PROG_MAKE_SET
58AC_CHECK_TOOL(AR, ar)
59AC_CHECK_TOOL(RANLIB, ranlib, :)
60
61dnl ---------
62dnl AIX check
63dnl ---------
64AC_AIX
65
66dnl ----------------------
67dnl Packages configuration
68dnl ----------------------
69AC_ARG_ENABLE(vtysh,
paule8f29842003-08-12 13:08:31 +000070[ --enable-vtysh, Make integrated vty shell for Quagga])
paul7ea487b2003-03-17 02:05:07 +000071AC_ARG_ENABLE(ipv6,
72[ --disable-ipv6 turn off IPv6 related features and daemons])
73AC_ARG_ENABLE(zebra,
74[ --disable-zebra do not build zebra daemon])
75AC_ARG_ENABLE(bgpd,
76[ --disable-bgpd do not build bgpd])
77AC_ARG_ENABLE(ripd,
78[ --disable-ripd do not build ripd])
79AC_ARG_ENABLE(ripngd,
80[ --disable-ripngd do not build ripngd])
81AC_ARG_ENABLE(ospfd,
82[ --disable-ospfd do not build ospfd])
paul7ea487b2003-03-17 02:05:07 +000083AC_ARG_ENABLE(ospf6d,
84[ --disable-ospf6d do not build ospf6d])
jardin9e867fe2003-12-23 08:56:18 +000085AC_ARG_ENABLE(isisd,
86[ --disable-isisd do not build isisd])
paul7ea487b2003-03-17 02:05:07 +000087AC_ARG_ENABLE(bgp-announce,
88[ --disable-bgp-announce, turn off BGP route announcement])
89AC_ARG_ENABLE(netlink,
90[ --enable-netlink force to use Linux netlink interface])
91AC_ARG_ENABLE(broken-aliases,
92[ --enable-broken-aliases enable aliases as distinct interfaces for Linux 2.2.X])
93AC_ARG_ENABLE(snmp,
94[ --enable-snmp enable SNMP support])
95AC_ARG_WITH(libpam,
96[ --with-libpam use libpam for PAM support in vtysh])
hasso71c0fb52003-05-25 20:18:13 +000097AC_ARG_ENABLE(tcp-zebra,
paul7ea487b2003-03-17 02:05:07 +000098[ --enable-tcp-zebra enable TCP/IP socket connection between zebra and protocol daemon])
99dnl Temporary option until OSPF NSSA implementation complete
100AC_ARG_ENABLE(nssa,
101[ --enable-nssa enable OSPF NSSA option])
102AC_ARG_ENABLE(opaque-lsa,
paul1ef74ef2003-03-21 15:16:05 +0000103[ --enable-opaque-lsa enable OSPF Opaque-LSA with OSPFAPI support (RFC2370)])
104AC_ARG_ENABLE(ospfapi,
105[ --disable-ospfapi do not build OSPFAPI to access the OSPF LSA Database,
106 (this is the default if --enable-opaque-lsa is not set)])
107AC_ARG_ENABLE(ospfclient,
108[ --disable-ospfclient do not build OSPFAPI client for OSPFAPI,
109 (this is the default if --disable-ospfapi is set)])
paul7ea487b2003-03-17 02:05:07 +0000110AC_ARG_ENABLE(ospf-te,
111[ --enable-ospf-te enable Traffic Engineering Extension to OSPF])
112AC_ARG_ENABLE(multipath,
113[ --enable-multipath=ARG enable multipath function, ARG must be digit])
paule8f29842003-08-12 13:08:31 +0000114AC_ARG_ENABLE(quagga_user,
115[ --enable-user=ARG user to run Quagga suite as (default quagga)])
116AC_ARG_ENABLE(quagga_group,
117[ --enable-group=ARG group to run Quagga suite as (default quagga)])
pauledd7c242003-06-04 13:59:38 +0000118AC_ARG_ENABLE(vty_group,
119[ --enable-vty-group=ARG set vty sockets to have specified group as owner])
gdtaa593d52003-12-22 20:15:53 +0000120AC_ARG_ENABLE(configfile_mask,
121[ --enable-configfile-mask=ARG set mask for config files])
122AC_ARG_ENABLE(logfile_mask,
123[ --enable-logfile-mask=ARG set mask for log files])
pauledd7c242003-06-04 13:59:38 +0000124
hasso71c0fb52003-05-25 20:18:13 +0000125AC_ARG_ENABLE(rtadv,
gdtd2a0ccc2003-12-03 18:13:48 +0000126[ --disable-rtadv disable IPV6 router advertisement feature])
hasso41d3fc92004-04-06 11:59:00 +0000127AC_ARG_ENABLE(capabilities,
128[ --disable-capabilities disable using POSIX capabilities])
paul7ea487b2003-03-17 02:05:07 +0000129
130if test "${enable_broken_aliases}" = "yes"; then
131 if test "${enable_netlink}" = "yes"
132 then
133 echo "Sorry, you can't use netlink with broken aliases"
134 exit 1
135 fi
136 AC_DEFINE(HAVE_BROKEN_ALIASES,,Broken Alias)
137 enable_netlink=no
138fi
139
140if test "${enable_tcp_zebra}" = "yes"; then
141 AC_DEFINE(HAVE_TCP_ZEBRA,,Use TCP for zebra communication)
142fi
143
144if test "${enable_nssa}" = "yes"; then
145 AC_DEFINE(HAVE_NSSA,,OSPF NSSA)
146fi
147
148if test "${enable_opaque_lsa}" = "yes"; then
149 AC_DEFINE(HAVE_OPAQUE_LSA,,OSPF Opaque LSA)
150fi
151
152if test "${enable_ospf_te}" = "yes"; then
153 AC_DEFINE(HAVE_OPAQUE_LSA,,OSPF Opaque LSA)
154 AC_DEFINE(HAVE_OSPF_TE,,OSPF TE)
155fi
156
gdtd2a0ccc2003-12-03 18:13:48 +0000157AC_MSG_CHECKING(if zebra should be configurable to send Route Advertisements)
158if test "${enable_rtadv}" != "no"; then
hasso71c0fb52003-05-25 20:18:13 +0000159 AC_MSG_RESULT(yes)
gdtd2a0ccc2003-12-03 18:13:48 +0000160 AC_DEFINE(HAVE_RTADV,,Enable IPv6 Routing Advertisement support)
paul2487bea2003-05-25 23:51:31 +0000161else
162 AC_MSG_RESULT(no)
hasso71c0fb52003-05-25 20:18:13 +0000163fi
paul7ea487b2003-03-17 02:05:07 +0000164
paul79cb2162003-06-06 12:19:53 +0000165if test "${enable_user}" = "yes" || test x"${enable_user}" = x""; then
paule8f29842003-08-12 13:08:31 +0000166 enable_user="quagga"
pauledd7c242003-06-04 13:59:38 +0000167elif test "${enable_user}" = "no"; then
168 enable_user="root"
169fi
paule8f29842003-08-12 13:08:31 +0000170AC_DEFINE_UNQUOTED(QUAGGA_USER, "${enable_user}", Quagga User)
pauledd7c242003-06-04 13:59:38 +0000171
paul79cb2162003-06-06 12:19:53 +0000172if test "${enable_group}" = "yes" || test x"${enable_group}" = x""; then
paule8f29842003-08-12 13:08:31 +0000173 enable_group="quagga"
pauledd7c242003-06-04 13:59:38 +0000174elif test "${enable_group}" = "no"; then
175 enable_group="root"
176fi
paule8f29842003-08-12 13:08:31 +0000177AC_DEFINE_UNQUOTED(QUAGGA_GROUP, "${enable_group}", Quagga Group)
pauledd7c242003-06-04 13:59:38 +0000178
179if test x"${enable_vty_group}" = x"yes" ; then
paul8d4aee52003-06-06 00:30:35 +0000180 AC_MSG_ERROR([--enable-vty-group requires a group as argument, not yes])
paul79cb2162003-06-06 12:19:53 +0000181elif test x"${enable_vty_group}" != x""; then
paul8d4aee52003-06-06 00:30:35 +0000182 if test x"${enable_vty_group}" != x"no"; then
pauledd7c242003-06-04 13:59:38 +0000183 AC_DEFINE_UNQUOTED(VTY_GROUP, "${enable_vty_group}", VTY Sockets Group)
184 fi
185fi
186
gdtaa593d52003-12-22 20:15:53 +0000187enable_configfile_mask=${enable_configfile_mask:-0600}
188AC_DEFINE_UNQUOTED(CONFIGFILE_MASK, ${enable_configfile_mask}, Mask for config files)
189
190enable_logfile_mask=${enable_logfile_mask:-0600}
191AC_DEFINE_UNQUOTED(LOGFILE_MASK, ${enable_logfile_mask}, Mask for log files)
192
paul7ea487b2003-03-17 02:05:07 +0000193changequote(, )dnl
194
195MULTIPATH_NUM=1
196
197case "${enable_multipath}" in
198 [0-9]|[1-9][0-9])
199 MULTIPATH_NUM="${enable_multipath}"
200 ;;
201 "")
202 ;;
203 *)
204 echo "Please specify digit to --enable-multipath ARG."
205 exit 1
206 ;;
207esac
208
209changequote([, ])dnl
210
211AC_SUBST(MULTIPATH_NUM)
212
213dnl -------------------
214dnl Check header files.
215dnl -------------------
pauldc7a2bf2003-10-22 00:07:44 +0000216AC_HEADER_STDC
217AC_CHECK_HEADERS([string.h stropts.h sys/conf.h sys/ksym.h sys/time.h \
218 sys/times.h sys/select.h sys/sysctl.h sys/sockio.h \
219 sys/types.h linux/version.h kvm.h netdb.h asm/types.h \
220 libutil.h limits.h])
221
paul835b7f12003-10-30 21:59:57 +0000222AC_CHECK_HEADERS([sys/socket.h netinet/in_systm.h netinet/in.h \
paulf3bd1a72003-11-02 07:29:11 +0000223 net/if_dl.h net/netopt.h inet/nd.h net/route.h \
paul835b7f12003-10-30 21:59:57 +0000224 net/if.h net/if_var.h netinet/in_var.h])
pauldc7a2bf2003-10-22 00:07:44 +0000225
gdtfa3232e2003-12-03 17:52:30 +0000226dnl V6 headers are checked below, after we check for v6
paul7ea487b2003-03-17 02:05:07 +0000227
228dnl check some types
229AC_C_CONST
230dnl AC_TYPE_PID_T
231AC_TYPE_SIGNAL
232
233dnl Some systems (Solaris 2.x) require libnsl (Network Services Library)
234case "$host" in
235 *-sunos5.6* | *-solaris2.6*)
236 opsys=sol2-6
237 AC_DEFINE(SUNOS_5,,SunOS 5)
238 AC_CHECK_LIB(xnet, main)
239 CURSES=-lcurses
240 ;;
241 *-sunos5* | *-solaris2*)
242 AC_DEFINE(SUNOS_5,,SunOS 5)
243 AC_CHECK_LIB(socket, main)
244 AC_CHECK_LIB(nsl, main)
245 CURSES=-lcurses
246 ;;
247 *-linux-*)
248 opsys=gnu-linux
249 AC_DEFINE(GNU_LINUX,,GNU Linux)
250 ;;
251 *-nec-sysv4*)
252 AC_CHECK_LIB(nsl, gethostbyname)
253 AC_CHECK_LIB(socket, socket)
254 ;;
255 *-freebsd3.2)
256 AC_DEFINE(FREEBSD_32,,FreeBSD 3.2)
257 ;;
258 *-openbsd*)
259 opsys=openbsd
260 AC_DEFINE(OPEN_BSD,,OpenBSD)
261 ;;
262 *-bsdi*)
263 opsys=bsdi
264 OTHER_METHOD="mtu_kvm.o"
265 AC_CHECK_LIB(kvm, main)
266 ;;
paul49e3b3c2003-10-23 20:39:50 +0000267 *-irix6.5)
pauldc7a2bf2003-10-22 00:07:44 +0000268 opsys=irix
269 AC_DEFINE(IRIX_65,,IRIX 6.5)
270 ;;
paul7ea487b2003-03-17 02:05:07 +0000271esac
272
273dnl ---------------------
274dnl Integrated VTY option
275dnl ---------------------
276case "${enable_vtysh}" in
277 "yes") VTYSH="vtysh";
278 AC_DEFINE(VTYSH,,VTY shell)
279 AC_CHECK_LIB(tinfo, tputs, , AC_CHECK_LIB(ncurses, tputs))
280 AC_CHECK_LIB(readline, main)
281 if test $ac_cv_lib_readline_main = no; then
282 AC_MSG_ERROR([vtysh needs libreadline but was not found on your system.])
283 fi
284 AC_CHECK_HEADER(readline/history.h)
285 if test $ac_cv_header_readline_history_h = no;then
286 AC_MSG_ERROR([readline is too old to have readline/history.h, please update to the latest readline library.])
287 fi
paul3d3de8c2003-05-23 10:33:49 +0000288 AC_CHECK_LIB(readline, rl_completion_matches)
289 if test $ac_cv_lib_readline_rl_completion_matches = no; then
290 AC_DEFINE(rl_completion_matches,completion_matches,Old readline)
291 fi
292 ;;
paul7ea487b2003-03-17 02:05:07 +0000293 "no" ) VTYSH="";;
294 * ) ;;
295esac
296
297dnl ----------
298dnl PAM module
299dnl ----------
300if test "$with_libpam" = "yes"; then
paul24cd4352003-05-06 12:16:27 +0000301 AC_CHECK_HEADER(security/pam_misc.h)
302 if test "$ac_cv_header_security_pam_misc_h" = yes; then
303 AC_DEFINE(HAVE_PAM_MISC_H,,Have pam_misc.h)
304 AC_DEFINE(PAM_CONV_FUNC,misc_conv,Have misc_conv)
305 pam_conv_func="misc_conv"
paul24cd4352003-05-06 12:16:27 +0000306 fi
paul24cd4352003-05-06 12:16:27 +0000307 AC_CHECK_HEADER(security/openpam.h)
308 if test "$ac_cv_header_security_openpam_h" = yes; then
309 AC_DEFINE(HAVE_OPENPAM_H,,Have openpam.h)
310 AC_DEFINE(PAM_CONV_FUNC,openpam_ttyconv,Have openpam_ttyconv)
311 pam_conv_func="openpam_ttyconv"
paul24cd4352003-05-06 12:16:27 +0000312 fi
313 if test -z "$ac_cv_header_security_pam_misc_h$ac_cv_header_security_openpam_h" ; then
314 AC_MSG_WARN([*** pam support will not be built ***])
315 with_libpam="no"
316 fi
317fi
318
319if test "$with_libpam" = "yes"; then
paul7ea487b2003-03-17 02:05:07 +0000320dnl took this test from proftpd's configure.in and suited to our needs
321dnl -------------------------------------------------------------------------
322dnl
323dnl This next check looks funky due to a linker problem with some versions
324dnl of the PAM library. Prior to 0.72 release, the Linux PAM shared library
325dnl omitted requiring libdl linking information. PAM-0.72 or better ships
326dnl with RedHat 6.2 and Debian 2.2 or better.
327AC_CHECK_LIB(pam, pam_start,
paul24cd4352003-05-06 12:16:27 +0000328 [AC_CHECK_LIB(pam, $pam_conv_func,
paul7ea487b2003-03-17 02:05:07 +0000329 [AC_DEFINE(USE_PAM,,Use PAM for authentication)
330 LIBPAM="-lpam"],
331 [AC_DEFINE(USE_PAM,,Use PAM for authentication)
332 LIBPAM="-lpam -lpam_misc"]
333 )
334 ],
335
336 [AC_CHECK_LIB(pam, pam_end,
paul24cd4352003-05-06 12:16:27 +0000337 [AC_CHECK_LIB(pam, $pam_conv_func,
paula159ed92003-06-04 11:01:45 +0000338 [AC_DEFINE(USE_PAM,,Use PAM for authentication)
paul7ea487b2003-03-17 02:05:07 +0000339 LIBPAM="-lpam -ldl"],
paula159ed92003-06-04 11:01:45 +0000340 [AC_DEFINE(USE_PAM,,Use PAM for authentication)
paul7ea487b2003-03-17 02:05:07 +0000341 LIBPAM="-lpam -ldl -lpam_misc"]
342 )
343 ],AC_MSG_WARN([*** pam support will not be built ***]),
344 [-ldl])
345 ]
346)
347fi
348AC_SUBST(LIBPAM)
349
350dnl -------------------------------
351dnl Endian-ness check
352dnl -------------------------------
353AC_WORDS_BIGENDIAN
354
355dnl -------------------------------
356dnl check the size in byte of the C
357dnl -------------------------------
358dnl AC_CHECK_SIZEOF(char)
359dnl AC_CHECK_SIZEOF(int)
360dnl AC_CHECK_SIZEOF(short)
361dnl AC_CHECK_SIZEOF(long)
362
363dnl ----------------------------
364dnl check existance of functions
365dnl ----------------------------
paul49e3b3c2003-10-23 20:39:50 +0000366AC_CHECK_FUNCS(memset memcpy strerror inet_aton daemon snprintf vsnprintf \
paul04bd4842003-10-24 04:24:39 +0000367 strlcat strlcpy if_nametoindex if_indextoname getifaddrs \
368 fcntl)
paula159ed92003-06-04 11:01:45 +0000369AC_CHECK_FUNCS(setproctitle, ,
370 [AC_CHECK_LIB(util, setproctitle,
371 [LIBS="$LIBS -lutil"
372 AC_DEFINE(HAVE_SETPROCTITLE,, Have setproctitle)
373 ]
374 )
375 ]
376)
paul7ea487b2003-03-17 02:05:07 +0000377
378dnl ------------------------------------
379dnl Determine routing get and set method
380dnl ------------------------------------
381AC_MSG_CHECKING(zebra between kernel interface method)
382if test x"$opsys" = x"gnu-linux"; then
383 if test "${enable_netlink}" = "yes";then
384 AC_MSG_RESULT(netlink)
385 RT_METHOD=rt_netlink.o
386 AC_DEFINE(HAVE_NETLINK,,netlink)
387 netlink=yes
388 elif test "${enable_netlink}" = "no"; then
389 AC_MSG_RESULT(ioctl)
390 RT_METHOD=rt_ioctl.o
391 netlink=no
392 else
393 AC_MSG_RESULT(netlink)
394 RT_METHOD=rt_netlink.o
395 AC_DEFINE(HAVE_NETLINK,,netlink)
396 netlink=yes
397 fi
398else
399 if test "$opsys" = "sol2-6";then
400 AC_MSG_RESULT(solaris)
401 KERNEL_METHOD="kernel_socket.o"
402 RT_METHOD="rt_socket.o"
paul49e3b3c2003-10-23 20:39:50 +0000403 elif test "$opsys" = "irix" ; then
404 AC_MSG_RESULT(irix)
405 KERNEL_METHOD="kernel_socket.o"
406 RT_METHOD="rt_socket.o"
paul7ea487b2003-03-17 02:05:07 +0000407 else
408 AC_TRY_RUN([#include <errno.h>
409#include <sys/types.h>
410#include <sys/socket.h>
411
412main ()
413{
414 int ac_sock;
415
416 ac_sock = socket (AF_ROUTE, SOCK_RAW, 0);
417 if (ac_sock < 0 && errno == EINVAL)
418 exit (1);
419 exit (0);
420}],
421 [KERNEL_METHOD=kernel_socket.o
422 RT_METHOD=rt_socket.o
423 AC_MSG_RESULT(socket)],
424 [RT_METHOD=rt_ioctl.o
425 AC_MSG_RESULT(ioctl)],
426 [KERNEL_METHOD=kernel_socket.o
427 RT_METHOD=rt_socket.o
428 AC_MSG_RESULT(socket)])
429 fi
430fi
431AC_SUBST(RT_METHOD)
432AC_SUBST(KERNEL_METHOD)
433AC_SUBST(OTHER_METHOD)
434
435dnl ------------------------------
436dnl check kernel route read method
437dnl ------------------------------
438AC_CACHE_CHECK(route read method check, zebra_rtread,
439[if test "$netlink" = yes; then
440 RTREAD_METHOD="rtread_netlink.o"
441 zebra_rtread="netlink"
442else
443for zebra_rtread in /proc/net/route /dev/ip /dev/null;
444do
445 test x`ls $zebra_rtread 2>/dev/null` = x"$zebra_rtread" && break
446done
447case $zebra_rtread in
448 "/proc/net/route") RTREAD_METHOD="rtread_proc.o"
449 zebra_rtread="proc";;
paul9c30ab62003-07-08 08:36:17 +0000450 "/dev/ip")
451 case "$host" in
452 *-freebsd*) RTREAD_METHOD=rtread_sysctl.o
453 zebra_rtread="sysctl";;
454 *) RTREAD_METHOD="rtread_getmsg.o"
455 zebra_rtread="getmsg";;
456 esac;;
paul7ea487b2003-03-17 02:05:07 +0000457 *) RTREAD_METHOD="rtread_sysctl.o"
458 zebra_rtread="sysctl";;
459esac
460fi])
461AC_SUBST(RTREAD_METHOD)
462
463dnl -----------------------------
464dnl check interface lookup method
465dnl -----------------------------
466AC_MSG_CHECKING(interface looking up method)
467if test "$netlink" = yes; then
468 AC_MSG_RESULT(netlink)
469 IF_METHOD=if_netlink.o
470else
471 if test "$opsys" = "sol2-6";then
472 AC_MSG_RESULT(solaris)
473 IF_METHOD=if_ioctl.o
paul49e3b3c2003-10-23 20:39:50 +0000474 elif test "$opsys" = "irix" ; then
475 AC_MSG_RESULT(irix)
476 IF_METHOD=if_ioctl.o
paul7ea487b2003-03-17 02:05:07 +0000477 elif test "$opsys" = "openbsd";then
478 AC_MSG_RESULT(openbsd)
479 IF_METHOD=if_ioctl.o
480 elif grep NET_RT_IFLIST /usr/include/sys/socket.h >/dev/null 2>&1; then
481 AC_MSG_RESULT(sysctl)
482 IF_METHOD=if_sysctl.o
483 AC_DEFINE(HAVE_NET_RT_IFLIST,,NET_RT_IFLIST)
484 else
485 AC_MSG_RESULT(ioctl)
486 IF_METHOD=if_ioctl.o
487 fi
488fi
489AC_SUBST(IF_METHOD)
490
491dnl -----------------------
492dnl check proc file system.
493dnl -----------------------
494if test -r /proc/net/dev; then
495 AC_DEFINE(HAVE_PROC_NET_DEV,,/proc/net/dev)
496 IF_PROC=if_proc.o
497fi
498
499if test -r /proc/net/if_inet6; then
500 AC_DEFINE(HAVE_PROC_NET_IF_INET6,,/proc/net/if_inet6)
501 IF_PROC=if_proc.o
502fi
503AC_SUBST(IF_PROC)
504
505dnl -----------------------------
506dnl check ipforward detect method
507dnl -----------------------------
508AC_CACHE_CHECK(ipforward method check, zebra_ipforward_path,
509[for zebra_ipforward_path in /proc/net/snmp /dev/ip /dev/null;
510do
511 test x`ls $zebra_ipforward_path 2>/dev/null` = x"$zebra_ipforward_path" && break
512done
513case $zebra_ipforward_path in
514 "/proc/net/snmp") IPFORWARD=ipforward_proc.o
515 zebra_ipforward_path="proc";;
516 "/dev/ip")
517 case "$host" in
518 *-nec-sysv4*) IPFORWARD=ipforward_ews.o
519 zebra_ipforward_path="ews";;
paul9c30ab62003-07-08 08:36:17 +0000520 *-freebsd*) IPFORWARD=ipforward_sysctl.o
521 zebra_ipforward_path="sysctl";;
paul7ea487b2003-03-17 02:05:07 +0000522 *) IPFORWARD=ipforward_solaris.o
523 zebra_ipforward_path="solaris";;
524 esac;;
525 *) IPFORWARD=ipforward_sysctl.o
526 zebra_ipforward_path="sysctl";;
527esac])
528AC_SUBST(IPFORWARD)
529
530AC_CHECK_FUNCS(getaddrinfo, [have_getaddrinfo=yes], [have_getaddrinfo=no])
531
532dnl ----------
533dnl IPv6 check
534dnl ----------
535AC_MSG_CHECKING(whether does this OS have IPv6 stack)
536if test "${enable_ipv6}" = "no"; then
537 AC_MSG_RESULT(disabled)
538else
539dnl ----------
540dnl INRIA IPv6
541dnl ----------
paula159ed92003-06-04 11:01:45 +0000542 if grep IPV6_INRIA_VERSION /usr/include/netinet/in.h >/dev/null 2>&1; then
543 zebra_cv_ipv6=yes
544 AC_DEFINE(HAVE_IPV6,1,INRIA IPv6)
545 AC_DEFINE(INRIA_IPV6,1,INRIA IPv6)
546 RIPNGD="ripngd"
547 OSPF6D="ospf6d"
548 LIB_IPV6=""
549 AC_MSG_RESULT(INRIA IPv6)
paul7ea487b2003-03-17 02:05:07 +0000550dnl ---------
551dnl KAME IPv6
552dnl ---------
paula159ed92003-06-04 11:01:45 +0000553 elif grep WIDE /usr/include/netinet6/in6.h >/dev/null 2>&1; then
554 zebra_cv_ipv6=yes
555 AC_DEFINE(HAVE_IPV6,1,KAME IPv6)
556 AC_DEFINE(KAME,1,KAME IPv6)
557 RIPNGD="ripngd"
558 OSPF6D="ospf6d"
559 if test -d /usr/local/v6/lib -a -f /usr/local/v6/lib/libinet6.a; then
paul7ea487b2003-03-17 02:05:07 +0000560 LIB_IPV6="-L/usr/local/v6/lib -linet6"
paula159ed92003-06-04 11:01:45 +0000561 fi
562 AC_MSG_RESULT(KAME)
hasso71c0fb52003-05-25 20:18:13 +0000563dnl -------------------------
564dnl MUSICA IPv6
565dnl default host check
566dnl It is not used by Kheops
567dnl -------------------------
paula159ed92003-06-04 11:01:45 +0000568 elif grep MUSICA /usr/include6/netinet6/in6.h >/dev/null 2>&1; then
569 zebra_cv_ipv6=yes
570 AC_DEFINE(HAVE_IPV6,1,Musicia IPv6)
571 AC_DEFINE(MUSICA,1,Musica IPv6 stack)
572 AC_DEFINE(KAME,1,KAME IPv6 stack)
573 RIPNGD="ripngd"
574 OSPF6D="ospf6d"
575 if test -d /usr/local/v6/lib -a -f /usr/local/v6/lib/libinet6.a; then
hasso71c0fb52003-05-25 20:18:13 +0000576 LIB_IPV6="-L/usr/local/v6/lib -linet6"
paula159ed92003-06-04 11:01:45 +0000577 fi
578 AC_MSG_RESULT(MUSICA)
paul7ea487b2003-03-17 02:05:07 +0000579dnl ---------
580dnl NRL check
581dnl ---------
paula159ed92003-06-04 11:01:45 +0000582 elif grep NRL /usr/include/netinet6/in6.h >/dev/null 2>&1; then
583 zebra_cv_ipv6=yes
584 AC_DEFINE(HAVE_IPV6,1,NRL IPv6)
585 AC_DEFINE(NRL,1,NRL)
586 RIPNGD="ripngd"
587 OSPF6D="ospf6d"
588 if test x"$opsys" = x"bsdi";then
paul7ea487b2003-03-17 02:05:07 +0000589 AC_DEFINE(BSDI_NRL,,BSDI)
590 AC_MSG_RESULT(BSDI_NRL)
paula159ed92003-06-04 11:01:45 +0000591 else
paul7ea487b2003-03-17 02:05:07 +0000592 AC_MSG_RESULT(NRL)
paula159ed92003-06-04 11:01:45 +0000593 fi
paul7ea487b2003-03-17 02:05:07 +0000594dnl ----------
595dnl Linux IPv6
596dnl ----------
paula159ed92003-06-04 11:01:45 +0000597 elif test "${enable_ipv6}" = "yes"; then
598 AC_EGREP_CPP(yes, [
599 #include <linux/version.h>
600 /* 2.1.128 or later */
601 #if LINUX_VERSION_CODE >= 0x020180
602 yes
603 #endif],
604 [zebra_cv_ipv6=yes
605 zebra_cv_linux_ipv6=yes
606 AC_MSG_RESULT(Linux IPv6)])
607 else
608 if test x`ls /proc/net/ipv6_route 2>/dev/null` = x"/proc/net/ipv6_route"
609 then
paul7ea487b2003-03-17 02:05:07 +0000610 zebra_cv_ipv6=yes
611 zebra_cv_linux_ipv6=yes
612 AC_MSG_RESULT(Linux IPv6)
paula159ed92003-06-04 11:01:45 +0000613 fi
614 fi
paul7ea487b2003-03-17 02:05:07 +0000615
paula159ed92003-06-04 11:01:45 +0000616 if test "$zebra_cv_linux_ipv6" = "yes";then
617 AC_MSG_CHECKING(for GNU libc >= 2.1)
618 AC_DEFINE(HAVE_IPV6,1,Linux IPv6)
619 AC_EGREP_CPP(yes, [
paul7ea487b2003-03-17 02:05:07 +0000620#include <features.h>
621#if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1
622 yes
paula159ed92003-06-04 11:01:45 +0000623#endif],
624 [glibc=yes
625 AC_DEFINE(LINUX_IPV6,1,Linux IPv6 stack)
626 AC_MSG_RESULT(yes)],
627 AC_MSG_RESULT(no)
628 )
629 RIPNGD="ripngd"
630 OSPF6D="ospf6d"
631 if test "$glibc" != "yes"; then
paul7ea487b2003-03-17 02:05:07 +0000632 INCLUDES="-I/usr/inet6/include"
633 if test x`ls /usr/inet6/lib/libinet6.a 2>/dev/null` != x;then
634 LIB_IPV6="-L/usr/inet6/lib -linet6"
635 fi
paula159ed92003-06-04 11:01:45 +0000636 fi
637 fi
paul7ea487b2003-03-17 02:05:07 +0000638
639dnl -----------------------
640dnl Set IPv6 related values
641dnl -----------------------
paula159ed92003-06-04 11:01:45 +0000642 LIBS="$LIB_IPV6 $LIBS"
643 AC_SUBST(LIB_IPV6)
paul7ea487b2003-03-17 02:05:07 +0000644
paula159ed92003-06-04 11:01:45 +0000645 if test x"$RIPNGD" = x""; then
646 AC_MSG_RESULT(IPv4 only)
647 fi
paul7ea487b2003-03-17 02:05:07 +0000648fi
649
gdtfa3232e2003-12-03 17:52:30 +0000650dnl ------------------
651dnl IPv6 header checks
652dnl ------------------
653if test "x${zebra_cv_ipv6}" = "xyes"; then
654AC_CHECK_HEADERS([netinet6/in6.h netinet/in6_var.h netinet/icmp6.h \
655 netinet6/in6_var.h netinet6/nd6.h])
656fi
657
paul7ea487b2003-03-17 02:05:07 +0000658dnl --------------------
659dnl Daemon disable check
660dnl --------------------
661if test "${enable_zebra}" = "no";then
662 ZEBRA=""
663else
664 ZEBRA="zebra"
665fi
666
667if test "${enable_bgpd}" = "no";then
668 BGPD=""
669else
670 BGPD="bgpd"
671fi
672
673if test "${enable_ripd}" = "no";then
674 RIPD=""
675else
676 RIPD="ripd"
677fi
678
679if test "${enable_ospfd}" = "no";then
680 OSPFD=""
681else
682 OSPFD="ospfd"
683fi
684
paul1ef74ef2003-03-21 15:16:05 +0000685OSPFCLIENT=""
686if test "${enable_opaque_lsa}" = "yes"; then
687 if test "${enable_ospfapi}" != "no";then
paul9a569842003-03-28 01:45:13 +0000688 AC_DEFINE(SUPPORT_OSPF_API,,OSPFAPI)
paul1ef74ef2003-03-21 15:16:05 +0000689
690 if test "${enable_ospfclient}" != "no";then
691 OSPFCLIENT="ospfclient"
692 fi
693 fi
694
paul7ea487b2003-03-17 02:05:07 +0000695fi
696
697case "${enable_ripngd}" in
698 "yes") RIPNGD="ripngd";;
699 "no" ) RIPNGD="";;
700 * ) ;;
701esac
702
703case "${enable_ospf6d}" in
704 "yes") OSPF6D="ospf6d";;
705 "no" ) OSPF6D="";;
706 * ) ;;
707esac
708
jardin9e867fe2003-12-23 08:56:18 +0000709case "${enable_isisd}" in
710 "yes") ISISD="isisd";;
711 "no" ) ISISD="";;
712 * ) ISISD="isisd";;
713esac
714
paul7ea487b2003-03-17 02:05:07 +0000715if test "${enable_bgp_announce}" = "no";then
716 AC_DEFINE(DISABLE_BGP_ANNOUNCE,,Disable BGP installation to zebra)
717fi
718
719AC_SUBST(ZEBRA)
720AC_SUBST(BGPD)
721AC_SUBST(RIPD)
722AC_SUBST(RIPNGD)
723AC_SUBST(OSPFD)
724AC_SUBST(OSPF6D)
jardin9e867fe2003-12-23 08:56:18 +0000725AC_SUBST(ISISD)
paul7ea487b2003-03-17 02:05:07 +0000726AC_SUBST(VTYSH)
727AC_SUBST(INCLUDES)
728AC_SUBST(CURSES)
729AC_SUBST(OSPFCLIENT)
paul1ef74ef2003-03-21 15:16:05 +0000730AC_SUBST(OSPFAPI)
paul7ea487b2003-03-17 02:05:07 +0000731AC_CHECK_LIB(c, inet_ntop, [AC_DEFINE(HAVE_INET_NTOP,,inet_ntop)])
732AC_CHECK_LIB(c, inet_pton, [AC_DEFINE(HAVE_INET_PTON,,inet_pton)])
733AC_CHECK_LIB(crypt, crypt)
734AC_CHECK_LIB(resolv, res_init)
735AC_CHECK_LIB(m, main)
736
737dnl ---------------------------------------------------
738dnl BSD/OS 4.1 define inet_XtoY function as __inet_XtoY
739dnl ---------------------------------------------------
paula159ed92003-06-04 11:01:45 +0000740AC_CHECK_FUNC(__inet_ntop, AC_DEFINE(HAVE_INET_NTOP,,__inet_ntop))
741AC_CHECK_FUNC(__inet_pton, AC_DEFINE(HAVE_INET_PTON,,__inet_pton))
742AC_CHECK_FUNC(__inet_aton, AC_DEFINE(HAVE_INET_ATON,,__inet_aton))
paul7ea487b2003-03-17 02:05:07 +0000743
744dnl ---------------------------
745dnl check system has GNU regexp
746dnl ---------------------------
747dnl AC_MSG_CHECKING(whether system has GNU regex)
748AC_CHECK_LIB(c, regexec,
749[AC_DEFINE(HAVE_GNU_REGEX,,GNU regexp library)
750 LIB_REGEX=""],
751[LIB_REGEX="regex.o"])
752AC_SUBST(LIB_REGEX)
753
754dnl ------------------
755dnl check SNMP library
756dnl ------------------
757if test "${enable_snmp}" = "yes";then
758dnl AC_CHECK_LIB(snmp, asn_parse_int, HAVE_SNMP=yes)
paul7ea487b2003-03-17 02:05:07 +0000759 if test "${HAVE_SNMP}" = ""; then
paul1ef74ef2003-03-21 15:16:05 +0000760 old_libs="${LIBS}"
761 LIBS="-L/usr/lib"
paul7ea487b2003-03-17 02:05:07 +0000762 unset ac_cv_lib_snmp_asn_parse_int
paul1ef74ef2003-03-21 15:16:05 +0000763 AC_CHECK_LIB(crypto, main, NEED_CRYPTO=yes, )
764 if test "${NEED_CRYPTO}" = ""; then
765 AC_CHECK_LIB(netsnmp, asn_parse_int, [HAVE_NETSNMP=yes; HAVE_SNMP=yes ])
766 else
767 AC_CHECK_LIB(netsnmp, asn_parse_int, [HAVE_NETSNMP=yes; HAVE_SNMP=yes; NEED_CRYPTO=yes;LIBS="$LIBS -lcrypto" ],,"-lcrypto")
768 fi
769 LIBS="${old_libs}"
paul7ea487b2003-03-17 02:05:07 +0000770 fi
paul1ef74ef2003-03-21 15:16:05 +0000771 if test "${HAVE_SNMP}" = ""; then
772 old_libs="${LIBS}"
773 LIBS="-L/usr/lib"
774 unset ac_cv_lib_snmp_asn_parse_int
775 AC_CHECK_LIB(snmp, asn_parse_int, HAVE_SNMP=yes, )
776 if test "${HAVE_SNMP}" = ""; then
777 unset ac_cv_lib_snmp_asn_parse_int
778 AC_CHECK_LIB(crypto, main, NEED_CRYPTO=yes, )
779 if test "${NEED_CRYPTO}" = "yes"; then
780 AC_CHECK_LIB(snmp, asn_parse_int, [HAVE_SNMP=yes; NEED_CRYPTO=yes; LIBS="$LIBS -lcrypto" ],,"-lcrypto")
781 fi
782 fi
783 LIBS="${old_libs}"
784 fi
paul7ea487b2003-03-17 02:05:07 +0000785
786 if test "${HAVE_SNMP}" = ""; then
paul1ef74ef2003-03-21 15:16:05 +0000787 old_libs="${LIBS}"
788 LIBS="-L/usr/local/lib"
789 unset ac_cv_lib_snmp_asn_parse_int
790 AC_CHECK_LIB(snmp, asn_parse_int, HAVE_SNMP=yes)
791 if test "${HAVE_SNMP}" = ""; then
792 unset ac_cv_lib_snmp_asn_parse_int
793 AC_CHECK_LIB(crypto, main, NEED_CRYPTO=yes, )
794 if test "${NEED_CRYPTO}" = "yes"; then
795 AC_CHECK_LIB(snmp, asn_parse_int, [HAVE_SNMP=yes; NEED_CRYPTO=yes; LIBS="$LIBS -lcrypto" ],,"-lcrypto")
796 fi
797 fi
798 LIBS="${old_libs}"
paul7ea487b2003-03-17 02:05:07 +0000799 fi
paul1ef74ef2003-03-21 15:16:05 +0000800
paul7ea487b2003-03-17 02:05:07 +0000801 if test "${HAVE_SNMP}" = "yes"; then
802 for ac_snmp in /usr/include/net-snmp/library/asn1.h /usr/include/ucd-snmp/asn1.h /usr/local/include/ucd-snmp/asn1.h /dev/null
803 do
804 test -f "${ac_snmp}" && break
805 done
paul1ef74ef2003-03-21 15:16:05 +0000806
paul7ea487b2003-03-17 02:05:07 +0000807 case ${ac_snmp} in
808 /usr/include/net-snmp/*)
809 AC_DEFINE(HAVE_SNMP,,SNMP)
paul1ef74ef2003-03-21 15:16:05 +0000810 AC_DEFINE(HAVE_NETSNMP,,SNMP)
paul7ea487b2003-03-17 02:05:07 +0000811 AC_DEFINE(UCD_COMPATIBLE,,SNMP)
paulac7c4bb2003-03-19 04:25:08 +0000812 CFLAGS="${CFLAGS} -I/usr/include/net-snmp -I/usr/include/net-snmp/library"
813 if test "${HAVE_NETSNMP}" = "yes"; then
paul1ef74ef2003-03-21 15:16:05 +0000814 LIBS="${LIBS} -lnetsnmp"
paulac7c4bb2003-03-19 04:25:08 +0000815 else
paul1ef74ef2003-03-21 15:16:05 +0000816 LIBS="${LIBS} -lsnmp"
paulac7c4bb2003-03-19 04:25:08 +0000817 fi
paul7ea487b2003-03-17 02:05:07 +0000818 ;;
819 /usr/include/ucd-snmp/*)
820 AC_DEFINE(HAVE_SNMP,,SNMP)
821 CFLAGS="${CFLAGS} -I/usr/include/ucd-snmp"
822 LIBS="${LIBS} -lsnmp"
823 ;;
824 /usr/local/include/ucd-snmp/*)
825 AC_DEFINE(HAVE_SNMP,,SNMP)
826 CFLAGS="${CFLAGS} -I/usr/local/include/ucd-snmp"
827 LIBS="${LIBS} -L/usr/local/lib -lsnmp"
828 ;;
paulf3bd1a72003-11-02 07:29:11 +0000829 /usr/local/include/net-snmp/*)
830 AC_DEFINE(HAVE_SNMP,,SNMP)
831 AC_DEFINE(HAVE_NET_SNMP,,SNMP)
832 AC_DEFINE(UCD_COMPATIBLE,,SNMP)
833 CFLAGS="${CFLAGS} -I/usr/local/include/net-snmp"
834 LIBS="${LIBS} -L/usr/local/lib -lnetsnmp"
835 ;;
paul7ea487b2003-03-17 02:05:07 +0000836 esac
837 if test "${NEED_CRYPTO}" = "yes"; then
838 LIBS="${LIBS} -lcrypto"
839 fi
840 fi
841fi
842
843dnl ----------------------------
844dnl check sa_len of sockaddr
845dnl ----------------------------
846AC_MSG_CHECKING(whether struct sockaddr has a sa_len field)
847AC_TRY_COMPILE([#include <sys/types.h>
848#include <sys/socket.h>
849],[static struct sockaddr ac_i;int ac_j = sizeof (ac_i.sa_len);],
850[AC_MSG_RESULT(yes)
851 AC_DEFINE(HAVE_SA_LEN,,sa_len)],
852 AC_MSG_RESULT(no))
853
854dnl ----------------------------
855dnl check sin_len of sockaddr_in
856dnl ----------------------------
857AC_MSG_CHECKING(whether struct sockaddr_in has a sin_len field)
858AC_TRY_COMPILE([#include <sys/types.h>
859#include <netinet/in.h>
860],[static struct sockaddr_in ac_i;int ac_j = sizeof (ac_i.sin_len);],
861[AC_MSG_RESULT(yes)
862 AC_DEFINE(HAVE_SIN_LEN,,sin_len)],
863 AC_MSG_RESULT(no))
864
865dnl ----------------------------
866dnl check sun_len of sockaddr_un
867dnl ----------------------------
868AC_MSG_CHECKING(whether struct sockaddr_un has a sun_len field)
869AC_TRY_COMPILE([#include <sys/types.h>
870#include <sys/un.h>
871],[static struct sockaddr_un ac_i;int ac_j = sizeof (ac_i.sun_len);],
872[AC_MSG_RESULT(yes)
873 AC_DEFINE(HAVE_SUN_LEN,,sun_len)],
874 AC_MSG_RESULT(no))
875
876dnl -----------------------------------
877dnl check sin6_scope_id of sockaddr_in6
878dnl -----------------------------------
879if test "$zebra_cv_ipv6" = yes; then
880 AC_MSG_CHECKING(whether struct sockaddr_in6 has a sin6_scope_id field)
881 AC_TRY_COMPILE([#include <sys/types.h>
882#include <netinet/in.h>
883],[static struct sockaddr_in6 ac_i;int ac_j = sizeof (ac_i.sin6_scope_id);],
884[AC_MSG_RESULT(yes)
885 AC_DEFINE(HAVE_SIN6_SCOPE_ID,,scope id)],
886 AC_MSG_RESULT(no))
887fi
888
889dnl ----------------------------
890dnl check socklen_t exist or not
891dnl ----------------------------
892AC_MSG_CHECKING(whther socklen_t is defined)
893AC_TRY_COMPILE([#include <sys/types.h>
894#include <sys/socket.h>
895#include <netinet/in.h>
896],[socklen_t ac_x;],
897[AC_MSG_RESULT(yes)
898 AC_DEFINE(HAVE_SOCKLEN_T,,socklen_t)],
899 AC_MSG_RESULT(no))
900
901dnl ------------------------
902dnl check struct sockaddr_dl
903dnl ------------------------
904AC_MSG_CHECKING(whether struct sockaddr_dl exist)
905AC_EGREP_HEADER(sockaddr_dl,
906net/if_dl.h,
907[AC_MSG_RESULT(yes)
908 AC_DEFINE(HAVE_SOCKADDR_DL,,sockaddr_dl)],
909 AC_MSG_RESULT(no))
910
911dnl --------------------------
912dnl check structure ifaliasreq
913dnl --------------------------
914AC_MSG_CHECKING(whether struct ifaliasreq exist)
915AC_EGREP_HEADER(ifaliasreq,
916net/if.h,
917[AC_MSG_RESULT(yes)
918 AC_DEFINE(HAVE_IFALIASREQ,,ifaliasreq)],
919 AC_MSG_RESULT(no))
920
921dnl ----------------------------
922dnl check structure in6_aliasreq
923dnl ----------------------------
hasso71c0fb52003-05-25 20:18:13 +0000924AC_MSG_CHECKING(whether struct in6_aliasreq exist)
paul7ea487b2003-03-17 02:05:07 +0000925AC_EGREP_HEADER(in6_aliasreq,
926netinet6/in6_var.h,
927[AC_MSG_RESULT(yes)
928 AC_DEFINE(HAVE_IN6_ALIASREQ,,in6_aliasreq)],
929 AC_MSG_RESULT(no))
930
hasso71c0fb52003-05-25 20:18:13 +0000931dnl -----------------------------------
932dnl check ifra_lifetime of in6_aliasreq
933dnl -----------------------------------
934AC_MSG_CHECKING(whether in6_aliasreq.ifra_lifetime exist)
935AC_TRY_COMPILE([#include <sys/types.h>
936#include <netinet6/in6_var.h>
937],[static struct if6_aliasreq ac_i;int ac_j = sizeof (ac_i.ifra_lifetime);],
938[AC_MSG_RESULT(yes)
paula159ed92003-06-04 11:01:45 +0000939 AC_DEFINE(HAVE_IFRA_LIFETIME,,Have in6_aliasreq.ifra_lifetime)],
hasso71c0fb52003-05-25 20:18:13 +0000940 AC_MSG_RESULT(no))
941
paul7ea487b2003-03-17 02:05:07 +0000942dnl ---------------------------
943dnl check structure rt_addrinfo
944dnl ---------------------------
945AC_MSG_CHECKING(whether struct rt_addrinfo exist)
946AC_EGREP_HEADER(rt_addrinfo,
947net/route.h,
948[AC_MSG_RESULT(yes)
949 AC_DEFINE(HAVE_RT_ADDRINFO,,rt_addrinfo)],
950 AC_MSG_RESULT(no))
951
952dnl --------------------------
953dnl check structure in_pktinfo
954dnl --------------------------
955AC_MSG_CHECKING(whether struct in_pktinfo exist)
956AC_TRY_COMPILE([#include <netinet/in.h>
957],[struct in_pktinfo ac_x;],
958[AC_MSG_RESULT(yes)
959 AC_DEFINE(HAVE_INPKTINFO,,in_pktinfo)],
960 AC_MSG_RESULT(no))
961
962dnl --------------------------------------
963dnl checking for getrusage struct and call
964dnl --------------------------------------
965AC_MSG_CHECKING(whether getrusage is available)
966AC_TRY_COMPILE([#include <sys/resource.h>
967],[struct rusage ac_x; getrusage (RUSAGE_SELF, &ac_x);],
968[AC_MSG_RESULT(yes)
969 AC_DEFINE(HAVE_RUSAGE,,rusage)],
970 AC_MSG_RESULT(no))
971
pauledd7c242003-06-04 13:59:38 +0000972dnl -------------------
973dnl capabilities checks
974dnl -------------------
hasso41d3fc92004-04-06 11:59:00 +0000975if test "${enable_capabilities}" != "no"; then
976 AC_MSG_CHECKING(whether prctl PR_SET_KEEPCAPS is available)
977 AC_TRY_COMPILE([#include <sys/prctl.h>],[prctl(PR_SET_KEEPCAPS, 1, 0, 0, 0);],
978 [AC_MSG_RESULT(yes)
979 AC_DEFINE(HAVE_PR_SET_KEEPCAPS,,prctl)
980 quagga_ac_keepcaps="yes"],
981 AC_MSG_RESULT(no)
pauledd7c242003-06-04 13:59:38 +0000982 )
hasso41d3fc92004-04-06 11:59:00 +0000983 if test x"${quagga_ac_keepcaps}" = x"yes"; then
984 AC_CHECK_HEADERS(sys/capability.h)
985 fi
986 if test x"${ac_cv_header_sys_capability_h}" = x"yes"; then
987 AC_CHECK_LIB(cap, cap_init,
988 [AC_DEFINE(HAVE_LCAPS,1,Capabilities)
989 LIBCAP="-lcap"
990 ]
991 )
992 fi
pauledd7c242003-06-04 13:59:38 +0000993fi
994AC_SUBST(LIBCAP)
995
paulfb2d1502003-06-04 09:40:54 +0000996dnl ---------------------------
997dnl check for glibc 'backtrace'
998dnl ---------------------------
999if test "${glibc}" = "yes"; then
1000 AC_CHECK_HEADER(execinfo.h)
1001fi
1002if test x"${ac_cv_header_execinfo_h}" = x"yes"; then
1003 AC_CHECK_FUNC(backtrace,
1004 [AC_DEFINE(HAVE_GLIBC_BACKTRACE,,Glibc backtrace)]
1005 )
1006fi
1007
paul408ad942003-05-20 00:03:33 +00001008dnl ----------
1009dnl configure date
1010dnl ----------
1011CONFDATE=`date '+%Y%m%d'`
1012AC_SUBST(CONFDATE)
1013
paul7ea487b2003-03-17 02:05:07 +00001014dnl ------------------------------
paula159ed92003-06-04 11:01:45 +00001015dnl set paths for state directory
paul23bd12c2003-04-07 06:11:09 +00001016dnl ------------------------------
1017if test "${prefix}" = "NONE"; then
paule8f29842003-08-12 13:08:31 +00001018 quagga_statedir_prefix="";
paul23bd12c2003-04-07 06:11:09 +00001019else
paule8f29842003-08-12 13:08:31 +00001020 quagga_statedir_prefix=${prefix}
paul23bd12c2003-04-07 06:11:09 +00001021fi
1022if test "${localstatedir}" = '${prefix}/var'; then
paula159ed92003-06-04 11:01:45 +00001023 AC_CACHE_CHECK(state directory,ac_statedir,
paule8f29842003-08-12 13:08:31 +00001024 [for QUAGGA_STATE_DIR in ${quagga_statedir_prefix}/var/run dnl
1025 ${quagga_statedir_prefix}/var/adm dnl
1026 ${quagga_statedir_prefix}/etc dnl
paula159ed92003-06-04 11:01:45 +00001027 /var/run dnl
1028 /var/adm dnl
1029 /etc dnl
1030 /dev/null;
paul23bd12c2003-04-07 06:11:09 +00001031 do
paule8f29842003-08-12 13:08:31 +00001032 test -d $QUAGGA_STATE_DIR && break
paul23bd12c2003-04-07 06:11:09 +00001033 done
paule8f29842003-08-12 13:08:31 +00001034 quagga_statedir=$QUAGGA_STATE_DIR])
paul23bd12c2003-04-07 06:11:09 +00001035else
paule8f29842003-08-12 13:08:31 +00001036 quagga_statedir=${localstatedir}
paula159ed92003-06-04 11:01:45 +00001037 AC_MSG_CHECKING(directory to use for state file)
paule8f29842003-08-12 13:08:31 +00001038 AC_MSG_RESULT(${quagga_statedir})
paul23bd12c2003-04-07 06:11:09 +00001039fi
paule8f29842003-08-12 13:08:31 +00001040if test $quagga_statedir = "/dev/null"; then
paula159ed92003-06-04 11:01:45 +00001041 AC_MSG_ERROR('STATE DIRECTORY NOT FOUND! FIX OR SPECIFY --localstatedir!')
1042fi
1043
paule8f29842003-08-12 13:08:31 +00001044AC_DEFINE_UNQUOTED(PATH_ZEBRA_PID, "$quagga_statedir/zebra.pid",zebra PID)
1045AC_DEFINE_UNQUOTED(PATH_RIPD_PID, "$quagga_statedir/ripd.pid",ripd PID)
1046AC_DEFINE_UNQUOTED(PATH_RIPNGD_PID, "$quagga_statedir/ripngd.pid",ripngd PID)
1047AC_DEFINE_UNQUOTED(PATH_BGPD_PID, "$quagga_statedir/bgpd.pid",bgpd PID)
1048AC_DEFINE_UNQUOTED(PATH_OSPFD_PID, "$quagga_statedir/ospfd.pid",ospfd PID)
1049AC_DEFINE_UNQUOTED(PATH_OSPF6D_PID, "$quagga_statedir/ospf6d.pid",ospf6d PID)
jardin9e867fe2003-12-23 08:56:18 +00001050AC_DEFINE_UNQUOTED(PATH_ISISD_PID, "$quagga_statedir/isisd.pid",isisd PID)
paule8f29842003-08-12 13:08:31 +00001051AC_DEFINE_UNQUOTED(ZEBRA_SERV_PATH, "$quagga_statedir/zserv.api",zebra api socket)
1052AC_DEFINE_UNQUOTED(ZEBRA_VTYSH_PATH, "$quagga_statedir/zebra.vty",zebra vty socket)
1053AC_DEFINE_UNQUOTED(RIP_VTYSH_PATH, "$quagga_statedir/ripd.vty",rip vty socket)
1054AC_DEFINE_UNQUOTED(RIPNG_VTYSH_PATH, "$quagga_statedir/ripngd.vty",ripng vty socket)
1055AC_DEFINE_UNQUOTED(BGP_VTYSH_PATH, "$quagga_statedir/bgpd.vty",bgpd vty socket)
1056AC_DEFINE_UNQUOTED(OSPF_VTYSH_PATH, "$quagga_statedir/ospfd.vty",ospfd vty socket)
1057AC_DEFINE_UNQUOTED(OSPF6_VTYSH_PATH, "$quagga_statedir/ospf6d.vty",ospf6d vty socket)
jardin9e867fe2003-12-23 08:56:18 +00001058AC_DEFINE_UNQUOTED(ISIS_VTYSH_PATH, "$quagga_statedir/isisd.vty",isisd vty socket)
paul7ea487b2003-03-17 02:05:07 +00001059
1060dnl ---------------------------
1061dnl Check htonl works correctly
1062dnl ---------------------------
1063AC_MSG_CHECKING(for working htonl)
1064AC_CACHE_VAL(ac_cv_htonl_works, [
1065AC_TRY_LINK([#ifdef HAVE_SYS_TYPES_H
1066#include <sys/types.h>
1067#endif
1068#ifdef HAVE_NETDB_H
1069#include <netdb.h>
1070#endif
1071#ifdef HAVE_NETINET_IN_H
1072#include <netinet/in.h>
1073#endif],
1074[htonl (0);],
1075ac_cv_htonl_works=yes,
1076ac_cv_htonl_works=no)])
1077AC_MSG_RESULT($ac_cv_htonl_works)
1078
paul6382b6f2003-05-20 00:17:45 +00001079AC_OUTPUT(Makefile lib/Makefile zebra/Makefile ripd/Makefile
1080 ripngd/Makefile bgpd/Makefile ospfd/Makefile
jardin9e867fe2003-12-23 08:56:18 +00001081 ospf6d/Makefile isisd/Makefile vtysh/Makefile doc/Makefile
paul6382b6f2003-05-20 00:17:45 +00001082 ospfclient/Makefile
jardina4d2a0d2004-01-10 20:42:35 +00001083 redhat/Makefile redhat/quagga.spec
paulfa1253d2003-09-24 05:09:26 +00001084 lib/version.h)
paul7ea487b2003-03-17 02:05:07 +00001085
1086echo "
1087zebra configuration
1088-------------------
paulfa1253d2003-09-24 05:09:26 +00001089quagga version : ${PACKAGE_VERSION}
paul7ea487b2003-03-17 02:05:07 +00001090host operationg system : ${host_os}
1091source code location : ${srcdir}
1092compiler : ${CC}
1093compiler flags : ${CFLAGS}
hasso71c0fb52003-05-25 20:18:13 +00001094linker flags : ${LDFLAGS} ${LIBS}
paule8f29842003-08-12 13:08:31 +00001095state file directory : ${quagga_statedir}
pauldc7a2bf2003-10-22 00:07:44 +00001096config file directory : `eval echo \`echo ${sysconfdir}\``
gdtd6b72f72003-12-03 17:24:27 +00001097example directory : `eval echo \`echo ${exampledir}\``
paul8d4aee52003-06-06 00:30:35 +00001098user to run as : ${enable_user}
1099group to run as : ${enable_group}
1100group for vty sockets : ${enable_vty_group}
gdtaa593d52003-12-22 20:15:53 +00001101config file mask : ${enable_configfile_mask}
1102log file mask : ${enable_logfile_mask}
pauldc7a2bf2003-10-22 00:07:44 +00001103
1104The above user and group must have read/write access to the state file
1105directory and to the config files in the config file directory.
paul7ea487b2003-03-17 02:05:07 +00001106"