blob: 25bdd730574fb1ddedc5673f7ab7f076c9669580 [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
10AC_INIT(lib/zebra.h)
paule8f29842003-08-12 13:08:31 +000011AM_INIT_AUTOMAKE(quagga, 0.96)
paul7ea487b2003-03-17 02:05:07 +000012AM_CONFIG_HEADER(config.h)
13
14dnl -----------------------------------
15dnl Get hostname and other information.
16dnl -----------------------------------
17AC_CANONICAL_HOST
18
19dnl ------------
20dnl Check CFLAGS
21dnl ------------
22AC_ARG_WITH(cflags,
23[ --with-cflags Set CFLAGS for use in compilation.])
24if test "x$with_cflags" != "x" ; then
25 CFLAGS="$with_cflags" ; cflags_specified=yes ;
26elif test -n "$CFLAGS" ; then
27 cflags_specified=yes ;
28fi
29
30dnl --------
31dnl Check CC
32dnl --------
33AC_PROG_CC
34
35dnl -----------------------------------------
36dnl If CLFAGS doesn\'t exist set default value
37dnl -----------------------------------------
38if test "x$cflags_specified" = "x" ; then
39 CFLAGS="$CFLAGS -Wall"
40fi
41
42dnl --------------
43dnl Check programs
44dnl --------------
45AC_PROG_CPP
46AC_PROG_INSTALL
47AC_PROG_MAKE_SET
48AC_CHECK_TOOL(AR, ar)
49AC_CHECK_TOOL(RANLIB, ranlib, :)
50
51dnl ---------
52dnl AIX check
53dnl ---------
54AC_AIX
55
56dnl ----------------------
57dnl Packages configuration
58dnl ----------------------
59AC_ARG_ENABLE(vtysh,
paule8f29842003-08-12 13:08:31 +000060[ --enable-vtysh, Make integrated vty shell for Quagga])
paul7ea487b2003-03-17 02:05:07 +000061AC_ARG_ENABLE(ipv6,
62[ --disable-ipv6 turn off IPv6 related features and daemons])
63AC_ARG_ENABLE(zebra,
64[ --disable-zebra do not build zebra daemon])
65AC_ARG_ENABLE(bgpd,
66[ --disable-bgpd do not build bgpd])
67AC_ARG_ENABLE(ripd,
68[ --disable-ripd do not build ripd])
69AC_ARG_ENABLE(ripngd,
70[ --disable-ripngd do not build ripngd])
71AC_ARG_ENABLE(ospfd,
72[ --disable-ospfd do not build ospfd])
paul7ea487b2003-03-17 02:05:07 +000073AC_ARG_ENABLE(ospf6d,
74[ --disable-ospf6d do not build ospf6d])
75AC_ARG_ENABLE(bgp-announce,
76[ --disable-bgp-announce, turn off BGP route announcement])
77AC_ARG_ENABLE(netlink,
78[ --enable-netlink force to use Linux netlink interface])
79AC_ARG_ENABLE(broken-aliases,
80[ --enable-broken-aliases enable aliases as distinct interfaces for Linux 2.2.X])
81AC_ARG_ENABLE(snmp,
82[ --enable-snmp enable SNMP support])
83AC_ARG_WITH(libpam,
84[ --with-libpam use libpam for PAM support in vtysh])
hasso71c0fb52003-05-25 20:18:13 +000085AC_ARG_ENABLE(tcp-zebra,
paul7ea487b2003-03-17 02:05:07 +000086[ --enable-tcp-zebra enable TCP/IP socket connection between zebra and protocol daemon])
87dnl Temporary option until OSPF NSSA implementation complete
88AC_ARG_ENABLE(nssa,
89[ --enable-nssa enable OSPF NSSA option])
90AC_ARG_ENABLE(opaque-lsa,
paul1ef74ef2003-03-21 15:16:05 +000091[ --enable-opaque-lsa enable OSPF Opaque-LSA with OSPFAPI support (RFC2370)])
92AC_ARG_ENABLE(ospfapi,
93[ --disable-ospfapi do not build OSPFAPI to access the OSPF LSA Database,
94 (this is the default if --enable-opaque-lsa is not set)])
95AC_ARG_ENABLE(ospfclient,
96[ --disable-ospfclient do not build OSPFAPI client for OSPFAPI,
97 (this is the default if --disable-ospfapi is set)])
paul7ea487b2003-03-17 02:05:07 +000098AC_ARG_ENABLE(ospf-te,
99[ --enable-ospf-te enable Traffic Engineering Extension to OSPF])
100AC_ARG_ENABLE(multipath,
101[ --enable-multipath=ARG enable multipath function, ARG must be digit])
paule8f29842003-08-12 13:08:31 +0000102AC_ARG_ENABLE(quagga_user,
103[ --enable-user=ARG user to run Quagga suite as (default quagga)])
104AC_ARG_ENABLE(quagga_group,
105[ --enable-group=ARG group to run Quagga suite as (default quagga)])
pauledd7c242003-06-04 13:59:38 +0000106AC_ARG_ENABLE(vty_group,
107[ --enable-vty-group=ARG set vty sockets to have specified group as owner])
108
hasso71c0fb52003-05-25 20:18:13 +0000109AC_ARG_ENABLE(rtadv,
pauledd7c242003-06-04 13:59:38 +0000110[ --enable-rtadv enable IPV6 router advertisement feature])
paul7ea487b2003-03-17 02:05:07 +0000111
112if test "${enable_broken_aliases}" = "yes"; then
113 if test "${enable_netlink}" = "yes"
114 then
115 echo "Sorry, you can't use netlink with broken aliases"
116 exit 1
117 fi
118 AC_DEFINE(HAVE_BROKEN_ALIASES,,Broken Alias)
119 enable_netlink=no
120fi
121
122if test "${enable_tcp_zebra}" = "yes"; then
123 AC_DEFINE(HAVE_TCP_ZEBRA,,Use TCP for zebra communication)
124fi
125
126if test "${enable_nssa}" = "yes"; then
127 AC_DEFINE(HAVE_NSSA,,OSPF NSSA)
128fi
129
130if test "${enable_opaque_lsa}" = "yes"; then
131 AC_DEFINE(HAVE_OPAQUE_LSA,,OSPF Opaque LSA)
132fi
133
134if test "${enable_ospf_te}" = "yes"; then
135 AC_DEFINE(HAVE_OPAQUE_LSA,,OSPF Opaque LSA)
136 AC_DEFINE(HAVE_OSPF_TE,,OSPF TE)
137fi
138
paule8f29842003-08-12 13:08:31 +0000139AC_MSG_CHECKING(Should zebra's RTADV be used)
paul2487bea2003-05-25 23:51:31 +0000140if test "${enable_rtadv}" = "yes"; then
hasso71c0fb52003-05-25 20:18:13 +0000141 AC_MSG_RESULT(yes)
paule8f29842003-08-12 13:08:31 +0000142 AC_DEFINE(HAVE_RTADV,,Enable zebra IPv6 Routing Advertisements)
paul2487bea2003-05-25 23:51:31 +0000143else
144 AC_MSG_RESULT(no)
hasso71c0fb52003-05-25 20:18:13 +0000145fi
paul7ea487b2003-03-17 02:05:07 +0000146
paul79cb2162003-06-06 12:19:53 +0000147if test "${enable_user}" = "yes" || test x"${enable_user}" = x""; then
paule8f29842003-08-12 13:08:31 +0000148 enable_user="quagga"
pauledd7c242003-06-04 13:59:38 +0000149elif test "${enable_user}" = "no"; then
150 enable_user="root"
151fi
paule8f29842003-08-12 13:08:31 +0000152AC_DEFINE_UNQUOTED(QUAGGA_USER, "${enable_user}", Quagga User)
pauledd7c242003-06-04 13:59:38 +0000153
paul79cb2162003-06-06 12:19:53 +0000154if test "${enable_group}" = "yes" || test x"${enable_group}" = x""; then
paule8f29842003-08-12 13:08:31 +0000155 enable_group="quagga"
pauledd7c242003-06-04 13:59:38 +0000156elif test "${enable_group}" = "no"; then
157 enable_group="root"
158fi
paule8f29842003-08-12 13:08:31 +0000159AC_DEFINE_UNQUOTED(QUAGGA_GROUP, "${enable_group}", Quagga Group)
pauledd7c242003-06-04 13:59:38 +0000160
161if test x"${enable_vty_group}" = x"yes" ; then
paul8d4aee52003-06-06 00:30:35 +0000162 AC_MSG_ERROR([--enable-vty-group requires a group as argument, not yes])
paul79cb2162003-06-06 12:19:53 +0000163elif test x"${enable_vty_group}" != x""; then
paul8d4aee52003-06-06 00:30:35 +0000164 if test x"${enable_vty_group}" != x"no"; then
pauledd7c242003-06-04 13:59:38 +0000165 AC_DEFINE_UNQUOTED(VTY_GROUP, "${enable_vty_group}", VTY Sockets Group)
166 fi
167fi
168
paul7ea487b2003-03-17 02:05:07 +0000169changequote(, )dnl
170
171MULTIPATH_NUM=1
172
173case "${enable_multipath}" in
174 [0-9]|[1-9][0-9])
175 MULTIPATH_NUM="${enable_multipath}"
176 ;;
177 "")
178 ;;
179 *)
180 echo "Please specify digit to --enable-multipath ARG."
181 exit 1
182 ;;
183esac
184
185changequote([, ])dnl
186
187AC_SUBST(MULTIPATH_NUM)
188
189dnl -------------------
190dnl Check header files.
191dnl -------------------
192AC_STDC_HEADERS
paul595db7f2003-05-25 21:35:06 +0000193AC_CHECK_HEADERS(string.h stropts.h sys/conf.h sys/ksym.h sys/time.h sys/times.h sys/select.h sys/sysctl.h sys/sockio.h sys/types.h net/if_dl.h net/if_var.h linux/version.h kvm.h netdb.h netinet/in.h net/netopt.h netinet/in_var.h netinet/in6_var.h netinet6/in6_var.h netinet/in6.h inet/nd.h asm/types.h netinet/icmp6.h netinet6/nd6.h libutil.h)
paul7ea487b2003-03-17 02:05:07 +0000194
195dnl check some types
196AC_C_CONST
197dnl AC_TYPE_PID_T
198AC_TYPE_SIGNAL
199
200dnl Some systems (Solaris 2.x) require libnsl (Network Services Library)
201case "$host" in
202 *-sunos5.6* | *-solaris2.6*)
203 opsys=sol2-6
204 AC_DEFINE(SUNOS_5,,SunOS 5)
205 AC_CHECK_LIB(xnet, main)
206 CURSES=-lcurses
207 ;;
208 *-sunos5* | *-solaris2*)
209 AC_DEFINE(SUNOS_5,,SunOS 5)
210 AC_CHECK_LIB(socket, main)
211 AC_CHECK_LIB(nsl, main)
212 CURSES=-lcurses
213 ;;
214 *-linux-*)
215 opsys=gnu-linux
216 AC_DEFINE(GNU_LINUX,,GNU Linux)
217 ;;
218 *-nec-sysv4*)
219 AC_CHECK_LIB(nsl, gethostbyname)
220 AC_CHECK_LIB(socket, socket)
221 ;;
222 *-freebsd3.2)
223 AC_DEFINE(FREEBSD_32,,FreeBSD 3.2)
224 ;;
225 *-openbsd*)
226 opsys=openbsd
227 AC_DEFINE(OPEN_BSD,,OpenBSD)
228 ;;
229 *-bsdi*)
230 opsys=bsdi
231 OTHER_METHOD="mtu_kvm.o"
232 AC_CHECK_LIB(kvm, main)
233 ;;
234esac
235
236dnl ---------------------
237dnl Integrated VTY option
238dnl ---------------------
239case "${enable_vtysh}" in
240 "yes") VTYSH="vtysh";
241 AC_DEFINE(VTYSH,,VTY shell)
242 AC_CHECK_LIB(tinfo, tputs, , AC_CHECK_LIB(ncurses, tputs))
243 AC_CHECK_LIB(readline, main)
244 if test $ac_cv_lib_readline_main = no; then
245 AC_MSG_ERROR([vtysh needs libreadline but was not found on your system.])
246 fi
247 AC_CHECK_HEADER(readline/history.h)
248 if test $ac_cv_header_readline_history_h = no;then
249 AC_MSG_ERROR([readline is too old to have readline/history.h, please update to the latest readline library.])
250 fi
paul3d3de8c2003-05-23 10:33:49 +0000251 AC_CHECK_LIB(readline, rl_completion_matches)
252 if test $ac_cv_lib_readline_rl_completion_matches = no; then
253 AC_DEFINE(rl_completion_matches,completion_matches,Old readline)
254 fi
255 ;;
paul7ea487b2003-03-17 02:05:07 +0000256 "no" ) VTYSH="";;
257 * ) ;;
258esac
259
260dnl ----------
261dnl PAM module
262dnl ----------
263if test "$with_libpam" = "yes"; then
paul24cd4352003-05-06 12:16:27 +0000264 AC_CHECK_HEADER(security/pam_misc.h)
265 if test "$ac_cv_header_security_pam_misc_h" = yes; then
266 AC_DEFINE(HAVE_PAM_MISC_H,,Have pam_misc.h)
267 AC_DEFINE(PAM_CONV_FUNC,misc_conv,Have misc_conv)
268 pam_conv_func="misc_conv"
paul24cd4352003-05-06 12:16:27 +0000269 fi
paul24cd4352003-05-06 12:16:27 +0000270 AC_CHECK_HEADER(security/openpam.h)
271 if test "$ac_cv_header_security_openpam_h" = yes; then
272 AC_DEFINE(HAVE_OPENPAM_H,,Have openpam.h)
273 AC_DEFINE(PAM_CONV_FUNC,openpam_ttyconv,Have openpam_ttyconv)
274 pam_conv_func="openpam_ttyconv"
paul24cd4352003-05-06 12:16:27 +0000275 fi
276 if test -z "$ac_cv_header_security_pam_misc_h$ac_cv_header_security_openpam_h" ; then
277 AC_MSG_WARN([*** pam support will not be built ***])
278 with_libpam="no"
279 fi
280fi
281
282if test "$with_libpam" = "yes"; then
paul7ea487b2003-03-17 02:05:07 +0000283dnl took this test from proftpd's configure.in and suited to our needs
284dnl -------------------------------------------------------------------------
285dnl
286dnl This next check looks funky due to a linker problem with some versions
287dnl of the PAM library. Prior to 0.72 release, the Linux PAM shared library
288dnl omitted requiring libdl linking information. PAM-0.72 or better ships
289dnl with RedHat 6.2 and Debian 2.2 or better.
290AC_CHECK_LIB(pam, pam_start,
paul24cd4352003-05-06 12:16:27 +0000291 [AC_CHECK_LIB(pam, $pam_conv_func,
paul7ea487b2003-03-17 02:05:07 +0000292 [AC_DEFINE(USE_PAM,,Use PAM for authentication)
293 LIBPAM="-lpam"],
294 [AC_DEFINE(USE_PAM,,Use PAM for authentication)
295 LIBPAM="-lpam -lpam_misc"]
296 )
297 ],
298
299 [AC_CHECK_LIB(pam, pam_end,
paul24cd4352003-05-06 12:16:27 +0000300 [AC_CHECK_LIB(pam, $pam_conv_func,
paula159ed92003-06-04 11:01:45 +0000301 [AC_DEFINE(USE_PAM,,Use PAM for authentication)
paul7ea487b2003-03-17 02:05:07 +0000302 LIBPAM="-lpam -ldl"],
paula159ed92003-06-04 11:01:45 +0000303 [AC_DEFINE(USE_PAM,,Use PAM for authentication)
paul7ea487b2003-03-17 02:05:07 +0000304 LIBPAM="-lpam -ldl -lpam_misc"]
305 )
306 ],AC_MSG_WARN([*** pam support will not be built ***]),
307 [-ldl])
308 ]
309)
310fi
311AC_SUBST(LIBPAM)
312
313dnl -------------------------------
314dnl Endian-ness check
315dnl -------------------------------
316AC_WORDS_BIGENDIAN
317
318dnl -------------------------------
319dnl check the size in byte of the C
320dnl -------------------------------
321dnl AC_CHECK_SIZEOF(char)
322dnl AC_CHECK_SIZEOF(int)
323dnl AC_CHECK_SIZEOF(short)
324dnl AC_CHECK_SIZEOF(long)
325
326dnl ----------------------------
327dnl check existance of functions
328dnl ----------------------------
329AC_CHECK_FUNCS(bcopy bzero strerror inet_aton daemon snprintf vsnprintf strlcat strlcpy if_nametoindex if_indextoname getifaddrs)
paula159ed92003-06-04 11:01:45 +0000330AC_CHECK_FUNCS(setproctitle, ,
331 [AC_CHECK_LIB(util, setproctitle,
332 [LIBS="$LIBS -lutil"
333 AC_DEFINE(HAVE_SETPROCTITLE,, Have setproctitle)
334 ]
335 )
336 ]
337)
paul7ea487b2003-03-17 02:05:07 +0000338
339dnl ------------------------------------
340dnl Determine routing get and set method
341dnl ------------------------------------
342AC_MSG_CHECKING(zebra between kernel interface method)
343if test x"$opsys" = x"gnu-linux"; then
344 if test "${enable_netlink}" = "yes";then
345 AC_MSG_RESULT(netlink)
346 RT_METHOD=rt_netlink.o
347 AC_DEFINE(HAVE_NETLINK,,netlink)
348 netlink=yes
349 elif test "${enable_netlink}" = "no"; then
350 AC_MSG_RESULT(ioctl)
351 RT_METHOD=rt_ioctl.o
352 netlink=no
353 else
354 AC_MSG_RESULT(netlink)
355 RT_METHOD=rt_netlink.o
356 AC_DEFINE(HAVE_NETLINK,,netlink)
357 netlink=yes
358 fi
359else
360 if test "$opsys" = "sol2-6";then
361 AC_MSG_RESULT(solaris)
362 KERNEL_METHOD="kernel_socket.o"
363 RT_METHOD="rt_socket.o"
364 else
365 AC_TRY_RUN([#include <errno.h>
366#include <sys/types.h>
367#include <sys/socket.h>
368
369main ()
370{
371 int ac_sock;
372
373 ac_sock = socket (AF_ROUTE, SOCK_RAW, 0);
374 if (ac_sock < 0 && errno == EINVAL)
375 exit (1);
376 exit (0);
377}],
378 [KERNEL_METHOD=kernel_socket.o
379 RT_METHOD=rt_socket.o
380 AC_MSG_RESULT(socket)],
381 [RT_METHOD=rt_ioctl.o
382 AC_MSG_RESULT(ioctl)],
383 [KERNEL_METHOD=kernel_socket.o
384 RT_METHOD=rt_socket.o
385 AC_MSG_RESULT(socket)])
386 fi
387fi
388AC_SUBST(RT_METHOD)
389AC_SUBST(KERNEL_METHOD)
390AC_SUBST(OTHER_METHOD)
391
392dnl ------------------------------
393dnl check kernel route read method
394dnl ------------------------------
395AC_CACHE_CHECK(route read method check, zebra_rtread,
396[if test "$netlink" = yes; then
397 RTREAD_METHOD="rtread_netlink.o"
398 zebra_rtread="netlink"
399else
400for zebra_rtread in /proc/net/route /dev/ip /dev/null;
401do
402 test x`ls $zebra_rtread 2>/dev/null` = x"$zebra_rtread" && break
403done
404case $zebra_rtread in
405 "/proc/net/route") RTREAD_METHOD="rtread_proc.o"
406 zebra_rtread="proc";;
paul9c30ab62003-07-08 08:36:17 +0000407 "/dev/ip")
408 case "$host" in
409 *-freebsd*) RTREAD_METHOD=rtread_sysctl.o
410 zebra_rtread="sysctl";;
411 *) RTREAD_METHOD="rtread_getmsg.o"
412 zebra_rtread="getmsg";;
413 esac;;
paul7ea487b2003-03-17 02:05:07 +0000414 *) RTREAD_METHOD="rtread_sysctl.o"
415 zebra_rtread="sysctl";;
416esac
417fi])
418AC_SUBST(RTREAD_METHOD)
419
420dnl -----------------------------
421dnl check interface lookup method
422dnl -----------------------------
423AC_MSG_CHECKING(interface looking up method)
424if test "$netlink" = yes; then
425 AC_MSG_RESULT(netlink)
426 IF_METHOD=if_netlink.o
427else
428 if test "$opsys" = "sol2-6";then
429 AC_MSG_RESULT(solaris)
430 IF_METHOD=if_ioctl.o
431 elif test "$opsys" = "openbsd";then
432 AC_MSG_RESULT(openbsd)
433 IF_METHOD=if_ioctl.o
434 elif grep NET_RT_IFLIST /usr/include/sys/socket.h >/dev/null 2>&1; then
435 AC_MSG_RESULT(sysctl)
436 IF_METHOD=if_sysctl.o
437 AC_DEFINE(HAVE_NET_RT_IFLIST,,NET_RT_IFLIST)
438 else
439 AC_MSG_RESULT(ioctl)
440 IF_METHOD=if_ioctl.o
441 fi
442fi
443AC_SUBST(IF_METHOD)
444
445dnl -----------------------
446dnl check proc file system.
447dnl -----------------------
448if test -r /proc/net/dev; then
449 AC_DEFINE(HAVE_PROC_NET_DEV,,/proc/net/dev)
450 IF_PROC=if_proc.o
451fi
452
453if test -r /proc/net/if_inet6; then
454 AC_DEFINE(HAVE_PROC_NET_IF_INET6,,/proc/net/if_inet6)
455 IF_PROC=if_proc.o
456fi
457AC_SUBST(IF_PROC)
458
459dnl -----------------------------
460dnl check ipforward detect method
461dnl -----------------------------
462AC_CACHE_CHECK(ipforward method check, zebra_ipforward_path,
463[for zebra_ipforward_path in /proc/net/snmp /dev/ip /dev/null;
464do
465 test x`ls $zebra_ipforward_path 2>/dev/null` = x"$zebra_ipforward_path" && break
466done
467case $zebra_ipforward_path in
468 "/proc/net/snmp") IPFORWARD=ipforward_proc.o
469 zebra_ipforward_path="proc";;
470 "/dev/ip")
471 case "$host" in
472 *-nec-sysv4*) IPFORWARD=ipforward_ews.o
473 zebra_ipforward_path="ews";;
paul9c30ab62003-07-08 08:36:17 +0000474 *-freebsd*) IPFORWARD=ipforward_sysctl.o
475 zebra_ipforward_path="sysctl";;
paul7ea487b2003-03-17 02:05:07 +0000476 *) IPFORWARD=ipforward_solaris.o
477 zebra_ipforward_path="solaris";;
478 esac;;
479 *) IPFORWARD=ipforward_sysctl.o
480 zebra_ipforward_path="sysctl";;
481esac])
482AC_SUBST(IPFORWARD)
483
484AC_CHECK_FUNCS(getaddrinfo, [have_getaddrinfo=yes], [have_getaddrinfo=no])
485
486dnl ----------
487dnl IPv6 check
488dnl ----------
489AC_MSG_CHECKING(whether does this OS have IPv6 stack)
490if test "${enable_ipv6}" = "no"; then
491 AC_MSG_RESULT(disabled)
492else
493dnl ----------
494dnl INRIA IPv6
495dnl ----------
paula159ed92003-06-04 11:01:45 +0000496 if grep IPV6_INRIA_VERSION /usr/include/netinet/in.h >/dev/null 2>&1; then
497 zebra_cv_ipv6=yes
498 AC_DEFINE(HAVE_IPV6,1,INRIA IPv6)
499 AC_DEFINE(INRIA_IPV6,1,INRIA IPv6)
500 RIPNGD="ripngd"
501 OSPF6D="ospf6d"
502 LIB_IPV6=""
503 AC_MSG_RESULT(INRIA IPv6)
paul7ea487b2003-03-17 02:05:07 +0000504dnl ---------
505dnl KAME IPv6
506dnl ---------
paula159ed92003-06-04 11:01:45 +0000507 elif grep WIDE /usr/include/netinet6/in6.h >/dev/null 2>&1; then
508 zebra_cv_ipv6=yes
509 AC_DEFINE(HAVE_IPV6,1,KAME IPv6)
510 AC_DEFINE(KAME,1,KAME IPv6)
511 RIPNGD="ripngd"
512 OSPF6D="ospf6d"
513 if test -d /usr/local/v6/lib -a -f /usr/local/v6/lib/libinet6.a; then
paul7ea487b2003-03-17 02:05:07 +0000514 LIB_IPV6="-L/usr/local/v6/lib -linet6"
paula159ed92003-06-04 11:01:45 +0000515 fi
516 AC_MSG_RESULT(KAME)
hasso71c0fb52003-05-25 20:18:13 +0000517dnl -------------------------
518dnl MUSICA IPv6
519dnl default host check
520dnl It is not used by Kheops
521dnl -------------------------
paula159ed92003-06-04 11:01:45 +0000522 elif grep MUSICA /usr/include6/netinet6/in6.h >/dev/null 2>&1; then
523 zebra_cv_ipv6=yes
524 AC_DEFINE(HAVE_IPV6,1,Musicia IPv6)
525 AC_DEFINE(MUSICA,1,Musica IPv6 stack)
526 AC_DEFINE(KAME,1,KAME IPv6 stack)
527 RIPNGD="ripngd"
528 OSPF6D="ospf6d"
529 if test -d /usr/local/v6/lib -a -f /usr/local/v6/lib/libinet6.a; then
hasso71c0fb52003-05-25 20:18:13 +0000530 LIB_IPV6="-L/usr/local/v6/lib -linet6"
paula159ed92003-06-04 11:01:45 +0000531 fi
532 AC_MSG_RESULT(MUSICA)
paul7ea487b2003-03-17 02:05:07 +0000533dnl ---------
534dnl NRL check
535dnl ---------
paula159ed92003-06-04 11:01:45 +0000536 elif grep NRL /usr/include/netinet6/in6.h >/dev/null 2>&1; then
537 zebra_cv_ipv6=yes
538 AC_DEFINE(HAVE_IPV6,1,NRL IPv6)
539 AC_DEFINE(NRL,1,NRL)
540 RIPNGD="ripngd"
541 OSPF6D="ospf6d"
542 if test x"$opsys" = x"bsdi";then
paul7ea487b2003-03-17 02:05:07 +0000543 AC_DEFINE(BSDI_NRL,,BSDI)
544 AC_MSG_RESULT(BSDI_NRL)
paula159ed92003-06-04 11:01:45 +0000545 else
paul7ea487b2003-03-17 02:05:07 +0000546 AC_MSG_RESULT(NRL)
paula159ed92003-06-04 11:01:45 +0000547 fi
paul7ea487b2003-03-17 02:05:07 +0000548dnl ----------
549dnl Linux IPv6
550dnl ----------
paula159ed92003-06-04 11:01:45 +0000551 elif test "${enable_ipv6}" = "yes"; then
552 AC_EGREP_CPP(yes, [
553 #include <linux/version.h>
554 /* 2.1.128 or later */
555 #if LINUX_VERSION_CODE >= 0x020180
556 yes
557 #endif],
558 [zebra_cv_ipv6=yes
559 zebra_cv_linux_ipv6=yes
560 AC_MSG_RESULT(Linux IPv6)])
561 else
562 if test x`ls /proc/net/ipv6_route 2>/dev/null` = x"/proc/net/ipv6_route"
563 then
paul7ea487b2003-03-17 02:05:07 +0000564 zebra_cv_ipv6=yes
565 zebra_cv_linux_ipv6=yes
566 AC_MSG_RESULT(Linux IPv6)
paula159ed92003-06-04 11:01:45 +0000567 fi
568 fi
paul7ea487b2003-03-17 02:05:07 +0000569
paula159ed92003-06-04 11:01:45 +0000570 if test "$zebra_cv_linux_ipv6" = "yes";then
571 AC_MSG_CHECKING(for GNU libc >= 2.1)
572 AC_DEFINE(HAVE_IPV6,1,Linux IPv6)
573 AC_EGREP_CPP(yes, [
paul7ea487b2003-03-17 02:05:07 +0000574#include <features.h>
575#if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1
576 yes
paula159ed92003-06-04 11:01:45 +0000577#endif],
578 [glibc=yes
579 AC_DEFINE(LINUX_IPV6,1,Linux IPv6 stack)
580 AC_MSG_RESULT(yes)],
581 AC_MSG_RESULT(no)
582 )
583 RIPNGD="ripngd"
584 OSPF6D="ospf6d"
585 if test "$glibc" != "yes"; then
paul7ea487b2003-03-17 02:05:07 +0000586 INCLUDES="-I/usr/inet6/include"
587 if test x`ls /usr/inet6/lib/libinet6.a 2>/dev/null` != x;then
588 LIB_IPV6="-L/usr/inet6/lib -linet6"
589 fi
paula159ed92003-06-04 11:01:45 +0000590 fi
591 fi
paul7ea487b2003-03-17 02:05:07 +0000592
593dnl -----------------------
594dnl Set IPv6 related values
595dnl -----------------------
paula159ed92003-06-04 11:01:45 +0000596 LIBS="$LIB_IPV6 $LIBS"
597 AC_SUBST(LIB_IPV6)
paul7ea487b2003-03-17 02:05:07 +0000598
paula159ed92003-06-04 11:01:45 +0000599 if test x"$RIPNGD" = x""; then
600 AC_MSG_RESULT(IPv4 only)
601 fi
paul7ea487b2003-03-17 02:05:07 +0000602fi
603
604dnl --------------------
605dnl Daemon disable check
606dnl --------------------
607if test "${enable_zebra}" = "no";then
608 ZEBRA=""
609else
610 ZEBRA="zebra"
611fi
612
613if test "${enable_bgpd}" = "no";then
614 BGPD=""
615else
616 BGPD="bgpd"
617fi
618
619if test "${enable_ripd}" = "no";then
620 RIPD=""
621else
622 RIPD="ripd"
623fi
624
625if test "${enable_ospfd}" = "no";then
626 OSPFD=""
627else
628 OSPFD="ospfd"
629fi
630
paul1ef74ef2003-03-21 15:16:05 +0000631OSPFCLIENT=""
632if test "${enable_opaque_lsa}" = "yes"; then
633 if test "${enable_ospfapi}" != "no";then
paul9a569842003-03-28 01:45:13 +0000634 AC_DEFINE(SUPPORT_OSPF_API,,OSPFAPI)
paul1ef74ef2003-03-21 15:16:05 +0000635
636 if test "${enable_ospfclient}" != "no";then
637 OSPFCLIENT="ospfclient"
638 fi
639 fi
640
paul7ea487b2003-03-17 02:05:07 +0000641fi
642
643case "${enable_ripngd}" in
644 "yes") RIPNGD="ripngd";;
645 "no" ) RIPNGD="";;
646 * ) ;;
647esac
648
649case "${enable_ospf6d}" in
650 "yes") OSPF6D="ospf6d";;
651 "no" ) OSPF6D="";;
652 * ) ;;
653esac
654
655if test "${enable_bgp_announce}" = "no";then
656 AC_DEFINE(DISABLE_BGP_ANNOUNCE,,Disable BGP installation to zebra)
657fi
658
659AC_SUBST(ZEBRA)
660AC_SUBST(BGPD)
661AC_SUBST(RIPD)
662AC_SUBST(RIPNGD)
663AC_SUBST(OSPFD)
664AC_SUBST(OSPF6D)
665AC_SUBST(VTYSH)
666AC_SUBST(INCLUDES)
667AC_SUBST(CURSES)
668AC_SUBST(OSPFCLIENT)
paul1ef74ef2003-03-21 15:16:05 +0000669AC_SUBST(OSPFAPI)
paul7ea487b2003-03-17 02:05:07 +0000670AC_CHECK_LIB(c, inet_ntop, [AC_DEFINE(HAVE_INET_NTOP,,inet_ntop)])
671AC_CHECK_LIB(c, inet_pton, [AC_DEFINE(HAVE_INET_PTON,,inet_pton)])
672AC_CHECK_LIB(crypt, crypt)
673AC_CHECK_LIB(resolv, res_init)
674AC_CHECK_LIB(m, main)
675
676dnl ---------------------------------------------------
677dnl BSD/OS 4.1 define inet_XtoY function as __inet_XtoY
678dnl ---------------------------------------------------
paula159ed92003-06-04 11:01:45 +0000679AC_CHECK_FUNC(__inet_ntop, AC_DEFINE(HAVE_INET_NTOP,,__inet_ntop))
680AC_CHECK_FUNC(__inet_pton, AC_DEFINE(HAVE_INET_PTON,,__inet_pton))
681AC_CHECK_FUNC(__inet_aton, AC_DEFINE(HAVE_INET_ATON,,__inet_aton))
paul7ea487b2003-03-17 02:05:07 +0000682
683dnl ---------------------------
684dnl check system has GNU regexp
685dnl ---------------------------
686dnl AC_MSG_CHECKING(whether system has GNU regex)
687AC_CHECK_LIB(c, regexec,
688[AC_DEFINE(HAVE_GNU_REGEX,,GNU regexp library)
689 LIB_REGEX=""],
690[LIB_REGEX="regex.o"])
691AC_SUBST(LIB_REGEX)
692
693dnl ------------------
694dnl check SNMP library
695dnl ------------------
696if test "${enable_snmp}" = "yes";then
697dnl AC_CHECK_LIB(snmp, asn_parse_int, HAVE_SNMP=yes)
paul7ea487b2003-03-17 02:05:07 +0000698 if test "${HAVE_SNMP}" = ""; then
paul1ef74ef2003-03-21 15:16:05 +0000699 old_libs="${LIBS}"
700 LIBS="-L/usr/lib"
paul7ea487b2003-03-17 02:05:07 +0000701 unset ac_cv_lib_snmp_asn_parse_int
paul1ef74ef2003-03-21 15:16:05 +0000702 AC_CHECK_LIB(crypto, main, NEED_CRYPTO=yes, )
703 if test "${NEED_CRYPTO}" = ""; then
704 AC_CHECK_LIB(netsnmp, asn_parse_int, [HAVE_NETSNMP=yes; HAVE_SNMP=yes ])
705 else
706 AC_CHECK_LIB(netsnmp, asn_parse_int, [HAVE_NETSNMP=yes; HAVE_SNMP=yes; NEED_CRYPTO=yes;LIBS="$LIBS -lcrypto" ],,"-lcrypto")
707 fi
708 LIBS="${old_libs}"
paul7ea487b2003-03-17 02:05:07 +0000709 fi
paul1ef74ef2003-03-21 15:16:05 +0000710 if test "${HAVE_SNMP}" = ""; then
711 old_libs="${LIBS}"
712 LIBS="-L/usr/lib"
713 unset ac_cv_lib_snmp_asn_parse_int
714 AC_CHECK_LIB(snmp, asn_parse_int, HAVE_SNMP=yes, )
715 if test "${HAVE_SNMP}" = ""; then
716 unset ac_cv_lib_snmp_asn_parse_int
717 AC_CHECK_LIB(crypto, main, NEED_CRYPTO=yes, )
718 if test "${NEED_CRYPTO}" = "yes"; then
719 AC_CHECK_LIB(snmp, asn_parse_int, [HAVE_SNMP=yes; NEED_CRYPTO=yes; LIBS="$LIBS -lcrypto" ],,"-lcrypto")
720 fi
721 fi
722 LIBS="${old_libs}"
723 fi
paul7ea487b2003-03-17 02:05:07 +0000724
725 if test "${HAVE_SNMP}" = ""; then
paul1ef74ef2003-03-21 15:16:05 +0000726 old_libs="${LIBS}"
727 LIBS="-L/usr/local/lib"
728 unset ac_cv_lib_snmp_asn_parse_int
729 AC_CHECK_LIB(snmp, asn_parse_int, HAVE_SNMP=yes)
730 if test "${HAVE_SNMP}" = ""; then
731 unset ac_cv_lib_snmp_asn_parse_int
732 AC_CHECK_LIB(crypto, main, NEED_CRYPTO=yes, )
733 if test "${NEED_CRYPTO}" = "yes"; then
734 AC_CHECK_LIB(snmp, asn_parse_int, [HAVE_SNMP=yes; NEED_CRYPTO=yes; LIBS="$LIBS -lcrypto" ],,"-lcrypto")
735 fi
736 fi
737 LIBS="${old_libs}"
paul7ea487b2003-03-17 02:05:07 +0000738 fi
paul1ef74ef2003-03-21 15:16:05 +0000739
paul7ea487b2003-03-17 02:05:07 +0000740 if test "${HAVE_SNMP}" = "yes"; then
741 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
742 do
743 test -f "${ac_snmp}" && break
744 done
paul1ef74ef2003-03-21 15:16:05 +0000745
paul7ea487b2003-03-17 02:05:07 +0000746 case ${ac_snmp} in
747 /usr/include/net-snmp/*)
748 AC_DEFINE(HAVE_SNMP,,SNMP)
paul1ef74ef2003-03-21 15:16:05 +0000749 AC_DEFINE(HAVE_NETSNMP,,SNMP)
paul7ea487b2003-03-17 02:05:07 +0000750 AC_DEFINE(UCD_COMPATIBLE,,SNMP)
paulac7c4bb2003-03-19 04:25:08 +0000751 CFLAGS="${CFLAGS} -I/usr/include/net-snmp -I/usr/include/net-snmp/library"
752 if test "${HAVE_NETSNMP}" = "yes"; then
paul1ef74ef2003-03-21 15:16:05 +0000753 LIBS="${LIBS} -lnetsnmp"
paulac7c4bb2003-03-19 04:25:08 +0000754 else
paul1ef74ef2003-03-21 15:16:05 +0000755 LIBS="${LIBS} -lsnmp"
paulac7c4bb2003-03-19 04:25:08 +0000756 fi
paul7ea487b2003-03-17 02:05:07 +0000757 ;;
758 /usr/include/ucd-snmp/*)
759 AC_DEFINE(HAVE_SNMP,,SNMP)
760 CFLAGS="${CFLAGS} -I/usr/include/ucd-snmp"
761 LIBS="${LIBS} -lsnmp"
762 ;;
763 /usr/local/include/ucd-snmp/*)
764 AC_DEFINE(HAVE_SNMP,,SNMP)
765 CFLAGS="${CFLAGS} -I/usr/local/include/ucd-snmp"
766 LIBS="${LIBS} -L/usr/local/lib -lsnmp"
767 ;;
768 esac
769 if test "${NEED_CRYPTO}" = "yes"; then
770 LIBS="${LIBS} -lcrypto"
771 fi
772 fi
773fi
774
775dnl ----------------------------
776dnl check sa_len of sockaddr
777dnl ----------------------------
778AC_MSG_CHECKING(whether struct sockaddr has a sa_len field)
779AC_TRY_COMPILE([#include <sys/types.h>
780#include <sys/socket.h>
781],[static struct sockaddr ac_i;int ac_j = sizeof (ac_i.sa_len);],
782[AC_MSG_RESULT(yes)
783 AC_DEFINE(HAVE_SA_LEN,,sa_len)],
784 AC_MSG_RESULT(no))
785
786dnl ----------------------------
787dnl check sin_len of sockaddr_in
788dnl ----------------------------
789AC_MSG_CHECKING(whether struct sockaddr_in has a sin_len field)
790AC_TRY_COMPILE([#include <sys/types.h>
791#include <netinet/in.h>
792],[static struct sockaddr_in ac_i;int ac_j = sizeof (ac_i.sin_len);],
793[AC_MSG_RESULT(yes)
794 AC_DEFINE(HAVE_SIN_LEN,,sin_len)],
795 AC_MSG_RESULT(no))
796
797dnl ----------------------------
798dnl check sun_len of sockaddr_un
799dnl ----------------------------
800AC_MSG_CHECKING(whether struct sockaddr_un has a sun_len field)
801AC_TRY_COMPILE([#include <sys/types.h>
802#include <sys/un.h>
803],[static struct sockaddr_un ac_i;int ac_j = sizeof (ac_i.sun_len);],
804[AC_MSG_RESULT(yes)
805 AC_DEFINE(HAVE_SUN_LEN,,sun_len)],
806 AC_MSG_RESULT(no))
807
808dnl -----------------------------------
809dnl check sin6_scope_id of sockaddr_in6
810dnl -----------------------------------
811if test "$zebra_cv_ipv6" = yes; then
812 AC_MSG_CHECKING(whether struct sockaddr_in6 has a sin6_scope_id field)
813 AC_TRY_COMPILE([#include <sys/types.h>
814#include <netinet/in.h>
815],[static struct sockaddr_in6 ac_i;int ac_j = sizeof (ac_i.sin6_scope_id);],
816[AC_MSG_RESULT(yes)
817 AC_DEFINE(HAVE_SIN6_SCOPE_ID,,scope id)],
818 AC_MSG_RESULT(no))
819fi
820
821dnl ----------------------------
822dnl check socklen_t exist or not
823dnl ----------------------------
824AC_MSG_CHECKING(whther socklen_t is defined)
825AC_TRY_COMPILE([#include <sys/types.h>
826#include <sys/socket.h>
827#include <netinet/in.h>
828],[socklen_t ac_x;],
829[AC_MSG_RESULT(yes)
830 AC_DEFINE(HAVE_SOCKLEN_T,,socklen_t)],
831 AC_MSG_RESULT(no))
832
833dnl ------------------------
834dnl check struct sockaddr_dl
835dnl ------------------------
836AC_MSG_CHECKING(whether struct sockaddr_dl exist)
837AC_EGREP_HEADER(sockaddr_dl,
838net/if_dl.h,
839[AC_MSG_RESULT(yes)
840 AC_DEFINE(HAVE_SOCKADDR_DL,,sockaddr_dl)],
841 AC_MSG_RESULT(no))
842
843dnl --------------------------
844dnl check structure ifaliasreq
845dnl --------------------------
846AC_MSG_CHECKING(whether struct ifaliasreq exist)
847AC_EGREP_HEADER(ifaliasreq,
848net/if.h,
849[AC_MSG_RESULT(yes)
850 AC_DEFINE(HAVE_IFALIASREQ,,ifaliasreq)],
851 AC_MSG_RESULT(no))
852
853dnl ----------------------------
854dnl check structure in6_aliasreq
855dnl ----------------------------
hasso71c0fb52003-05-25 20:18:13 +0000856AC_MSG_CHECKING(whether struct in6_aliasreq exist)
paul7ea487b2003-03-17 02:05:07 +0000857AC_EGREP_HEADER(in6_aliasreq,
858netinet6/in6_var.h,
859[AC_MSG_RESULT(yes)
860 AC_DEFINE(HAVE_IN6_ALIASREQ,,in6_aliasreq)],
861 AC_MSG_RESULT(no))
862
hasso71c0fb52003-05-25 20:18:13 +0000863dnl -----------------------------------
864dnl check ifra_lifetime of in6_aliasreq
865dnl -----------------------------------
866AC_MSG_CHECKING(whether in6_aliasreq.ifra_lifetime exist)
867AC_TRY_COMPILE([#include <sys/types.h>
868#include <netinet6/in6_var.h>
869],[static struct if6_aliasreq ac_i;int ac_j = sizeof (ac_i.ifra_lifetime);],
870[AC_MSG_RESULT(yes)
paula159ed92003-06-04 11:01:45 +0000871 AC_DEFINE(HAVE_IFRA_LIFETIME,,Have in6_aliasreq.ifra_lifetime)],
hasso71c0fb52003-05-25 20:18:13 +0000872 AC_MSG_RESULT(no))
873
paul7ea487b2003-03-17 02:05:07 +0000874dnl ---------------------------
875dnl check structure rt_addrinfo
876dnl ---------------------------
877AC_MSG_CHECKING(whether struct rt_addrinfo exist)
878AC_EGREP_HEADER(rt_addrinfo,
879net/route.h,
880[AC_MSG_RESULT(yes)
881 AC_DEFINE(HAVE_RT_ADDRINFO,,rt_addrinfo)],
882 AC_MSG_RESULT(no))
883
884dnl --------------------------
885dnl check structure in_pktinfo
886dnl --------------------------
887AC_MSG_CHECKING(whether struct in_pktinfo exist)
888AC_TRY_COMPILE([#include <netinet/in.h>
889],[struct in_pktinfo ac_x;],
890[AC_MSG_RESULT(yes)
891 AC_DEFINE(HAVE_INPKTINFO,,in_pktinfo)],
892 AC_MSG_RESULT(no))
893
894dnl --------------------------------------
895dnl checking for getrusage struct and call
896dnl --------------------------------------
897AC_MSG_CHECKING(whether getrusage is available)
898AC_TRY_COMPILE([#include <sys/resource.h>
899],[struct rusage ac_x; getrusage (RUSAGE_SELF, &ac_x);],
900[AC_MSG_RESULT(yes)
901 AC_DEFINE(HAVE_RUSAGE,,rusage)],
902 AC_MSG_RESULT(no))
903
pauledd7c242003-06-04 13:59:38 +0000904dnl -------------------
905dnl capabilities checks
906dnl -------------------
907AC_MSG_CHECKING(whether prctl PR_SET_KEEPCAPS is available)
908AC_TRY_COMPILE([#include <sys/prctl.h>],[prctl(PR_SET_KEEPCAPS, 1, 0, 0, 0);],
909 [AC_MSG_RESULT(yes)
910 AC_DEFINE(HAVE_PR_SET_KEEPCAPS,,prctl)
paule8f29842003-08-12 13:08:31 +0000911 quagga_ac_keepcaps="yes"],
pauledd7c242003-06-04 13:59:38 +0000912 AC_MSG_RESULT(no)
913)
paule8f29842003-08-12 13:08:31 +0000914if test x"${quagga_ac_keepcaps}" = x"yes"; then
pauledd7c242003-06-04 13:59:38 +0000915 AC_CHECK_HEADERS(sys/capability.h)
916fi
917if test x"${ac_cv_header_sys_capability_h}" = x"yes"; then
918 AC_CHECK_LIB(cap, cap_init,
919 [AC_DEFINE(HAVE_LCAPS,1,Capabilities)
920 LIBCAP="-lcap"
921 ]
922 )
923fi
924AC_SUBST(LIBCAP)
925
paulfb2d1502003-06-04 09:40:54 +0000926dnl ---------------------------
927dnl check for glibc 'backtrace'
928dnl ---------------------------
929if test "${glibc}" = "yes"; then
930 AC_CHECK_HEADER(execinfo.h)
931fi
932if test x"${ac_cv_header_execinfo_h}" = x"yes"; then
933 AC_CHECK_FUNC(backtrace,
934 [AC_DEFINE(HAVE_GLIBC_BACKTRACE,,Glibc backtrace)]
935 )
936fi
937
paul7ea487b2003-03-17 02:05:07 +0000938dnl -------------
939dnl check version
940dnl -------------
941file="${srcdir}/lib/version.h"
paule8f29842003-08-12 13:08:31 +0000942VERSION=`sed -ne 's/^#.*QUAGGA_VERSION.*\"\([^\"]*\)\"$/\1/p' $file`
paul7ea487b2003-03-17 02:05:07 +0000943AC_SUBST(VERSION)
944
paul408ad942003-05-20 00:03:33 +0000945dnl ----------
946dnl configure date
947dnl ----------
948CONFDATE=`date '+%Y%m%d'`
949AC_SUBST(CONFDATE)
950
paul7ea487b2003-03-17 02:05:07 +0000951dnl ------------------------------
paula159ed92003-06-04 11:01:45 +0000952dnl set paths for state directory
paul23bd12c2003-04-07 06:11:09 +0000953dnl ------------------------------
954if test "${prefix}" = "NONE"; then
paule8f29842003-08-12 13:08:31 +0000955 quagga_statedir_prefix="";
paul23bd12c2003-04-07 06:11:09 +0000956else
paule8f29842003-08-12 13:08:31 +0000957 quagga_statedir_prefix=${prefix}
paul23bd12c2003-04-07 06:11:09 +0000958fi
959if test "${localstatedir}" = '${prefix}/var'; then
paula159ed92003-06-04 11:01:45 +0000960 AC_CACHE_CHECK(state directory,ac_statedir,
paule8f29842003-08-12 13:08:31 +0000961 [for QUAGGA_STATE_DIR in ${quagga_statedir_prefix}/var/run dnl
962 ${quagga_statedir_prefix}/var/adm dnl
963 ${quagga_statedir_prefix}/etc dnl
paula159ed92003-06-04 11:01:45 +0000964 /var/run dnl
965 /var/adm dnl
966 /etc dnl
967 /dev/null;
paul23bd12c2003-04-07 06:11:09 +0000968 do
paule8f29842003-08-12 13:08:31 +0000969 test -d $QUAGGA_STATE_DIR && break
paul23bd12c2003-04-07 06:11:09 +0000970 done
paule8f29842003-08-12 13:08:31 +0000971 quagga_statedir=$QUAGGA_STATE_DIR])
paul23bd12c2003-04-07 06:11:09 +0000972else
paule8f29842003-08-12 13:08:31 +0000973 quagga_statedir=${localstatedir}
paula159ed92003-06-04 11:01:45 +0000974 AC_MSG_CHECKING(directory to use for state file)
paule8f29842003-08-12 13:08:31 +0000975 AC_MSG_RESULT(${quagga_statedir})
paul23bd12c2003-04-07 06:11:09 +0000976fi
paule8f29842003-08-12 13:08:31 +0000977if test $quagga_statedir = "/dev/null"; then
paula159ed92003-06-04 11:01:45 +0000978 AC_MSG_ERROR('STATE DIRECTORY NOT FOUND! FIX OR SPECIFY --localstatedir!')
979fi
980
paule8f29842003-08-12 13:08:31 +0000981AC_DEFINE_UNQUOTED(PATH_ZEBRA_PID, "$quagga_statedir/zebra.pid",zebra PID)
982AC_DEFINE_UNQUOTED(PATH_RIPD_PID, "$quagga_statedir/ripd.pid",ripd PID)
983AC_DEFINE_UNQUOTED(PATH_RIPNGD_PID, "$quagga_statedir/ripngd.pid",ripngd PID)
984AC_DEFINE_UNQUOTED(PATH_BGPD_PID, "$quagga_statedir/bgpd.pid",bgpd PID)
985AC_DEFINE_UNQUOTED(PATH_OSPFD_PID, "$quagga_statedir/ospfd.pid",ospfd PID)
986AC_DEFINE_UNQUOTED(PATH_OSPF6D_PID, "$quagga_statedir/ospf6d.pid",ospf6d PID)
987AC_DEFINE_UNQUOTED(ZEBRA_SERV_PATH, "$quagga_statedir/zserv.api",zebra api socket)
988AC_DEFINE_UNQUOTED(ZEBRA_VTYSH_PATH, "$quagga_statedir/zebra.vty",zebra vty socket)
989AC_DEFINE_UNQUOTED(RIP_VTYSH_PATH, "$quagga_statedir/ripd.vty",rip vty socket)
990AC_DEFINE_UNQUOTED(RIPNG_VTYSH_PATH, "$quagga_statedir/ripngd.vty",ripng vty socket)
991AC_DEFINE_UNQUOTED(BGP_VTYSH_PATH, "$quagga_statedir/bgpd.vty",bgpd vty socket)
992AC_DEFINE_UNQUOTED(OSPF_VTYSH_PATH, "$quagga_statedir/ospfd.vty",ospfd vty socket)
993AC_DEFINE_UNQUOTED(OSPF6_VTYSH_PATH, "$quagga_statedir/ospf6d.vty",ospf6d vty socket)
paul7ea487b2003-03-17 02:05:07 +0000994
995dnl ---------------------------
996dnl Check htonl works correctly
997dnl ---------------------------
998AC_MSG_CHECKING(for working htonl)
999AC_CACHE_VAL(ac_cv_htonl_works, [
1000AC_TRY_LINK([#ifdef HAVE_SYS_TYPES_H
1001#include <sys/types.h>
1002#endif
1003#ifdef HAVE_NETDB_H
1004#include <netdb.h>
1005#endif
1006#ifdef HAVE_NETINET_IN_H
1007#include <netinet/in.h>
1008#endif],
1009[htonl (0);],
1010ac_cv_htonl_works=yes,
1011ac_cv_htonl_works=no)])
1012AC_MSG_RESULT($ac_cv_htonl_works)
1013
paul6382b6f2003-05-20 00:17:45 +00001014AC_OUTPUT(Makefile lib/Makefile zebra/Makefile ripd/Makefile
1015 ripngd/Makefile bgpd/Makefile ospfd/Makefile
1016 ospf6d/Makefile vtysh/Makefile doc/Makefile
1017 ospfclient/Makefile
paule8f29842003-08-12 13:08:31 +00001018 redhat/quagga.spec)
paul7ea487b2003-03-17 02:05:07 +00001019
1020echo "
1021zebra configuration
1022-------------------
paule8f29842003-08-12 13:08:31 +00001023quagga version : ${VERSION}
paul7ea487b2003-03-17 02:05:07 +00001024host operationg system : ${host_os}
1025source code location : ${srcdir}
1026compiler : ${CC}
1027compiler flags : ${CFLAGS}
hasso71c0fb52003-05-25 20:18:13 +00001028linker flags : ${LDFLAGS} ${LIBS}
paule8f29842003-08-12 13:08:31 +00001029state file directory : ${quagga_statedir}
paul8d4aee52003-06-06 00:30:35 +00001030user to run as : ${enable_user}
1031group to run as : ${enable_group}
1032group for vty sockets : ${enable_vty_group}
paul7ea487b2003-03-17 02:05:07 +00001033"