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