blob: 632de2ac0e1cc2329c6ef377c0bf99b958c6dd99 [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##
gdt87efd642004-06-30 17:36:11 +00008## $Id: configure.ac,v 1.55 2004/06/30 17:36:11 gdt Exp $
paule8f29842003-08-12 13:08:31 +00009AC_PREREQ(2.53)
paul7ea487b2003-03-17 02:05:07 +000010
paul8b338fe2004-05-03 12:50:39 +000011AC_INIT(quagga, 0.96.5, [http://bugzilla.quagga.net])
paulfa1253d2003-09-24 05:09:26 +000012AC_CONFIG_SRCDIR(lib/zebra.h)
gdt81b81822004-04-07 22:48:47 +000013AM_INIT_AUTOMAKE(1.6)
paul7ea487b2003-03-17 02:05:07 +000014AM_CONFIG_HEADER(config.h)
15
gdtd6b72f72003-12-03 17:24:27 +000016dnl default is to match previous behavior
gdtc4f0efe2003-12-04 15:39:25 +000017exampledir=${sysconfdir}
gdtd6b72f72003-12-03 17:24:27 +000018AC_ARG_ENABLE([exampledir],
19 AC_HELP_STRING([--enable-exampledir],
20 [specify alternate directory for examples]),
21 exampledir="$enableval",)
gdtc4f0efe2003-12-04 15:39:25 +000022dnl XXX add --exampledir to autoconf standard directory list somehow
gdtd6b72f72003-12-03 17:24:27 +000023AC_SUBST(exampledir)
24
paul7ea487b2003-03-17 02:05:07 +000025dnl -----------------------------------
26dnl Get hostname and other information.
27dnl -----------------------------------
28AC_CANONICAL_HOST
29
30dnl ------------
31dnl Check CFLAGS
32dnl ------------
33AC_ARG_WITH(cflags,
34[ --with-cflags Set CFLAGS for use in compilation.])
35if test "x$with_cflags" != "x" ; then
36 CFLAGS="$with_cflags" ; cflags_specified=yes ;
37elif test -n "$CFLAGS" ; then
38 cflags_specified=yes ;
39fi
40
41dnl --------
42dnl Check CC
43dnl --------
44AC_PROG_CC
45
46dnl -----------------------------------------
47dnl If CLFAGS doesn\'t exist set default value
48dnl -----------------------------------------
49if test "x$cflags_specified" = "x" ; then
50 CFLAGS="$CFLAGS -Wall"
51fi
52
53dnl --------------
54dnl Check programs
55dnl --------------
56AC_PROG_CPP
57AC_PROG_INSTALL
58AC_PROG_MAKE_SET
59AC_CHECK_TOOL(AR, ar)
60AC_CHECK_TOOL(RANLIB, ranlib, :)
61
62dnl ---------
63dnl AIX check
64dnl ---------
65AC_AIX
66
gdt87efd642004-06-30 17:36:11 +000067dnl -------
68dnl libtool
69dnl -------
70AM_PROG_LIBTOOL
71
paul7ea487b2003-03-17 02:05:07 +000072dnl ----------------------
73dnl Packages configuration
74dnl ----------------------
75AC_ARG_ENABLE(vtysh,
gdtfc9d0742004-06-30 14:25:12 +000076[ --enable-vtysh include integrated vty shell for Quagga])
paul7ea487b2003-03-17 02:05:07 +000077AC_ARG_ENABLE(ipv6,
78[ --disable-ipv6 turn off IPv6 related features and daemons])
79AC_ARG_ENABLE(zebra,
80[ --disable-zebra do not build zebra daemon])
81AC_ARG_ENABLE(bgpd,
82[ --disable-bgpd do not build bgpd])
83AC_ARG_ENABLE(ripd,
84[ --disable-ripd do not build ripd])
85AC_ARG_ENABLE(ripngd,
86[ --disable-ripngd do not build ripngd])
87AC_ARG_ENABLE(ospfd,
88[ --disable-ospfd do not build ospfd])
paul7ea487b2003-03-17 02:05:07 +000089AC_ARG_ENABLE(ospf6d,
90[ --disable-ospf6d do not build ospf6d])
jardin9e867fe2003-12-23 08:56:18 +000091AC_ARG_ENABLE(isisd,
92[ --disable-isisd do not build isisd])
paul7ea487b2003-03-17 02:05:07 +000093AC_ARG_ENABLE(bgp-announce,
94[ --disable-bgp-announce, turn off BGP route announcement])
95AC_ARG_ENABLE(netlink,
96[ --enable-netlink force to use Linux netlink interface])
97AC_ARG_ENABLE(broken-aliases,
98[ --enable-broken-aliases enable aliases as distinct interfaces for Linux 2.2.X])
99AC_ARG_ENABLE(snmp,
100[ --enable-snmp enable SNMP support])
101AC_ARG_WITH(libpam,
102[ --with-libpam use libpam for PAM support in vtysh])
hasso71c0fb52003-05-25 20:18:13 +0000103AC_ARG_ENABLE(tcp-zebra,
paul7ea487b2003-03-17 02:05:07 +0000104[ --enable-tcp-zebra enable TCP/IP socket connection between zebra and protocol daemon])
paul7ea487b2003-03-17 02:05:07 +0000105AC_ARG_ENABLE(opaque-lsa,
paul1ef74ef2003-03-21 15:16:05 +0000106[ --enable-opaque-lsa enable OSPF Opaque-LSA with OSPFAPI support (RFC2370)])
107AC_ARG_ENABLE(ospfapi,
108[ --disable-ospfapi do not build OSPFAPI to access the OSPF LSA Database,
109 (this is the default if --enable-opaque-lsa is not set)])
110AC_ARG_ENABLE(ospfclient,
111[ --disable-ospfclient do not build OSPFAPI client for OSPFAPI,
112 (this is the default if --disable-ospfapi is set)])
paul7ea487b2003-03-17 02:05:07 +0000113AC_ARG_ENABLE(ospf-te,
114[ --enable-ospf-te enable Traffic Engineering Extension to OSPF])
115AC_ARG_ENABLE(multipath,
116[ --enable-multipath=ARG enable multipath function, ARG must be digit])
paule8f29842003-08-12 13:08:31 +0000117AC_ARG_ENABLE(quagga_user,
118[ --enable-user=ARG user to run Quagga suite as (default quagga)])
119AC_ARG_ENABLE(quagga_group,
120[ --enable-group=ARG group to run Quagga suite as (default quagga)])
pauledd7c242003-06-04 13:59:38 +0000121AC_ARG_ENABLE(vty_group,
122[ --enable-vty-group=ARG set vty sockets to have specified group as owner])
gdtaa593d52003-12-22 20:15:53 +0000123AC_ARG_ENABLE(configfile_mask,
124[ --enable-configfile-mask=ARG set mask for config files])
125AC_ARG_ENABLE(logfile_mask,
126[ --enable-logfile-mask=ARG set mask for log files])
pauledd7c242003-06-04 13:59:38 +0000127
hasso71c0fb52003-05-25 20:18:13 +0000128AC_ARG_ENABLE(rtadv,
gdtd2a0ccc2003-12-03 18:13:48 +0000129[ --disable-rtadv disable IPV6 router advertisement feature])
hassoca776982004-06-12 14:33:05 +0000130AC_ARG_ENABLE(irdp,
131[ --enable-irdp enable IRDP server support in zebra])
hasso41d3fc92004-04-06 11:59:00 +0000132AC_ARG_ENABLE(capabilities,
133[ --disable-capabilities disable using POSIX capabilities])
paul7ea487b2003-03-17 02:05:07 +0000134
135if test "${enable_broken_aliases}" = "yes"; then
136 if test "${enable_netlink}" = "yes"
137 then
138 echo "Sorry, you can't use netlink with broken aliases"
139 exit 1
140 fi
141 AC_DEFINE(HAVE_BROKEN_ALIASES,,Broken Alias)
142 enable_netlink=no
143fi
144
145if test "${enable_tcp_zebra}" = "yes"; then
146 AC_DEFINE(HAVE_TCP_ZEBRA,,Use TCP for zebra communication)
147fi
148
paul7ea487b2003-03-17 02:05:07 +0000149if test "${enable_opaque_lsa}" = "yes"; then
150 AC_DEFINE(HAVE_OPAQUE_LSA,,OSPF Opaque LSA)
151fi
152
153if test "${enable_ospf_te}" = "yes"; then
154 AC_DEFINE(HAVE_OPAQUE_LSA,,OSPF Opaque LSA)
155 AC_DEFINE(HAVE_OSPF_TE,,OSPF TE)
156fi
157
gdtd2a0ccc2003-12-03 18:13:48 +0000158AC_MSG_CHECKING(if zebra should be configurable to send Route Advertisements)
159if test "${enable_rtadv}" != "no"; then
hasso71c0fb52003-05-25 20:18:13 +0000160 AC_MSG_RESULT(yes)
gdtd2a0ccc2003-12-03 18:13:48 +0000161 AC_DEFINE(HAVE_RTADV,,Enable IPv6 Routing Advertisement support)
paul2487bea2003-05-25 23:51:31 +0000162else
163 AC_MSG_RESULT(no)
hasso71c0fb52003-05-25 20:18:13 +0000164fi
paul7ea487b2003-03-17 02:05:07 +0000165
hassoca776982004-06-12 14:33:05 +0000166if test "${enable_irdp}" = "yes"; then
167 AC_DEFINE(HAVE_IRDP,, IRDP )
168fi
169
paul79cb2162003-06-06 12:19:53 +0000170if test "${enable_user}" = "yes" || test x"${enable_user}" = x""; then
paule8f29842003-08-12 13:08:31 +0000171 enable_user="quagga"
pauledd7c242003-06-04 13:59:38 +0000172elif test "${enable_user}" = "no"; then
173 enable_user="root"
174fi
paule8f29842003-08-12 13:08:31 +0000175AC_DEFINE_UNQUOTED(QUAGGA_USER, "${enable_user}", Quagga User)
pauledd7c242003-06-04 13:59:38 +0000176
paul79cb2162003-06-06 12:19:53 +0000177if test "${enable_group}" = "yes" || test x"${enable_group}" = x""; then
paule8f29842003-08-12 13:08:31 +0000178 enable_group="quagga"
pauledd7c242003-06-04 13:59:38 +0000179elif test "${enable_group}" = "no"; then
180 enable_group="root"
181fi
paule8f29842003-08-12 13:08:31 +0000182AC_DEFINE_UNQUOTED(QUAGGA_GROUP, "${enable_group}", Quagga Group)
pauledd7c242003-06-04 13:59:38 +0000183
184if test x"${enable_vty_group}" = x"yes" ; then
paul8d4aee52003-06-06 00:30:35 +0000185 AC_MSG_ERROR([--enable-vty-group requires a group as argument, not yes])
paul79cb2162003-06-06 12:19:53 +0000186elif test x"${enable_vty_group}" != x""; then
paul8d4aee52003-06-06 00:30:35 +0000187 if test x"${enable_vty_group}" != x"no"; then
pauledd7c242003-06-04 13:59:38 +0000188 AC_DEFINE_UNQUOTED(VTY_GROUP, "${enable_vty_group}", VTY Sockets Group)
189 fi
190fi
191
gdtaa593d52003-12-22 20:15:53 +0000192enable_configfile_mask=${enable_configfile_mask:-0600}
193AC_DEFINE_UNQUOTED(CONFIGFILE_MASK, ${enable_configfile_mask}, Mask for config files)
194
195enable_logfile_mask=${enable_logfile_mask:-0600}
196AC_DEFINE_UNQUOTED(LOGFILE_MASK, ${enable_logfile_mask}, Mask for log files)
197
paul7ea487b2003-03-17 02:05:07 +0000198changequote(, )dnl
199
200MULTIPATH_NUM=1
201
202case "${enable_multipath}" in
203 [0-9]|[1-9][0-9])
204 MULTIPATH_NUM="${enable_multipath}"
205 ;;
206 "")
207 ;;
208 *)
209 echo "Please specify digit to --enable-multipath ARG."
210 exit 1
211 ;;
212esac
213
214changequote([, ])dnl
215
216AC_SUBST(MULTIPATH_NUM)
217
218dnl -------------------
219dnl Check header files.
220dnl -------------------
pauldc7a2bf2003-10-22 00:07:44 +0000221AC_HEADER_STDC
222AC_CHECK_HEADERS([string.h stropts.h sys/conf.h sys/ksym.h sys/time.h \
223 sys/times.h sys/select.h sys/sysctl.h sys/sockio.h \
224 sys/types.h linux/version.h kvm.h netdb.h asm/types.h \
225 libutil.h limits.h])
226
paul835b7f12003-10-30 21:59:57 +0000227AC_CHECK_HEADERS([sys/socket.h netinet/in_systm.h netinet/in.h \
paulf3bd1a72003-11-02 07:29:11 +0000228 net/if_dl.h net/netopt.h inet/nd.h net/route.h \
paul835b7f12003-10-30 21:59:57 +0000229 net/if.h net/if_var.h netinet/in_var.h])
pauldc7a2bf2003-10-22 00:07:44 +0000230
gdtfa3232e2003-12-03 17:52:30 +0000231dnl V6 headers are checked below, after we check for v6
paul7ea487b2003-03-17 02:05:07 +0000232
233dnl check some types
234AC_C_CONST
235dnl AC_TYPE_PID_T
236AC_TYPE_SIGNAL
237
238dnl Some systems (Solaris 2.x) require libnsl (Network Services Library)
239case "$host" in
paul19877dd2004-05-11 10:49:35 +0000240 [*-sunos5.[6-8]*] | [*-solaris2.[6-8]*])
paul7ea487b2003-03-17 02:05:07 +0000241 opsys=sol2-6
paul19877dd2004-05-11 10:49:35 +0000242 AC_DEFINE(SUNOS_56, 1, SunOS 5.6 to 5.8)
243 AC_DEFINE(SUNOS_5, 1, SunOS 5)
paul7ea487b2003-03-17 02:05:07 +0000244 AC_CHECK_LIB(xnet, main)
245 CURSES=-lcurses
246 ;;
paul19877dd2004-05-11 10:49:35 +0000247 [*-sunos5.[8-9]] | [*-sunos5.1[0-9]] \
248 | [*-solaris2.[8-9]] | [*-solaris2.1[0-9]])
249 opsys=sol9
250 AC_DEFINE(SUNOS_59,,SunOS 5.9 up)
251 AC_DEFINE(SUNOS_5, 1, SunOS 5)
252 AC_CHECK_LIB(socket, main)
253 AC_CHECK_LIB(nsl, main)
254 CURSES=-lcurses
255 ;;
paul7ea487b2003-03-17 02:05:07 +0000256 *-sunos5* | *-solaris2*)
paul19877dd2004-05-11 10:49:35 +0000257 AC_DEFINE(SUNOS_5,,SunOS 5, Unknown SunOS)
paul7ea487b2003-03-17 02:05:07 +0000258 AC_CHECK_LIB(socket, main)
259 AC_CHECK_LIB(nsl, main)
260 CURSES=-lcurses
261 ;;
262 *-linux-*)
263 opsys=gnu-linux
264 AC_DEFINE(GNU_LINUX,,GNU Linux)
265 ;;
266 *-nec-sysv4*)
267 AC_CHECK_LIB(nsl, gethostbyname)
268 AC_CHECK_LIB(socket, socket)
269 ;;
270 *-freebsd3.2)
271 AC_DEFINE(FREEBSD_32,,FreeBSD 3.2)
272 ;;
273 *-openbsd*)
274 opsys=openbsd
275 AC_DEFINE(OPEN_BSD,,OpenBSD)
276 ;;
277 *-bsdi*)
278 opsys=bsdi
279 OTHER_METHOD="mtu_kvm.o"
280 AC_CHECK_LIB(kvm, main)
281 ;;
paul49e3b3c2003-10-23 20:39:50 +0000282 *-irix6.5)
pauldc7a2bf2003-10-22 00:07:44 +0000283 opsys=irix
284 AC_DEFINE(IRIX_65,,IRIX 6.5)
285 ;;
paul7ea487b2003-03-17 02:05:07 +0000286esac
287
288dnl ---------------------
289dnl Integrated VTY option
290dnl ---------------------
291case "${enable_vtysh}" in
292 "yes") VTYSH="vtysh";
293 AC_DEFINE(VTYSH,,VTY shell)
gdtfc9d0742004-06-30 14:25:12 +0000294 AC_PATH_PROG(PERL, perl)
295dnl Vtysh uses libreadline, which looks for termcap functions at
296dnl configure time. We follow readline's search order.
297dnl The required procedures are in libtermcap on NetBSD, in
298dnl [TODO] on Linux, and in [TODO] on Solaris.
299 AC_CHECK_LIB(termcap, tputs, ,
300 AC_CHECK_LIB(tinfo, tputs, ,
301 AC_CHECK_LIB(curses, tputs, ,
302 AC_CHECK_LIB(ncurses, tputs))))
paul7ea487b2003-03-17 02:05:07 +0000303 AC_CHECK_LIB(readline, main)
304 if test $ac_cv_lib_readline_main = no; then
gdtfc9d0742004-06-30 14:25:12 +0000305 AC_MSG_ERROR([vtysh needs libreadline but was not found and usable on your system.])
paul7ea487b2003-03-17 02:05:07 +0000306 fi
307 AC_CHECK_HEADER(readline/history.h)
308 if test $ac_cv_header_readline_history_h = no;then
309 AC_MSG_ERROR([readline is too old to have readline/history.h, please update to the latest readline library.])
310 fi
paul3d3de8c2003-05-23 10:33:49 +0000311 AC_CHECK_LIB(readline, rl_completion_matches)
312 if test $ac_cv_lib_readline_rl_completion_matches = no; then
313 AC_DEFINE(rl_completion_matches,completion_matches,Old readline)
314 fi
315 ;;
paul7ea487b2003-03-17 02:05:07 +0000316 "no" ) VTYSH="";;
317 * ) ;;
318esac
319
320dnl ----------
321dnl PAM module
322dnl ----------
323if test "$with_libpam" = "yes"; then
paul24cd4352003-05-06 12:16:27 +0000324 AC_CHECK_HEADER(security/pam_misc.h)
325 if test "$ac_cv_header_security_pam_misc_h" = yes; then
326 AC_DEFINE(HAVE_PAM_MISC_H,,Have pam_misc.h)
327 AC_DEFINE(PAM_CONV_FUNC,misc_conv,Have misc_conv)
328 pam_conv_func="misc_conv"
paul24cd4352003-05-06 12:16:27 +0000329 fi
paul24cd4352003-05-06 12:16:27 +0000330 AC_CHECK_HEADER(security/openpam.h)
331 if test "$ac_cv_header_security_openpam_h" = yes; then
332 AC_DEFINE(HAVE_OPENPAM_H,,Have openpam.h)
333 AC_DEFINE(PAM_CONV_FUNC,openpam_ttyconv,Have openpam_ttyconv)
334 pam_conv_func="openpam_ttyconv"
paul24cd4352003-05-06 12:16:27 +0000335 fi
336 if test -z "$ac_cv_header_security_pam_misc_h$ac_cv_header_security_openpam_h" ; then
337 AC_MSG_WARN([*** pam support will not be built ***])
338 with_libpam="no"
339 fi
340fi
341
342if test "$with_libpam" = "yes"; then
paul7ea487b2003-03-17 02:05:07 +0000343dnl took this test from proftpd's configure.in and suited to our needs
344dnl -------------------------------------------------------------------------
345dnl
346dnl This next check looks funky due to a linker problem with some versions
347dnl of the PAM library. Prior to 0.72 release, the Linux PAM shared library
348dnl omitted requiring libdl linking information. PAM-0.72 or better ships
349dnl with RedHat 6.2 and Debian 2.2 or better.
350AC_CHECK_LIB(pam, pam_start,
paul24cd4352003-05-06 12:16:27 +0000351 [AC_CHECK_LIB(pam, $pam_conv_func,
paul7ea487b2003-03-17 02:05:07 +0000352 [AC_DEFINE(USE_PAM,,Use PAM for authentication)
353 LIBPAM="-lpam"],
354 [AC_DEFINE(USE_PAM,,Use PAM for authentication)
355 LIBPAM="-lpam -lpam_misc"]
356 )
357 ],
358
359 [AC_CHECK_LIB(pam, pam_end,
paul24cd4352003-05-06 12:16:27 +0000360 [AC_CHECK_LIB(pam, $pam_conv_func,
paula159ed92003-06-04 11:01:45 +0000361 [AC_DEFINE(USE_PAM,,Use PAM for authentication)
paul7ea487b2003-03-17 02:05:07 +0000362 LIBPAM="-lpam -ldl"],
paula159ed92003-06-04 11:01:45 +0000363 [AC_DEFINE(USE_PAM,,Use PAM for authentication)
paul7ea487b2003-03-17 02:05:07 +0000364 LIBPAM="-lpam -ldl -lpam_misc"]
365 )
366 ],AC_MSG_WARN([*** pam support will not be built ***]),
367 [-ldl])
368 ]
369)
370fi
371AC_SUBST(LIBPAM)
372
373dnl -------------------------------
374dnl Endian-ness check
375dnl -------------------------------
376AC_WORDS_BIGENDIAN
377
378dnl -------------------------------
379dnl check the size in byte of the C
380dnl -------------------------------
381dnl AC_CHECK_SIZEOF(char)
382dnl AC_CHECK_SIZEOF(int)
383dnl AC_CHECK_SIZEOF(short)
384dnl AC_CHECK_SIZEOF(long)
385
386dnl ----------------------------
387dnl check existance of functions
388dnl ----------------------------
paul49e3b3c2003-10-23 20:39:50 +0000389AC_CHECK_FUNCS(memset memcpy strerror inet_aton daemon snprintf vsnprintf \
paul04bd4842003-10-24 04:24:39 +0000390 strlcat strlcpy if_nametoindex if_indextoname getifaddrs \
391 fcntl)
paula159ed92003-06-04 11:01:45 +0000392AC_CHECK_FUNCS(setproctitle, ,
393 [AC_CHECK_LIB(util, setproctitle,
394 [LIBS="$LIBS -lutil"
395 AC_DEFINE(HAVE_SETPROCTITLE,, Have setproctitle)
396 ]
397 )
398 ]
399)
paul7ea487b2003-03-17 02:05:07 +0000400
401dnl ------------------------------------
402dnl Determine routing get and set method
403dnl ------------------------------------
404AC_MSG_CHECKING(zebra between kernel interface method)
405if test x"$opsys" = x"gnu-linux"; then
406 if test "${enable_netlink}" = "yes";then
407 AC_MSG_RESULT(netlink)
408 RT_METHOD=rt_netlink.o
409 AC_DEFINE(HAVE_NETLINK,,netlink)
410 netlink=yes
411 elif test "${enable_netlink}" = "no"; then
412 AC_MSG_RESULT(ioctl)
413 RT_METHOD=rt_ioctl.o
414 netlink=no
415 else
416 AC_MSG_RESULT(netlink)
417 RT_METHOD=rt_netlink.o
418 AC_DEFINE(HAVE_NETLINK,,netlink)
419 netlink=yes
420 fi
paul19877dd2004-05-11 10:49:35 +0000421elif test x"$opsys" = x"sol2-6";then
422 AC_MSG_RESULT(Route socket)
423 KERNEL_METHOD="kernel_socket.o"
424 RT_METHOD="rt_socket.o"
425elif test x"$opsys" = x"sol9";then
426 AC_MSG_RESULT(Route socket)
427 KERNEL_METHOD="kernel_socket.o"
428 RT_METHOD="rt_socket.o"
429elif test "$opsys" = "irix" ; then
430 AC_MSG_RESULT(Route socket)
431 KERNEL_METHOD="kernel_socket.o"
432 RT_METHOD="rt_socket.o"
paul7ea487b2003-03-17 02:05:07 +0000433else
paul19877dd2004-05-11 10:49:35 +0000434 AC_TRY_RUN([#include <errno.h>
paul7ea487b2003-03-17 02:05:07 +0000435#include <sys/types.h>
436#include <sys/socket.h>
437
438main ()
439{
440 int ac_sock;
441
442 ac_sock = socket (AF_ROUTE, SOCK_RAW, 0);
443 if (ac_sock < 0 && errno == EINVAL)
444 exit (1);
445 exit (0);
446}],
447 [KERNEL_METHOD=kernel_socket.o
448 RT_METHOD=rt_socket.o
449 AC_MSG_RESULT(socket)],
450 [RT_METHOD=rt_ioctl.o
451 AC_MSG_RESULT(ioctl)],
452 [KERNEL_METHOD=kernel_socket.o
453 RT_METHOD=rt_socket.o
454 AC_MSG_RESULT(socket)])
paul7ea487b2003-03-17 02:05:07 +0000455fi
456AC_SUBST(RT_METHOD)
457AC_SUBST(KERNEL_METHOD)
458AC_SUBST(OTHER_METHOD)
459
460dnl ------------------------------
461dnl check kernel route read method
462dnl ------------------------------
463AC_CACHE_CHECK(route read method check, zebra_rtread,
464[if test "$netlink" = yes; then
465 RTREAD_METHOD="rtread_netlink.o"
466 zebra_rtread="netlink"
467else
468for zebra_rtread in /proc/net/route /dev/ip /dev/null;
469do
470 test x`ls $zebra_rtread 2>/dev/null` = x"$zebra_rtread" && break
471done
472case $zebra_rtread in
473 "/proc/net/route") RTREAD_METHOD="rtread_proc.o"
474 zebra_rtread="proc";;
paul9c30ab62003-07-08 08:36:17 +0000475 "/dev/ip")
476 case "$host" in
477 *-freebsd*) RTREAD_METHOD=rtread_sysctl.o
478 zebra_rtread="sysctl";;
479 *) RTREAD_METHOD="rtread_getmsg.o"
480 zebra_rtread="getmsg";;
481 esac;;
paul7ea487b2003-03-17 02:05:07 +0000482 *) RTREAD_METHOD="rtread_sysctl.o"
483 zebra_rtread="sysctl";;
484esac
485fi])
486AC_SUBST(RTREAD_METHOD)
487
488dnl -----------------------------
489dnl check interface lookup method
490dnl -----------------------------
paul19877dd2004-05-11 10:49:35 +0000491IOCTL_METHOD=ioctl.o
paul7ea487b2003-03-17 02:05:07 +0000492AC_MSG_CHECKING(interface looking up method)
493if test "$netlink" = yes; then
494 AC_MSG_RESULT(netlink)
495 IF_METHOD=if_netlink.o
paul19877dd2004-05-11 10:49:35 +0000496elif test "$opsys" = "sol2-6";then
497 AC_MSG_RESULT(Solaris GIF)
498 IF_METHOD=if_ioctl.o
499elif test "$opsys" = "sol9";then
500 AC_MSG_RESULT(Solaris GLIF)
501 IF_METHOD=if_ioctl_solaris.o
502 IOCTL_METHOD=ioctl_solaris.o
503elif test "$opsys" = "irix" ; then
504 AC_MSG_RESULT(IRIX)
505 IF_METHOD=if_ioctl.o
506elif test "$opsys" = "openbsd";then
507 AC_MSG_RESULT(openbsd)
508 IF_METHOD=if_ioctl.o
509elif grep NET_RT_IFLIST /usr/include/sys/socket.h >/dev/null 2>&1; then
510 AC_MSG_RESULT(sysctl)
paul7ea487b2003-03-17 02:05:07 +0000511 IF_METHOD=if_sysctl.o
512 AC_DEFINE(HAVE_NET_RT_IFLIST,,NET_RT_IFLIST)
paul19877dd2004-05-11 10:49:35 +0000513else
paul7ea487b2003-03-17 02:05:07 +0000514 AC_MSG_RESULT(ioctl)
515 IF_METHOD=if_ioctl.o
paul7ea487b2003-03-17 02:05:07 +0000516fi
517AC_SUBST(IF_METHOD)
paul19877dd2004-05-11 10:49:35 +0000518AC_SUBST(IOCTL_METHOD)
paul7ea487b2003-03-17 02:05:07 +0000519
520dnl -----------------------
521dnl check proc file system.
522dnl -----------------------
523if test -r /proc/net/dev; then
524 AC_DEFINE(HAVE_PROC_NET_DEV,,/proc/net/dev)
525 IF_PROC=if_proc.o
526fi
527
528if test -r /proc/net/if_inet6; then
529 AC_DEFINE(HAVE_PROC_NET_IF_INET6,,/proc/net/if_inet6)
530 IF_PROC=if_proc.o
531fi
532AC_SUBST(IF_PROC)
533
534dnl -----------------------------
535dnl check ipforward detect method
536dnl -----------------------------
537AC_CACHE_CHECK(ipforward method check, zebra_ipforward_path,
538[for zebra_ipforward_path in /proc/net/snmp /dev/ip /dev/null;
539do
540 test x`ls $zebra_ipforward_path 2>/dev/null` = x"$zebra_ipforward_path" && break
541done
542case $zebra_ipforward_path in
543 "/proc/net/snmp") IPFORWARD=ipforward_proc.o
544 zebra_ipforward_path="proc";;
545 "/dev/ip")
546 case "$host" in
547 *-nec-sysv4*) IPFORWARD=ipforward_ews.o
548 zebra_ipforward_path="ews";;
paul9c30ab62003-07-08 08:36:17 +0000549 *-freebsd*) IPFORWARD=ipforward_sysctl.o
550 zebra_ipforward_path="sysctl";;
paul7ea487b2003-03-17 02:05:07 +0000551 *) IPFORWARD=ipforward_solaris.o
552 zebra_ipforward_path="solaris";;
553 esac;;
554 *) IPFORWARD=ipforward_sysctl.o
555 zebra_ipforward_path="sysctl";;
556esac])
557AC_SUBST(IPFORWARD)
558
559AC_CHECK_FUNCS(getaddrinfo, [have_getaddrinfo=yes], [have_getaddrinfo=no])
560
561dnl ----------
562dnl IPv6 check
563dnl ----------
564AC_MSG_CHECKING(whether does this OS have IPv6 stack)
565if test "${enable_ipv6}" = "no"; then
566 AC_MSG_RESULT(disabled)
567else
568dnl ----------
569dnl INRIA IPv6
570dnl ----------
paula159ed92003-06-04 11:01:45 +0000571 if grep IPV6_INRIA_VERSION /usr/include/netinet/in.h >/dev/null 2>&1; then
572 zebra_cv_ipv6=yes
573 AC_DEFINE(HAVE_IPV6,1,INRIA IPv6)
574 AC_DEFINE(INRIA_IPV6,1,INRIA IPv6)
575 RIPNGD="ripngd"
576 OSPF6D="ospf6d"
577 LIB_IPV6=""
578 AC_MSG_RESULT(INRIA IPv6)
paul7ea487b2003-03-17 02:05:07 +0000579dnl ---------
580dnl KAME IPv6
581dnl ---------
paula159ed92003-06-04 11:01:45 +0000582 elif grep WIDE /usr/include/netinet6/in6.h >/dev/null 2>&1; then
583 zebra_cv_ipv6=yes
584 AC_DEFINE(HAVE_IPV6,1,KAME IPv6)
585 AC_DEFINE(KAME,1,KAME IPv6)
586 RIPNGD="ripngd"
587 OSPF6D="ospf6d"
588 if test -d /usr/local/v6/lib -a -f /usr/local/v6/lib/libinet6.a; then
paul7ea487b2003-03-17 02:05:07 +0000589 LIB_IPV6="-L/usr/local/v6/lib -linet6"
paula159ed92003-06-04 11:01:45 +0000590 fi
591 AC_MSG_RESULT(KAME)
hasso71c0fb52003-05-25 20:18:13 +0000592dnl -------------------------
593dnl MUSICA IPv6
594dnl default host check
595dnl It is not used by Kheops
596dnl -------------------------
paula159ed92003-06-04 11:01:45 +0000597 elif grep MUSICA /usr/include6/netinet6/in6.h >/dev/null 2>&1; then
598 zebra_cv_ipv6=yes
599 AC_DEFINE(HAVE_IPV6,1,Musicia IPv6)
600 AC_DEFINE(MUSICA,1,Musica IPv6 stack)
601 AC_DEFINE(KAME,1,KAME IPv6 stack)
602 RIPNGD="ripngd"
603 OSPF6D="ospf6d"
604 if test -d /usr/local/v6/lib -a -f /usr/local/v6/lib/libinet6.a; then
hasso71c0fb52003-05-25 20:18:13 +0000605 LIB_IPV6="-L/usr/local/v6/lib -linet6"
paula159ed92003-06-04 11:01:45 +0000606 fi
607 AC_MSG_RESULT(MUSICA)
paul7ea487b2003-03-17 02:05:07 +0000608dnl ---------
609dnl NRL check
610dnl ---------
paula159ed92003-06-04 11:01:45 +0000611 elif grep NRL /usr/include/netinet6/in6.h >/dev/null 2>&1; then
612 zebra_cv_ipv6=yes
613 AC_DEFINE(HAVE_IPV6,1,NRL IPv6)
614 AC_DEFINE(NRL,1,NRL)
615 RIPNGD="ripngd"
616 OSPF6D="ospf6d"
617 if test x"$opsys" = x"bsdi";then
paul7ea487b2003-03-17 02:05:07 +0000618 AC_DEFINE(BSDI_NRL,,BSDI)
619 AC_MSG_RESULT(BSDI_NRL)
paula159ed92003-06-04 11:01:45 +0000620 else
paul7ea487b2003-03-17 02:05:07 +0000621 AC_MSG_RESULT(NRL)
paula159ed92003-06-04 11:01:45 +0000622 fi
paul19877dd2004-05-11 10:49:35 +0000623dnl ------------------------------------
624dnl Solaris 9, 10 and potentially higher
625dnl ------------------------------------
626 elif test x"$opsys" = x"sol9"; then
627 zebra_cv_ipv6=yes;
628 AC_DEFINE(HAVE_IPV6, 1, IPv6)
629 AC_DEFINE(SOLARIS_IPV6, 1, Solaris IPv6)
630 RIPNGD="ripngd"
631 OSPF6D="ospf6d"
632 AC_MSG_RESULT(Solaris IPv6)
paul7ea487b2003-03-17 02:05:07 +0000633dnl ----------
634dnl Linux IPv6
635dnl ----------
paula159ed92003-06-04 11:01:45 +0000636 elif test "${enable_ipv6}" = "yes"; then
637 AC_EGREP_CPP(yes, [
638 #include <linux/version.h>
639 /* 2.1.128 or later */
640 #if LINUX_VERSION_CODE >= 0x020180
641 yes
642 #endif],
643 [zebra_cv_ipv6=yes
644 zebra_cv_linux_ipv6=yes
645 AC_MSG_RESULT(Linux IPv6)])
646 else
647 if test x`ls /proc/net/ipv6_route 2>/dev/null` = x"/proc/net/ipv6_route"
648 then
paul7ea487b2003-03-17 02:05:07 +0000649 zebra_cv_ipv6=yes
650 zebra_cv_linux_ipv6=yes
651 AC_MSG_RESULT(Linux IPv6)
paula159ed92003-06-04 11:01:45 +0000652 fi
653 fi
paul7ea487b2003-03-17 02:05:07 +0000654
paula159ed92003-06-04 11:01:45 +0000655 if test "$zebra_cv_linux_ipv6" = "yes";then
656 AC_MSG_CHECKING(for GNU libc >= 2.1)
657 AC_DEFINE(HAVE_IPV6,1,Linux IPv6)
658 AC_EGREP_CPP(yes, [
paul7ea487b2003-03-17 02:05:07 +0000659#include <features.h>
660#if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1
661 yes
paula159ed92003-06-04 11:01:45 +0000662#endif],
663 [glibc=yes
664 AC_DEFINE(LINUX_IPV6,1,Linux IPv6 stack)
665 AC_MSG_RESULT(yes)],
666 AC_MSG_RESULT(no)
667 )
668 RIPNGD="ripngd"
669 OSPF6D="ospf6d"
670 if test "$glibc" != "yes"; then
paul7ea487b2003-03-17 02:05:07 +0000671 INCLUDES="-I/usr/inet6/include"
672 if test x`ls /usr/inet6/lib/libinet6.a 2>/dev/null` != x;then
673 LIB_IPV6="-L/usr/inet6/lib -linet6"
674 fi
paula159ed92003-06-04 11:01:45 +0000675 fi
676 fi
paul7ea487b2003-03-17 02:05:07 +0000677
678dnl -----------------------
679dnl Set IPv6 related values
680dnl -----------------------
paula159ed92003-06-04 11:01:45 +0000681 LIBS="$LIB_IPV6 $LIBS"
682 AC_SUBST(LIB_IPV6)
paul7ea487b2003-03-17 02:05:07 +0000683
paula159ed92003-06-04 11:01:45 +0000684 if test x"$RIPNGD" = x""; then
685 AC_MSG_RESULT(IPv4 only)
686 fi
paul7ea487b2003-03-17 02:05:07 +0000687fi
688
gdtfa3232e2003-12-03 17:52:30 +0000689dnl ------------------
690dnl IPv6 header checks
691dnl ------------------
692if test "x${zebra_cv_ipv6}" = "xyes"; then
693AC_CHECK_HEADERS([netinet6/in6.h netinet/in6_var.h netinet/icmp6.h \
694 netinet6/in6_var.h netinet6/nd6.h])
695fi
696
paul7ea487b2003-03-17 02:05:07 +0000697dnl --------------------
698dnl Daemon disable check
699dnl --------------------
700if test "${enable_zebra}" = "no";then
701 ZEBRA=""
702else
703 ZEBRA="zebra"
704fi
705
706if test "${enable_bgpd}" = "no";then
707 BGPD=""
708else
709 BGPD="bgpd"
710fi
711
712if test "${enable_ripd}" = "no";then
713 RIPD=""
714else
715 RIPD="ripd"
716fi
717
718if test "${enable_ospfd}" = "no";then
719 OSPFD=""
720else
721 OSPFD="ospfd"
722fi
723
paul1ef74ef2003-03-21 15:16:05 +0000724OSPFCLIENT=""
725if test "${enable_opaque_lsa}" = "yes"; then
726 if test "${enable_ospfapi}" != "no";then
paul9a569842003-03-28 01:45:13 +0000727 AC_DEFINE(SUPPORT_OSPF_API,,OSPFAPI)
paul1ef74ef2003-03-21 15:16:05 +0000728
729 if test "${enable_ospfclient}" != "no";then
730 OSPFCLIENT="ospfclient"
731 fi
732 fi
733
paul7ea487b2003-03-17 02:05:07 +0000734fi
735
736case "${enable_ripngd}" in
737 "yes") RIPNGD="ripngd";;
738 "no" ) RIPNGD="";;
739 * ) ;;
740esac
741
742case "${enable_ospf6d}" in
743 "yes") OSPF6D="ospf6d";;
744 "no" ) OSPF6D="";;
745 * ) ;;
746esac
747
jardin9e867fe2003-12-23 08:56:18 +0000748case "${enable_isisd}" in
749 "yes") ISISD="isisd";;
750 "no" ) ISISD="";;
751 * ) ISISD="isisd";;
752esac
753
paul7ea487b2003-03-17 02:05:07 +0000754if test "${enable_bgp_announce}" = "no";then
755 AC_DEFINE(DISABLE_BGP_ANNOUNCE,,Disable BGP installation to zebra)
756fi
757
758AC_SUBST(ZEBRA)
759AC_SUBST(BGPD)
760AC_SUBST(RIPD)
761AC_SUBST(RIPNGD)
762AC_SUBST(OSPFD)
763AC_SUBST(OSPF6D)
jardin9e867fe2003-12-23 08:56:18 +0000764AC_SUBST(ISISD)
paul7ea487b2003-03-17 02:05:07 +0000765AC_SUBST(VTYSH)
766AC_SUBST(INCLUDES)
767AC_SUBST(CURSES)
768AC_SUBST(OSPFCLIENT)
paul1ef74ef2003-03-21 15:16:05 +0000769AC_SUBST(OSPFAPI)
paul7ea487b2003-03-17 02:05:07 +0000770AC_CHECK_LIB(c, inet_ntop, [AC_DEFINE(HAVE_INET_NTOP,,inet_ntop)])
771AC_CHECK_LIB(c, inet_pton, [AC_DEFINE(HAVE_INET_PTON,,inet_pton)])
772AC_CHECK_LIB(crypt, crypt)
773AC_CHECK_LIB(resolv, res_init)
774AC_CHECK_LIB(m, main)
775
776dnl ---------------------------------------------------
777dnl BSD/OS 4.1 define inet_XtoY function as __inet_XtoY
778dnl ---------------------------------------------------
paula159ed92003-06-04 11:01:45 +0000779AC_CHECK_FUNC(__inet_ntop, AC_DEFINE(HAVE_INET_NTOP,,__inet_ntop))
780AC_CHECK_FUNC(__inet_pton, AC_DEFINE(HAVE_INET_PTON,,__inet_pton))
781AC_CHECK_FUNC(__inet_aton, AC_DEFINE(HAVE_INET_ATON,,__inet_aton))
paul7ea487b2003-03-17 02:05:07 +0000782
783dnl ---------------------------
784dnl check system has GNU regexp
785dnl ---------------------------
786dnl AC_MSG_CHECKING(whether system has GNU regex)
787AC_CHECK_LIB(c, regexec,
788[AC_DEFINE(HAVE_GNU_REGEX,,GNU regexp library)
789 LIB_REGEX=""],
790[LIB_REGEX="regex.o"])
791AC_SUBST(LIB_REGEX)
792
793dnl ------------------
794dnl check SNMP library
795dnl ------------------
796if test "${enable_snmp}" = "yes";then
797dnl AC_CHECK_LIB(snmp, asn_parse_int, HAVE_SNMP=yes)
paul7ea487b2003-03-17 02:05:07 +0000798 if test "${HAVE_SNMP}" = ""; then
paul1ef74ef2003-03-21 15:16:05 +0000799 old_libs="${LIBS}"
800 LIBS="-L/usr/lib"
paul7ea487b2003-03-17 02:05:07 +0000801 unset ac_cv_lib_snmp_asn_parse_int
paul1ef74ef2003-03-21 15:16:05 +0000802 AC_CHECK_LIB(crypto, main, NEED_CRYPTO=yes, )
803 if test "${NEED_CRYPTO}" = ""; then
804 AC_CHECK_LIB(netsnmp, asn_parse_int, [HAVE_NETSNMP=yes; HAVE_SNMP=yes ])
805 else
806 AC_CHECK_LIB(netsnmp, asn_parse_int, [HAVE_NETSNMP=yes; HAVE_SNMP=yes; NEED_CRYPTO=yes;LIBS="$LIBS -lcrypto" ],,"-lcrypto")
807 fi
808 LIBS="${old_libs}"
paul7ea487b2003-03-17 02:05:07 +0000809 fi
paul1ef74ef2003-03-21 15:16:05 +0000810 if test "${HAVE_SNMP}" = ""; then
811 old_libs="${LIBS}"
812 LIBS="-L/usr/lib"
813 unset ac_cv_lib_snmp_asn_parse_int
814 AC_CHECK_LIB(snmp, asn_parse_int, HAVE_SNMP=yes, )
815 if test "${HAVE_SNMP}" = ""; then
816 unset ac_cv_lib_snmp_asn_parse_int
817 AC_CHECK_LIB(crypto, main, NEED_CRYPTO=yes, )
818 if test "${NEED_CRYPTO}" = "yes"; then
819 AC_CHECK_LIB(snmp, asn_parse_int, [HAVE_SNMP=yes; NEED_CRYPTO=yes; LIBS="$LIBS -lcrypto" ],,"-lcrypto")
820 fi
821 fi
822 LIBS="${old_libs}"
823 fi
paul7ea487b2003-03-17 02:05:07 +0000824
825 if test "${HAVE_SNMP}" = ""; then
paul1ef74ef2003-03-21 15:16:05 +0000826 old_libs="${LIBS}"
827 LIBS="-L/usr/local/lib"
828 unset ac_cv_lib_snmp_asn_parse_int
829 AC_CHECK_LIB(snmp, asn_parse_int, HAVE_SNMP=yes)
830 if test "${HAVE_SNMP}" = ""; then
831 unset ac_cv_lib_snmp_asn_parse_int
832 AC_CHECK_LIB(crypto, main, NEED_CRYPTO=yes, )
833 if test "${NEED_CRYPTO}" = "yes"; then
834 AC_CHECK_LIB(snmp, asn_parse_int, [HAVE_SNMP=yes; NEED_CRYPTO=yes; LIBS="$LIBS -lcrypto" ],,"-lcrypto")
835 fi
836 fi
837 LIBS="${old_libs}"
paul7ea487b2003-03-17 02:05:07 +0000838 fi
paul1ef74ef2003-03-21 15:16:05 +0000839
paul7ea487b2003-03-17 02:05:07 +0000840 if test "${HAVE_SNMP}" = "yes"; then
841 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
842 do
843 test -f "${ac_snmp}" && break
844 done
paul1ef74ef2003-03-21 15:16:05 +0000845
paul7ea487b2003-03-17 02:05:07 +0000846 case ${ac_snmp} in
847 /usr/include/net-snmp/*)
848 AC_DEFINE(HAVE_SNMP,,SNMP)
paul1ef74ef2003-03-21 15:16:05 +0000849 AC_DEFINE(HAVE_NETSNMP,,SNMP)
paul7ea487b2003-03-17 02:05:07 +0000850 AC_DEFINE(UCD_COMPATIBLE,,SNMP)
paulac7c4bb2003-03-19 04:25:08 +0000851 CFLAGS="${CFLAGS} -I/usr/include/net-snmp -I/usr/include/net-snmp/library"
852 if test "${HAVE_NETSNMP}" = "yes"; then
paul1ef74ef2003-03-21 15:16:05 +0000853 LIBS="${LIBS} -lnetsnmp"
paulac7c4bb2003-03-19 04:25:08 +0000854 else
paul1ef74ef2003-03-21 15:16:05 +0000855 LIBS="${LIBS} -lsnmp"
paulac7c4bb2003-03-19 04:25:08 +0000856 fi
paul7ea487b2003-03-17 02:05:07 +0000857 ;;
858 /usr/include/ucd-snmp/*)
859 AC_DEFINE(HAVE_SNMP,,SNMP)
860 CFLAGS="${CFLAGS} -I/usr/include/ucd-snmp"
861 LIBS="${LIBS} -lsnmp"
862 ;;
863 /usr/local/include/ucd-snmp/*)
864 AC_DEFINE(HAVE_SNMP,,SNMP)
865 CFLAGS="${CFLAGS} -I/usr/local/include/ucd-snmp"
866 LIBS="${LIBS} -L/usr/local/lib -lsnmp"
867 ;;
paulf3bd1a72003-11-02 07:29:11 +0000868 /usr/local/include/net-snmp/*)
869 AC_DEFINE(HAVE_SNMP,,SNMP)
870 AC_DEFINE(HAVE_NET_SNMP,,SNMP)
871 AC_DEFINE(UCD_COMPATIBLE,,SNMP)
872 CFLAGS="${CFLAGS} -I/usr/local/include/net-snmp"
873 LIBS="${LIBS} -L/usr/local/lib -lnetsnmp"
874 ;;
paul7ea487b2003-03-17 02:05:07 +0000875 esac
876 if test "${NEED_CRYPTO}" = "yes"; then
877 LIBS="${LIBS} -lcrypto"
878 fi
879 fi
880fi
881
882dnl ----------------------------
883dnl check sa_len of sockaddr
884dnl ----------------------------
885AC_MSG_CHECKING(whether struct sockaddr has a sa_len field)
886AC_TRY_COMPILE([#include <sys/types.h>
887#include <sys/socket.h>
888],[static struct sockaddr ac_i;int ac_j = sizeof (ac_i.sa_len);],
889[AC_MSG_RESULT(yes)
890 AC_DEFINE(HAVE_SA_LEN,,sa_len)],
891 AC_MSG_RESULT(no))
892
893dnl ----------------------------
894dnl check sin_len of sockaddr_in
895dnl ----------------------------
896AC_MSG_CHECKING(whether struct sockaddr_in has a sin_len field)
897AC_TRY_COMPILE([#include <sys/types.h>
898#include <netinet/in.h>
899],[static struct sockaddr_in ac_i;int ac_j = sizeof (ac_i.sin_len);],
900[AC_MSG_RESULT(yes)
901 AC_DEFINE(HAVE_SIN_LEN,,sin_len)],
902 AC_MSG_RESULT(no))
903
904dnl ----------------------------
905dnl check sun_len of sockaddr_un
906dnl ----------------------------
907AC_MSG_CHECKING(whether struct sockaddr_un has a sun_len field)
908AC_TRY_COMPILE([#include <sys/types.h>
909#include <sys/un.h>
910],[static struct sockaddr_un ac_i;int ac_j = sizeof (ac_i.sun_len);],
911[AC_MSG_RESULT(yes)
912 AC_DEFINE(HAVE_SUN_LEN,,sun_len)],
913 AC_MSG_RESULT(no))
914
915dnl -----------------------------------
916dnl check sin6_scope_id of sockaddr_in6
917dnl -----------------------------------
918if test "$zebra_cv_ipv6" = yes; then
919 AC_MSG_CHECKING(whether struct sockaddr_in6 has a sin6_scope_id field)
920 AC_TRY_COMPILE([#include <sys/types.h>
921#include <netinet/in.h>
922],[static struct sockaddr_in6 ac_i;int ac_j = sizeof (ac_i.sin6_scope_id);],
923[AC_MSG_RESULT(yes)
924 AC_DEFINE(HAVE_SIN6_SCOPE_ID,,scope id)],
925 AC_MSG_RESULT(no))
926fi
927
928dnl ----------------------------
929dnl check socklen_t exist or not
930dnl ----------------------------
931AC_MSG_CHECKING(whther socklen_t is defined)
932AC_TRY_COMPILE([#include <sys/types.h>
933#include <sys/socket.h>
934#include <netinet/in.h>
935],[socklen_t ac_x;],
936[AC_MSG_RESULT(yes)
937 AC_DEFINE(HAVE_SOCKLEN_T,,socklen_t)],
938 AC_MSG_RESULT(no))
939
940dnl ------------------------
941dnl check struct sockaddr_dl
942dnl ------------------------
943AC_MSG_CHECKING(whether struct sockaddr_dl exist)
944AC_EGREP_HEADER(sockaddr_dl,
945net/if_dl.h,
946[AC_MSG_RESULT(yes)
947 AC_DEFINE(HAVE_SOCKADDR_DL,,sockaddr_dl)],
948 AC_MSG_RESULT(no))
949
950dnl --------------------------
951dnl check structure ifaliasreq
952dnl --------------------------
953AC_MSG_CHECKING(whether struct ifaliasreq exist)
954AC_EGREP_HEADER(ifaliasreq,
955net/if.h,
956[AC_MSG_RESULT(yes)
957 AC_DEFINE(HAVE_IFALIASREQ,,ifaliasreq)],
958 AC_MSG_RESULT(no))
959
960dnl ----------------------------
961dnl check structure in6_aliasreq
962dnl ----------------------------
hasso71c0fb52003-05-25 20:18:13 +0000963AC_MSG_CHECKING(whether struct in6_aliasreq exist)
paul7ea487b2003-03-17 02:05:07 +0000964AC_EGREP_HEADER(in6_aliasreq,
965netinet6/in6_var.h,
966[AC_MSG_RESULT(yes)
967 AC_DEFINE(HAVE_IN6_ALIASREQ,,in6_aliasreq)],
968 AC_MSG_RESULT(no))
969
hasso71c0fb52003-05-25 20:18:13 +0000970dnl -----------------------------------
971dnl check ifra_lifetime of in6_aliasreq
972dnl -----------------------------------
973AC_MSG_CHECKING(whether in6_aliasreq.ifra_lifetime exist)
974AC_TRY_COMPILE([#include <sys/types.h>
975#include <netinet6/in6_var.h>
976],[static struct if6_aliasreq ac_i;int ac_j = sizeof (ac_i.ifra_lifetime);],
977[AC_MSG_RESULT(yes)
paula159ed92003-06-04 11:01:45 +0000978 AC_DEFINE(HAVE_IFRA_LIFETIME,,Have in6_aliasreq.ifra_lifetime)],
hasso71c0fb52003-05-25 20:18:13 +0000979 AC_MSG_RESULT(no))
980
paul7ea487b2003-03-17 02:05:07 +0000981dnl ---------------------------
982dnl check structure rt_addrinfo
983dnl ---------------------------
984AC_MSG_CHECKING(whether struct rt_addrinfo exist)
985AC_EGREP_HEADER(rt_addrinfo,
986net/route.h,
987[AC_MSG_RESULT(yes)
988 AC_DEFINE(HAVE_RT_ADDRINFO,,rt_addrinfo)],
989 AC_MSG_RESULT(no))
990
991dnl --------------------------
992dnl check structure in_pktinfo
993dnl --------------------------
994AC_MSG_CHECKING(whether struct in_pktinfo exist)
995AC_TRY_COMPILE([#include <netinet/in.h>
996],[struct in_pktinfo ac_x;],
997[AC_MSG_RESULT(yes)
998 AC_DEFINE(HAVE_INPKTINFO,,in_pktinfo)],
999 AC_MSG_RESULT(no))
1000
1001dnl --------------------------------------
1002dnl checking for getrusage struct and call
1003dnl --------------------------------------
1004AC_MSG_CHECKING(whether getrusage is available)
1005AC_TRY_COMPILE([#include <sys/resource.h>
1006],[struct rusage ac_x; getrusage (RUSAGE_SELF, &ac_x);],
1007[AC_MSG_RESULT(yes)
1008 AC_DEFINE(HAVE_RUSAGE,,rusage)],
1009 AC_MSG_RESULT(no))
1010
pauledd7c242003-06-04 13:59:38 +00001011dnl -------------------
1012dnl capabilities checks
1013dnl -------------------
hasso41d3fc92004-04-06 11:59:00 +00001014if test "${enable_capabilities}" != "no"; then
1015 AC_MSG_CHECKING(whether prctl PR_SET_KEEPCAPS is available)
1016 AC_TRY_COMPILE([#include <sys/prctl.h>],[prctl(PR_SET_KEEPCAPS, 1, 0, 0, 0);],
1017 [AC_MSG_RESULT(yes)
1018 AC_DEFINE(HAVE_PR_SET_KEEPCAPS,,prctl)
1019 quagga_ac_keepcaps="yes"],
1020 AC_MSG_RESULT(no)
pauledd7c242003-06-04 13:59:38 +00001021 )
hasso41d3fc92004-04-06 11:59:00 +00001022 if test x"${quagga_ac_keepcaps}" = x"yes"; then
1023 AC_CHECK_HEADERS(sys/capability.h)
1024 fi
1025 if test x"${ac_cv_header_sys_capability_h}" = x"yes"; then
1026 AC_CHECK_LIB(cap, cap_init,
1027 [AC_DEFINE(HAVE_LCAPS,1,Capabilities)
1028 LIBCAP="-lcap"
1029 ]
1030 )
1031 fi
pauledd7c242003-06-04 13:59:38 +00001032fi
1033AC_SUBST(LIBCAP)
1034
paulfb2d1502003-06-04 09:40:54 +00001035dnl ---------------------------
1036dnl check for glibc 'backtrace'
1037dnl ---------------------------
1038if test "${glibc}" = "yes"; then
1039 AC_CHECK_HEADER(execinfo.h)
1040fi
1041if test x"${ac_cv_header_execinfo_h}" = x"yes"; then
1042 AC_CHECK_FUNC(backtrace,
1043 [AC_DEFINE(HAVE_GLIBC_BACKTRACE,,Glibc backtrace)]
1044 )
1045fi
1046
paul408ad942003-05-20 00:03:33 +00001047dnl ----------
1048dnl configure date
1049dnl ----------
1050CONFDATE=`date '+%Y%m%d'`
1051AC_SUBST(CONFDATE)
1052
paul7ea487b2003-03-17 02:05:07 +00001053dnl ------------------------------
paula159ed92003-06-04 11:01:45 +00001054dnl set paths for state directory
paul23bd12c2003-04-07 06:11:09 +00001055dnl ------------------------------
1056if test "${prefix}" = "NONE"; then
paule8f29842003-08-12 13:08:31 +00001057 quagga_statedir_prefix="";
paul23bd12c2003-04-07 06:11:09 +00001058else
paule8f29842003-08-12 13:08:31 +00001059 quagga_statedir_prefix=${prefix}
paul23bd12c2003-04-07 06:11:09 +00001060fi
1061if test "${localstatedir}" = '${prefix}/var'; then
paula159ed92003-06-04 11:01:45 +00001062 AC_CACHE_CHECK(state directory,ac_statedir,
paule8f29842003-08-12 13:08:31 +00001063 [for QUAGGA_STATE_DIR in ${quagga_statedir_prefix}/var/run dnl
1064 ${quagga_statedir_prefix}/var/adm dnl
1065 ${quagga_statedir_prefix}/etc dnl
paula159ed92003-06-04 11:01:45 +00001066 /var/run dnl
1067 /var/adm dnl
1068 /etc dnl
1069 /dev/null;
paul23bd12c2003-04-07 06:11:09 +00001070 do
paule8f29842003-08-12 13:08:31 +00001071 test -d $QUAGGA_STATE_DIR && break
paul23bd12c2003-04-07 06:11:09 +00001072 done
paule8f29842003-08-12 13:08:31 +00001073 quagga_statedir=$QUAGGA_STATE_DIR])
paul23bd12c2003-04-07 06:11:09 +00001074else
paule8f29842003-08-12 13:08:31 +00001075 quagga_statedir=${localstatedir}
paula159ed92003-06-04 11:01:45 +00001076 AC_MSG_CHECKING(directory to use for state file)
paule8f29842003-08-12 13:08:31 +00001077 AC_MSG_RESULT(${quagga_statedir})
paul23bd12c2003-04-07 06:11:09 +00001078fi
paule8f29842003-08-12 13:08:31 +00001079if test $quagga_statedir = "/dev/null"; then
paula159ed92003-06-04 11:01:45 +00001080 AC_MSG_ERROR('STATE DIRECTORY NOT FOUND! FIX OR SPECIFY --localstatedir!')
1081fi
1082
paule8f29842003-08-12 13:08:31 +00001083AC_DEFINE_UNQUOTED(PATH_ZEBRA_PID, "$quagga_statedir/zebra.pid",zebra PID)
1084AC_DEFINE_UNQUOTED(PATH_RIPD_PID, "$quagga_statedir/ripd.pid",ripd PID)
1085AC_DEFINE_UNQUOTED(PATH_RIPNGD_PID, "$quagga_statedir/ripngd.pid",ripngd PID)
1086AC_DEFINE_UNQUOTED(PATH_BGPD_PID, "$quagga_statedir/bgpd.pid",bgpd PID)
1087AC_DEFINE_UNQUOTED(PATH_OSPFD_PID, "$quagga_statedir/ospfd.pid",ospfd PID)
1088AC_DEFINE_UNQUOTED(PATH_OSPF6D_PID, "$quagga_statedir/ospf6d.pid",ospf6d PID)
jardin9e867fe2003-12-23 08:56:18 +00001089AC_DEFINE_UNQUOTED(PATH_ISISD_PID, "$quagga_statedir/isisd.pid",isisd PID)
paule8f29842003-08-12 13:08:31 +00001090AC_DEFINE_UNQUOTED(ZEBRA_SERV_PATH, "$quagga_statedir/zserv.api",zebra api socket)
1091AC_DEFINE_UNQUOTED(ZEBRA_VTYSH_PATH, "$quagga_statedir/zebra.vty",zebra vty socket)
1092AC_DEFINE_UNQUOTED(RIP_VTYSH_PATH, "$quagga_statedir/ripd.vty",rip vty socket)
1093AC_DEFINE_UNQUOTED(RIPNG_VTYSH_PATH, "$quagga_statedir/ripngd.vty",ripng vty socket)
1094AC_DEFINE_UNQUOTED(BGP_VTYSH_PATH, "$quagga_statedir/bgpd.vty",bgpd vty socket)
1095AC_DEFINE_UNQUOTED(OSPF_VTYSH_PATH, "$quagga_statedir/ospfd.vty",ospfd vty socket)
1096AC_DEFINE_UNQUOTED(OSPF6_VTYSH_PATH, "$quagga_statedir/ospf6d.vty",ospf6d vty socket)
jardin9e867fe2003-12-23 08:56:18 +00001097AC_DEFINE_UNQUOTED(ISIS_VTYSH_PATH, "$quagga_statedir/isisd.vty",isisd vty socket)
paul7ea487b2003-03-17 02:05:07 +00001098
1099dnl ---------------------------
1100dnl Check htonl works correctly
1101dnl ---------------------------
1102AC_MSG_CHECKING(for working htonl)
1103AC_CACHE_VAL(ac_cv_htonl_works, [
1104AC_TRY_LINK([#ifdef HAVE_SYS_TYPES_H
1105#include <sys/types.h>
1106#endif
1107#ifdef HAVE_NETDB_H
1108#include <netdb.h>
1109#endif
1110#ifdef HAVE_NETINET_IN_H
1111#include <netinet/in.h>
1112#endif],
1113[htonl (0);],
1114ac_cv_htonl_works=yes,
1115ac_cv_htonl_works=no)])
1116AC_MSG_RESULT($ac_cv_htonl_works)
1117
paul6382b6f2003-05-20 00:17:45 +00001118AC_OUTPUT(Makefile lib/Makefile zebra/Makefile ripd/Makefile
1119 ripngd/Makefile bgpd/Makefile ospfd/Makefile
jardin9e867fe2003-12-23 08:56:18 +00001120 ospf6d/Makefile isisd/Makefile vtysh/Makefile doc/Makefile
paul6382b6f2003-05-20 00:17:45 +00001121 ospfclient/Makefile
gdtfc9d0742004-06-30 14:25:12 +00001122 vtysh/extract.pl
jardina4d2a0d2004-01-10 20:42:35 +00001123 redhat/Makefile redhat/quagga.spec
gdtfc9d0742004-06-30 14:25:12 +00001124 lib/version.h,
1125 [chmod +x vtysh/extract.pl])
paul7ea487b2003-03-17 02:05:07 +00001126
1127echo "
1128zebra configuration
1129-------------------
paulfa1253d2003-09-24 05:09:26 +00001130quagga version : ${PACKAGE_VERSION}
paul7ea487b2003-03-17 02:05:07 +00001131host operationg system : ${host_os}
1132source code location : ${srcdir}
1133compiler : ${CC}
1134compiler flags : ${CFLAGS}
hasso71c0fb52003-05-25 20:18:13 +00001135linker flags : ${LDFLAGS} ${LIBS}
paule8f29842003-08-12 13:08:31 +00001136state file directory : ${quagga_statedir}
pauldc7a2bf2003-10-22 00:07:44 +00001137config file directory : `eval echo \`echo ${sysconfdir}\``
gdtd6b72f72003-12-03 17:24:27 +00001138example directory : `eval echo \`echo ${exampledir}\``
paul8d4aee52003-06-06 00:30:35 +00001139user to run as : ${enable_user}
1140group to run as : ${enable_group}
1141group for vty sockets : ${enable_vty_group}
gdtaa593d52003-12-22 20:15:53 +00001142config file mask : ${enable_configfile_mask}
1143log file mask : ${enable_logfile_mask}
pauldc7a2bf2003-10-22 00:07:44 +00001144
1145The above user and group must have read/write access to the state file
1146directory and to the config files in the config file directory.
paul7ea487b2003-03-17 02:05:07 +00001147"