]>
Commit | Line | Data |
---|---|---|
7ea487bc | 1 | ## |
e8f2984c | 2 | ## Configure template file for Quagga. |
7ea487bc | 3 | ## autoconf will generate configure script. |
4 | ## | |
5 | ## Copyright (c) 1996, 97, 98, 99, 2000 Kunihiro Ishiguro <kunihiro@zebra.org> | |
e8f2984c | 6 | ## Portions Copyright (c) 2003 Paul Jakma <paul@dishone.st> |
7ea487bc | 7 | ## |
3e511c8e | 8 | ## $Id: configure.ac,v 1.72 2004/10/22 23:53:19 paul Exp $ |
e8f2984c | 9 | AC_PREREQ(2.53) |
7ea487bc | 10 | |
3e511c8e | 11 | AC_INIT(Quagga, 0.97.2, [http://bugzilla.quagga.net]) |
fa1253d0 | 12 | AC_CONFIG_SRCDIR(lib/zebra.h) |
81b81822 | 13 | AM_INIT_AUTOMAKE(1.6) |
7ea487bc | 14 | AM_CONFIG_HEADER(config.h) |
15 | ||
d6b72f7a | 16 | dnl default is to match previous behavior |
c4f0efe6 | 17 | exampledir=${sysconfdir} |
d6b72f7a | 18 | AC_ARG_ENABLE([exampledir], |
19 | AC_HELP_STRING([--enable-exampledir], | |
20 | [specify alternate directory for examples]), | |
21 | exampledir="$enableval",) | |
c4f0efe6 | 22 | dnl XXX add --exampledir to autoconf standard directory list somehow |
d6b72f7a | 23 | AC_SUBST(exampledir) |
24 | ||
cbd04084 | 25 | dnl default is to match previous behavior |
26 | pkgsrcrcdir="" | |
27 | pkgsrcdir="" | |
28 | AC_ARG_ENABLE([pkgsrcrcdir], | |
29 | AC_HELP_STRING([--enable-pkgsrcrcdir], | |
30 | [specify directory for rc.d scripts]), | |
31 | pkgsrcrcdir="$enableval"; pkgsrcdir="pkgsrc",) | |
32 | dnl XXX add --pkgsrcrcdir to autoconf standard directory list somehow | |
33 | AC_SUBST(pkgsrcdir) | |
34 | AC_SUBST(pkgsrcrcdir) | |
35 | ||
7ea487bc | 36 | dnl ----------------------------------- |
37 | dnl Get hostname and other information. | |
38 | dnl ----------------------------------- | |
39 | AC_CANONICAL_HOST | |
40 | ||
41 | dnl ------------ | |
42 | dnl Check CFLAGS | |
43 | dnl ------------ | |
44 | AC_ARG_WITH(cflags, | |
45 | [ --with-cflags Set CFLAGS for use in compilation.]) | |
46 | if test "x$with_cflags" != "x" ; then | |
47 | CFLAGS="$with_cflags" ; cflags_specified=yes ; | |
48 | elif test -n "$CFLAGS" ; then | |
49 | cflags_specified=yes ; | |
50 | fi | |
51 | ||
52 | dnl -------- | |
53 | dnl Check CC | |
54 | dnl -------- | |
55 | AC_PROG_CC | |
56 | ||
a49c0ff6 | 57 | dnl --------------------------------------------- |
7ea487bc | 58 | dnl If CLFAGS doesn\'t exist set default value |
a49c0ff6 | 59 | dnl AC_PROG_CC will have set minimal default |
60 | dnl already, eg "-O2 -g" for gcc, "-g" for others | |
27eebb3e | 61 | dnl (Wall is gcc specific... have to make sure |
62 | dnl gcc is being used before setting it) | |
a49c0ff6 | 63 | dnl --------------------------------------------- |
27eebb3e | 64 | dnl |
7ea487bc | 65 | if test "x$cflags_specified" = "x" ; then |
a49c0ff6 | 66 | if test "x${GCC}" = "xyes"; then |
7fd63b38 | 67 | CFLAGS="-Os -g -Wall -Wsign-compare -Wpointer-arith" |
7347a2ad | 68 | CFLAGS="${CFLAGS} -Wbad-function-cast -Wwrite-strings" |
a49c0ff6 | 69 | fi |
7fd63b38 | 70 | # TODO: conditionally addd -Wpacked if handled |
7ea487bc | 71 | fi |
72 | ||
73 | dnl -------------- | |
74 | dnl Check programs | |
75 | dnl -------------- | |
76 | AC_PROG_CPP | |
77 | AC_PROG_INSTALL | |
78 | AC_PROG_MAKE_SET | |
79 | AC_CHECK_TOOL(AR, ar) | |
80 | AC_CHECK_TOOL(RANLIB, ranlib, :) | |
81 | ||
82 | dnl --------- | |
83 | dnl AIX check | |
84 | dnl --------- | |
85 | AC_AIX | |
86 | ||
87efd646 | 87 | dnl ------- |
88 | dnl libtool | |
89 | dnl ------- | |
0fc42949 | 90 | AC_PROG_LIBTOOL |
87efd646 | 91 | |
7ea487bc | 92 | dnl ---------------------- |
93 | dnl Packages configuration | |
94 | dnl ---------------------- | |
95 | AC_ARG_ENABLE(vtysh, | |
fc9d0745 | 96 | [ --enable-vtysh include integrated vty shell for Quagga]) |
7ea487bc | 97 | AC_ARG_ENABLE(ipv6, |
98 | [ --disable-ipv6 turn off IPv6 related features and daemons]) | |
99 | AC_ARG_ENABLE(zebra, | |
100 | [ --disable-zebra do not build zebra daemon]) | |
101 | AC_ARG_ENABLE(bgpd, | |
102 | [ --disable-bgpd do not build bgpd]) | |
103 | AC_ARG_ENABLE(ripd, | |
104 | [ --disable-ripd do not build ripd]) | |
105 | AC_ARG_ENABLE(ripngd, | |
106 | [ --disable-ripngd do not build ripngd]) | |
107 | AC_ARG_ENABLE(ospfd, | |
108 | [ --disable-ospfd do not build ospfd]) | |
7ea487bc | 109 | AC_ARG_ENABLE(ospf6d, |
110 | [ --disable-ospf6d do not build ospf6d]) | |
9e867fe6 | 111 | AC_ARG_ENABLE(isisd, |
ae399ab0 | 112 | [ --enable-isisd build isisd]) |
7ea487bc | 113 | AC_ARG_ENABLE(bgp-announce, |
114 | [ --disable-bgp-announce, turn off BGP route announcement]) | |
115 | AC_ARG_ENABLE(netlink, | |
116 | [ --enable-netlink force to use Linux netlink interface]) | |
117 | AC_ARG_ENABLE(broken-aliases, | |
118 | [ --enable-broken-aliases enable aliases as distinct interfaces for Linux 2.2.X]) | |
119 | AC_ARG_ENABLE(snmp, | |
120 | [ --enable-snmp enable SNMP support]) | |
121 | AC_ARG_WITH(libpam, | |
122 | [ --with-libpam use libpam for PAM support in vtysh]) | |
71c0fb50 | 123 | AC_ARG_ENABLE(tcp-zebra, |
7ea487bc | 124 | [ --enable-tcp-zebra enable TCP/IP socket connection between zebra and protocol daemon]) |
7ea487bc | 125 | AC_ARG_ENABLE(opaque-lsa, |
1ef74ef7 | 126 | [ --enable-opaque-lsa enable OSPF Opaque-LSA with OSPFAPI support (RFC2370)]) |
127 | AC_ARG_ENABLE(ospfapi, | |
128 | [ --disable-ospfapi do not build OSPFAPI to access the OSPF LSA Database, | |
129 | (this is the default if --enable-opaque-lsa is not set)]) | |
130 | AC_ARG_ENABLE(ospfclient, | |
131 | [ --disable-ospfclient do not build OSPFAPI client for OSPFAPI, | |
132 | (this is the default if --disable-ospfapi is set)]) | |
7ea487bc | 133 | AC_ARG_ENABLE(ospf-te, |
134 | [ --enable-ospf-te enable Traffic Engineering Extension to OSPF]) | |
135 | AC_ARG_ENABLE(multipath, | |
136 | [ --enable-multipath=ARG enable multipath function, ARG must be digit]) | |
e8f2984c | 137 | AC_ARG_ENABLE(quagga_user, |
138 | [ --enable-user=ARG user to run Quagga suite as (default quagga)]) | |
139 | AC_ARG_ENABLE(quagga_group, | |
140 | [ --enable-group=ARG group to run Quagga suite as (default quagga)]) | |
edd7c245 | 141 | AC_ARG_ENABLE(vty_group, |
6b6942f9 | 142 | [ --enable-vty-group=ARG set vty sockets to have specified group as owner]) |
aa593d5e | 143 | AC_ARG_ENABLE(configfile_mask, |
144 | [ --enable-configfile-mask=ARG set mask for config files]) | |
145 | AC_ARG_ENABLE(logfile_mask, | |
146 | [ --enable-logfile-mask=ARG set mask for log files]) | |
edd7c245 | 147 | |
71c0fb50 | 148 | AC_ARG_ENABLE(rtadv, |
6b6942f9 | 149 | [ --disable-rtadv disable IPV6 router advertisement feature]) |
ca776988 | 150 | AC_ARG_ENABLE(irdp, |
6b6942f9 | 151 | [ --enable-irdp enable IRDP server support in zebra]) |
41d3fc96 | 152 | AC_ARG_ENABLE(capabilities, |
153 | [ --disable-capabilities disable using POSIX capabilities]) | |
6b6942f9 | 154 | AC_ARG_ENABLE(gcc_ultra_verbose, |
155 | [ --enable-gcc-ultra-verbose enable ultra verbose GCC warnings]) | |
156 | ||
157 | if test x"${enable_gcc_ultra_verbose}" = x"yes" ; then | |
158 | CFLAGS="${CFLAGS} -W -Wcast-qual -Wstrict-prototypes" | |
159 | CFLAGS="${CFLAGS} -Wmissing-declarations -Wmissing-noreturn" | |
160 | CFLAGS="${CFLAGS} -Wmissing-format-attribute -Wunreachable-code" | |
161 | CFLAGS="${CFLAGS} -Wpacked -Wpadded" | |
162 | fi | |
7ea487bc | 163 | |
164 | if test "${enable_broken_aliases}" = "yes"; then | |
165 | if test "${enable_netlink}" = "yes" | |
166 | then | |
167 | echo "Sorry, you can't use netlink with broken aliases" | |
168 | exit 1 | |
169 | fi | |
170 | AC_DEFINE(HAVE_BROKEN_ALIASES,,Broken Alias) | |
171 | enable_netlink=no | |
172 | fi | |
173 | ||
174 | if test "${enable_tcp_zebra}" = "yes"; then | |
175 | AC_DEFINE(HAVE_TCP_ZEBRA,,Use TCP for zebra communication) | |
176 | fi | |
177 | ||
7ea487bc | 178 | if test "${enable_opaque_lsa}" = "yes"; then |
179 | AC_DEFINE(HAVE_OPAQUE_LSA,,OSPF Opaque LSA) | |
180 | fi | |
181 | ||
182 | if test "${enable_ospf_te}" = "yes"; then | |
183 | AC_DEFINE(HAVE_OPAQUE_LSA,,OSPF Opaque LSA) | |
184 | AC_DEFINE(HAVE_OSPF_TE,,OSPF TE) | |
185 | fi | |
186 | ||
d2a0ccc6 | 187 | AC_MSG_CHECKING(if zebra should be configurable to send Route Advertisements) |
188 | if test "${enable_rtadv}" != "no"; then | |
71c0fb50 | 189 | AC_MSG_RESULT(yes) |
d2a0ccc6 | 190 | AC_DEFINE(HAVE_RTADV,,Enable IPv6 Routing Advertisement support) |
2487bea1 | 191 | else |
192 | AC_MSG_RESULT(no) | |
71c0fb50 | 193 | fi |
7ea487bc | 194 | |
ca776988 | 195 | if test "${enable_irdp}" = "yes"; then |
196 | AC_DEFINE(HAVE_IRDP,, IRDP ) | |
197 | fi | |
198 | ||
79cb2169 | 199 | if test "${enable_user}" = "yes" || test x"${enable_user}" = x""; then |
e8f2984c | 200 | enable_user="quagga" |
edd7c245 | 201 | elif test "${enable_user}" = "no"; then |
202 | enable_user="root" | |
203 | fi | |
e8f2984c | 204 | AC_DEFINE_UNQUOTED(QUAGGA_USER, "${enable_user}", Quagga User) |
edd7c245 | 205 | |
79cb2169 | 206 | if test "${enable_group}" = "yes" || test x"${enable_group}" = x""; then |
e8f2984c | 207 | enable_group="quagga" |
edd7c245 | 208 | elif test "${enable_group}" = "no"; then |
209 | enable_group="root" | |
210 | fi | |
e8f2984c | 211 | AC_DEFINE_UNQUOTED(QUAGGA_GROUP, "${enable_group}", Quagga Group) |
edd7c245 | 212 | |
213 | if test x"${enable_vty_group}" = x"yes" ; then | |
8d4aee5d | 214 | AC_MSG_ERROR([--enable-vty-group requires a group as argument, not yes]) |
79cb2169 | 215 | elif test x"${enable_vty_group}" != x""; then |
8d4aee5d | 216 | if test x"${enable_vty_group}" != x"no"; then |
edd7c245 | 217 | AC_DEFINE_UNQUOTED(VTY_GROUP, "${enable_vty_group}", VTY Sockets Group) |
218 | fi | |
219 | fi | |
220 | ||
aa593d5e | 221 | enable_configfile_mask=${enable_configfile_mask:-0600} |
222 | AC_DEFINE_UNQUOTED(CONFIGFILE_MASK, ${enable_configfile_mask}, Mask for config files) | |
223 | ||
224 | enable_logfile_mask=${enable_logfile_mask:-0600} | |
225 | AC_DEFINE_UNQUOTED(LOGFILE_MASK, ${enable_logfile_mask}, Mask for log files) | |
226 | ||
7ea487bc | 227 | changequote(, )dnl |
228 | ||
229 | MULTIPATH_NUM=1 | |
230 | ||
231 | case "${enable_multipath}" in | |
232 | [0-9]|[1-9][0-9]) | |
233 | MULTIPATH_NUM="${enable_multipath}" | |
234 | ;; | |
235 | "") | |
236 | ;; | |
237 | *) | |
238 | echo "Please specify digit to --enable-multipath ARG." | |
239 | exit 1 | |
240 | ;; | |
241 | esac | |
242 | ||
243 | changequote([, ])dnl | |
244 | ||
245 | AC_SUBST(MULTIPATH_NUM) | |
246 | ||
247 | dnl ------------------- | |
248 | dnl Check header files. | |
249 | dnl ------------------- | |
dc7a2bf1 | 250 | AC_HEADER_STDC |
251 | AC_CHECK_HEADERS([string.h stropts.h sys/conf.h sys/ksym.h sys/time.h \ | |
252 | sys/times.h sys/select.h sys/sysctl.h sys/sockio.h \ | |
253 | sys/types.h linux/version.h kvm.h netdb.h asm/types.h \ | |
254 | libutil.h limits.h]) | |
255 | ||
835b7f1b | 256 | AC_CHECK_HEADERS([sys/socket.h netinet/in_systm.h netinet/in.h \ |
f3bd1a78 | 257 | net/if_dl.h net/netopt.h inet/nd.h net/route.h \ |
835b7f1b | 258 | net/if.h net/if_var.h netinet/in_var.h]) |
dc7a2bf1 | 259 | |
fa3232e1 | 260 | dnl V6 headers are checked below, after we check for v6 |
7ea487bc | 261 | |
262 | dnl check some types | |
263 | AC_C_CONST | |
264 | dnl AC_TYPE_PID_T | |
265 | AC_TYPE_SIGNAL | |
266 | ||
267 | dnl Some systems (Solaris 2.x) require libnsl (Network Services Library) | |
268 | case "$host" in | |
19877dd2 | 269 | [*-sunos5.[6-8]*] | [*-solaris2.[6-8]*]) |
7ea487bc | 270 | opsys=sol2-6 |
19877dd2 | 271 | AC_DEFINE(SUNOS_56, 1, SunOS 5.6 to 5.8) |
272 | AC_DEFINE(SUNOS_5, 1, SunOS 5) | |
7ea487bc | 273 | AC_CHECK_LIB(xnet, main) |
274 | CURSES=-lcurses | |
275 | ;; | |
19877dd2 | 276 | [*-sunos5.[8-9]] | [*-sunos5.1[0-9]] \ |
277 | | [*-solaris2.[8-9]] | [*-solaris2.1[0-9]]) | |
278 | opsys=sol9 | |
279 | AC_DEFINE(SUNOS_59,,SunOS 5.9 up) | |
280 | AC_DEFINE(SUNOS_5, 1, SunOS 5) | |
281 | AC_CHECK_LIB(socket, main) | |
282 | AC_CHECK_LIB(nsl, main) | |
283 | CURSES=-lcurses | |
284 | ;; | |
7ea487bc | 285 | *-sunos5* | *-solaris2*) |
19877dd2 | 286 | AC_DEFINE(SUNOS_5,,SunOS 5, Unknown SunOS) |
7ea487bc | 287 | AC_CHECK_LIB(socket, main) |
288 | AC_CHECK_LIB(nsl, main) | |
289 | CURSES=-lcurses | |
290 | ;; | |
291 | *-linux-*) | |
292 | opsys=gnu-linux | |
293 | AC_DEFINE(GNU_LINUX,,GNU Linux) | |
294 | ;; | |
295 | *-nec-sysv4*) | |
296 | AC_CHECK_LIB(nsl, gethostbyname) | |
297 | AC_CHECK_LIB(socket, socket) | |
298 | ;; | |
299 | *-freebsd3.2) | |
300 | AC_DEFINE(FREEBSD_32,,FreeBSD 3.2) | |
301 | ;; | |
302 | *-openbsd*) | |
303 | opsys=openbsd | |
304 | AC_DEFINE(OPEN_BSD,,OpenBSD) | |
305 | ;; | |
306 | *-bsdi*) | |
307 | opsys=bsdi | |
308 | OTHER_METHOD="mtu_kvm.o" | |
309 | AC_CHECK_LIB(kvm, main) | |
310 | ;; | |
49e3b3c0 | 311 | *-irix6.5) |
dc7a2bf1 | 312 | opsys=irix |
313 | AC_DEFINE(IRIX_65,,IRIX 6.5) | |
314 | ;; | |
7ea487bc | 315 | esac |
316 | ||
317 | dnl --------------------- | |
318 | dnl Integrated VTY option | |
319 | dnl --------------------- | |
320 | case "${enable_vtysh}" in | |
321 | "yes") VTYSH="vtysh"; | |
322 | AC_DEFINE(VTYSH,,VTY shell) | |
fc9d0745 | 323 | AC_PATH_PROG(PERL, perl) |
324 | dnl Vtysh uses libreadline, which looks for termcap functions at | |
325 | dnl configure time. We follow readline's search order. | |
326 | dnl The required procedures are in libtermcap on NetBSD, in | |
327 | dnl [TODO] on Linux, and in [TODO] on Solaris. | |
328 | AC_CHECK_LIB(termcap, tputs, , | |
329 | AC_CHECK_LIB(tinfo, tputs, , | |
330 | AC_CHECK_LIB(curses, tputs, , | |
331 | AC_CHECK_LIB(ncurses, tputs)))) | |
7ea487bc | 332 | AC_CHECK_LIB(readline, main) |
333 | if test $ac_cv_lib_readline_main = no; then | |
fc9d0745 | 334 | AC_MSG_ERROR([vtysh needs libreadline but was not found and usable on your system.]) |
7ea487bc | 335 | fi |
336 | AC_CHECK_HEADER(readline/history.h) | |
337 | if test $ac_cv_header_readline_history_h = no;then | |
338 | AC_MSG_ERROR([readline is too old to have readline/history.h, please update to the latest readline library.]) | |
339 | fi | |
3d3de8c4 | 340 | AC_CHECK_LIB(readline, rl_completion_matches) |
341 | if test $ac_cv_lib_readline_rl_completion_matches = no; then | |
342 | AC_DEFINE(rl_completion_matches,completion_matches,Old readline) | |
343 | fi | |
344 | ;; | |
7ea487bc | 345 | "no" ) VTYSH="";; |
346 | * ) ;; | |
347 | esac | |
348 | ||
349 | dnl ---------- | |
350 | dnl PAM module | |
351 | dnl ---------- | |
24cd435b | 352 | if test "$with_libpam" = "yes"; then |
24cd435b | 353 | AC_CHECK_HEADER(security/pam_misc.h) |
354 | if test "$ac_cv_header_security_pam_misc_h" = yes; then | |
355 | AC_DEFINE(HAVE_PAM_MISC_H,,Have pam_misc.h) | |
356 | AC_DEFINE(PAM_CONV_FUNC,misc_conv,Have misc_conv) | |
357 | pam_conv_func="misc_conv" | |
24cd435b | 358 | fi |
24cd435b | 359 | AC_CHECK_HEADER(security/openpam.h) |
360 | if test "$ac_cv_header_security_openpam_h" = yes; then | |
361 | AC_DEFINE(HAVE_OPENPAM_H,,Have openpam.h) | |
362 | AC_DEFINE(PAM_CONV_FUNC,openpam_ttyconv,Have openpam_ttyconv) | |
363 | pam_conv_func="openpam_ttyconv" | |
24cd435b | 364 | fi |
365 | if test -z "$ac_cv_header_security_pam_misc_h$ac_cv_header_security_openpam_h" ; then | |
366 | AC_MSG_WARN([*** pam support will not be built ***]) | |
367 | with_libpam="no" | |
368 | fi | |
369 | fi | |
370 | ||
7ea487bc | 371 | if test "$with_libpam" = "yes"; then |
372 | dnl took this test from proftpd's configure.in and suited to our needs | |
373 | dnl ------------------------------------------------------------------------- | |
374 | dnl | |
375 | dnl This next check looks funky due to a linker problem with some versions | |
376 | dnl of the PAM library. Prior to 0.72 release, the Linux PAM shared library | |
377 | dnl omitted requiring libdl linking information. PAM-0.72 or better ships | |
378 | dnl with RedHat 6.2 and Debian 2.2 or better. | |
379 | AC_CHECK_LIB(pam, pam_start, | |
24cd435b | 380 | [AC_CHECK_LIB(pam, $pam_conv_func, |
7ea487bc | 381 | [AC_DEFINE(USE_PAM,,Use PAM for authentication) |
382 | LIBPAM="-lpam"], | |
383 | [AC_DEFINE(USE_PAM,,Use PAM for authentication) | |
384 | LIBPAM="-lpam -lpam_misc"] | |
385 | ) | |
386 | ], | |
387 | ||
388 | [AC_CHECK_LIB(pam, pam_end, | |
24cd435b | 389 | [AC_CHECK_LIB(pam, $pam_conv_func, |
a159ed93 | 390 | [AC_DEFINE(USE_PAM,,Use PAM for authentication) |
7ea487bc | 391 | LIBPAM="-lpam -ldl"], |
a159ed93 | 392 | [AC_DEFINE(USE_PAM,,Use PAM for authentication) |
7ea487bc | 393 | LIBPAM="-lpam -ldl -lpam_misc"] |
394 | ) | |
395 | ],AC_MSG_WARN([*** pam support will not be built ***]), | |
396 | [-ldl]) | |
397 | ] | |
398 | ) | |
399 | fi | |
400 | AC_SUBST(LIBPAM) | |
401 | ||
402 | dnl ------------------------------- | |
403 | dnl Endian-ness check | |
404 | dnl ------------------------------- | |
405 | AC_WORDS_BIGENDIAN | |
406 | ||
407 | dnl ------------------------------- | |
408 | dnl check the size in byte of the C | |
409 | dnl ------------------------------- | |
410 | dnl AC_CHECK_SIZEOF(char) | |
411 | dnl AC_CHECK_SIZEOF(int) | |
412 | dnl AC_CHECK_SIZEOF(short) | |
413 | dnl AC_CHECK_SIZEOF(long) | |
414 | ||
415 | dnl ---------------------------- | |
416 | dnl check existance of functions | |
417 | dnl ---------------------------- | |
49e3b3c0 | 418 | AC_CHECK_FUNCS(memset memcpy strerror inet_aton daemon snprintf vsnprintf \ |
04bd484b | 419 | strlcat strlcpy if_nametoindex if_indextoname getifaddrs \ |
420 | fcntl) | |
a159ed93 | 421 | AC_CHECK_FUNCS(setproctitle, , |
422 | [AC_CHECK_LIB(util, setproctitle, | |
423 | [LIBS="$LIBS -lutil" | |
424 | AC_DEFINE(HAVE_SETPROCTITLE,, Have setproctitle) | |
425 | ] | |
426 | ) | |
427 | ] | |
428 | ) | |
7ea487bc | 429 | |
430 | dnl ------------------------------------ | |
431 | dnl Determine routing get and set method | |
432 | dnl ------------------------------------ | |
433 | AC_MSG_CHECKING(zebra between kernel interface method) | |
434 | if test x"$opsys" = x"gnu-linux"; then | |
435 | if test "${enable_netlink}" = "yes";then | |
436 | AC_MSG_RESULT(netlink) | |
437 | RT_METHOD=rt_netlink.o | |
438 | AC_DEFINE(HAVE_NETLINK,,netlink) | |
439 | netlink=yes | |
440 | elif test "${enable_netlink}" = "no"; then | |
441 | AC_MSG_RESULT(ioctl) | |
442 | RT_METHOD=rt_ioctl.o | |
443 | netlink=no | |
444 | else | |
445 | AC_MSG_RESULT(netlink) | |
446 | RT_METHOD=rt_netlink.o | |
447 | AC_DEFINE(HAVE_NETLINK,,netlink) | |
448 | netlink=yes | |
449 | fi | |
19877dd2 | 450 | elif test x"$opsys" = x"sol2-6";then |
451 | AC_MSG_RESULT(Route socket) | |
452 | KERNEL_METHOD="kernel_socket.o" | |
453 | RT_METHOD="rt_socket.o" | |
454 | elif test x"$opsys" = x"sol9";then | |
455 | AC_MSG_RESULT(Route socket) | |
456 | KERNEL_METHOD="kernel_socket.o" | |
457 | RT_METHOD="rt_socket.o" | |
458 | elif test "$opsys" = "irix" ; then | |
459 | AC_MSG_RESULT(Route socket) | |
460 | KERNEL_METHOD="kernel_socket.o" | |
461 | RT_METHOD="rt_socket.o" | |
7ea487bc | 462 | else |
19877dd2 | 463 | AC_TRY_RUN([#include <errno.h> |
7ea487bc | 464 | #include <sys/types.h> |
465 | #include <sys/socket.h> | |
466 | ||
467 | main () | |
468 | { | |
469 | int ac_sock; | |
470 | ||
471 | ac_sock = socket (AF_ROUTE, SOCK_RAW, 0); | |
472 | if (ac_sock < 0 && errno == EINVAL) | |
473 | exit (1); | |
474 | exit (0); | |
475 | }], | |
476 | [KERNEL_METHOD=kernel_socket.o | |
477 | RT_METHOD=rt_socket.o | |
478 | AC_MSG_RESULT(socket)], | |
479 | [RT_METHOD=rt_ioctl.o | |
480 | AC_MSG_RESULT(ioctl)], | |
481 | [KERNEL_METHOD=kernel_socket.o | |
482 | RT_METHOD=rt_socket.o | |
483 | AC_MSG_RESULT(socket)]) | |
7ea487bc | 484 | fi |
485 | AC_SUBST(RT_METHOD) | |
486 | AC_SUBST(KERNEL_METHOD) | |
487 | AC_SUBST(OTHER_METHOD) | |
488 | ||
489 | dnl ------------------------------ | |
490 | dnl check kernel route read method | |
491 | dnl ------------------------------ | |
492 | AC_CACHE_CHECK(route read method check, zebra_rtread, | |
493 | [if test "$netlink" = yes; then | |
494 | RTREAD_METHOD="rtread_netlink.o" | |
495 | zebra_rtread="netlink" | |
496 | else | |
497 | for zebra_rtread in /proc/net/route /dev/ip /dev/null; | |
498 | do | |
499 | test x`ls $zebra_rtread 2>/dev/null` = x"$zebra_rtread" && break | |
500 | done | |
501 | case $zebra_rtread in | |
502 | "/proc/net/route") RTREAD_METHOD="rtread_proc.o" | |
503 | zebra_rtread="proc";; | |
9c30ab6b | 504 | "/dev/ip") |
505 | case "$host" in | |
506 | *-freebsd*) RTREAD_METHOD=rtread_sysctl.o | |
507 | zebra_rtread="sysctl";; | |
508 | *) RTREAD_METHOD="rtread_getmsg.o" | |
509 | zebra_rtread="getmsg";; | |
510 | esac;; | |
7ea487bc | 511 | *) RTREAD_METHOD="rtread_sysctl.o" |
512 | zebra_rtread="sysctl";; | |
513 | esac | |
514 | fi]) | |
515 | AC_SUBST(RTREAD_METHOD) | |
516 | ||
517 | dnl ----------------------------- | |
518 | dnl check interface lookup method | |
519 | dnl ----------------------------- | |
19877dd2 | 520 | IOCTL_METHOD=ioctl.o |
7ea487bc | 521 | AC_MSG_CHECKING(interface looking up method) |
522 | if test "$netlink" = yes; then | |
523 | AC_MSG_RESULT(netlink) | |
524 | IF_METHOD=if_netlink.o | |
19877dd2 | 525 | elif test "$opsys" = "sol2-6";then |
526 | AC_MSG_RESULT(Solaris GIF) | |
527 | IF_METHOD=if_ioctl.o | |
528 | elif test "$opsys" = "sol9";then | |
529 | AC_MSG_RESULT(Solaris GLIF) | |
530 | IF_METHOD=if_ioctl_solaris.o | |
531 | IOCTL_METHOD=ioctl_solaris.o | |
532 | elif test "$opsys" = "irix" ; then | |
533 | AC_MSG_RESULT(IRIX) | |
534 | IF_METHOD=if_ioctl.o | |
535 | elif test "$opsys" = "openbsd";then | |
536 | AC_MSG_RESULT(openbsd) | |
537 | IF_METHOD=if_ioctl.o | |
538 | elif grep NET_RT_IFLIST /usr/include/sys/socket.h >/dev/null 2>&1; then | |
539 | AC_MSG_RESULT(sysctl) | |
7ea487bc | 540 | IF_METHOD=if_sysctl.o |
541 | AC_DEFINE(HAVE_NET_RT_IFLIST,,NET_RT_IFLIST) | |
19877dd2 | 542 | else |
7ea487bc | 543 | AC_MSG_RESULT(ioctl) |
544 | IF_METHOD=if_ioctl.o | |
7ea487bc | 545 | fi |
546 | AC_SUBST(IF_METHOD) | |
19877dd2 | 547 | AC_SUBST(IOCTL_METHOD) |
7ea487bc | 548 | |
549 | dnl ----------------------- | |
550 | dnl check proc file system. | |
551 | dnl ----------------------- | |
552 | if test -r /proc/net/dev; then | |
553 | AC_DEFINE(HAVE_PROC_NET_DEV,,/proc/net/dev) | |
554 | IF_PROC=if_proc.o | |
555 | fi | |
556 | ||
557 | if test -r /proc/net/if_inet6; then | |
558 | AC_DEFINE(HAVE_PROC_NET_IF_INET6,,/proc/net/if_inet6) | |
559 | IF_PROC=if_proc.o | |
560 | fi | |
561 | AC_SUBST(IF_PROC) | |
562 | ||
563 | dnl ----------------------------- | |
564 | dnl check ipforward detect method | |
565 | dnl ----------------------------- | |
566 | AC_CACHE_CHECK(ipforward method check, zebra_ipforward_path, | |
567 | [for zebra_ipforward_path in /proc/net/snmp /dev/ip /dev/null; | |
568 | do | |
569 | test x`ls $zebra_ipforward_path 2>/dev/null` = x"$zebra_ipforward_path" && break | |
570 | done | |
571 | case $zebra_ipforward_path in | |
572 | "/proc/net/snmp") IPFORWARD=ipforward_proc.o | |
573 | zebra_ipforward_path="proc";; | |
574 | "/dev/ip") | |
575 | case "$host" in | |
576 | *-nec-sysv4*) IPFORWARD=ipforward_ews.o | |
577 | zebra_ipforward_path="ews";; | |
9c30ab6b | 578 | *-freebsd*) IPFORWARD=ipforward_sysctl.o |
579 | zebra_ipforward_path="sysctl";; | |
7ea487bc | 580 | *) IPFORWARD=ipforward_solaris.o |
581 | zebra_ipforward_path="solaris";; | |
582 | esac;; | |
583 | *) IPFORWARD=ipforward_sysctl.o | |
584 | zebra_ipforward_path="sysctl";; | |
585 | esac]) | |
586 | AC_SUBST(IPFORWARD) | |
587 | ||
588 | AC_CHECK_FUNCS(getaddrinfo, [have_getaddrinfo=yes], [have_getaddrinfo=no]) | |
589 | ||
590 | dnl ---------- | |
591 | dnl IPv6 check | |
592 | dnl ---------- | |
593 | AC_MSG_CHECKING(whether does this OS have IPv6 stack) | |
594 | if test "${enable_ipv6}" = "no"; then | |
595 | AC_MSG_RESULT(disabled) | |
596 | else | |
597 | dnl ---------- | |
598 | dnl INRIA IPv6 | |
599 | dnl ---------- | |
a159ed93 | 600 | if grep IPV6_INRIA_VERSION /usr/include/netinet/in.h >/dev/null 2>&1; then |
601 | zebra_cv_ipv6=yes | |
602 | AC_DEFINE(HAVE_IPV6,1,INRIA IPv6) | |
603 | AC_DEFINE(INRIA_IPV6,1,INRIA IPv6) | |
604 | RIPNGD="ripngd" | |
605 | OSPF6D="ospf6d" | |
606 | LIB_IPV6="" | |
607 | AC_MSG_RESULT(INRIA IPv6) | |
7ea487bc | 608 | dnl --------- |
609 | dnl KAME IPv6 | |
610 | dnl --------- | |
a159ed93 | 611 | elif grep WIDE /usr/include/netinet6/in6.h >/dev/null 2>&1; then |
612 | zebra_cv_ipv6=yes | |
613 | AC_DEFINE(HAVE_IPV6,1,KAME IPv6) | |
614 | AC_DEFINE(KAME,1,KAME IPv6) | |
615 | RIPNGD="ripngd" | |
616 | OSPF6D="ospf6d" | |
617 | if test -d /usr/local/v6/lib -a -f /usr/local/v6/lib/libinet6.a; then | |
7ea487bc | 618 | LIB_IPV6="-L/usr/local/v6/lib -linet6" |
a159ed93 | 619 | fi |
620 | AC_MSG_RESULT(KAME) | |
71c0fb50 | 621 | dnl ------------------------- |
622 | dnl MUSICA IPv6 | |
623 | dnl default host check | |
624 | dnl It is not used by Kheops | |
625 | dnl ------------------------- | |
a159ed93 | 626 | elif grep MUSICA /usr/include6/netinet6/in6.h >/dev/null 2>&1; then |
627 | zebra_cv_ipv6=yes | |
628 | AC_DEFINE(HAVE_IPV6,1,Musicia IPv6) | |
629 | AC_DEFINE(MUSICA,1,Musica IPv6 stack) | |
630 | AC_DEFINE(KAME,1,KAME IPv6 stack) | |
631 | RIPNGD="ripngd" | |
632 | OSPF6D="ospf6d" | |
633 | if test -d /usr/local/v6/lib -a -f /usr/local/v6/lib/libinet6.a; then | |
71c0fb50 | 634 | LIB_IPV6="-L/usr/local/v6/lib -linet6" |
a159ed93 | 635 | fi |
636 | AC_MSG_RESULT(MUSICA) | |
7ea487bc | 637 | dnl --------- |
638 | dnl NRL check | |
639 | dnl --------- | |
a159ed93 | 640 | elif grep NRL /usr/include/netinet6/in6.h >/dev/null 2>&1; then |
641 | zebra_cv_ipv6=yes | |
642 | AC_DEFINE(HAVE_IPV6,1,NRL IPv6) | |
643 | AC_DEFINE(NRL,1,NRL) | |
644 | RIPNGD="ripngd" | |
645 | OSPF6D="ospf6d" | |
646 | if test x"$opsys" = x"bsdi";then | |
7ea487bc | 647 | AC_DEFINE(BSDI_NRL,,BSDI) |
648 | AC_MSG_RESULT(BSDI_NRL) | |
a159ed93 | 649 | else |
7ea487bc | 650 | AC_MSG_RESULT(NRL) |
a159ed93 | 651 | fi |
19877dd2 | 652 | dnl ------------------------------------ |
653 | dnl Solaris 9, 10 and potentially higher | |
654 | dnl ------------------------------------ | |
655 | elif test x"$opsys" = x"sol9"; then | |
656 | zebra_cv_ipv6=yes; | |
657 | AC_DEFINE(HAVE_IPV6, 1, IPv6) | |
658 | AC_DEFINE(SOLARIS_IPV6, 1, Solaris IPv6) | |
659 | RIPNGD="ripngd" | |
660 | OSPF6D="ospf6d" | |
661 | AC_MSG_RESULT(Solaris IPv6) | |
7ea487bc | 662 | dnl ---------- |
663 | dnl Linux IPv6 | |
664 | dnl ---------- | |
a159ed93 | 665 | elif test "${enable_ipv6}" = "yes"; then |
666 | AC_EGREP_CPP(yes, [ | |
667 | #include <linux/version.h> | |
668 | /* 2.1.128 or later */ | |
669 | #if LINUX_VERSION_CODE >= 0x020180 | |
670 | yes | |
671 | #endif], | |
672 | [zebra_cv_ipv6=yes | |
673 | zebra_cv_linux_ipv6=yes | |
674 | AC_MSG_RESULT(Linux IPv6)]) | |
675 | else | |
676 | if test x`ls /proc/net/ipv6_route 2>/dev/null` = x"/proc/net/ipv6_route" | |
677 | then | |
7ea487bc | 678 | zebra_cv_ipv6=yes |
679 | zebra_cv_linux_ipv6=yes | |
680 | AC_MSG_RESULT(Linux IPv6) | |
a159ed93 | 681 | fi |
682 | fi | |
7ea487bc | 683 | |
a159ed93 | 684 | if test "$zebra_cv_linux_ipv6" = "yes";then |
685 | AC_MSG_CHECKING(for GNU libc >= 2.1) | |
686 | AC_DEFINE(HAVE_IPV6,1,Linux IPv6) | |
687 | AC_EGREP_CPP(yes, [ | |
7ea487bc | 688 | #include <features.h> |
689 | #if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 | |
690 | yes | |
a159ed93 | 691 | #endif], |
692 | [glibc=yes | |
693 | AC_DEFINE(LINUX_IPV6,1,Linux IPv6 stack) | |
694 | AC_MSG_RESULT(yes)], | |
695 | AC_MSG_RESULT(no) | |
696 | ) | |
697 | RIPNGD="ripngd" | |
698 | OSPF6D="ospf6d" | |
699 | if test "$glibc" != "yes"; then | |
7ea487bc | 700 | INCLUDES="-I/usr/inet6/include" |
701 | if test x`ls /usr/inet6/lib/libinet6.a 2>/dev/null` != x;then | |
702 | LIB_IPV6="-L/usr/inet6/lib -linet6" | |
703 | fi | |
a159ed93 | 704 | fi |
705 | fi | |
7ea487bc | 706 | |
707 | dnl ----------------------- | |
708 | dnl Set IPv6 related values | |
709 | dnl ----------------------- | |
a159ed93 | 710 | LIBS="$LIB_IPV6 $LIBS" |
711 | AC_SUBST(LIB_IPV6) | |
7ea487bc | 712 | |
a159ed93 | 713 | if test x"$RIPNGD" = x""; then |
714 | AC_MSG_RESULT(IPv4 only) | |
715 | fi | |
7ea487bc | 716 | fi |
717 | ||
fa3232e1 | 718 | dnl ------------------ |
719 | dnl IPv6 header checks | |
720 | dnl ------------------ | |
721 | if test "x${zebra_cv_ipv6}" = "xyes"; then | |
722 | AC_CHECK_HEADERS([netinet6/in6.h netinet/in6_var.h netinet/icmp6.h \ | |
723 | netinet6/in6_var.h netinet6/nd6.h]) | |
724 | fi | |
725 | ||
7ea487bc | 726 | dnl -------------------- |
727 | dnl Daemon disable check | |
728 | dnl -------------------- | |
729 | if test "${enable_zebra}" = "no";then | |
730 | ZEBRA="" | |
731 | else | |
732 | ZEBRA="zebra" | |
733 | fi | |
734 | ||
735 | if test "${enable_bgpd}" = "no";then | |
736 | BGPD="" | |
737 | else | |
738 | BGPD="bgpd" | |
739 | fi | |
740 | ||
741 | if test "${enable_ripd}" = "no";then | |
742 | RIPD="" | |
743 | else | |
744 | RIPD="ripd" | |
745 | fi | |
746 | ||
747 | if test "${enable_ospfd}" = "no";then | |
748 | OSPFD="" | |
749 | else | |
750 | OSPFD="ospfd" | |
751 | fi | |
752 | ||
1ef74ef7 | 753 | OSPFCLIENT="" |
754 | if test "${enable_opaque_lsa}" = "yes"; then | |
755 | if test "${enable_ospfapi}" != "no";then | |
9a569848 | 756 | AC_DEFINE(SUPPORT_OSPF_API,,OSPFAPI) |
1ef74ef7 | 757 | |
758 | if test "${enable_ospfclient}" != "no";then | |
759 | OSPFCLIENT="ospfclient" | |
760 | fi | |
761 | fi | |
762 | ||
7ea487bc | 763 | fi |
764 | ||
765 | case "${enable_ripngd}" in | |
766 | "yes") RIPNGD="ripngd";; | |
767 | "no" ) RIPNGD="";; | |
768 | * ) ;; | |
769 | esac | |
770 | ||
771 | case "${enable_ospf6d}" in | |
772 | "yes") OSPF6D="ospf6d";; | |
773 | "no" ) OSPF6D="";; | |
774 | * ) ;; | |
775 | esac | |
776 | ||
9e867fe6 | 777 | case "${enable_isisd}" in |
778 | "yes") ISISD="isisd";; | |
779 | "no" ) ISISD="";; | |
ae399ab0 | 780 | * ) ;; |
9e867fe6 | 781 | esac |
782 | ||
7ea487bc | 783 | if test "${enable_bgp_announce}" = "no";then |
784 | AC_DEFINE(DISABLE_BGP_ANNOUNCE,,Disable BGP installation to zebra) | |
785 | fi | |
786 | ||
787 | AC_SUBST(ZEBRA) | |
788 | AC_SUBST(BGPD) | |
789 | AC_SUBST(RIPD) | |
790 | AC_SUBST(RIPNGD) | |
791 | AC_SUBST(OSPFD) | |
792 | AC_SUBST(OSPF6D) | |
9e867fe6 | 793 | AC_SUBST(ISISD) |
7ea487bc | 794 | AC_SUBST(VTYSH) |
795 | AC_SUBST(INCLUDES) | |
796 | AC_SUBST(CURSES) | |
797 | AC_SUBST(OSPFCLIENT) | |
1ef74ef7 | 798 | AC_SUBST(OSPFAPI) |
7ea487bc | 799 | AC_CHECK_LIB(c, inet_ntop, [AC_DEFINE(HAVE_INET_NTOP,,inet_ntop)]) |
800 | AC_CHECK_LIB(c, inet_pton, [AC_DEFINE(HAVE_INET_PTON,,inet_pton)]) | |
801 | AC_CHECK_LIB(crypt, crypt) | |
802 | AC_CHECK_LIB(resolv, res_init) | |
803 | AC_CHECK_LIB(m, main) | |
804 | ||
805 | dnl --------------------------------------------------- | |
806 | dnl BSD/OS 4.1 define inet_XtoY function as __inet_XtoY | |
807 | dnl --------------------------------------------------- | |
a159ed93 | 808 | AC_CHECK_FUNC(__inet_ntop, AC_DEFINE(HAVE_INET_NTOP,,__inet_ntop)) |
809 | AC_CHECK_FUNC(__inet_pton, AC_DEFINE(HAVE_INET_PTON,,__inet_pton)) | |
810 | AC_CHECK_FUNC(__inet_aton, AC_DEFINE(HAVE_INET_ATON,,__inet_aton)) | |
7ea487bc | 811 | |
812 | dnl --------------------------- | |
813 | dnl check system has GNU regexp | |
814 | dnl --------------------------- | |
815 | dnl AC_MSG_CHECKING(whether system has GNU regex) | |
816 | AC_CHECK_LIB(c, regexec, | |
817 | [AC_DEFINE(HAVE_GNU_REGEX,,GNU regexp library) | |
818 | LIB_REGEX=""], | |
819 | [LIB_REGEX="regex.o"]) | |
820 | AC_SUBST(LIB_REGEX) | |
821 | ||
822 | dnl ------------------ | |
823 | dnl check SNMP library | |
824 | dnl ------------------ | |
825 | if test "${enable_snmp}" = "yes";then | |
826 | dnl AC_CHECK_LIB(snmp, asn_parse_int, HAVE_SNMP=yes) | |
7ea487bc | 827 | if test "${HAVE_SNMP}" = ""; then |
1ef74ef7 | 828 | old_libs="${LIBS}" |
829 | LIBS="-L/usr/lib" | |
7ea487bc | 830 | unset ac_cv_lib_snmp_asn_parse_int |
1ef74ef7 | 831 | AC_CHECK_LIB(crypto, main, NEED_CRYPTO=yes, ) |
832 | if test "${NEED_CRYPTO}" = ""; then | |
833 | AC_CHECK_LIB(netsnmp, asn_parse_int, [HAVE_NETSNMP=yes; HAVE_SNMP=yes ]) | |
834 | else | |
835 | AC_CHECK_LIB(netsnmp, asn_parse_int, [HAVE_NETSNMP=yes; HAVE_SNMP=yes; NEED_CRYPTO=yes;LIBS="$LIBS -lcrypto" ],,"-lcrypto") | |
836 | fi | |
837 | LIBS="${old_libs}" | |
7ea487bc | 838 | fi |
7ea487bc | 839 | if test "${HAVE_SNMP}" = ""; then |
1ef74ef7 | 840 | old_libs="${LIBS}" |
841 | LIBS="-L/usr/lib" | |
842 | unset ac_cv_lib_snmp_asn_parse_int | |
843 | AC_CHECK_LIB(snmp, asn_parse_int, HAVE_SNMP=yes, ) | |
844 | if test "${HAVE_SNMP}" = ""; then | |
845 | unset ac_cv_lib_snmp_asn_parse_int | |
846 | AC_CHECK_LIB(crypto, main, NEED_CRYPTO=yes, ) | |
847 | if test "${NEED_CRYPTO}" = "yes"; then | |
848 | AC_CHECK_LIB(snmp, asn_parse_int, [HAVE_SNMP=yes; NEED_CRYPTO=yes; LIBS="$LIBS -lcrypto" ],,"-lcrypto") | |
849 | fi | |
850 | fi | |
851 | LIBS="${old_libs}" | |
7ea487bc | 852 | fi |
1ef74ef7 | 853 | |
ac7c4bb6 | 854 | if test "${HAVE_SNMP}" = ""; then |
1ef74ef7 | 855 | old_libs="${LIBS}" |
856 | LIBS="-L/usr/local/lib" | |
857 | unset ac_cv_lib_snmp_asn_parse_int | |
858 | AC_CHECK_LIB(snmp, asn_parse_int, HAVE_SNMP=yes) | |
859 | if test "${HAVE_SNMP}" = ""; then | |
860 | unset ac_cv_lib_snmp_asn_parse_int | |
861 | AC_CHECK_LIB(crypto, main, NEED_CRYPTO=yes, ) | |
862 | if test "${NEED_CRYPTO}" = "yes"; then | |
863 | AC_CHECK_LIB(snmp, asn_parse_int, [HAVE_SNMP=yes; NEED_CRYPTO=yes; LIBS="$LIBS -lcrypto" ],,"-lcrypto") | |
864 | fi | |
865 | fi | |
866 | LIBS="${old_libs}" | |
ac7c4bb6 | 867 | fi |
1ef74ef7 | 868 | |
7ea487bc | 869 | if test "${HAVE_SNMP}" = "yes"; then |
870 | 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 | |
871 | do | |
872 | test -f "${ac_snmp}" && break | |
873 | done | |
1ef74ef7 | 874 | |
7ea487bc | 875 | case ${ac_snmp} in |
876 | /usr/include/net-snmp/*) | |
877 | AC_DEFINE(HAVE_SNMP,,SNMP) | |
1ef74ef7 | 878 | AC_DEFINE(HAVE_NETSNMP,,SNMP) |
7ea487bc | 879 | AC_DEFINE(UCD_COMPATIBLE,,SNMP) |
ac7c4bb6 | 880 | CFLAGS="${CFLAGS} -I/usr/include/net-snmp -I/usr/include/net-snmp/library" |
881 | if test "${HAVE_NETSNMP}" = "yes"; then | |
1ef74ef7 | 882 | LIBS="${LIBS} -lnetsnmp" |
ac7c4bb6 | 883 | else |
1ef74ef7 | 884 | LIBS="${LIBS} -lsnmp" |
ac7c4bb6 | 885 | fi |
7ea487bc | 886 | ;; |
887 | /usr/include/ucd-snmp/*) | |
888 | AC_DEFINE(HAVE_SNMP,,SNMP) | |
889 | CFLAGS="${CFLAGS} -I/usr/include/ucd-snmp" | |
890 | LIBS="${LIBS} -lsnmp" | |
891 | ;; | |
892 | /usr/local/include/ucd-snmp/*) | |
893 | AC_DEFINE(HAVE_SNMP,,SNMP) | |
894 | CFLAGS="${CFLAGS} -I/usr/local/include/ucd-snmp" | |
895 | LIBS="${LIBS} -L/usr/local/lib -lsnmp" | |
896 | ;; | |
f3bd1a78 | 897 | /usr/local/include/net-snmp/*) |
898 | AC_DEFINE(HAVE_SNMP,,SNMP) | |
899 | AC_DEFINE(HAVE_NET_SNMP,,SNMP) | |
900 | AC_DEFINE(UCD_COMPATIBLE,,SNMP) | |
901 | CFLAGS="${CFLAGS} -I/usr/local/include/net-snmp" | |
902 | LIBS="${LIBS} -L/usr/local/lib -lnetsnmp" | |
903 | ;; | |
7ea487bc | 904 | esac |
905 | if test "${NEED_CRYPTO}" = "yes"; then | |
906 | LIBS="${LIBS} -lcrypto" | |
907 | fi | |
908 | fi | |
909 | fi | |
910 | ||
911 | dnl ---------------------------- | |
912 | dnl check sa_len of sockaddr | |
913 | dnl ---------------------------- | |
914 | AC_MSG_CHECKING(whether struct sockaddr has a sa_len field) | |
915 | AC_TRY_COMPILE([#include <sys/types.h> | |
916 | #include <sys/socket.h> | |
917 | ],[static struct sockaddr ac_i;int ac_j = sizeof (ac_i.sa_len);], | |
918 | [AC_MSG_RESULT(yes) | |
919 | AC_DEFINE(HAVE_SA_LEN,,sa_len)], | |
920 | AC_MSG_RESULT(no)) | |
921 | ||
922 | dnl ---------------------------- | |
923 | dnl check sin_len of sockaddr_in | |
924 | dnl ---------------------------- | |
925 | AC_MSG_CHECKING(whether struct sockaddr_in has a sin_len field) | |
926 | AC_TRY_COMPILE([#include <sys/types.h> | |
927 | #include <netinet/in.h> | |
928 | ],[static struct sockaddr_in ac_i;int ac_j = sizeof (ac_i.sin_len);], | |
929 | [AC_MSG_RESULT(yes) | |
930 | AC_DEFINE(HAVE_SIN_LEN,,sin_len)], | |
931 | AC_MSG_RESULT(no)) | |
932 | ||
933 | dnl ---------------------------- | |
934 | dnl check sun_len of sockaddr_un | |
935 | dnl ---------------------------- | |
936 | AC_MSG_CHECKING(whether struct sockaddr_un has a sun_len field) | |
937 | AC_TRY_COMPILE([#include <sys/types.h> | |
938 | #include <sys/un.h> | |
939 | ],[static struct sockaddr_un ac_i;int ac_j = sizeof (ac_i.sun_len);], | |
940 | [AC_MSG_RESULT(yes) | |
941 | AC_DEFINE(HAVE_SUN_LEN,,sun_len)], | |
942 | AC_MSG_RESULT(no)) | |
943 | ||
944 | dnl ----------------------------------- | |
945 | dnl check sin6_scope_id of sockaddr_in6 | |
946 | dnl ----------------------------------- | |
947 | if test "$zebra_cv_ipv6" = yes; then | |
948 | AC_MSG_CHECKING(whether struct sockaddr_in6 has a sin6_scope_id field) | |
949 | AC_TRY_COMPILE([#include <sys/types.h> | |
950 | #include <netinet/in.h> | |
951 | ],[static struct sockaddr_in6 ac_i;int ac_j = sizeof (ac_i.sin6_scope_id);], | |
952 | [AC_MSG_RESULT(yes) | |
953 | AC_DEFINE(HAVE_SIN6_SCOPE_ID,,scope id)], | |
954 | AC_MSG_RESULT(no)) | |
955 | fi | |
956 | ||
957 | dnl ---------------------------- | |
958 | dnl check socklen_t exist or not | |
959 | dnl ---------------------------- | |
960 | AC_MSG_CHECKING(whther socklen_t is defined) | |
961 | AC_TRY_COMPILE([#include <sys/types.h> | |
962 | #include <sys/socket.h> | |
963 | #include <netinet/in.h> | |
964 | ],[socklen_t ac_x;], | |
965 | [AC_MSG_RESULT(yes) | |
966 | AC_DEFINE(HAVE_SOCKLEN_T,,socklen_t)], | |
967 | AC_MSG_RESULT(no)) | |
968 | ||
969 | dnl ------------------------ | |
970 | dnl check struct sockaddr_dl | |
971 | dnl ------------------------ | |
972 | AC_MSG_CHECKING(whether struct sockaddr_dl exist) | |
973 | AC_EGREP_HEADER(sockaddr_dl, | |
974 | net/if_dl.h, | |
975 | [AC_MSG_RESULT(yes) | |
976 | AC_DEFINE(HAVE_SOCKADDR_DL,,sockaddr_dl)], | |
977 | AC_MSG_RESULT(no)) | |
978 | ||
979 | dnl -------------------------- | |
980 | dnl check structure ifaliasreq | |
981 | dnl -------------------------- | |
982 | AC_MSG_CHECKING(whether struct ifaliasreq exist) | |
983 | AC_EGREP_HEADER(ifaliasreq, | |
984 | net/if.h, | |
985 | [AC_MSG_RESULT(yes) | |
986 | AC_DEFINE(HAVE_IFALIASREQ,,ifaliasreq)], | |
987 | AC_MSG_RESULT(no)) | |
988 | ||
989 | dnl ---------------------------- | |
990 | dnl check structure in6_aliasreq | |
991 | dnl ---------------------------- | |
71c0fb50 | 992 | AC_MSG_CHECKING(whether struct in6_aliasreq exist) |
7ea487bc | 993 | AC_EGREP_HEADER(in6_aliasreq, |
994 | netinet6/in6_var.h, | |
995 | [AC_MSG_RESULT(yes) | |
996 | AC_DEFINE(HAVE_IN6_ALIASREQ,,in6_aliasreq)], | |
997 | AC_MSG_RESULT(no)) | |
998 | ||
71c0fb50 | 999 | dnl ----------------------------------- |
1000 | dnl check ifra_lifetime of in6_aliasreq | |
1001 | dnl ----------------------------------- | |
1002 | AC_MSG_CHECKING(whether in6_aliasreq.ifra_lifetime exist) | |
1003 | AC_TRY_COMPILE([#include <sys/types.h> | |
1004 | #include <netinet6/in6_var.h> | |
1005 | ],[static struct if6_aliasreq ac_i;int ac_j = sizeof (ac_i.ifra_lifetime);], | |
1006 | [AC_MSG_RESULT(yes) | |
a159ed93 | 1007 | AC_DEFINE(HAVE_IFRA_LIFETIME,,Have in6_aliasreq.ifra_lifetime)], |
71c0fb50 | 1008 | AC_MSG_RESULT(no)) |
1009 | ||
7ea487bc | 1010 | dnl --------------------------- |
1011 | dnl check structure rt_addrinfo | |
1012 | dnl --------------------------- | |
1013 | AC_MSG_CHECKING(whether struct rt_addrinfo exist) | |
1014 | AC_EGREP_HEADER(rt_addrinfo, | |
1015 | net/route.h, | |
1016 | [AC_MSG_RESULT(yes) | |
1017 | AC_DEFINE(HAVE_RT_ADDRINFO,,rt_addrinfo)], | |
1018 | AC_MSG_RESULT(no)) | |
1019 | ||
1020 | dnl -------------------------- | |
1021 | dnl check structure in_pktinfo | |
1022 | dnl -------------------------- | |
1023 | AC_MSG_CHECKING(whether struct in_pktinfo exist) | |
1024 | AC_TRY_COMPILE([#include <netinet/in.h> | |
1025 | ],[struct in_pktinfo ac_x;], | |
1026 | [AC_MSG_RESULT(yes) | |
1027 | AC_DEFINE(HAVE_INPKTINFO,,in_pktinfo)], | |
1028 | AC_MSG_RESULT(no)) | |
1029 | ||
1030 | dnl -------------------------------------- | |
1031 | dnl checking for getrusage struct and call | |
1032 | dnl -------------------------------------- | |
1033 | AC_MSG_CHECKING(whether getrusage is available) | |
1034 | AC_TRY_COMPILE([#include <sys/resource.h> | |
1035 | ],[struct rusage ac_x; getrusage (RUSAGE_SELF, &ac_x);], | |
1036 | [AC_MSG_RESULT(yes) | |
1037 | AC_DEFINE(HAVE_RUSAGE,,rusage)], | |
1038 | AC_MSG_RESULT(no)) | |
1039 | ||
edd7c245 | 1040 | dnl ------------------- |
1041 | dnl capabilities checks | |
1042 | dnl ------------------- | |
41d3fc96 | 1043 | if test "${enable_capabilities}" != "no"; then |
1044 | AC_MSG_CHECKING(whether prctl PR_SET_KEEPCAPS is available) | |
1045 | AC_TRY_COMPILE([#include <sys/prctl.h>],[prctl(PR_SET_KEEPCAPS, 1, 0, 0, 0);], | |
1046 | [AC_MSG_RESULT(yes) | |
1047 | AC_DEFINE(HAVE_PR_SET_KEEPCAPS,,prctl) | |
1048 | quagga_ac_keepcaps="yes"], | |
1049 | AC_MSG_RESULT(no) | |
edd7c245 | 1050 | ) |
41d3fc96 | 1051 | if test x"${quagga_ac_keepcaps}" = x"yes"; then |
1052 | AC_CHECK_HEADERS(sys/capability.h) | |
1053 | fi | |
1054 | if test x"${ac_cv_header_sys_capability_h}" = x"yes"; then | |
1055 | AC_CHECK_LIB(cap, cap_init, | |
1056 | [AC_DEFINE(HAVE_LCAPS,1,Capabilities) | |
1057 | LIBCAP="-lcap" | |
1058 | ] | |
1059 | ) | |
1060 | fi | |
edd7c245 | 1061 | fi |
1062 | AC_SUBST(LIBCAP) | |
1063 | ||
fb2d1502 | 1064 | dnl --------------------------- |
1065 | dnl check for glibc 'backtrace' | |
1066 | dnl --------------------------- | |
1067 | if test "${glibc}" = "yes"; then | |
1068 | AC_CHECK_HEADER(execinfo.h) | |
1069 | fi | |
1070 | if test x"${ac_cv_header_execinfo_h}" = x"yes"; then | |
1071 | AC_CHECK_FUNC(backtrace, | |
1072 | [AC_DEFINE(HAVE_GLIBC_BACKTRACE,,Glibc backtrace)] | |
1073 | ) | |
1074 | fi | |
1075 | ||
408ad943 | 1076 | dnl ---------- |
1077 | dnl configure date | |
1078 | dnl ---------- | |
1079 | CONFDATE=`date '+%Y%m%d'` | |
1080 | AC_SUBST(CONFDATE) | |
1081 | ||
7ea487bc | 1082 | dnl ------------------------------ |
a159ed93 | 1083 | dnl set paths for state directory |
23bd12c3 | 1084 | dnl ------------------------------ |
1085 | if test "${prefix}" = "NONE"; then | |
e8f2984c | 1086 | quagga_statedir_prefix=""; |
23bd12c3 | 1087 | else |
e8f2984c | 1088 | quagga_statedir_prefix=${prefix} |
23bd12c3 | 1089 | fi |
1090 | if test "${localstatedir}" = '${prefix}/var'; then | |
a159ed93 | 1091 | AC_CACHE_CHECK(state directory,ac_statedir, |
e8f2984c | 1092 | [for QUAGGA_STATE_DIR in ${quagga_statedir_prefix}/var/run dnl |
1093 | ${quagga_statedir_prefix}/var/adm dnl | |
1094 | ${quagga_statedir_prefix}/etc dnl | |
a159ed93 | 1095 | /var/run dnl |
1096 | /var/adm dnl | |
1097 | /etc dnl | |
1098 | /dev/null; | |
23bd12c3 | 1099 | do |
e8f2984c | 1100 | test -d $QUAGGA_STATE_DIR && break |
23bd12c3 | 1101 | done |
e8f2984c | 1102 | quagga_statedir=$QUAGGA_STATE_DIR]) |
23bd12c3 | 1103 | else |
e8f2984c | 1104 | quagga_statedir=${localstatedir} |
a159ed93 | 1105 | AC_MSG_CHECKING(directory to use for state file) |
e8f2984c | 1106 | AC_MSG_RESULT(${quagga_statedir}) |
a159ed93 | 1107 | fi |
e8f2984c | 1108 | if test $quagga_statedir = "/dev/null"; then |
a159ed93 | 1109 | AC_MSG_ERROR('STATE DIRECTORY NOT FOUND! FIX OR SPECIFY --localstatedir!') |
1110 | fi | |
1111 | ||
e8f2984c | 1112 | AC_DEFINE_UNQUOTED(PATH_ZEBRA_PID, "$quagga_statedir/zebra.pid",zebra PID) |
1113 | AC_DEFINE_UNQUOTED(PATH_RIPD_PID, "$quagga_statedir/ripd.pid",ripd PID) | |
1114 | AC_DEFINE_UNQUOTED(PATH_RIPNGD_PID, "$quagga_statedir/ripngd.pid",ripngd PID) | |
1115 | AC_DEFINE_UNQUOTED(PATH_BGPD_PID, "$quagga_statedir/bgpd.pid",bgpd PID) | |
1116 | AC_DEFINE_UNQUOTED(PATH_OSPFD_PID, "$quagga_statedir/ospfd.pid",ospfd PID) | |
1117 | AC_DEFINE_UNQUOTED(PATH_OSPF6D_PID, "$quagga_statedir/ospf6d.pid",ospf6d PID) | |
9e867fe6 | 1118 | AC_DEFINE_UNQUOTED(PATH_ISISD_PID, "$quagga_statedir/isisd.pid",isisd PID) |
e8f2984c | 1119 | AC_DEFINE_UNQUOTED(ZEBRA_SERV_PATH, "$quagga_statedir/zserv.api",zebra api socket) |
1120 | AC_DEFINE_UNQUOTED(ZEBRA_VTYSH_PATH, "$quagga_statedir/zebra.vty",zebra vty socket) | |
1121 | AC_DEFINE_UNQUOTED(RIP_VTYSH_PATH, "$quagga_statedir/ripd.vty",rip vty socket) | |
1122 | AC_DEFINE_UNQUOTED(RIPNG_VTYSH_PATH, "$quagga_statedir/ripngd.vty",ripng vty socket) | |
1123 | AC_DEFINE_UNQUOTED(BGP_VTYSH_PATH, "$quagga_statedir/bgpd.vty",bgpd vty socket) | |
1124 | AC_DEFINE_UNQUOTED(OSPF_VTYSH_PATH, "$quagga_statedir/ospfd.vty",ospfd vty socket) | |
1125 | AC_DEFINE_UNQUOTED(OSPF6_VTYSH_PATH, "$quagga_statedir/ospf6d.vty",ospf6d vty socket) | |
9e867fe6 | 1126 | AC_DEFINE_UNQUOTED(ISIS_VTYSH_PATH, "$quagga_statedir/isisd.vty",isisd vty socket) |
7ea487bc | 1127 | |
1128 | dnl --------------------------- | |
1129 | dnl Check htonl works correctly | |
1130 | dnl --------------------------- | |
1131 | AC_MSG_CHECKING(for working htonl) | |
1132 | AC_CACHE_VAL(ac_cv_htonl_works, [ | |
1133 | AC_TRY_LINK([#ifdef HAVE_SYS_TYPES_H | |
1134 | #include <sys/types.h> | |
1135 | #endif | |
1136 | #ifdef HAVE_NETDB_H | |
1137 | #include <netdb.h> | |
1138 | #endif | |
1139 | #ifdef HAVE_NETINET_IN_H | |
1140 | #include <netinet/in.h> | |
1141 | #endif], | |
1142 | [htonl (0);], | |
1143 | ac_cv_htonl_works=yes, | |
1144 | ac_cv_htonl_works=no)]) | |
1145 | AC_MSG_RESULT($ac_cv_htonl_works) | |
1146 | ||
6382b6f8 | 1147 | AC_OUTPUT(Makefile lib/Makefile zebra/Makefile ripd/Makefile |
1148 | ripngd/Makefile bgpd/Makefile ospfd/Makefile | |
9e867fe6 | 1149 | ospf6d/Makefile isisd/Makefile vtysh/Makefile doc/Makefile |
6382b6f8 | 1150 | ospfclient/Makefile |
fc9d0745 | 1151 | vtysh/extract.pl |
b85dca31 | 1152 | m4/Makefile |
69f1fc22 | 1153 | pkgsrc/Makefile |
a4d2a0d2 | 1154 | redhat/Makefile redhat/quagga.spec |
b7a97f82 | 1155 | lib/version.h |
41c14a1f | 1156 | tests/Makefile |
cbd04084 | 1157 | pkgsrc/bgpd.sh pkgsrc/ospf6d.sh pkgsrc/ospfd.sh |
1158 | pkgsrc/ripd.sh pkgsrc/ripngd.sh pkgsrc/zebra.sh | |
b7a97f82 | 1159 | , |
fc9d0745 | 1160 | [chmod +x vtysh/extract.pl]) |
7ea487bc | 1161 | |
1162 | echo " | |
c89f6494 | 1163 | Quagga configuration |
1164 | -------------------- | |
1165 | quagga version : ${PACKAGE_VERSION} | |
7ea487bc | 1166 | host operationg system : ${host_os} |
1167 | source code location : ${srcdir} | |
1168 | compiler : ${CC} | |
1169 | compiler flags : ${CFLAGS} | |
71c0fb50 | 1170 | linker flags : ${LDFLAGS} ${LIBS} |
e8f2984c | 1171 | state file directory : ${quagga_statedir} |
dc7a2bf1 | 1172 | config file directory : `eval echo \`echo ${sysconfdir}\`` |
d6b72f7a | 1173 | example directory : `eval echo \`echo ${exampledir}\`` |
8d4aee5d | 1174 | user to run as : ${enable_user} |
1175 | group to run as : ${enable_group} | |
1176 | group for vty sockets : ${enable_vty_group} | |
aa593d5e | 1177 | config file mask : ${enable_configfile_mask} |
1178 | log file mask : ${enable_logfile_mask} | |
dc7a2bf1 | 1179 | |
1180 | The above user and group must have read/write access to the state file | |
1181 | directory and to the config files in the config file directory. | |
7ea487bc | 1182 | " |