blob: 807cf7c0ae2074b8b925c9dc3c1b99c636ec2819 [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 -------------------
pauldc7a2bf2003-10-22 00:07:44 +0000193AC_HEADER_STDC
194AC_CHECK_HEADERS([string.h stropts.h sys/conf.h sys/ksym.h sys/time.h \
195 sys/times.h sys/select.h sys/sysctl.h sys/sockio.h \
196 sys/types.h linux/version.h kvm.h netdb.h asm/types.h \
197 libutil.h limits.h])
198
199AC_CHECK_HEADERS([sys/socket.h netinet/in.h net/if_dl.h \
200 net/netopt.h inet/nd.h net/route.h net/if.h \
201 net/if_var.h netinet/in_var.h])
202
203if test "x${enable_ipv6}" = "xyes"; then
204AC_CHECK_HEADERS([netinet6/in6.h netinet/in6_var.h netinet/icmp6.h \
205 netinet6/in6_var.h netinet6/nd6.h])
206fi
207dnl if enable_ipv6
paul7ea487b2003-03-17 02:05:07 +0000208
209dnl check some types
210AC_C_CONST
211dnl AC_TYPE_PID_T
212AC_TYPE_SIGNAL
213
214dnl Some systems (Solaris 2.x) require libnsl (Network Services Library)
215case "$host" in
216 *-sunos5.6* | *-solaris2.6*)
217 opsys=sol2-6
218 AC_DEFINE(SUNOS_5,,SunOS 5)
219 AC_CHECK_LIB(xnet, main)
220 CURSES=-lcurses
221 ;;
222 *-sunos5* | *-solaris2*)
223 AC_DEFINE(SUNOS_5,,SunOS 5)
224 AC_CHECK_LIB(socket, main)
225 AC_CHECK_LIB(nsl, main)
226 CURSES=-lcurses
227 ;;
228 *-linux-*)
229 opsys=gnu-linux
230 AC_DEFINE(GNU_LINUX,,GNU Linux)
231 ;;
232 *-nec-sysv4*)
233 AC_CHECK_LIB(nsl, gethostbyname)
234 AC_CHECK_LIB(socket, socket)
235 ;;
236 *-freebsd3.2)
237 AC_DEFINE(FREEBSD_32,,FreeBSD 3.2)
238 ;;
239 *-openbsd*)
240 opsys=openbsd
241 AC_DEFINE(OPEN_BSD,,OpenBSD)
242 ;;
243 *-bsdi*)
244 opsys=bsdi
245 OTHER_METHOD="mtu_kvm.o"
246 AC_CHECK_LIB(kvm, main)
247 ;;
paul49e3b3c2003-10-23 20:39:50 +0000248 *-irix6.5)
pauldc7a2bf2003-10-22 00:07:44 +0000249 opsys=irix
250 AC_DEFINE(IRIX_65,,IRIX 6.5)
251 ;;
paul7ea487b2003-03-17 02:05:07 +0000252esac
253
254dnl ---------------------
255dnl Integrated VTY option
256dnl ---------------------
257case "${enable_vtysh}" in
258 "yes") VTYSH="vtysh";
259 AC_DEFINE(VTYSH,,VTY shell)
260 AC_CHECK_LIB(tinfo, tputs, , AC_CHECK_LIB(ncurses, tputs))
261 AC_CHECK_LIB(readline, main)
262 if test $ac_cv_lib_readline_main = no; then
263 AC_MSG_ERROR([vtysh needs libreadline but was not found on your system.])
264 fi
265 AC_CHECK_HEADER(readline/history.h)
266 if test $ac_cv_header_readline_history_h = no;then
267 AC_MSG_ERROR([readline is too old to have readline/history.h, please update to the latest readline library.])
268 fi
paul3d3de8c2003-05-23 10:33:49 +0000269 AC_CHECK_LIB(readline, rl_completion_matches)
270 if test $ac_cv_lib_readline_rl_completion_matches = no; then
271 AC_DEFINE(rl_completion_matches,completion_matches,Old readline)
272 fi
273 ;;
paul7ea487b2003-03-17 02:05:07 +0000274 "no" ) VTYSH="";;
275 * ) ;;
276esac
277
278dnl ----------
279dnl PAM module
280dnl ----------
281if test "$with_libpam" = "yes"; then
paul24cd4352003-05-06 12:16:27 +0000282 AC_CHECK_HEADER(security/pam_misc.h)
283 if test "$ac_cv_header_security_pam_misc_h" = yes; then
284 AC_DEFINE(HAVE_PAM_MISC_H,,Have pam_misc.h)
285 AC_DEFINE(PAM_CONV_FUNC,misc_conv,Have misc_conv)
286 pam_conv_func="misc_conv"
paul24cd4352003-05-06 12:16:27 +0000287 fi
paul24cd4352003-05-06 12:16:27 +0000288 AC_CHECK_HEADER(security/openpam.h)
289 if test "$ac_cv_header_security_openpam_h" = yes; then
290 AC_DEFINE(HAVE_OPENPAM_H,,Have openpam.h)
291 AC_DEFINE(PAM_CONV_FUNC,openpam_ttyconv,Have openpam_ttyconv)
292 pam_conv_func="openpam_ttyconv"
paul24cd4352003-05-06 12:16:27 +0000293 fi
294 if test -z "$ac_cv_header_security_pam_misc_h$ac_cv_header_security_openpam_h" ; then
295 AC_MSG_WARN([*** pam support will not be built ***])
296 with_libpam="no"
297 fi
298fi
299
300if test "$with_libpam" = "yes"; then
paul7ea487b2003-03-17 02:05:07 +0000301dnl took this test from proftpd's configure.in and suited to our needs
302dnl -------------------------------------------------------------------------
303dnl
304dnl This next check looks funky due to a linker problem with some versions
305dnl of the PAM library. Prior to 0.72 release, the Linux PAM shared library
306dnl omitted requiring libdl linking information. PAM-0.72 or better ships
307dnl with RedHat 6.2 and Debian 2.2 or better.
308AC_CHECK_LIB(pam, pam_start,
paul24cd4352003-05-06 12:16:27 +0000309 [AC_CHECK_LIB(pam, $pam_conv_func,
paul7ea487b2003-03-17 02:05:07 +0000310 [AC_DEFINE(USE_PAM,,Use PAM for authentication)
311 LIBPAM="-lpam"],
312 [AC_DEFINE(USE_PAM,,Use PAM for authentication)
313 LIBPAM="-lpam -lpam_misc"]
314 )
315 ],
316
317 [AC_CHECK_LIB(pam, pam_end,
paul24cd4352003-05-06 12:16:27 +0000318 [AC_CHECK_LIB(pam, $pam_conv_func,
paula159ed92003-06-04 11:01:45 +0000319 [AC_DEFINE(USE_PAM,,Use PAM for authentication)
paul7ea487b2003-03-17 02:05:07 +0000320 LIBPAM="-lpam -ldl"],
paula159ed92003-06-04 11:01:45 +0000321 [AC_DEFINE(USE_PAM,,Use PAM for authentication)
paul7ea487b2003-03-17 02:05:07 +0000322 LIBPAM="-lpam -ldl -lpam_misc"]
323 )
324 ],AC_MSG_WARN([*** pam support will not be built ***]),
325 [-ldl])
326 ]
327)
328fi
329AC_SUBST(LIBPAM)
330
331dnl -------------------------------
332dnl Endian-ness check
333dnl -------------------------------
334AC_WORDS_BIGENDIAN
335
336dnl -------------------------------
337dnl check the size in byte of the C
338dnl -------------------------------
339dnl AC_CHECK_SIZEOF(char)
340dnl AC_CHECK_SIZEOF(int)
341dnl AC_CHECK_SIZEOF(short)
342dnl AC_CHECK_SIZEOF(long)
343
344dnl ----------------------------
345dnl check existance of functions
346dnl ----------------------------
paul49e3b3c2003-10-23 20:39:50 +0000347AC_CHECK_FUNCS(memset memcpy strerror inet_aton daemon snprintf vsnprintf \
348 strlcat strlcpy if_nametoindex if_indextoname getifaddrs)
paula159ed92003-06-04 11:01:45 +0000349AC_CHECK_FUNCS(setproctitle, ,
350 [AC_CHECK_LIB(util, setproctitle,
351 [LIBS="$LIBS -lutil"
352 AC_DEFINE(HAVE_SETPROCTITLE,, Have setproctitle)
353 ]
354 )
355 ]
356)
paul7ea487b2003-03-17 02:05:07 +0000357
358dnl ------------------------------------
359dnl Determine routing get and set method
360dnl ------------------------------------
361AC_MSG_CHECKING(zebra between kernel interface method)
362if test x"$opsys" = x"gnu-linux"; then
363 if test "${enable_netlink}" = "yes";then
364 AC_MSG_RESULT(netlink)
365 RT_METHOD=rt_netlink.o
366 AC_DEFINE(HAVE_NETLINK,,netlink)
367 netlink=yes
368 elif test "${enable_netlink}" = "no"; then
369 AC_MSG_RESULT(ioctl)
370 RT_METHOD=rt_ioctl.o
371 netlink=no
372 else
373 AC_MSG_RESULT(netlink)
374 RT_METHOD=rt_netlink.o
375 AC_DEFINE(HAVE_NETLINK,,netlink)
376 netlink=yes
377 fi
378else
379 if test "$opsys" = "sol2-6";then
380 AC_MSG_RESULT(solaris)
381 KERNEL_METHOD="kernel_socket.o"
382 RT_METHOD="rt_socket.o"
paul49e3b3c2003-10-23 20:39:50 +0000383 elif test "$opsys" = "irix" ; then
384 AC_MSG_RESULT(irix)
385 KERNEL_METHOD="kernel_socket.o"
386 RT_METHOD="rt_socket.o"
paul7ea487b2003-03-17 02:05:07 +0000387 else
388 AC_TRY_RUN([#include <errno.h>
389#include <sys/types.h>
390#include <sys/socket.h>
391
392main ()
393{
394 int ac_sock;
395
396 ac_sock = socket (AF_ROUTE, SOCK_RAW, 0);
397 if (ac_sock < 0 && errno == EINVAL)
398 exit (1);
399 exit (0);
400}],
401 [KERNEL_METHOD=kernel_socket.o
402 RT_METHOD=rt_socket.o
403 AC_MSG_RESULT(socket)],
404 [RT_METHOD=rt_ioctl.o
405 AC_MSG_RESULT(ioctl)],
406 [KERNEL_METHOD=kernel_socket.o
407 RT_METHOD=rt_socket.o
408 AC_MSG_RESULT(socket)])
409 fi
410fi
411AC_SUBST(RT_METHOD)
412AC_SUBST(KERNEL_METHOD)
413AC_SUBST(OTHER_METHOD)
414
415dnl ------------------------------
416dnl check kernel route read method
417dnl ------------------------------
418AC_CACHE_CHECK(route read method check, zebra_rtread,
419[if test "$netlink" = yes; then
420 RTREAD_METHOD="rtread_netlink.o"
421 zebra_rtread="netlink"
422else
423for zebra_rtread in /proc/net/route /dev/ip /dev/null;
424do
425 test x`ls $zebra_rtread 2>/dev/null` = x"$zebra_rtread" && break
426done
427case $zebra_rtread in
428 "/proc/net/route") RTREAD_METHOD="rtread_proc.o"
429 zebra_rtread="proc";;
paul9c30ab62003-07-08 08:36:17 +0000430 "/dev/ip")
431 case "$host" in
432 *-freebsd*) RTREAD_METHOD=rtread_sysctl.o
433 zebra_rtread="sysctl";;
434 *) RTREAD_METHOD="rtread_getmsg.o"
435 zebra_rtread="getmsg";;
436 esac;;
paul7ea487b2003-03-17 02:05:07 +0000437 *) RTREAD_METHOD="rtread_sysctl.o"
438 zebra_rtread="sysctl";;
439esac
440fi])
441AC_SUBST(RTREAD_METHOD)
442
443dnl -----------------------------
444dnl check interface lookup method
445dnl -----------------------------
446AC_MSG_CHECKING(interface looking up method)
447if test "$netlink" = yes; then
448 AC_MSG_RESULT(netlink)
449 IF_METHOD=if_netlink.o
450else
451 if test "$opsys" = "sol2-6";then
452 AC_MSG_RESULT(solaris)
453 IF_METHOD=if_ioctl.o
paul49e3b3c2003-10-23 20:39:50 +0000454 elif test "$opsys" = "irix" ; then
455 AC_MSG_RESULT(irix)
456 IF_METHOD=if_ioctl.o
paul7ea487b2003-03-17 02:05:07 +0000457 elif test "$opsys" = "openbsd";then
458 AC_MSG_RESULT(openbsd)
459 IF_METHOD=if_ioctl.o
460 elif grep NET_RT_IFLIST /usr/include/sys/socket.h >/dev/null 2>&1; then
461 AC_MSG_RESULT(sysctl)
462 IF_METHOD=if_sysctl.o
463 AC_DEFINE(HAVE_NET_RT_IFLIST,,NET_RT_IFLIST)
464 else
465 AC_MSG_RESULT(ioctl)
466 IF_METHOD=if_ioctl.o
467 fi
468fi
469AC_SUBST(IF_METHOD)
470
471dnl -----------------------
472dnl check proc file system.
473dnl -----------------------
474if test -r /proc/net/dev; then
475 AC_DEFINE(HAVE_PROC_NET_DEV,,/proc/net/dev)
476 IF_PROC=if_proc.o
477fi
478
479if test -r /proc/net/if_inet6; then
480 AC_DEFINE(HAVE_PROC_NET_IF_INET6,,/proc/net/if_inet6)
481 IF_PROC=if_proc.o
482fi
483AC_SUBST(IF_PROC)
484
485dnl -----------------------------
486dnl check ipforward detect method
487dnl -----------------------------
488AC_CACHE_CHECK(ipforward method check, zebra_ipforward_path,
489[for zebra_ipforward_path in /proc/net/snmp /dev/ip /dev/null;
490do
491 test x`ls $zebra_ipforward_path 2>/dev/null` = x"$zebra_ipforward_path" && break
492done
493case $zebra_ipforward_path in
494 "/proc/net/snmp") IPFORWARD=ipforward_proc.o
495 zebra_ipforward_path="proc";;
496 "/dev/ip")
497 case "$host" in
498 *-nec-sysv4*) IPFORWARD=ipforward_ews.o
499 zebra_ipforward_path="ews";;
paul9c30ab62003-07-08 08:36:17 +0000500 *-freebsd*) IPFORWARD=ipforward_sysctl.o
501 zebra_ipforward_path="sysctl";;
paul7ea487b2003-03-17 02:05:07 +0000502 *) IPFORWARD=ipforward_solaris.o
503 zebra_ipforward_path="solaris";;
504 esac;;
505 *) IPFORWARD=ipforward_sysctl.o
506 zebra_ipforward_path="sysctl";;
507esac])
508AC_SUBST(IPFORWARD)
509
510AC_CHECK_FUNCS(getaddrinfo, [have_getaddrinfo=yes], [have_getaddrinfo=no])
511
512dnl ----------
513dnl IPv6 check
514dnl ----------
515AC_MSG_CHECKING(whether does this OS have IPv6 stack)
516if test "${enable_ipv6}" = "no"; then
517 AC_MSG_RESULT(disabled)
518else
519dnl ----------
520dnl INRIA IPv6
521dnl ----------
paula159ed92003-06-04 11:01:45 +0000522 if grep IPV6_INRIA_VERSION /usr/include/netinet/in.h >/dev/null 2>&1; then
523 zebra_cv_ipv6=yes
524 AC_DEFINE(HAVE_IPV6,1,INRIA IPv6)
525 AC_DEFINE(INRIA_IPV6,1,INRIA IPv6)
526 RIPNGD="ripngd"
527 OSPF6D="ospf6d"
528 LIB_IPV6=""
529 AC_MSG_RESULT(INRIA IPv6)
paul7ea487b2003-03-17 02:05:07 +0000530dnl ---------
531dnl KAME IPv6
532dnl ---------
paula159ed92003-06-04 11:01:45 +0000533 elif grep WIDE /usr/include/netinet6/in6.h >/dev/null 2>&1; then
534 zebra_cv_ipv6=yes
535 AC_DEFINE(HAVE_IPV6,1,KAME IPv6)
536 AC_DEFINE(KAME,1,KAME IPv6)
537 RIPNGD="ripngd"
538 OSPF6D="ospf6d"
539 if test -d /usr/local/v6/lib -a -f /usr/local/v6/lib/libinet6.a; then
paul7ea487b2003-03-17 02:05:07 +0000540 LIB_IPV6="-L/usr/local/v6/lib -linet6"
paula159ed92003-06-04 11:01:45 +0000541 fi
542 AC_MSG_RESULT(KAME)
hasso71c0fb52003-05-25 20:18:13 +0000543dnl -------------------------
544dnl MUSICA IPv6
545dnl default host check
546dnl It is not used by Kheops
547dnl -------------------------
paula159ed92003-06-04 11:01:45 +0000548 elif grep MUSICA /usr/include6/netinet6/in6.h >/dev/null 2>&1; then
549 zebra_cv_ipv6=yes
550 AC_DEFINE(HAVE_IPV6,1,Musicia IPv6)
551 AC_DEFINE(MUSICA,1,Musica IPv6 stack)
552 AC_DEFINE(KAME,1,KAME IPv6 stack)
553 RIPNGD="ripngd"
554 OSPF6D="ospf6d"
555 if test -d /usr/local/v6/lib -a -f /usr/local/v6/lib/libinet6.a; then
hasso71c0fb52003-05-25 20:18:13 +0000556 LIB_IPV6="-L/usr/local/v6/lib -linet6"
paula159ed92003-06-04 11:01:45 +0000557 fi
558 AC_MSG_RESULT(MUSICA)
paul7ea487b2003-03-17 02:05:07 +0000559dnl ---------
560dnl NRL check
561dnl ---------
paula159ed92003-06-04 11:01:45 +0000562 elif grep NRL /usr/include/netinet6/in6.h >/dev/null 2>&1; then
563 zebra_cv_ipv6=yes
564 AC_DEFINE(HAVE_IPV6,1,NRL IPv6)
565 AC_DEFINE(NRL,1,NRL)
566 RIPNGD="ripngd"
567 OSPF6D="ospf6d"
568 if test x"$opsys" = x"bsdi";then
paul7ea487b2003-03-17 02:05:07 +0000569 AC_DEFINE(BSDI_NRL,,BSDI)
570 AC_MSG_RESULT(BSDI_NRL)
paula159ed92003-06-04 11:01:45 +0000571 else
paul7ea487b2003-03-17 02:05:07 +0000572 AC_MSG_RESULT(NRL)
paula159ed92003-06-04 11:01:45 +0000573 fi
paul7ea487b2003-03-17 02:05:07 +0000574dnl ----------
575dnl Linux IPv6
576dnl ----------
paula159ed92003-06-04 11:01:45 +0000577 elif test "${enable_ipv6}" = "yes"; then
578 AC_EGREP_CPP(yes, [
579 #include <linux/version.h>
580 /* 2.1.128 or later */
581 #if LINUX_VERSION_CODE >= 0x020180
582 yes
583 #endif],
584 [zebra_cv_ipv6=yes
585 zebra_cv_linux_ipv6=yes
586 AC_MSG_RESULT(Linux IPv6)])
587 else
588 if test x`ls /proc/net/ipv6_route 2>/dev/null` = x"/proc/net/ipv6_route"
589 then
paul7ea487b2003-03-17 02:05:07 +0000590 zebra_cv_ipv6=yes
591 zebra_cv_linux_ipv6=yes
592 AC_MSG_RESULT(Linux IPv6)
paula159ed92003-06-04 11:01:45 +0000593 fi
594 fi
paul7ea487b2003-03-17 02:05:07 +0000595
paula159ed92003-06-04 11:01:45 +0000596 if test "$zebra_cv_linux_ipv6" = "yes";then
597 AC_MSG_CHECKING(for GNU libc >= 2.1)
598 AC_DEFINE(HAVE_IPV6,1,Linux IPv6)
599 AC_EGREP_CPP(yes, [
paul7ea487b2003-03-17 02:05:07 +0000600#include <features.h>
601#if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1
602 yes
paula159ed92003-06-04 11:01:45 +0000603#endif],
604 [glibc=yes
605 AC_DEFINE(LINUX_IPV6,1,Linux IPv6 stack)
606 AC_MSG_RESULT(yes)],
607 AC_MSG_RESULT(no)
608 )
609 RIPNGD="ripngd"
610 OSPF6D="ospf6d"
611 if test "$glibc" != "yes"; then
paul7ea487b2003-03-17 02:05:07 +0000612 INCLUDES="-I/usr/inet6/include"
613 if test x`ls /usr/inet6/lib/libinet6.a 2>/dev/null` != x;then
614 LIB_IPV6="-L/usr/inet6/lib -linet6"
615 fi
paula159ed92003-06-04 11:01:45 +0000616 fi
617 fi
paul7ea487b2003-03-17 02:05:07 +0000618
619dnl -----------------------
620dnl Set IPv6 related values
621dnl -----------------------
paula159ed92003-06-04 11:01:45 +0000622 LIBS="$LIB_IPV6 $LIBS"
623 AC_SUBST(LIB_IPV6)
paul7ea487b2003-03-17 02:05:07 +0000624
paula159ed92003-06-04 11:01:45 +0000625 if test x"$RIPNGD" = x""; then
626 AC_MSG_RESULT(IPv4 only)
627 fi
paul7ea487b2003-03-17 02:05:07 +0000628fi
629
630dnl --------------------
631dnl Daemon disable check
632dnl --------------------
633if test "${enable_zebra}" = "no";then
634 ZEBRA=""
635else
636 ZEBRA="zebra"
637fi
638
639if test "${enable_bgpd}" = "no";then
640 BGPD=""
641else
642 BGPD="bgpd"
643fi
644
645if test "${enable_ripd}" = "no";then
646 RIPD=""
647else
648 RIPD="ripd"
649fi
650
651if test "${enable_ospfd}" = "no";then
652 OSPFD=""
653else
654 OSPFD="ospfd"
655fi
656
paul1ef74ef2003-03-21 15:16:05 +0000657OSPFCLIENT=""
658if test "${enable_opaque_lsa}" = "yes"; then
659 if test "${enable_ospfapi}" != "no";then
paul9a569842003-03-28 01:45:13 +0000660 AC_DEFINE(SUPPORT_OSPF_API,,OSPFAPI)
paul1ef74ef2003-03-21 15:16:05 +0000661
662 if test "${enable_ospfclient}" != "no";then
663 OSPFCLIENT="ospfclient"
664 fi
665 fi
666
paul7ea487b2003-03-17 02:05:07 +0000667fi
668
669case "${enable_ripngd}" in
670 "yes") RIPNGD="ripngd";;
671 "no" ) RIPNGD="";;
672 * ) ;;
673esac
674
675case "${enable_ospf6d}" in
676 "yes") OSPF6D="ospf6d";;
677 "no" ) OSPF6D="";;
678 * ) ;;
679esac
680
681if test "${enable_bgp_announce}" = "no";then
682 AC_DEFINE(DISABLE_BGP_ANNOUNCE,,Disable BGP installation to zebra)
683fi
684
685AC_SUBST(ZEBRA)
686AC_SUBST(BGPD)
687AC_SUBST(RIPD)
688AC_SUBST(RIPNGD)
689AC_SUBST(OSPFD)
690AC_SUBST(OSPF6D)
691AC_SUBST(VTYSH)
692AC_SUBST(INCLUDES)
693AC_SUBST(CURSES)
694AC_SUBST(OSPFCLIENT)
paul1ef74ef2003-03-21 15:16:05 +0000695AC_SUBST(OSPFAPI)
paul7ea487b2003-03-17 02:05:07 +0000696AC_CHECK_LIB(c, inet_ntop, [AC_DEFINE(HAVE_INET_NTOP,,inet_ntop)])
697AC_CHECK_LIB(c, inet_pton, [AC_DEFINE(HAVE_INET_PTON,,inet_pton)])
698AC_CHECK_LIB(crypt, crypt)
699AC_CHECK_LIB(resolv, res_init)
700AC_CHECK_LIB(m, main)
701
702dnl ---------------------------------------------------
703dnl BSD/OS 4.1 define inet_XtoY function as __inet_XtoY
704dnl ---------------------------------------------------
paula159ed92003-06-04 11:01:45 +0000705AC_CHECK_FUNC(__inet_ntop, AC_DEFINE(HAVE_INET_NTOP,,__inet_ntop))
706AC_CHECK_FUNC(__inet_pton, AC_DEFINE(HAVE_INET_PTON,,__inet_pton))
707AC_CHECK_FUNC(__inet_aton, AC_DEFINE(HAVE_INET_ATON,,__inet_aton))
paul7ea487b2003-03-17 02:05:07 +0000708
709dnl ---------------------------
710dnl check system has GNU regexp
711dnl ---------------------------
712dnl AC_MSG_CHECKING(whether system has GNU regex)
713AC_CHECK_LIB(c, regexec,
714[AC_DEFINE(HAVE_GNU_REGEX,,GNU regexp library)
715 LIB_REGEX=""],
716[LIB_REGEX="regex.o"])
717AC_SUBST(LIB_REGEX)
718
719dnl ------------------
720dnl check SNMP library
721dnl ------------------
722if test "${enable_snmp}" = "yes";then
723dnl AC_CHECK_LIB(snmp, asn_parse_int, HAVE_SNMP=yes)
paul7ea487b2003-03-17 02:05:07 +0000724 if test "${HAVE_SNMP}" = ""; then
paul1ef74ef2003-03-21 15:16:05 +0000725 old_libs="${LIBS}"
726 LIBS="-L/usr/lib"
paul7ea487b2003-03-17 02:05:07 +0000727 unset ac_cv_lib_snmp_asn_parse_int
paul1ef74ef2003-03-21 15:16:05 +0000728 AC_CHECK_LIB(crypto, main, NEED_CRYPTO=yes, )
729 if test "${NEED_CRYPTO}" = ""; then
730 AC_CHECK_LIB(netsnmp, asn_parse_int, [HAVE_NETSNMP=yes; HAVE_SNMP=yes ])
731 else
732 AC_CHECK_LIB(netsnmp, asn_parse_int, [HAVE_NETSNMP=yes; HAVE_SNMP=yes; NEED_CRYPTO=yes;LIBS="$LIBS -lcrypto" ],,"-lcrypto")
733 fi
734 LIBS="${old_libs}"
paul7ea487b2003-03-17 02:05:07 +0000735 fi
paul1ef74ef2003-03-21 15:16:05 +0000736 if test "${HAVE_SNMP}" = ""; then
737 old_libs="${LIBS}"
738 LIBS="-L/usr/lib"
739 unset ac_cv_lib_snmp_asn_parse_int
740 AC_CHECK_LIB(snmp, asn_parse_int, HAVE_SNMP=yes, )
741 if test "${HAVE_SNMP}" = ""; then
742 unset ac_cv_lib_snmp_asn_parse_int
743 AC_CHECK_LIB(crypto, main, NEED_CRYPTO=yes, )
744 if test "${NEED_CRYPTO}" = "yes"; then
745 AC_CHECK_LIB(snmp, asn_parse_int, [HAVE_SNMP=yes; NEED_CRYPTO=yes; LIBS="$LIBS -lcrypto" ],,"-lcrypto")
746 fi
747 fi
748 LIBS="${old_libs}"
749 fi
paul7ea487b2003-03-17 02:05:07 +0000750
751 if test "${HAVE_SNMP}" = ""; then
paul1ef74ef2003-03-21 15:16:05 +0000752 old_libs="${LIBS}"
753 LIBS="-L/usr/local/lib"
754 unset ac_cv_lib_snmp_asn_parse_int
755 AC_CHECK_LIB(snmp, asn_parse_int, HAVE_SNMP=yes)
756 if test "${HAVE_SNMP}" = ""; then
757 unset ac_cv_lib_snmp_asn_parse_int
758 AC_CHECK_LIB(crypto, main, NEED_CRYPTO=yes, )
759 if test "${NEED_CRYPTO}" = "yes"; then
760 AC_CHECK_LIB(snmp, asn_parse_int, [HAVE_SNMP=yes; NEED_CRYPTO=yes; LIBS="$LIBS -lcrypto" ],,"-lcrypto")
761 fi
762 fi
763 LIBS="${old_libs}"
paul7ea487b2003-03-17 02:05:07 +0000764 fi
paul1ef74ef2003-03-21 15:16:05 +0000765
paul7ea487b2003-03-17 02:05:07 +0000766 if test "${HAVE_SNMP}" = "yes"; then
767 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
768 do
769 test -f "${ac_snmp}" && break
770 done
paul1ef74ef2003-03-21 15:16:05 +0000771
paul7ea487b2003-03-17 02:05:07 +0000772 case ${ac_snmp} in
773 /usr/include/net-snmp/*)
774 AC_DEFINE(HAVE_SNMP,,SNMP)
paul1ef74ef2003-03-21 15:16:05 +0000775 AC_DEFINE(HAVE_NETSNMP,,SNMP)
paul7ea487b2003-03-17 02:05:07 +0000776 AC_DEFINE(UCD_COMPATIBLE,,SNMP)
paulac7c4bb2003-03-19 04:25:08 +0000777 CFLAGS="${CFLAGS} -I/usr/include/net-snmp -I/usr/include/net-snmp/library"
778 if test "${HAVE_NETSNMP}" = "yes"; then
paul1ef74ef2003-03-21 15:16:05 +0000779 LIBS="${LIBS} -lnetsnmp"
paulac7c4bb2003-03-19 04:25:08 +0000780 else
paul1ef74ef2003-03-21 15:16:05 +0000781 LIBS="${LIBS} -lsnmp"
paulac7c4bb2003-03-19 04:25:08 +0000782 fi
paul7ea487b2003-03-17 02:05:07 +0000783 ;;
784 /usr/include/ucd-snmp/*)
785 AC_DEFINE(HAVE_SNMP,,SNMP)
786 CFLAGS="${CFLAGS} -I/usr/include/ucd-snmp"
787 LIBS="${LIBS} -lsnmp"
788 ;;
789 /usr/local/include/ucd-snmp/*)
790 AC_DEFINE(HAVE_SNMP,,SNMP)
791 CFLAGS="${CFLAGS} -I/usr/local/include/ucd-snmp"
792 LIBS="${LIBS} -L/usr/local/lib -lsnmp"
793 ;;
794 esac
795 if test "${NEED_CRYPTO}" = "yes"; then
796 LIBS="${LIBS} -lcrypto"
797 fi
798 fi
799fi
800
801dnl ----------------------------
802dnl check sa_len of sockaddr
803dnl ----------------------------
804AC_MSG_CHECKING(whether struct sockaddr has a sa_len field)
805AC_TRY_COMPILE([#include <sys/types.h>
806#include <sys/socket.h>
807],[static struct sockaddr ac_i;int ac_j = sizeof (ac_i.sa_len);],
808[AC_MSG_RESULT(yes)
809 AC_DEFINE(HAVE_SA_LEN,,sa_len)],
810 AC_MSG_RESULT(no))
811
812dnl ----------------------------
813dnl check sin_len of sockaddr_in
814dnl ----------------------------
815AC_MSG_CHECKING(whether struct sockaddr_in has a sin_len field)
816AC_TRY_COMPILE([#include <sys/types.h>
817#include <netinet/in.h>
818],[static struct sockaddr_in ac_i;int ac_j = sizeof (ac_i.sin_len);],
819[AC_MSG_RESULT(yes)
820 AC_DEFINE(HAVE_SIN_LEN,,sin_len)],
821 AC_MSG_RESULT(no))
822
823dnl ----------------------------
824dnl check sun_len of sockaddr_un
825dnl ----------------------------
826AC_MSG_CHECKING(whether struct sockaddr_un has a sun_len field)
827AC_TRY_COMPILE([#include <sys/types.h>
828#include <sys/un.h>
829],[static struct sockaddr_un ac_i;int ac_j = sizeof (ac_i.sun_len);],
830[AC_MSG_RESULT(yes)
831 AC_DEFINE(HAVE_SUN_LEN,,sun_len)],
832 AC_MSG_RESULT(no))
833
834dnl -----------------------------------
835dnl check sin6_scope_id of sockaddr_in6
836dnl -----------------------------------
837if test "$zebra_cv_ipv6" = yes; then
838 AC_MSG_CHECKING(whether struct sockaddr_in6 has a sin6_scope_id field)
839 AC_TRY_COMPILE([#include <sys/types.h>
840#include <netinet/in.h>
841],[static struct sockaddr_in6 ac_i;int ac_j = sizeof (ac_i.sin6_scope_id);],
842[AC_MSG_RESULT(yes)
843 AC_DEFINE(HAVE_SIN6_SCOPE_ID,,scope id)],
844 AC_MSG_RESULT(no))
845fi
846
847dnl ----------------------------
848dnl check socklen_t exist or not
849dnl ----------------------------
850AC_MSG_CHECKING(whther socklen_t is defined)
851AC_TRY_COMPILE([#include <sys/types.h>
852#include <sys/socket.h>
853#include <netinet/in.h>
854],[socklen_t ac_x;],
855[AC_MSG_RESULT(yes)
856 AC_DEFINE(HAVE_SOCKLEN_T,,socklen_t)],
857 AC_MSG_RESULT(no))
858
859dnl ------------------------
860dnl check struct sockaddr_dl
861dnl ------------------------
862AC_MSG_CHECKING(whether struct sockaddr_dl exist)
863AC_EGREP_HEADER(sockaddr_dl,
864net/if_dl.h,
865[AC_MSG_RESULT(yes)
866 AC_DEFINE(HAVE_SOCKADDR_DL,,sockaddr_dl)],
867 AC_MSG_RESULT(no))
868
869dnl --------------------------
870dnl check structure ifaliasreq
871dnl --------------------------
872AC_MSG_CHECKING(whether struct ifaliasreq exist)
873AC_EGREP_HEADER(ifaliasreq,
874net/if.h,
875[AC_MSG_RESULT(yes)
876 AC_DEFINE(HAVE_IFALIASREQ,,ifaliasreq)],
877 AC_MSG_RESULT(no))
878
879dnl ----------------------------
880dnl check structure in6_aliasreq
881dnl ----------------------------
hasso71c0fb52003-05-25 20:18:13 +0000882AC_MSG_CHECKING(whether struct in6_aliasreq exist)
paul7ea487b2003-03-17 02:05:07 +0000883AC_EGREP_HEADER(in6_aliasreq,
884netinet6/in6_var.h,
885[AC_MSG_RESULT(yes)
886 AC_DEFINE(HAVE_IN6_ALIASREQ,,in6_aliasreq)],
887 AC_MSG_RESULT(no))
888
hasso71c0fb52003-05-25 20:18:13 +0000889dnl -----------------------------------
890dnl check ifra_lifetime of in6_aliasreq
891dnl -----------------------------------
892AC_MSG_CHECKING(whether in6_aliasreq.ifra_lifetime exist)
893AC_TRY_COMPILE([#include <sys/types.h>
894#include <netinet6/in6_var.h>
895],[static struct if6_aliasreq ac_i;int ac_j = sizeof (ac_i.ifra_lifetime);],
896[AC_MSG_RESULT(yes)
paula159ed92003-06-04 11:01:45 +0000897 AC_DEFINE(HAVE_IFRA_LIFETIME,,Have in6_aliasreq.ifra_lifetime)],
hasso71c0fb52003-05-25 20:18:13 +0000898 AC_MSG_RESULT(no))
899
paul7ea487b2003-03-17 02:05:07 +0000900dnl ---------------------------
901dnl check structure rt_addrinfo
902dnl ---------------------------
903AC_MSG_CHECKING(whether struct rt_addrinfo exist)
904AC_EGREP_HEADER(rt_addrinfo,
905net/route.h,
906[AC_MSG_RESULT(yes)
907 AC_DEFINE(HAVE_RT_ADDRINFO,,rt_addrinfo)],
908 AC_MSG_RESULT(no))
909
910dnl --------------------------
911dnl check structure in_pktinfo
912dnl --------------------------
913AC_MSG_CHECKING(whether struct in_pktinfo exist)
914AC_TRY_COMPILE([#include <netinet/in.h>
915],[struct in_pktinfo ac_x;],
916[AC_MSG_RESULT(yes)
917 AC_DEFINE(HAVE_INPKTINFO,,in_pktinfo)],
918 AC_MSG_RESULT(no))
919
920dnl --------------------------------------
921dnl checking for getrusage struct and call
922dnl --------------------------------------
923AC_MSG_CHECKING(whether getrusage is available)
924AC_TRY_COMPILE([#include <sys/resource.h>
925],[struct rusage ac_x; getrusage (RUSAGE_SELF, &ac_x);],
926[AC_MSG_RESULT(yes)
927 AC_DEFINE(HAVE_RUSAGE,,rusage)],
928 AC_MSG_RESULT(no))
929
pauledd7c242003-06-04 13:59:38 +0000930dnl -------------------
931dnl capabilities checks
932dnl -------------------
933AC_MSG_CHECKING(whether prctl PR_SET_KEEPCAPS is available)
934AC_TRY_COMPILE([#include <sys/prctl.h>],[prctl(PR_SET_KEEPCAPS, 1, 0, 0, 0);],
935 [AC_MSG_RESULT(yes)
936 AC_DEFINE(HAVE_PR_SET_KEEPCAPS,,prctl)
paule8f29842003-08-12 13:08:31 +0000937 quagga_ac_keepcaps="yes"],
pauledd7c242003-06-04 13:59:38 +0000938 AC_MSG_RESULT(no)
939)
paule8f29842003-08-12 13:08:31 +0000940if test x"${quagga_ac_keepcaps}" = x"yes"; then
pauledd7c242003-06-04 13:59:38 +0000941 AC_CHECK_HEADERS(sys/capability.h)
942fi
943if test x"${ac_cv_header_sys_capability_h}" = x"yes"; then
944 AC_CHECK_LIB(cap, cap_init,
945 [AC_DEFINE(HAVE_LCAPS,1,Capabilities)
946 LIBCAP="-lcap"
947 ]
948 )
949fi
950AC_SUBST(LIBCAP)
951
paulfb2d1502003-06-04 09:40:54 +0000952dnl ---------------------------
953dnl check for glibc 'backtrace'
954dnl ---------------------------
955if test "${glibc}" = "yes"; then
956 AC_CHECK_HEADER(execinfo.h)
957fi
958if test x"${ac_cv_header_execinfo_h}" = x"yes"; then
959 AC_CHECK_FUNC(backtrace,
960 [AC_DEFINE(HAVE_GLIBC_BACKTRACE,,Glibc backtrace)]
961 )
962fi
963
paul408ad942003-05-20 00:03:33 +0000964dnl ----------
965dnl configure date
966dnl ----------
967CONFDATE=`date '+%Y%m%d'`
968AC_SUBST(CONFDATE)
969
paul7ea487b2003-03-17 02:05:07 +0000970dnl ------------------------------
paula159ed92003-06-04 11:01:45 +0000971dnl set paths for state directory
paul23bd12c2003-04-07 06:11:09 +0000972dnl ------------------------------
973if test "${prefix}" = "NONE"; then
paule8f29842003-08-12 13:08:31 +0000974 quagga_statedir_prefix="";
paul23bd12c2003-04-07 06:11:09 +0000975else
paule8f29842003-08-12 13:08:31 +0000976 quagga_statedir_prefix=${prefix}
paul23bd12c2003-04-07 06:11:09 +0000977fi
978if test "${localstatedir}" = '${prefix}/var'; then
paula159ed92003-06-04 11:01:45 +0000979 AC_CACHE_CHECK(state directory,ac_statedir,
paule8f29842003-08-12 13:08:31 +0000980 [for QUAGGA_STATE_DIR in ${quagga_statedir_prefix}/var/run dnl
981 ${quagga_statedir_prefix}/var/adm dnl
982 ${quagga_statedir_prefix}/etc dnl
paula159ed92003-06-04 11:01:45 +0000983 /var/run dnl
984 /var/adm dnl
985 /etc dnl
986 /dev/null;
paul23bd12c2003-04-07 06:11:09 +0000987 do
paule8f29842003-08-12 13:08:31 +0000988 test -d $QUAGGA_STATE_DIR && break
paul23bd12c2003-04-07 06:11:09 +0000989 done
paule8f29842003-08-12 13:08:31 +0000990 quagga_statedir=$QUAGGA_STATE_DIR])
paul23bd12c2003-04-07 06:11:09 +0000991else
paule8f29842003-08-12 13:08:31 +0000992 quagga_statedir=${localstatedir}
paula159ed92003-06-04 11:01:45 +0000993 AC_MSG_CHECKING(directory to use for state file)
paule8f29842003-08-12 13:08:31 +0000994 AC_MSG_RESULT(${quagga_statedir})
paul23bd12c2003-04-07 06:11:09 +0000995fi
paule8f29842003-08-12 13:08:31 +0000996if test $quagga_statedir = "/dev/null"; then
paula159ed92003-06-04 11:01:45 +0000997 AC_MSG_ERROR('STATE DIRECTORY NOT FOUND! FIX OR SPECIFY --localstatedir!')
998fi
999
paule8f29842003-08-12 13:08:31 +00001000AC_DEFINE_UNQUOTED(PATH_ZEBRA_PID, "$quagga_statedir/zebra.pid",zebra PID)
1001AC_DEFINE_UNQUOTED(PATH_RIPD_PID, "$quagga_statedir/ripd.pid",ripd PID)
1002AC_DEFINE_UNQUOTED(PATH_RIPNGD_PID, "$quagga_statedir/ripngd.pid",ripngd PID)
1003AC_DEFINE_UNQUOTED(PATH_BGPD_PID, "$quagga_statedir/bgpd.pid",bgpd PID)
1004AC_DEFINE_UNQUOTED(PATH_OSPFD_PID, "$quagga_statedir/ospfd.pid",ospfd PID)
1005AC_DEFINE_UNQUOTED(PATH_OSPF6D_PID, "$quagga_statedir/ospf6d.pid",ospf6d PID)
1006AC_DEFINE_UNQUOTED(ZEBRA_SERV_PATH, "$quagga_statedir/zserv.api",zebra api socket)
1007AC_DEFINE_UNQUOTED(ZEBRA_VTYSH_PATH, "$quagga_statedir/zebra.vty",zebra vty socket)
1008AC_DEFINE_UNQUOTED(RIP_VTYSH_PATH, "$quagga_statedir/ripd.vty",rip vty socket)
1009AC_DEFINE_UNQUOTED(RIPNG_VTYSH_PATH, "$quagga_statedir/ripngd.vty",ripng vty socket)
1010AC_DEFINE_UNQUOTED(BGP_VTYSH_PATH, "$quagga_statedir/bgpd.vty",bgpd vty socket)
1011AC_DEFINE_UNQUOTED(OSPF_VTYSH_PATH, "$quagga_statedir/ospfd.vty",ospfd vty socket)
1012AC_DEFINE_UNQUOTED(OSPF6_VTYSH_PATH, "$quagga_statedir/ospf6d.vty",ospf6d vty socket)
paul7ea487b2003-03-17 02:05:07 +00001013
1014dnl ---------------------------
1015dnl Check htonl works correctly
1016dnl ---------------------------
1017AC_MSG_CHECKING(for working htonl)
1018AC_CACHE_VAL(ac_cv_htonl_works, [
1019AC_TRY_LINK([#ifdef HAVE_SYS_TYPES_H
1020#include <sys/types.h>
1021#endif
1022#ifdef HAVE_NETDB_H
1023#include <netdb.h>
1024#endif
1025#ifdef HAVE_NETINET_IN_H
1026#include <netinet/in.h>
1027#endif],
1028[htonl (0);],
1029ac_cv_htonl_works=yes,
1030ac_cv_htonl_works=no)])
1031AC_MSG_RESULT($ac_cv_htonl_works)
1032
paul6382b6f2003-05-20 00:17:45 +00001033AC_OUTPUT(Makefile lib/Makefile zebra/Makefile ripd/Makefile
1034 ripngd/Makefile bgpd/Makefile ospfd/Makefile
1035 ospf6d/Makefile vtysh/Makefile doc/Makefile
1036 ospfclient/Makefile
paulfa1253d2003-09-24 05:09:26 +00001037 redhat/quagga.spec
1038 lib/version.h)
paul7ea487b2003-03-17 02:05:07 +00001039
1040echo "
1041zebra configuration
1042-------------------
paulfa1253d2003-09-24 05:09:26 +00001043quagga version : ${PACKAGE_VERSION}
paul7ea487b2003-03-17 02:05:07 +00001044host operationg system : ${host_os}
1045source code location : ${srcdir}
1046compiler : ${CC}
1047compiler flags : ${CFLAGS}
hasso71c0fb52003-05-25 20:18:13 +00001048linker flags : ${LDFLAGS} ${LIBS}
paule8f29842003-08-12 13:08:31 +00001049state file directory : ${quagga_statedir}
pauldc7a2bf2003-10-22 00:07:44 +00001050config file directory : `eval echo \`echo ${sysconfdir}\``
paul8d4aee52003-06-06 00:30:35 +00001051user to run as : ${enable_user}
1052group to run as : ${enable_group}
1053group for vty sockets : ${enable_vty_group}
pauldc7a2bf2003-10-22 00:07:44 +00001054
1055The above user and group must have read/write access to the state file
1056directory and to the config files in the config file directory.
paul7ea487b2003-03-17 02:05:07 +00001057"