blob: b3fd50ec5052a8eff2a5dda414e7a77ff0b1a2d1 [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
paulbf547fe2003-10-15 23:12:31 +000010AC_INIT(quagga, 0.96.4, [bug-zebra@gnu.org])
paulfa1253d2003-09-24 05:09:26 +000011AC_CONFIG_SRCDIR(lib/zebra.h)
12AM_INIT_AUTOMAKE()
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
16exampledir='${sysconfdir}'
17AC_ARG_ENABLE([exampledir],
18 AC_HELP_STRING([--enable-exampledir],
19 [specify alternate directory for examples]),
20 exampledir="$enableval",)
21dnl XXX hook into argument processing
22AC_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])
85AC_ARG_ENABLE(bgp-announce,
86[ --disable-bgp-announce, turn off BGP route announcement])
87AC_ARG_ENABLE(netlink,
88[ --enable-netlink force to use Linux netlink interface])
89AC_ARG_ENABLE(broken-aliases,
90[ --enable-broken-aliases enable aliases as distinct interfaces for Linux 2.2.X])
91AC_ARG_ENABLE(snmp,
92[ --enable-snmp enable SNMP support])
93AC_ARG_WITH(libpam,
94[ --with-libpam use libpam for PAM support in vtysh])
hasso71c0fb52003-05-25 20:18:13 +000095AC_ARG_ENABLE(tcp-zebra,
paul7ea487b2003-03-17 02:05:07 +000096[ --enable-tcp-zebra enable TCP/IP socket connection between zebra and protocol daemon])
97dnl Temporary option until OSPF NSSA implementation complete
98AC_ARG_ENABLE(nssa,
99[ --enable-nssa enable OSPF NSSA option])
100AC_ARG_ENABLE(opaque-lsa,
paul1ef74ef2003-03-21 15:16:05 +0000101[ --enable-opaque-lsa enable OSPF Opaque-LSA with OSPFAPI support (RFC2370)])
102AC_ARG_ENABLE(ospfapi,
103[ --disable-ospfapi do not build OSPFAPI to access the OSPF LSA Database,
104 (this is the default if --enable-opaque-lsa is not set)])
105AC_ARG_ENABLE(ospfclient,
106[ --disable-ospfclient do not build OSPFAPI client for OSPFAPI,
107 (this is the default if --disable-ospfapi is set)])
paul7ea487b2003-03-17 02:05:07 +0000108AC_ARG_ENABLE(ospf-te,
109[ --enable-ospf-te enable Traffic Engineering Extension to OSPF])
110AC_ARG_ENABLE(multipath,
111[ --enable-multipath=ARG enable multipath function, ARG must be digit])
paule8f29842003-08-12 13:08:31 +0000112AC_ARG_ENABLE(quagga_user,
113[ --enable-user=ARG user to run Quagga suite as (default quagga)])
114AC_ARG_ENABLE(quagga_group,
115[ --enable-group=ARG group to run Quagga suite as (default quagga)])
pauledd7c242003-06-04 13:59:38 +0000116AC_ARG_ENABLE(vty_group,
117[ --enable-vty-group=ARG set vty sockets to have specified group as owner])
118
hasso71c0fb52003-05-25 20:18:13 +0000119AC_ARG_ENABLE(rtadv,
pauledd7c242003-06-04 13:59:38 +0000120[ --enable-rtadv enable IPV6 router advertisement feature])
paul7ea487b2003-03-17 02:05:07 +0000121
122if test "${enable_broken_aliases}" = "yes"; then
123 if test "${enable_netlink}" = "yes"
124 then
125 echo "Sorry, you can't use netlink with broken aliases"
126 exit 1
127 fi
128 AC_DEFINE(HAVE_BROKEN_ALIASES,,Broken Alias)
129 enable_netlink=no
130fi
131
132if test "${enable_tcp_zebra}" = "yes"; then
133 AC_DEFINE(HAVE_TCP_ZEBRA,,Use TCP for zebra communication)
134fi
135
136if test "${enable_nssa}" = "yes"; then
137 AC_DEFINE(HAVE_NSSA,,OSPF NSSA)
138fi
139
140if test "${enable_opaque_lsa}" = "yes"; then
141 AC_DEFINE(HAVE_OPAQUE_LSA,,OSPF Opaque LSA)
142fi
143
144if test "${enable_ospf_te}" = "yes"; then
145 AC_DEFINE(HAVE_OPAQUE_LSA,,OSPF Opaque LSA)
146 AC_DEFINE(HAVE_OSPF_TE,,OSPF TE)
147fi
148
paule8f29842003-08-12 13:08:31 +0000149AC_MSG_CHECKING(Should zebra's RTADV be used)
paul2487bea2003-05-25 23:51:31 +0000150if test "${enable_rtadv}" = "yes"; then
hasso71c0fb52003-05-25 20:18:13 +0000151 AC_MSG_RESULT(yes)
paule8f29842003-08-12 13:08:31 +0000152 AC_DEFINE(HAVE_RTADV,,Enable zebra IPv6 Routing Advertisements)
paul2487bea2003-05-25 23:51:31 +0000153else
154 AC_MSG_RESULT(no)
hasso71c0fb52003-05-25 20:18:13 +0000155fi
paul7ea487b2003-03-17 02:05:07 +0000156
paul79cb2162003-06-06 12:19:53 +0000157if test "${enable_user}" = "yes" || test x"${enable_user}" = x""; then
paule8f29842003-08-12 13:08:31 +0000158 enable_user="quagga"
pauledd7c242003-06-04 13:59:38 +0000159elif test "${enable_user}" = "no"; then
160 enable_user="root"
161fi
paule8f29842003-08-12 13:08:31 +0000162AC_DEFINE_UNQUOTED(QUAGGA_USER, "${enable_user}", Quagga User)
pauledd7c242003-06-04 13:59:38 +0000163
paul79cb2162003-06-06 12:19:53 +0000164if test "${enable_group}" = "yes" || test x"${enable_group}" = x""; then
paule8f29842003-08-12 13:08:31 +0000165 enable_group="quagga"
pauledd7c242003-06-04 13:59:38 +0000166elif test "${enable_group}" = "no"; then
167 enable_group="root"
168fi
paule8f29842003-08-12 13:08:31 +0000169AC_DEFINE_UNQUOTED(QUAGGA_GROUP, "${enable_group}", Quagga Group)
pauledd7c242003-06-04 13:59:38 +0000170
171if test x"${enable_vty_group}" = x"yes" ; then
paul8d4aee52003-06-06 00:30:35 +0000172 AC_MSG_ERROR([--enable-vty-group requires a group as argument, not yes])
paul79cb2162003-06-06 12:19:53 +0000173elif test x"${enable_vty_group}" != x""; then
paul8d4aee52003-06-06 00:30:35 +0000174 if test x"${enable_vty_group}" != x"no"; then
pauledd7c242003-06-04 13:59:38 +0000175 AC_DEFINE_UNQUOTED(VTY_GROUP, "${enable_vty_group}", VTY Sockets Group)
176 fi
177fi
178
paul7ea487b2003-03-17 02:05:07 +0000179changequote(, )dnl
180
181MULTIPATH_NUM=1
182
183case "${enable_multipath}" in
184 [0-9]|[1-9][0-9])
185 MULTIPATH_NUM="${enable_multipath}"
186 ;;
187 "")
188 ;;
189 *)
190 echo "Please specify digit to --enable-multipath ARG."
191 exit 1
192 ;;
193esac
194
195changequote([, ])dnl
196
197AC_SUBST(MULTIPATH_NUM)
198
199dnl -------------------
200dnl Check header files.
201dnl -------------------
pauldc7a2bf2003-10-22 00:07:44 +0000202AC_HEADER_STDC
203AC_CHECK_HEADERS([string.h stropts.h sys/conf.h sys/ksym.h sys/time.h \
204 sys/times.h sys/select.h sys/sysctl.h sys/sockio.h \
205 sys/types.h linux/version.h kvm.h netdb.h asm/types.h \
206 libutil.h limits.h])
207
paul835b7f12003-10-30 21:59:57 +0000208AC_CHECK_HEADERS([sys/socket.h netinet/in_systm.h netinet/in.h \
paulf3bd1a72003-11-02 07:29:11 +0000209 net/if_dl.h net/netopt.h inet/nd.h net/route.h \
paul835b7f12003-10-30 21:59:57 +0000210 net/if.h net/if_var.h netinet/in_var.h])
pauldc7a2bf2003-10-22 00:07:44 +0000211
gdtfa3232e2003-12-03 17:52:30 +0000212dnl V6 headers are checked below, after we check for v6
paul7ea487b2003-03-17 02:05:07 +0000213
214dnl check some types
215AC_C_CONST
216dnl AC_TYPE_PID_T
217AC_TYPE_SIGNAL
218
219dnl Some systems (Solaris 2.x) require libnsl (Network Services Library)
220case "$host" in
221 *-sunos5.6* | *-solaris2.6*)
222 opsys=sol2-6
223 AC_DEFINE(SUNOS_5,,SunOS 5)
224 AC_CHECK_LIB(xnet, main)
225 CURSES=-lcurses
226 ;;
227 *-sunos5* | *-solaris2*)
228 AC_DEFINE(SUNOS_5,,SunOS 5)
229 AC_CHECK_LIB(socket, main)
230 AC_CHECK_LIB(nsl, main)
231 CURSES=-lcurses
232 ;;
233 *-linux-*)
234 opsys=gnu-linux
235 AC_DEFINE(GNU_LINUX,,GNU Linux)
236 ;;
237 *-nec-sysv4*)
238 AC_CHECK_LIB(nsl, gethostbyname)
239 AC_CHECK_LIB(socket, socket)
240 ;;
241 *-freebsd3.2)
242 AC_DEFINE(FREEBSD_32,,FreeBSD 3.2)
243 ;;
244 *-openbsd*)
245 opsys=openbsd
246 AC_DEFINE(OPEN_BSD,,OpenBSD)
247 ;;
248 *-bsdi*)
249 opsys=bsdi
250 OTHER_METHOD="mtu_kvm.o"
251 AC_CHECK_LIB(kvm, main)
252 ;;
paul49e3b3c2003-10-23 20:39:50 +0000253 *-irix6.5)
pauldc7a2bf2003-10-22 00:07:44 +0000254 opsys=irix
255 AC_DEFINE(IRIX_65,,IRIX 6.5)
256 ;;
paul7ea487b2003-03-17 02:05:07 +0000257esac
258
259dnl ---------------------
260dnl Integrated VTY option
261dnl ---------------------
262case "${enable_vtysh}" in
263 "yes") VTYSH="vtysh";
264 AC_DEFINE(VTYSH,,VTY shell)
265 AC_CHECK_LIB(tinfo, tputs, , AC_CHECK_LIB(ncurses, tputs))
266 AC_CHECK_LIB(readline, main)
267 if test $ac_cv_lib_readline_main = no; then
268 AC_MSG_ERROR([vtysh needs libreadline but was not found on your system.])
269 fi
270 AC_CHECK_HEADER(readline/history.h)
271 if test $ac_cv_header_readline_history_h = no;then
272 AC_MSG_ERROR([readline is too old to have readline/history.h, please update to the latest readline library.])
273 fi
paul3d3de8c2003-05-23 10:33:49 +0000274 AC_CHECK_LIB(readline, rl_completion_matches)
275 if test $ac_cv_lib_readline_rl_completion_matches = no; then
276 AC_DEFINE(rl_completion_matches,completion_matches,Old readline)
277 fi
278 ;;
paul7ea487b2003-03-17 02:05:07 +0000279 "no" ) VTYSH="";;
280 * ) ;;
281esac
282
283dnl ----------
284dnl PAM module
285dnl ----------
286if test "$with_libpam" = "yes"; then
paul24cd4352003-05-06 12:16:27 +0000287 AC_CHECK_HEADER(security/pam_misc.h)
288 if test "$ac_cv_header_security_pam_misc_h" = yes; then
289 AC_DEFINE(HAVE_PAM_MISC_H,,Have pam_misc.h)
290 AC_DEFINE(PAM_CONV_FUNC,misc_conv,Have misc_conv)
291 pam_conv_func="misc_conv"
paul24cd4352003-05-06 12:16:27 +0000292 fi
paul24cd4352003-05-06 12:16:27 +0000293 AC_CHECK_HEADER(security/openpam.h)
294 if test "$ac_cv_header_security_openpam_h" = yes; then
295 AC_DEFINE(HAVE_OPENPAM_H,,Have openpam.h)
296 AC_DEFINE(PAM_CONV_FUNC,openpam_ttyconv,Have openpam_ttyconv)
297 pam_conv_func="openpam_ttyconv"
paul24cd4352003-05-06 12:16:27 +0000298 fi
299 if test -z "$ac_cv_header_security_pam_misc_h$ac_cv_header_security_openpam_h" ; then
300 AC_MSG_WARN([*** pam support will not be built ***])
301 with_libpam="no"
302 fi
303fi
304
305if test "$with_libpam" = "yes"; then
paul7ea487b2003-03-17 02:05:07 +0000306dnl took this test from proftpd's configure.in and suited to our needs
307dnl -------------------------------------------------------------------------
308dnl
309dnl This next check looks funky due to a linker problem with some versions
310dnl of the PAM library. Prior to 0.72 release, the Linux PAM shared library
311dnl omitted requiring libdl linking information. PAM-0.72 or better ships
312dnl with RedHat 6.2 and Debian 2.2 or better.
313AC_CHECK_LIB(pam, pam_start,
paul24cd4352003-05-06 12:16:27 +0000314 [AC_CHECK_LIB(pam, $pam_conv_func,
paul7ea487b2003-03-17 02:05:07 +0000315 [AC_DEFINE(USE_PAM,,Use PAM for authentication)
316 LIBPAM="-lpam"],
317 [AC_DEFINE(USE_PAM,,Use PAM for authentication)
318 LIBPAM="-lpam -lpam_misc"]
319 )
320 ],
321
322 [AC_CHECK_LIB(pam, pam_end,
paul24cd4352003-05-06 12:16:27 +0000323 [AC_CHECK_LIB(pam, $pam_conv_func,
paula159ed92003-06-04 11:01:45 +0000324 [AC_DEFINE(USE_PAM,,Use PAM for authentication)
paul7ea487b2003-03-17 02:05:07 +0000325 LIBPAM="-lpam -ldl"],
paula159ed92003-06-04 11:01:45 +0000326 [AC_DEFINE(USE_PAM,,Use PAM for authentication)
paul7ea487b2003-03-17 02:05:07 +0000327 LIBPAM="-lpam -ldl -lpam_misc"]
328 )
329 ],AC_MSG_WARN([*** pam support will not be built ***]),
330 [-ldl])
331 ]
332)
333fi
334AC_SUBST(LIBPAM)
335
336dnl -------------------------------
337dnl Endian-ness check
338dnl -------------------------------
339AC_WORDS_BIGENDIAN
340
341dnl -------------------------------
342dnl check the size in byte of the C
343dnl -------------------------------
344dnl AC_CHECK_SIZEOF(char)
345dnl AC_CHECK_SIZEOF(int)
346dnl AC_CHECK_SIZEOF(short)
347dnl AC_CHECK_SIZEOF(long)
348
349dnl ----------------------------
350dnl check existance of functions
351dnl ----------------------------
paul49e3b3c2003-10-23 20:39:50 +0000352AC_CHECK_FUNCS(memset memcpy strerror inet_aton daemon snprintf vsnprintf \
paul04bd4842003-10-24 04:24:39 +0000353 strlcat strlcpy if_nametoindex if_indextoname getifaddrs \
354 fcntl)
paula159ed92003-06-04 11:01:45 +0000355AC_CHECK_FUNCS(setproctitle, ,
356 [AC_CHECK_LIB(util, setproctitle,
357 [LIBS="$LIBS -lutil"
358 AC_DEFINE(HAVE_SETPROCTITLE,, Have setproctitle)
359 ]
360 )
361 ]
362)
paul7ea487b2003-03-17 02:05:07 +0000363
364dnl ------------------------------------
365dnl Determine routing get and set method
366dnl ------------------------------------
367AC_MSG_CHECKING(zebra between kernel interface method)
368if test x"$opsys" = x"gnu-linux"; then
369 if test "${enable_netlink}" = "yes";then
370 AC_MSG_RESULT(netlink)
371 RT_METHOD=rt_netlink.o
372 AC_DEFINE(HAVE_NETLINK,,netlink)
373 netlink=yes
374 elif test "${enable_netlink}" = "no"; then
375 AC_MSG_RESULT(ioctl)
376 RT_METHOD=rt_ioctl.o
377 netlink=no
378 else
379 AC_MSG_RESULT(netlink)
380 RT_METHOD=rt_netlink.o
381 AC_DEFINE(HAVE_NETLINK,,netlink)
382 netlink=yes
383 fi
384else
385 if test "$opsys" = "sol2-6";then
386 AC_MSG_RESULT(solaris)
387 KERNEL_METHOD="kernel_socket.o"
388 RT_METHOD="rt_socket.o"
paul49e3b3c2003-10-23 20:39:50 +0000389 elif test "$opsys" = "irix" ; then
390 AC_MSG_RESULT(irix)
391 KERNEL_METHOD="kernel_socket.o"
392 RT_METHOD="rt_socket.o"
paul7ea487b2003-03-17 02:05:07 +0000393 else
394 AC_TRY_RUN([#include <errno.h>
395#include <sys/types.h>
396#include <sys/socket.h>
397
398main ()
399{
400 int ac_sock;
401
402 ac_sock = socket (AF_ROUTE, SOCK_RAW, 0);
403 if (ac_sock < 0 && errno == EINVAL)
404 exit (1);
405 exit (0);
406}],
407 [KERNEL_METHOD=kernel_socket.o
408 RT_METHOD=rt_socket.o
409 AC_MSG_RESULT(socket)],
410 [RT_METHOD=rt_ioctl.o
411 AC_MSG_RESULT(ioctl)],
412 [KERNEL_METHOD=kernel_socket.o
413 RT_METHOD=rt_socket.o
414 AC_MSG_RESULT(socket)])
415 fi
416fi
417AC_SUBST(RT_METHOD)
418AC_SUBST(KERNEL_METHOD)
419AC_SUBST(OTHER_METHOD)
420
421dnl ------------------------------
422dnl check kernel route read method
423dnl ------------------------------
424AC_CACHE_CHECK(route read method check, zebra_rtread,
425[if test "$netlink" = yes; then
426 RTREAD_METHOD="rtread_netlink.o"
427 zebra_rtread="netlink"
428else
429for zebra_rtread in /proc/net/route /dev/ip /dev/null;
430do
431 test x`ls $zebra_rtread 2>/dev/null` = x"$zebra_rtread" && break
432done
433case $zebra_rtread in
434 "/proc/net/route") RTREAD_METHOD="rtread_proc.o"
435 zebra_rtread="proc";;
paul9c30ab62003-07-08 08:36:17 +0000436 "/dev/ip")
437 case "$host" in
438 *-freebsd*) RTREAD_METHOD=rtread_sysctl.o
439 zebra_rtread="sysctl";;
440 *) RTREAD_METHOD="rtread_getmsg.o"
441 zebra_rtread="getmsg";;
442 esac;;
paul7ea487b2003-03-17 02:05:07 +0000443 *) RTREAD_METHOD="rtread_sysctl.o"
444 zebra_rtread="sysctl";;
445esac
446fi])
447AC_SUBST(RTREAD_METHOD)
448
449dnl -----------------------------
450dnl check interface lookup method
451dnl -----------------------------
452AC_MSG_CHECKING(interface looking up method)
453if test "$netlink" = yes; then
454 AC_MSG_RESULT(netlink)
455 IF_METHOD=if_netlink.o
456else
457 if test "$opsys" = "sol2-6";then
458 AC_MSG_RESULT(solaris)
459 IF_METHOD=if_ioctl.o
paul49e3b3c2003-10-23 20:39:50 +0000460 elif test "$opsys" = "irix" ; then
461 AC_MSG_RESULT(irix)
462 IF_METHOD=if_ioctl.o
paul7ea487b2003-03-17 02:05:07 +0000463 elif test "$opsys" = "openbsd";then
464 AC_MSG_RESULT(openbsd)
465 IF_METHOD=if_ioctl.o
466 elif grep NET_RT_IFLIST /usr/include/sys/socket.h >/dev/null 2>&1; then
467 AC_MSG_RESULT(sysctl)
468 IF_METHOD=if_sysctl.o
469 AC_DEFINE(HAVE_NET_RT_IFLIST,,NET_RT_IFLIST)
470 else
471 AC_MSG_RESULT(ioctl)
472 IF_METHOD=if_ioctl.o
473 fi
474fi
475AC_SUBST(IF_METHOD)
476
477dnl -----------------------
478dnl check proc file system.
479dnl -----------------------
480if test -r /proc/net/dev; then
481 AC_DEFINE(HAVE_PROC_NET_DEV,,/proc/net/dev)
482 IF_PROC=if_proc.o
483fi
484
485if test -r /proc/net/if_inet6; then
486 AC_DEFINE(HAVE_PROC_NET_IF_INET6,,/proc/net/if_inet6)
487 IF_PROC=if_proc.o
488fi
489AC_SUBST(IF_PROC)
490
491dnl -----------------------------
492dnl check ipforward detect method
493dnl -----------------------------
494AC_CACHE_CHECK(ipforward method check, zebra_ipforward_path,
495[for zebra_ipforward_path in /proc/net/snmp /dev/ip /dev/null;
496do
497 test x`ls $zebra_ipforward_path 2>/dev/null` = x"$zebra_ipforward_path" && break
498done
499case $zebra_ipforward_path in
500 "/proc/net/snmp") IPFORWARD=ipforward_proc.o
501 zebra_ipforward_path="proc";;
502 "/dev/ip")
503 case "$host" in
504 *-nec-sysv4*) IPFORWARD=ipforward_ews.o
505 zebra_ipforward_path="ews";;
paul9c30ab62003-07-08 08:36:17 +0000506 *-freebsd*) IPFORWARD=ipforward_sysctl.o
507 zebra_ipforward_path="sysctl";;
paul7ea487b2003-03-17 02:05:07 +0000508 *) IPFORWARD=ipforward_solaris.o
509 zebra_ipforward_path="solaris";;
510 esac;;
511 *) IPFORWARD=ipforward_sysctl.o
512 zebra_ipforward_path="sysctl";;
513esac])
514AC_SUBST(IPFORWARD)
515
516AC_CHECK_FUNCS(getaddrinfo, [have_getaddrinfo=yes], [have_getaddrinfo=no])
517
518dnl ----------
519dnl IPv6 check
520dnl ----------
521AC_MSG_CHECKING(whether does this OS have IPv6 stack)
522if test "${enable_ipv6}" = "no"; then
523 AC_MSG_RESULT(disabled)
524else
525dnl ----------
526dnl INRIA IPv6
527dnl ----------
paula159ed92003-06-04 11:01:45 +0000528 if grep IPV6_INRIA_VERSION /usr/include/netinet/in.h >/dev/null 2>&1; then
529 zebra_cv_ipv6=yes
530 AC_DEFINE(HAVE_IPV6,1,INRIA IPv6)
531 AC_DEFINE(INRIA_IPV6,1,INRIA IPv6)
532 RIPNGD="ripngd"
533 OSPF6D="ospf6d"
534 LIB_IPV6=""
535 AC_MSG_RESULT(INRIA IPv6)
paul7ea487b2003-03-17 02:05:07 +0000536dnl ---------
537dnl KAME IPv6
538dnl ---------
paula159ed92003-06-04 11:01:45 +0000539 elif grep WIDE /usr/include/netinet6/in6.h >/dev/null 2>&1; then
540 zebra_cv_ipv6=yes
541 AC_DEFINE(HAVE_IPV6,1,KAME IPv6)
542 AC_DEFINE(KAME,1,KAME IPv6)
543 RIPNGD="ripngd"
544 OSPF6D="ospf6d"
545 if test -d /usr/local/v6/lib -a -f /usr/local/v6/lib/libinet6.a; then
paul7ea487b2003-03-17 02:05:07 +0000546 LIB_IPV6="-L/usr/local/v6/lib -linet6"
paula159ed92003-06-04 11:01:45 +0000547 fi
548 AC_MSG_RESULT(KAME)
hasso71c0fb52003-05-25 20:18:13 +0000549dnl -------------------------
550dnl MUSICA IPv6
551dnl default host check
552dnl It is not used by Kheops
553dnl -------------------------
paula159ed92003-06-04 11:01:45 +0000554 elif grep MUSICA /usr/include6/netinet6/in6.h >/dev/null 2>&1; then
555 zebra_cv_ipv6=yes
556 AC_DEFINE(HAVE_IPV6,1,Musicia IPv6)
557 AC_DEFINE(MUSICA,1,Musica IPv6 stack)
558 AC_DEFINE(KAME,1,KAME IPv6 stack)
559 RIPNGD="ripngd"
560 OSPF6D="ospf6d"
561 if test -d /usr/local/v6/lib -a -f /usr/local/v6/lib/libinet6.a; then
hasso71c0fb52003-05-25 20:18:13 +0000562 LIB_IPV6="-L/usr/local/v6/lib -linet6"
paula159ed92003-06-04 11:01:45 +0000563 fi
564 AC_MSG_RESULT(MUSICA)
paul7ea487b2003-03-17 02:05:07 +0000565dnl ---------
566dnl NRL check
567dnl ---------
paula159ed92003-06-04 11:01:45 +0000568 elif grep NRL /usr/include/netinet6/in6.h >/dev/null 2>&1; then
569 zebra_cv_ipv6=yes
570 AC_DEFINE(HAVE_IPV6,1,NRL IPv6)
571 AC_DEFINE(NRL,1,NRL)
572 RIPNGD="ripngd"
573 OSPF6D="ospf6d"
574 if test x"$opsys" = x"bsdi";then
paul7ea487b2003-03-17 02:05:07 +0000575 AC_DEFINE(BSDI_NRL,,BSDI)
576 AC_MSG_RESULT(BSDI_NRL)
paula159ed92003-06-04 11:01:45 +0000577 else
paul7ea487b2003-03-17 02:05:07 +0000578 AC_MSG_RESULT(NRL)
paula159ed92003-06-04 11:01:45 +0000579 fi
paul7ea487b2003-03-17 02:05:07 +0000580dnl ----------
581dnl Linux IPv6
582dnl ----------
paula159ed92003-06-04 11:01:45 +0000583 elif test "${enable_ipv6}" = "yes"; then
584 AC_EGREP_CPP(yes, [
585 #include <linux/version.h>
586 /* 2.1.128 or later */
587 #if LINUX_VERSION_CODE >= 0x020180
588 yes
589 #endif],
590 [zebra_cv_ipv6=yes
591 zebra_cv_linux_ipv6=yes
592 AC_MSG_RESULT(Linux IPv6)])
593 else
594 if test x`ls /proc/net/ipv6_route 2>/dev/null` = x"/proc/net/ipv6_route"
595 then
paul7ea487b2003-03-17 02:05:07 +0000596 zebra_cv_ipv6=yes
597 zebra_cv_linux_ipv6=yes
598 AC_MSG_RESULT(Linux IPv6)
paula159ed92003-06-04 11:01:45 +0000599 fi
600 fi
paul7ea487b2003-03-17 02:05:07 +0000601
paula159ed92003-06-04 11:01:45 +0000602 if test "$zebra_cv_linux_ipv6" = "yes";then
603 AC_MSG_CHECKING(for GNU libc >= 2.1)
604 AC_DEFINE(HAVE_IPV6,1,Linux IPv6)
605 AC_EGREP_CPP(yes, [
paul7ea487b2003-03-17 02:05:07 +0000606#include <features.h>
607#if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1
608 yes
paula159ed92003-06-04 11:01:45 +0000609#endif],
610 [glibc=yes
611 AC_DEFINE(LINUX_IPV6,1,Linux IPv6 stack)
612 AC_MSG_RESULT(yes)],
613 AC_MSG_RESULT(no)
614 )
615 RIPNGD="ripngd"
616 OSPF6D="ospf6d"
617 if test "$glibc" != "yes"; then
paul7ea487b2003-03-17 02:05:07 +0000618 INCLUDES="-I/usr/inet6/include"
619 if test x`ls /usr/inet6/lib/libinet6.a 2>/dev/null` != x;then
620 LIB_IPV6="-L/usr/inet6/lib -linet6"
621 fi
paula159ed92003-06-04 11:01:45 +0000622 fi
623 fi
paul7ea487b2003-03-17 02:05:07 +0000624
625dnl -----------------------
626dnl Set IPv6 related values
627dnl -----------------------
paula159ed92003-06-04 11:01:45 +0000628 LIBS="$LIB_IPV6 $LIBS"
629 AC_SUBST(LIB_IPV6)
paul7ea487b2003-03-17 02:05:07 +0000630
paula159ed92003-06-04 11:01:45 +0000631 if test x"$RIPNGD" = x""; then
632 AC_MSG_RESULT(IPv4 only)
633 fi
paul7ea487b2003-03-17 02:05:07 +0000634fi
635
gdtfa3232e2003-12-03 17:52:30 +0000636dnl ------------------
637dnl IPv6 header checks
638dnl ------------------
639if test "x${zebra_cv_ipv6}" = "xyes"; then
640AC_CHECK_HEADERS([netinet6/in6.h netinet/in6_var.h netinet/icmp6.h \
641 netinet6/in6_var.h netinet6/nd6.h])
642fi
643
paul7ea487b2003-03-17 02:05:07 +0000644dnl --------------------
645dnl Daemon disable check
646dnl --------------------
647if test "${enable_zebra}" = "no";then
648 ZEBRA=""
649else
650 ZEBRA="zebra"
651fi
652
653if test "${enable_bgpd}" = "no";then
654 BGPD=""
655else
656 BGPD="bgpd"
657fi
658
659if test "${enable_ripd}" = "no";then
660 RIPD=""
661else
662 RIPD="ripd"
663fi
664
665if test "${enable_ospfd}" = "no";then
666 OSPFD=""
667else
668 OSPFD="ospfd"
669fi
670
paul1ef74ef2003-03-21 15:16:05 +0000671OSPFCLIENT=""
672if test "${enable_opaque_lsa}" = "yes"; then
673 if test "${enable_ospfapi}" != "no";then
paul9a569842003-03-28 01:45:13 +0000674 AC_DEFINE(SUPPORT_OSPF_API,,OSPFAPI)
paul1ef74ef2003-03-21 15:16:05 +0000675
676 if test "${enable_ospfclient}" != "no";then
677 OSPFCLIENT="ospfclient"
678 fi
679 fi
680
paul7ea487b2003-03-17 02:05:07 +0000681fi
682
683case "${enable_ripngd}" in
684 "yes") RIPNGD="ripngd";;
685 "no" ) RIPNGD="";;
686 * ) ;;
687esac
688
689case "${enable_ospf6d}" in
690 "yes") OSPF6D="ospf6d";;
691 "no" ) OSPF6D="";;
692 * ) ;;
693esac
694
695if test "${enable_bgp_announce}" = "no";then
696 AC_DEFINE(DISABLE_BGP_ANNOUNCE,,Disable BGP installation to zebra)
697fi
698
699AC_SUBST(ZEBRA)
700AC_SUBST(BGPD)
701AC_SUBST(RIPD)
702AC_SUBST(RIPNGD)
703AC_SUBST(OSPFD)
704AC_SUBST(OSPF6D)
705AC_SUBST(VTYSH)
706AC_SUBST(INCLUDES)
707AC_SUBST(CURSES)
708AC_SUBST(OSPFCLIENT)
paul1ef74ef2003-03-21 15:16:05 +0000709AC_SUBST(OSPFAPI)
paul7ea487b2003-03-17 02:05:07 +0000710AC_CHECK_LIB(c, inet_ntop, [AC_DEFINE(HAVE_INET_NTOP,,inet_ntop)])
711AC_CHECK_LIB(c, inet_pton, [AC_DEFINE(HAVE_INET_PTON,,inet_pton)])
712AC_CHECK_LIB(crypt, crypt)
713AC_CHECK_LIB(resolv, res_init)
714AC_CHECK_LIB(m, main)
715
716dnl ---------------------------------------------------
717dnl BSD/OS 4.1 define inet_XtoY function as __inet_XtoY
718dnl ---------------------------------------------------
paula159ed92003-06-04 11:01:45 +0000719AC_CHECK_FUNC(__inet_ntop, AC_DEFINE(HAVE_INET_NTOP,,__inet_ntop))
720AC_CHECK_FUNC(__inet_pton, AC_DEFINE(HAVE_INET_PTON,,__inet_pton))
721AC_CHECK_FUNC(__inet_aton, AC_DEFINE(HAVE_INET_ATON,,__inet_aton))
paul7ea487b2003-03-17 02:05:07 +0000722
723dnl ---------------------------
724dnl check system has GNU regexp
725dnl ---------------------------
726dnl AC_MSG_CHECKING(whether system has GNU regex)
727AC_CHECK_LIB(c, regexec,
728[AC_DEFINE(HAVE_GNU_REGEX,,GNU regexp library)
729 LIB_REGEX=""],
730[LIB_REGEX="regex.o"])
731AC_SUBST(LIB_REGEX)
732
733dnl ------------------
734dnl check SNMP library
735dnl ------------------
736if test "${enable_snmp}" = "yes";then
737dnl AC_CHECK_LIB(snmp, asn_parse_int, HAVE_SNMP=yes)
paul7ea487b2003-03-17 02:05:07 +0000738 if test "${HAVE_SNMP}" = ""; then
paul1ef74ef2003-03-21 15:16:05 +0000739 old_libs="${LIBS}"
740 LIBS="-L/usr/lib"
paul7ea487b2003-03-17 02:05:07 +0000741 unset ac_cv_lib_snmp_asn_parse_int
paul1ef74ef2003-03-21 15:16:05 +0000742 AC_CHECK_LIB(crypto, main, NEED_CRYPTO=yes, )
743 if test "${NEED_CRYPTO}" = ""; then
744 AC_CHECK_LIB(netsnmp, asn_parse_int, [HAVE_NETSNMP=yes; HAVE_SNMP=yes ])
745 else
746 AC_CHECK_LIB(netsnmp, asn_parse_int, [HAVE_NETSNMP=yes; HAVE_SNMP=yes; NEED_CRYPTO=yes;LIBS="$LIBS -lcrypto" ],,"-lcrypto")
747 fi
748 LIBS="${old_libs}"
paul7ea487b2003-03-17 02:05:07 +0000749 fi
paul1ef74ef2003-03-21 15:16:05 +0000750 if test "${HAVE_SNMP}" = ""; then
751 old_libs="${LIBS}"
752 LIBS="-L/usr/lib"
753 unset ac_cv_lib_snmp_asn_parse_int
754 AC_CHECK_LIB(snmp, asn_parse_int, HAVE_SNMP=yes, )
755 if test "${HAVE_SNMP}" = ""; then
756 unset ac_cv_lib_snmp_asn_parse_int
757 AC_CHECK_LIB(crypto, main, NEED_CRYPTO=yes, )
758 if test "${NEED_CRYPTO}" = "yes"; then
759 AC_CHECK_LIB(snmp, asn_parse_int, [HAVE_SNMP=yes; NEED_CRYPTO=yes; LIBS="$LIBS -lcrypto" ],,"-lcrypto")
760 fi
761 fi
762 LIBS="${old_libs}"
763 fi
paul7ea487b2003-03-17 02:05:07 +0000764
765 if test "${HAVE_SNMP}" = ""; then
paul1ef74ef2003-03-21 15:16:05 +0000766 old_libs="${LIBS}"
767 LIBS="-L/usr/local/lib"
768 unset ac_cv_lib_snmp_asn_parse_int
769 AC_CHECK_LIB(snmp, asn_parse_int, HAVE_SNMP=yes)
770 if test "${HAVE_SNMP}" = ""; then
771 unset ac_cv_lib_snmp_asn_parse_int
772 AC_CHECK_LIB(crypto, main, NEED_CRYPTO=yes, )
773 if test "${NEED_CRYPTO}" = "yes"; then
774 AC_CHECK_LIB(snmp, asn_parse_int, [HAVE_SNMP=yes; NEED_CRYPTO=yes; LIBS="$LIBS -lcrypto" ],,"-lcrypto")
775 fi
776 fi
777 LIBS="${old_libs}"
paul7ea487b2003-03-17 02:05:07 +0000778 fi
paul1ef74ef2003-03-21 15:16:05 +0000779
paul7ea487b2003-03-17 02:05:07 +0000780 if test "${HAVE_SNMP}" = "yes"; then
781 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
782 do
783 test -f "${ac_snmp}" && break
784 done
paul1ef74ef2003-03-21 15:16:05 +0000785
paul7ea487b2003-03-17 02:05:07 +0000786 case ${ac_snmp} in
787 /usr/include/net-snmp/*)
788 AC_DEFINE(HAVE_SNMP,,SNMP)
paul1ef74ef2003-03-21 15:16:05 +0000789 AC_DEFINE(HAVE_NETSNMP,,SNMP)
paul7ea487b2003-03-17 02:05:07 +0000790 AC_DEFINE(UCD_COMPATIBLE,,SNMP)
paulac7c4bb2003-03-19 04:25:08 +0000791 CFLAGS="${CFLAGS} -I/usr/include/net-snmp -I/usr/include/net-snmp/library"
792 if test "${HAVE_NETSNMP}" = "yes"; then
paul1ef74ef2003-03-21 15:16:05 +0000793 LIBS="${LIBS} -lnetsnmp"
paulac7c4bb2003-03-19 04:25:08 +0000794 else
paul1ef74ef2003-03-21 15:16:05 +0000795 LIBS="${LIBS} -lsnmp"
paulac7c4bb2003-03-19 04:25:08 +0000796 fi
paul7ea487b2003-03-17 02:05:07 +0000797 ;;
798 /usr/include/ucd-snmp/*)
799 AC_DEFINE(HAVE_SNMP,,SNMP)
800 CFLAGS="${CFLAGS} -I/usr/include/ucd-snmp"
801 LIBS="${LIBS} -lsnmp"
802 ;;
803 /usr/local/include/ucd-snmp/*)
804 AC_DEFINE(HAVE_SNMP,,SNMP)
805 CFLAGS="${CFLAGS} -I/usr/local/include/ucd-snmp"
806 LIBS="${LIBS} -L/usr/local/lib -lsnmp"
807 ;;
paulf3bd1a72003-11-02 07:29:11 +0000808 /usr/local/include/net-snmp/*)
809 AC_DEFINE(HAVE_SNMP,,SNMP)
810 AC_DEFINE(HAVE_NET_SNMP,,SNMP)
811 AC_DEFINE(UCD_COMPATIBLE,,SNMP)
812 CFLAGS="${CFLAGS} -I/usr/local/include/net-snmp"
813 LIBS="${LIBS} -L/usr/local/lib -lnetsnmp"
814 ;;
paul7ea487b2003-03-17 02:05:07 +0000815 esac
816 if test "${NEED_CRYPTO}" = "yes"; then
817 LIBS="${LIBS} -lcrypto"
818 fi
819 fi
820fi
821
822dnl ----------------------------
823dnl check sa_len of sockaddr
824dnl ----------------------------
825AC_MSG_CHECKING(whether struct sockaddr has a sa_len field)
826AC_TRY_COMPILE([#include <sys/types.h>
827#include <sys/socket.h>
828],[static struct sockaddr ac_i;int ac_j = sizeof (ac_i.sa_len);],
829[AC_MSG_RESULT(yes)
830 AC_DEFINE(HAVE_SA_LEN,,sa_len)],
831 AC_MSG_RESULT(no))
832
833dnl ----------------------------
834dnl check sin_len of sockaddr_in
835dnl ----------------------------
836AC_MSG_CHECKING(whether struct sockaddr_in has a sin_len field)
837AC_TRY_COMPILE([#include <sys/types.h>
838#include <netinet/in.h>
839],[static struct sockaddr_in ac_i;int ac_j = sizeof (ac_i.sin_len);],
840[AC_MSG_RESULT(yes)
841 AC_DEFINE(HAVE_SIN_LEN,,sin_len)],
842 AC_MSG_RESULT(no))
843
844dnl ----------------------------
845dnl check sun_len of sockaddr_un
846dnl ----------------------------
847AC_MSG_CHECKING(whether struct sockaddr_un has a sun_len field)
848AC_TRY_COMPILE([#include <sys/types.h>
849#include <sys/un.h>
850],[static struct sockaddr_un ac_i;int ac_j = sizeof (ac_i.sun_len);],
851[AC_MSG_RESULT(yes)
852 AC_DEFINE(HAVE_SUN_LEN,,sun_len)],
853 AC_MSG_RESULT(no))
854
855dnl -----------------------------------
856dnl check sin6_scope_id of sockaddr_in6
857dnl -----------------------------------
858if test "$zebra_cv_ipv6" = yes; then
859 AC_MSG_CHECKING(whether struct sockaddr_in6 has a sin6_scope_id field)
860 AC_TRY_COMPILE([#include <sys/types.h>
861#include <netinet/in.h>
862],[static struct sockaddr_in6 ac_i;int ac_j = sizeof (ac_i.sin6_scope_id);],
863[AC_MSG_RESULT(yes)
864 AC_DEFINE(HAVE_SIN6_SCOPE_ID,,scope id)],
865 AC_MSG_RESULT(no))
866fi
867
868dnl ----------------------------
869dnl check socklen_t exist or not
870dnl ----------------------------
871AC_MSG_CHECKING(whther socklen_t is defined)
872AC_TRY_COMPILE([#include <sys/types.h>
873#include <sys/socket.h>
874#include <netinet/in.h>
875],[socklen_t ac_x;],
876[AC_MSG_RESULT(yes)
877 AC_DEFINE(HAVE_SOCKLEN_T,,socklen_t)],
878 AC_MSG_RESULT(no))
879
880dnl ------------------------
881dnl check struct sockaddr_dl
882dnl ------------------------
883AC_MSG_CHECKING(whether struct sockaddr_dl exist)
884AC_EGREP_HEADER(sockaddr_dl,
885net/if_dl.h,
886[AC_MSG_RESULT(yes)
887 AC_DEFINE(HAVE_SOCKADDR_DL,,sockaddr_dl)],
888 AC_MSG_RESULT(no))
889
890dnl --------------------------
891dnl check structure ifaliasreq
892dnl --------------------------
893AC_MSG_CHECKING(whether struct ifaliasreq exist)
894AC_EGREP_HEADER(ifaliasreq,
895net/if.h,
896[AC_MSG_RESULT(yes)
897 AC_DEFINE(HAVE_IFALIASREQ,,ifaliasreq)],
898 AC_MSG_RESULT(no))
899
900dnl ----------------------------
901dnl check structure in6_aliasreq
902dnl ----------------------------
hasso71c0fb52003-05-25 20:18:13 +0000903AC_MSG_CHECKING(whether struct in6_aliasreq exist)
paul7ea487b2003-03-17 02:05:07 +0000904AC_EGREP_HEADER(in6_aliasreq,
905netinet6/in6_var.h,
906[AC_MSG_RESULT(yes)
907 AC_DEFINE(HAVE_IN6_ALIASREQ,,in6_aliasreq)],
908 AC_MSG_RESULT(no))
909
hasso71c0fb52003-05-25 20:18:13 +0000910dnl -----------------------------------
911dnl check ifra_lifetime of in6_aliasreq
912dnl -----------------------------------
913AC_MSG_CHECKING(whether in6_aliasreq.ifra_lifetime exist)
914AC_TRY_COMPILE([#include <sys/types.h>
915#include <netinet6/in6_var.h>
916],[static struct if6_aliasreq ac_i;int ac_j = sizeof (ac_i.ifra_lifetime);],
917[AC_MSG_RESULT(yes)
paula159ed92003-06-04 11:01:45 +0000918 AC_DEFINE(HAVE_IFRA_LIFETIME,,Have in6_aliasreq.ifra_lifetime)],
hasso71c0fb52003-05-25 20:18:13 +0000919 AC_MSG_RESULT(no))
920
paul7ea487b2003-03-17 02:05:07 +0000921dnl ---------------------------
922dnl check structure rt_addrinfo
923dnl ---------------------------
924AC_MSG_CHECKING(whether struct rt_addrinfo exist)
925AC_EGREP_HEADER(rt_addrinfo,
926net/route.h,
927[AC_MSG_RESULT(yes)
928 AC_DEFINE(HAVE_RT_ADDRINFO,,rt_addrinfo)],
929 AC_MSG_RESULT(no))
930
931dnl --------------------------
932dnl check structure in_pktinfo
933dnl --------------------------
934AC_MSG_CHECKING(whether struct in_pktinfo exist)
935AC_TRY_COMPILE([#include <netinet/in.h>
936],[struct in_pktinfo ac_x;],
937[AC_MSG_RESULT(yes)
938 AC_DEFINE(HAVE_INPKTINFO,,in_pktinfo)],
939 AC_MSG_RESULT(no))
940
941dnl --------------------------------------
942dnl checking for getrusage struct and call
943dnl --------------------------------------
944AC_MSG_CHECKING(whether getrusage is available)
945AC_TRY_COMPILE([#include <sys/resource.h>
946],[struct rusage ac_x; getrusage (RUSAGE_SELF, &ac_x);],
947[AC_MSG_RESULT(yes)
948 AC_DEFINE(HAVE_RUSAGE,,rusage)],
949 AC_MSG_RESULT(no))
950
pauledd7c242003-06-04 13:59:38 +0000951dnl -------------------
952dnl capabilities checks
953dnl -------------------
954AC_MSG_CHECKING(whether prctl PR_SET_KEEPCAPS is available)
955AC_TRY_COMPILE([#include <sys/prctl.h>],[prctl(PR_SET_KEEPCAPS, 1, 0, 0, 0);],
956 [AC_MSG_RESULT(yes)
957 AC_DEFINE(HAVE_PR_SET_KEEPCAPS,,prctl)
paule8f29842003-08-12 13:08:31 +0000958 quagga_ac_keepcaps="yes"],
pauledd7c242003-06-04 13:59:38 +0000959 AC_MSG_RESULT(no)
960)
paule8f29842003-08-12 13:08:31 +0000961if test x"${quagga_ac_keepcaps}" = x"yes"; then
pauledd7c242003-06-04 13:59:38 +0000962 AC_CHECK_HEADERS(sys/capability.h)
963fi
964if test x"${ac_cv_header_sys_capability_h}" = x"yes"; then
965 AC_CHECK_LIB(cap, cap_init,
966 [AC_DEFINE(HAVE_LCAPS,1,Capabilities)
967 LIBCAP="-lcap"
968 ]
969 )
970fi
971AC_SUBST(LIBCAP)
972
paulfb2d1502003-06-04 09:40:54 +0000973dnl ---------------------------
974dnl check for glibc 'backtrace'
975dnl ---------------------------
976if test "${glibc}" = "yes"; then
977 AC_CHECK_HEADER(execinfo.h)
978fi
979if test x"${ac_cv_header_execinfo_h}" = x"yes"; then
980 AC_CHECK_FUNC(backtrace,
981 [AC_DEFINE(HAVE_GLIBC_BACKTRACE,,Glibc backtrace)]
982 )
983fi
984
paul408ad942003-05-20 00:03:33 +0000985dnl ----------
986dnl configure date
987dnl ----------
988CONFDATE=`date '+%Y%m%d'`
989AC_SUBST(CONFDATE)
990
paul7ea487b2003-03-17 02:05:07 +0000991dnl ------------------------------
paula159ed92003-06-04 11:01:45 +0000992dnl set paths for state directory
paul23bd12c2003-04-07 06:11:09 +0000993dnl ------------------------------
994if test "${prefix}" = "NONE"; then
paule8f29842003-08-12 13:08:31 +0000995 quagga_statedir_prefix="";
paul23bd12c2003-04-07 06:11:09 +0000996else
paule8f29842003-08-12 13:08:31 +0000997 quagga_statedir_prefix=${prefix}
paul23bd12c2003-04-07 06:11:09 +0000998fi
999if test "${localstatedir}" = '${prefix}/var'; then
paula159ed92003-06-04 11:01:45 +00001000 AC_CACHE_CHECK(state directory,ac_statedir,
paule8f29842003-08-12 13:08:31 +00001001 [for QUAGGA_STATE_DIR in ${quagga_statedir_prefix}/var/run dnl
1002 ${quagga_statedir_prefix}/var/adm dnl
1003 ${quagga_statedir_prefix}/etc dnl
paula159ed92003-06-04 11:01:45 +00001004 /var/run dnl
1005 /var/adm dnl
1006 /etc dnl
1007 /dev/null;
paul23bd12c2003-04-07 06:11:09 +00001008 do
paule8f29842003-08-12 13:08:31 +00001009 test -d $QUAGGA_STATE_DIR && break
paul23bd12c2003-04-07 06:11:09 +00001010 done
paule8f29842003-08-12 13:08:31 +00001011 quagga_statedir=$QUAGGA_STATE_DIR])
paul23bd12c2003-04-07 06:11:09 +00001012else
paule8f29842003-08-12 13:08:31 +00001013 quagga_statedir=${localstatedir}
paula159ed92003-06-04 11:01:45 +00001014 AC_MSG_CHECKING(directory to use for state file)
paule8f29842003-08-12 13:08:31 +00001015 AC_MSG_RESULT(${quagga_statedir})
paul23bd12c2003-04-07 06:11:09 +00001016fi
paule8f29842003-08-12 13:08:31 +00001017if test $quagga_statedir = "/dev/null"; then
paula159ed92003-06-04 11:01:45 +00001018 AC_MSG_ERROR('STATE DIRECTORY NOT FOUND! FIX OR SPECIFY --localstatedir!')
1019fi
1020
paule8f29842003-08-12 13:08:31 +00001021AC_DEFINE_UNQUOTED(PATH_ZEBRA_PID, "$quagga_statedir/zebra.pid",zebra PID)
1022AC_DEFINE_UNQUOTED(PATH_RIPD_PID, "$quagga_statedir/ripd.pid",ripd PID)
1023AC_DEFINE_UNQUOTED(PATH_RIPNGD_PID, "$quagga_statedir/ripngd.pid",ripngd PID)
1024AC_DEFINE_UNQUOTED(PATH_BGPD_PID, "$quagga_statedir/bgpd.pid",bgpd PID)
1025AC_DEFINE_UNQUOTED(PATH_OSPFD_PID, "$quagga_statedir/ospfd.pid",ospfd PID)
1026AC_DEFINE_UNQUOTED(PATH_OSPF6D_PID, "$quagga_statedir/ospf6d.pid",ospf6d PID)
1027AC_DEFINE_UNQUOTED(ZEBRA_SERV_PATH, "$quagga_statedir/zserv.api",zebra api socket)
1028AC_DEFINE_UNQUOTED(ZEBRA_VTYSH_PATH, "$quagga_statedir/zebra.vty",zebra vty socket)
1029AC_DEFINE_UNQUOTED(RIP_VTYSH_PATH, "$quagga_statedir/ripd.vty",rip vty socket)
1030AC_DEFINE_UNQUOTED(RIPNG_VTYSH_PATH, "$quagga_statedir/ripngd.vty",ripng vty socket)
1031AC_DEFINE_UNQUOTED(BGP_VTYSH_PATH, "$quagga_statedir/bgpd.vty",bgpd vty socket)
1032AC_DEFINE_UNQUOTED(OSPF_VTYSH_PATH, "$quagga_statedir/ospfd.vty",ospfd vty socket)
1033AC_DEFINE_UNQUOTED(OSPF6_VTYSH_PATH, "$quagga_statedir/ospf6d.vty",ospf6d vty socket)
paul7ea487b2003-03-17 02:05:07 +00001034
1035dnl ---------------------------
1036dnl Check htonl works correctly
1037dnl ---------------------------
1038AC_MSG_CHECKING(for working htonl)
1039AC_CACHE_VAL(ac_cv_htonl_works, [
1040AC_TRY_LINK([#ifdef HAVE_SYS_TYPES_H
1041#include <sys/types.h>
1042#endif
1043#ifdef HAVE_NETDB_H
1044#include <netdb.h>
1045#endif
1046#ifdef HAVE_NETINET_IN_H
1047#include <netinet/in.h>
1048#endif],
1049[htonl (0);],
1050ac_cv_htonl_works=yes,
1051ac_cv_htonl_works=no)])
1052AC_MSG_RESULT($ac_cv_htonl_works)
1053
paul6382b6f2003-05-20 00:17:45 +00001054AC_OUTPUT(Makefile lib/Makefile zebra/Makefile ripd/Makefile
1055 ripngd/Makefile bgpd/Makefile ospfd/Makefile
1056 ospf6d/Makefile vtysh/Makefile doc/Makefile
1057 ospfclient/Makefile
paulfa1253d2003-09-24 05:09:26 +00001058 redhat/quagga.spec
1059 lib/version.h)
paul7ea487b2003-03-17 02:05:07 +00001060
1061echo "
1062zebra configuration
1063-------------------
paulfa1253d2003-09-24 05:09:26 +00001064quagga version : ${PACKAGE_VERSION}
paul7ea487b2003-03-17 02:05:07 +00001065host operationg system : ${host_os}
1066source code location : ${srcdir}
1067compiler : ${CC}
1068compiler flags : ${CFLAGS}
hasso71c0fb52003-05-25 20:18:13 +00001069linker flags : ${LDFLAGS} ${LIBS}
paule8f29842003-08-12 13:08:31 +00001070state file directory : ${quagga_statedir}
pauldc7a2bf2003-10-22 00:07:44 +00001071config file directory : `eval echo \`echo ${sysconfdir}\``
gdtd6b72f72003-12-03 17:24:27 +00001072example directory : `eval echo \`echo ${exampledir}\``
paul8d4aee52003-06-06 00:30:35 +00001073user to run as : ${enable_user}
1074group to run as : ${enable_group}
1075group for vty sockets : ${enable_vty_group}
pauldc7a2bf2003-10-22 00:07:44 +00001076
1077The above user and group must have read/write access to the state file
1078directory and to the config files in the config file directory.
paul7ea487b2003-03-17 02:05:07 +00001079"