]> git.proxmox.com Git - mirror_frr.git/blob - configure.ac
Cumulus: Fixup changelog and version string.
[mirror_frr.git] / configure.ac
1 ##
2 ## Configure template file for Quagga.
3 ## autoconf will generate configure script.
4 ##
5 ## Copyright (c) 1996, 97, 98, 99, 2000 Kunihiro Ishiguro <kunihiro@zebra.org>
6 ## Portions Copyright (c) 2003 Paul Jakma <paul@dishone.st>
7 ##
8 AC_PREREQ(2.60)
9
10 AC_INIT(Quagga, 0.99.24+cl3u5, [https://bugzilla.quagga.net])
11 CONFIG_ARGS="$*"
12 AC_SUBST(CONFIG_ARGS)
13 AC_CONFIG_SRCDIR(lib/zebra.h)
14 AC_CONFIG_MACRO_DIR([m4])
15
16 dnl -----------------------------------
17 dnl Get hostname and other information.
18 dnl -----------------------------------
19 AC_CANONICAL_BUILD()
20 AC_CANONICAL_HOST()
21 AC_CANONICAL_TARGET()
22
23 AM_INIT_AUTOMAKE(1.6)
24 AM_SILENT_RULES([yes])
25 AC_CONFIG_HEADERS(config.h)
26
27 AC_PATH_PROG(PERL, perl)
28 AC_CHECK_PROG([GAWK],[gawk],[gawk],[not-in-PATH])
29 if test "x$GAWK" = "xnot-in-PATH" ; then
30 AC_MSG_ERROR([GNU awk is required for lib/memtype.h made by memtypes.awk.
31 BSD awk complains: awk: gensub doesn't support backreferences (subst "\1") ])
32 fi
33 AC_ARG_VAR([GAWK],[GNU AWK])
34
35 dnl default is to match previous behavior
36 exampledir=${sysconfdir}
37 AC_ARG_ENABLE([exampledir],
38 AS_HELP_STRING([--enable-exampledir],
39 [specify alternate directory for examples]),
40 exampledir="$enableval",)
41 dnl XXX add --exampledir to autoconf standard directory list somehow
42 AC_SUBST(exampledir)
43
44 dnl default is to match previous behavior
45 pkgsrcrcdir=""
46 pkgsrcdir=""
47 AC_ARG_ENABLE([pkgsrcrcdir],
48 AS_HELP_STRING([--enable-pkgsrcrcdir],
49 [specify directory for rc.d scripts]),
50 pkgsrcrcdir="$enableval"; pkgsrcdir="pkgsrc",)
51 dnl XXX add --pkgsrcrcdir to autoconf standard directory list somehow
52 AC_SUBST(pkgsrcdir)
53 AC_SUBST(pkgsrcrcdir)
54
55 dnl ------------
56 dnl Check CFLAGS
57 dnl ------------
58 AC_ARG_WITH(cflags,
59 [ --with-cflags Set CFLAGS for use in compilation.])
60 if test "x$with_cflags" != "x" ; then
61 CFLAGS="$with_cflags" ; cflags_specified=yes ;
62 elif test -n "$CFLAGS" ; then
63 cflags_specified=yes ;
64 fi
65
66 AC_ARG_ENABLE(tcmalloc,
67 [ --enable-tcmalloc Turn on tcmalloc],
68 [case "${enableval}" in
69 yes) tcmalloc_enabled=true
70 LIBS="$LIBS -ltcmalloc_minimal"
71 ;;
72 no) tcmalloc_enabled=false ;;
73 *) AC_MSG_ERROR(bad value ${enableval} for --enable-tcmalloc) ;;
74 esac],[tcmalloc_enabled=false])
75
76
77 dnl --------------------
78 dnl Check CC and friends
79 dnl --------------------
80 AC_LANG([C])
81 AC_PROG_CC
82 AC_PROG_CPP
83 AM_PROG_CC_C_O
84 AC_PROG_RANLIB
85 AC_PROG_EGREP
86
87 dnl autoconf 2.59 appears not to support AC_PROG_SED
88 dnl AC_PROG_SED
89 AC_CHECK_PROG([SED],[sed],[sed],[/bin/false])
90
91 dnl pdflatex and latexmk are needed to build HACKING.pdf
92 AC_CHECK_PROG([PDFLATEX],[pdflatex],[pdflatex],[/bin/false])
93 AC_CHECK_PROG([LATEXMK],[latexmk],[latexmk],[/bin/false])
94 if test "x$PDFLATEX" = "x/bin/false" -o "x$LATEXMK" = "x/bin/false"; then
95 AC_MSG_WARN([Will not be able to make PDF versions of TeX documents])
96 else
97 HAVE_LATEX=true
98 fi
99 AM_CONDITIONAL([HAVE_LATEX], [test "x$HAVE_LATEX" = "xtrue"])
100
101 if test "x${GCC}" != "xyes" ; then
102 AC_MSG_CHECKING([whether we are using SunPro compiler])
103 AC_EGREP_CPP([^__SUNPRO_C.*0x5(7|8|9)], ["__SUNPRO_C" __SUNPRO_C],
104 [AC_MSG_RESULT([no])],
105 [COMPILER="SUNPRO"
106 AC_MSG_RESULT([yes])]
107 )
108 fi
109
110 dnl ---------------------------------------------
111 dnl If CLFAGS doesn\'t exist set default value
112 dnl AC_PROG_CC will have set minimal default
113 dnl already, eg "-O2 -g" for gcc, "-g" for others
114 dnl (Wall is gcc specific... have to make sure
115 dnl gcc is being used before setting it)
116 dnl
117 dnl Sun Studio 10 / SunPro 5.7 is also supported,
118 dnl so lets set some sane CFLAGS for it.
119 dnl ---------------------------------------------
120
121 AC_USE_SYSTEM_EXTENSIONS()
122 AC_DEFUN([AC_C_FLAG], [{
123 AC_LANG_PUSH(C)
124 ac_c_flag_save="$CFLAGS"
125 CFLAGS="$CFLAGS $1"
126 AC_MSG_CHECKING([[whether $CC supports $1]])
127 AC_COMPILE_IFELSE(
128 [AC_LANG_PROGRAM([[]])],
129 [
130 AC_MSG_RESULT([yes])
131 m4_if([$3], [], [], [
132 CFLAGS="$ac_c_flag_save"
133 $3
134 ])
135 ], [
136 CFLAGS="$ac_c_flag_save"
137 AC_MSG_RESULT([no])
138 $2
139 ])
140 AC_LANG_POP(C)
141 }])
142
143 AC_MSG_CHECKING([whether to set a default CFLAGS])
144 if test "x${cflags_specified}" = "x" ; then
145 case ${COMPILER} in
146 "SUNPRO")
147 CFLAGS="-xO4 -v -g -xspace -xcode=pic32 -xstrconst -xc99"
148 AC_MSG_RESULT([SunPro default])
149 ;;
150 *)
151 AC_MSG_RESULT([autodetecting])
152
153 AC_C_FLAG([-diag-error 10006])
154 AC_C_FLAG([-std=gnu99])
155 AC_C_FLAG([-g])
156 AC_C_FLAG([-Os], [
157 AC_C_FLAG([-O2])
158 ])
159 AC_C_FLAG([-fno-omit-frame-pointer])
160 AC_C_FLAG([-Wall])
161 AC_C_FLAG([-Wextra])
162 AC_C_FLAG([-Wmissing-prototypes])
163 AC_C_FLAG([-Wmissing-declarations])
164 AC_C_FLAG([-Wpointer-arith])
165 AC_C_FLAG([-Wbad-function-cast])
166 AC_C_FLAG([-Wwrite-strings])
167 if test x"${enable_gcc_ultra_verbose}" = x"yes" ; then
168 AC_C_FLAG([-Wcast-qual])
169 AC_C_FLAG([-Wstrict-prototypes])
170 AC_C_FLAG([-Wmissing-noreturn])
171 AC_C_FLAG([-Wmissing-format-attribute])
172 AC_C_FLAG([-Wunreachable-code])
173 AC_C_FLAG([-Wpacked])
174 AC_C_FLAG([-Wpadded])
175 else
176 AC_C_FLAG([-Wno-unused-result])
177 fi
178 AC_C_FLAG([-Wno-unused-parameter])
179 AC_C_FLAG([-Wno-missing-field-initializers])
180 # ICC emits a broken warning for const char *x = a ? "b" : "c";
181 # for some reason the string consts get 'promoted' to char *,
182 # triggering a const to non-const conversion warning.
183 AC_C_FLAG([-diag-disable 3179])
184 ;;
185 esac
186 else
187 AC_MSG_RESULT([CFLAGS supplied by user])
188 fi
189
190 if test x"${enable_werror}" = x"yes" ; then
191 WERROR="-Werror"
192 fi
193 AC_SUBST(WERROR)
194
195 dnl --------------
196 dnl Check programs
197 dnl --------------
198 AC_PROG_INSTALL
199 AC_PROG_LN_S
200 AC_PROG_MAKE_SET
201 AC_CHECK_TOOL(AR, ar)
202
203 dnl ---------------------------
204 dnl We, perhaps unfortunately,
205 dnl depend on GNU Make specific
206 dnl constructs.
207 dnl Give the user a warning if
208 dnl not GNU Make.
209 dnl ---------------------------
210 AC_CACHE_CHECK([if ${MAKE-make} is GNU make], [quagga_cv_gnu_make],
211 [quagga_cv_gnu_make=no
212 if ${MAKE-make} --version 2>/dev/null | \
213 grep '^GNU Make ' >/dev/null ; then
214 quagga_cv_gnu_make=yes;
215 fi
216 ]
217 )
218
219 dnl -----------------
220 dnl System extensions
221 dnl -----------------
222 AC_GNU_SOURCE
223
224 dnl -------
225 dnl libtool
226 dnl -------
227 LT_INIT
228
229 dnl ----------------------
230 dnl Packages configuration
231 dnl ----------------------
232 AC_ARG_WITH(pkg-extra-version,
233 AS_HELP_STRING([--with-pkg-extra-version=VER], [add extra version field, for packagers/distributions]),
234 [EXTRAVERSION=$withval],)
235 AC_ARG_WITH(pkg-git-version,
236 AS_HELP_STRING([--with-pkg-git-version], [add git information to MOTD and build version string]),
237 [ test "x$withval" != "xno" && with_pkg_git_version="yes" ])
238 AC_ARG_ENABLE(vtysh,
239 AS_HELP_STRING([--disable-vtysh], [do not build integrated vty shell for Quagga]))
240 AC_ARG_ENABLE(doc,
241 AS_HELP_STRING([--disable-doc], [do not build docs]))
242 AC_ARG_ENABLE(zebra,
243 AS_HELP_STRING([--disable-zebra], [do not build zebra daemon]))
244 AC_ARG_ENABLE(bgpd,
245 AS_HELP_STRING([--disable-bgpd], [do not build bgpd]))
246 AC_ARG_ENABLE(ripd,
247 AS_HELP_STRING([--disable-ripd], [do not build ripd]))
248 AC_ARG_ENABLE(ripngd,
249 AS_HELP_STRING([--disable-ripngd], [do not build ripngd]))
250 AC_ARG_ENABLE(ospfd,
251 AS_HELP_STRING([--disable-ospfd], [do not build ospfd]))
252 AC_ARG_ENABLE(ospf6d,
253 AS_HELP_STRING([--disable-ospf6d], [do not build ospf6d]))
254 AC_ARG_ENABLE(watchquagga,
255 AS_HELP_STRING([--disable-watchquagga], [do not build watchquagga]))
256 AC_ARG_ENABLE(isisd,
257 AS_HELP_STRING([--disable-isisd], [do not build isisd]))
258 AC_ARG_ENABLE(pimd,
259 AS_HELP_STRING([--disable-pimd], [do not build pimd]))
260 AC_ARG_ENABLE(bgp-announce,
261 AS_HELP_STRING([--disable-bgp-announce,], [turn off BGP route announcement]))
262 AC_ARG_ENABLE(snmp,
263 AS_HELP_STRING([--enable-snmp=ARG], [enable SNMP support (smux or agentx)]))
264 AC_ARG_WITH(libpam,
265 AS_HELP_STRING([--with-libpam], [use libpam for PAM support in vtysh]))
266 AC_ARG_ENABLE(tcp-zebra,
267 AS_HELP_STRING([--enable-tcp-zebra], [enable TCP/IP socket connection between zebra and protocol daemon]))
268 AC_ARG_ENABLE(opaque-lsa,
269 AS_HELP_STRING([--disable-opaque-lsa],[do not build OSPF Opaque-LSA with OSPFAPI support (RFC2370)]))
270 AC_ARG_ENABLE(ospfapi,
271 AS_HELP_STRING([--disable-ospfapi], [do not build OSPFAPI to access the OSPF LSA Database]))
272 AC_ARG_ENABLE(ospfclient,
273 AS_HELP_STRING([--disable-ospfclient], [do not build OSPFAPI client for OSPFAPI,
274 (this is the default if --disable-ospfapi is set)]))
275 AC_ARG_ENABLE(ospf-te,
276 AS_HELP_STRING([--disable-ospf-te],[disable Traffic Engineering Extension to OSPF]))
277 AC_ARG_ENABLE(multipath,
278 AS_HELP_STRING([--enable-multipath=ARG], [enable multipath function, ARG must be digit]))
279 AC_ARG_ENABLE(user,
280 AS_HELP_STRING([--enable-user=USER], [user to run Quagga suite as (default quagga)]))
281 AC_ARG_ENABLE(group,
282 AS_HELP_STRING([--enable-group=GROUP], [group to run Quagga suite as (default quagga)]))
283 AC_ARG_ENABLE(vty_group,
284 AS_HELP_STRING([--enable-vty-group=ARG], [set vty sockets to have specified group as owner]))
285 AC_ARG_ENABLE(configfile_mask,
286 AS_HELP_STRING([--enable-configfile-mask=ARG], [set mask for config files]))
287 AC_ARG_ENABLE(logfile_mask,
288 AS_HELP_STRING([--enable-logfile-mask=ARG], [set mask for log files]))
289 AC_ARG_ENABLE(shell_access,
290 AS_HELP_STRING([--enable-shell-access], [Allow users to access shell/telnet/ssh]))
291 AC_ARG_ENABLE(rtadv,
292 AS_HELP_STRING([--disable-rtadv], [disable IPV6 router advertisement feature]))
293 AC_ARG_ENABLE(irdp,
294 AS_HELP_STRING([--enable-irdp], [enable IRDP server support in zebra]))
295 AC_ARG_ENABLE(isis_topology,
296 AS_HELP_STRING([--enable-isis-topology], [enable IS-IS topology generator]))
297 AC_ARG_ENABLE(capabilities,
298 AS_HELP_STRING([--disable-capabilities], [disable using POSIX capabilities]))
299 AC_ARG_ENABLE(rusage,
300 AS_HELP_STRING([--disable-rusage], [disable using getrusage]))
301 AC_ARG_ENABLE(gcc_ultra_verbose,
302 AS_HELP_STRING([--enable-gcc-ultra-verbose], [enable ultra verbose GCC warnings]))
303 AC_ARG_ENABLE(linux24_tcp_md5,
304 AS_HELP_STRING([--enable-linux24-tcp-md5], [enable support for old, Linux-2.4 RFC2385 patch]))
305 AC_ARG_ENABLE(gcc-rdynamic,
306 AS_HELP_STRING([--enable-gcc-rdynamic], [enable linking with -rdynamic for better backtraces (default if gcc)]))
307 AC_ARG_ENABLE(backtrace,
308 AS_HELP_STRING([--disable-backtrace,], [disable crash backtraces (default autodetect)]))
309 AC_ARG_ENABLE(time-check,
310 AS_HELP_STRING([--disable-time-check], [disable slow thread warning messages]))
311 AC_ARG_ENABLE(pcreposix,
312 AS_HELP_STRING([--enable-pcreposix], [enable using PCRE Posix libs for regex functions]))
313 AC_ARG_ENABLE(fpm,
314 AS_HELP_STRING([--enable-fpm], [enable Forwarding Plane Manager support]))
315 AC_ARG_ENABLE(systemd,
316 AS_HELP_STRING([--enable-systemd], [enable Systemd support]))
317 AC_ARG_ENABLE(poll,
318 AS_HELP_STRING([--enable-poll], [enable usage of Poll instead of select]))
319 AC_ARG_ENABLE(werror,
320 AS_HELP_STRING([--enable-werror], [enable -Werror (recommended for developers only)]))
321 AC_ARG_ENABLE(cumulus,
322 AS_HELP_STRING([--enable-cumulus], [enable Cumulus Switch Special Extensions]))
323 AC_ARG_ENABLE(rr-semantics,
324 AS_HELP_STRING([--disable-rr-semantics], [disable the v6 Route Replace semantics]))
325
326 AC_CHECK_HEADERS(json-c/json.h)
327 AC_CHECK_LIB(json-c, json_object_get, LIBS="$LIBS -ljson-c")
328 if test $ac_cv_lib_json_c_json_object_get = no; then
329 AC_MSG_ERROR([lib json is needed to compile])
330 fi
331
332 AC_CHECK_HEADERS(json-c/json.h)
333 AC_CHECK_LIB(json-c, json_object_get, LIBS="$LIBS -ljson-c")
334 if test $ac_cv_lib_json_c_json_object_get = no; then
335 AC_MSG_ERROR([lib json is needed to compile])
336 fi
337
338 if test x"${enable_gcc_rdynamic}" != x"no" ; then
339 if test x"${enable_gcc_rdynamic}" = x"yes" -o x"$COMPILER" = x"GCC"; then
340 LDFLAGS="${LDFLAGS} -rdynamic"
341 fi
342 fi
343
344 if test x"${enable_time_check}" != x"no" ; then
345 if test x"${enable_time_check}" = x"yes" -o x"${enable_time_check}" = x ; then
346 AC_DEFINE(CONSUMED_TIME_CHECK,5000000,Consumed Time Check)
347 else
348 AC_DEFINE_UNQUOTED(CONSUMED_TIME_CHECK,$enable_time_check,Consumed Time Check)
349 fi
350 fi
351
352 case "${enable_systemd}" in
353 "no") ;;
354 "yes")
355 AC_CHECK_LIB(systemd, sd_notify, LIBS="$LIBS -lsystemd")
356 if test $ac_cv_lib_systemd_sd_notify = no; then
357 AC_MSG_ERROR([enable systemd has been specified but systemd development env not found on your system])
358 else
359 AC_DEFINE(HAVE_SYSTEMD,,Compile systemd support in)
360 fi
361 ;;
362 "*") ;;
363 esac
364
365 if test "${enable_rr_semantics}" != "no" ; then
366 AC_DEFINE(HAVE_V6_RR_SEMANTICS,, Compile in v6 Route Replacement Semantics)
367 fi
368
369 if test "${enable_poll}" = "yes" ; then
370 AC_DEFINE(HAVE_POLL,,Compile systemd support in)
371 fi
372
373 if test "${enable_cumulus}" = "yes" ; then
374 AC_DEFINE(HAVE_CUMULUS,,Compile Special Cumulus Code in)
375 fi
376
377 if test "${enable_shell_access}" = "yes"; then
378 AC_DEFINE(HAVE_SHELL_ACCESS,,Allow user to use ssh/telnet/bash)
379 fi
380
381 if test "${enable_fpm}" = "yes"; then
382 AC_DEFINE(HAVE_FPM,,Forwarding Plane Manager support)
383 fi
384
385 if test "${enable_tcp_zebra}" = "yes"; then
386 AC_DEFINE(HAVE_TCP_ZEBRA,,Use TCP for zebra communication)
387 fi
388
389 if test "${enable_opaque_lsa}" != "no"; then
390 AC_DEFINE(HAVE_OPAQUE_LSA,,OSPF Opaque LSA)
391 fi
392
393 if test "${enable_ospf_te}" != "no"; then
394 AC_DEFINE(HAVE_OPAQUE_LSA,,OSPF Opaque LSA)
395 AC_DEFINE(HAVE_OSPF_TE,,OSPF TE)
396 fi
397
398 if test "${enable_linux24_tcp_md5}" = "yes"; then
399 AC_DEFINE(HAVE_TCP_MD5_LINUX24,,Old Linux 2.4 TCP MD5 Signature Patch)
400 fi
401
402 AC_MSG_CHECKING(if zebra should be configurable to send Route Advertisements)
403 if test "${enable_rtadv}" != "no"; then
404 AC_MSG_RESULT(yes)
405 AC_DEFINE(HAVE_RTADV,,Enable IPv6 Routing Advertisement support)
406 else
407 AC_MSG_RESULT(no)
408 fi
409
410 if test "${enable_irdp}" = "yes"; then
411 AC_DEFINE(HAVE_IRDP,, IRDP )
412 fi
413
414 if test "${enable_isisd}" != "no" && test "${enable_isis_topology}" = yes; then
415 AC_DEFINE(TOPOLOGY_GENERATE,,Enable IS-IS topology generator code)
416 ISIS_TOPOLOGY_INCLUDES="-I\$(srcdir)/topology"
417 ISIS_TOPOLOGY_DIR="topology"
418 ISIS_TOPOLOGY_LIB="./topology/libtopology.a"
419 fi
420
421 AC_SUBST(ISIS_TOPOLOGY_INCLUDES)
422 AC_SUBST(ISIS_TOPOLOGY_DIR)
423 AC_SUBST(ISIS_TOPOLOGY_LIB)
424
425 if test "${enable_user}" = "yes" || test x"${enable_user}" = x""; then
426 enable_user="quagga"
427 elif test "${enable_user}" = "no"; then
428 enable_user="root"
429 fi
430
431 if test "${enable_group}" = "yes" || test x"${enable_group}" = x""; then
432 enable_group="quagga"
433 elif test "${enable_group}" = "no"; then
434 enable_group="root"
435 fi
436
437 if test x"${enable_vty_group}" = x"yes" ; then
438 AC_MSG_ERROR([--enable-vty-group requires a group as argument, not yes])
439 elif test x"${enable_vty_group}" != x""; then
440 if test x"${enable_vty_group}" != x"no"; then
441 AC_DEFINE_UNQUOTED(VTY_GROUP, "${enable_vty_group}", VTY Sockets Group)
442 fi
443 fi
444 AC_SUBST([enable_user])
445 AC_SUBST([enable_group])
446 AC_SUBST([enable_vty_group])
447 AC_DEFINE_UNQUOTED(QUAGGA_USER, "${enable_user}", Quagga User)
448 AC_DEFINE_UNQUOTED(QUAGGA_GROUP, "${enable_group}", Quagga Group)
449
450 enable_configfile_mask=${enable_configfile_mask:-0600}
451 AC_DEFINE_UNQUOTED(CONFIGFILE_MASK, ${enable_configfile_mask}, Mask for config files)
452
453 enable_logfile_mask=${enable_logfile_mask:-0600}
454 AC_DEFINE_UNQUOTED(LOGFILE_MASK, ${enable_logfile_mask}, Mask for log files)
455
456 MPATH_NUM=1
457
458 case "${enable_multipath}" in
459 0)
460 MPATH_NUM=64
461 ;;
462 [[1-9]|[1-9][0-9]|[1-9][0-9][0-9]])
463 MPATH_NUM="${enable_multipath}"
464 ;;
465 "")
466 ;;
467 *)
468 AC_MSG_FAILURE([Please specify digit to enable multipath ARG])
469 ;;
470 esac
471
472 AC_DEFINE_UNQUOTED(MULTIPATH_NUM, $MPATH_NUM, Maximum number of paths for a route)
473
474 dnl -----------------------------------
475 dnl Add extra version string to package
476 dnl name, string and version fields.
477 dnl -----------------------------------
478 if test "x${EXTRAVERSION}" != "x" ; then
479 VERSION="${VERSION}${EXTRAVERSION}"
480 PACKAGE_VERSION="${PACKAGE_VERSION}${EXTRAVERSION}"
481 PACKAGE_STRING="${PACKAGE_STRING}${EXTRAVERSION}"
482 fi
483
484 if test "x$with_pkg_git_version" = "xyes"; then
485 if test -d "${srcdir}/.git"; then
486 AC_DEFINE(GIT_VERSION, [1], [include git version info])
487 else with_pkg_git_version="no"
488 AC_MSG_WARN([--with-pkg-git-version given, but this is not a git checkout])
489 fi
490 fi
491 AM_CONDITIONAL([GIT_VERSION], [test "x$with_pkg_git_version" = "xyes"])
492
493 dnl ------------------------------------
494 dnl Check C keywords and standard types
495 dnl ------------------------------------
496 AC_C_CONST
497 AC_C_INLINE
498 AC_C_RESTRICT
499 AC_C_VOLATILE
500 AC_HEADER_STDC
501 AC_HEADER_TIME
502 AC_HEADER_SYS_WAIT
503 AC_HEADER_STDBOOL
504 dnl AC_TYPE_PID_T
505 AC_TYPE_UID_T
506 AC_TYPE_MODE_T
507 AC_TYPE_SIZE_T
508 AC_STRUCT_TM
509
510 dnl -------------------------
511 dnl Check other header files.
512 dnl -------------------------
513 AC_CHECK_HEADERS([stropts.h sys/ksym.h sys/times.h sys/select.h \
514 sys/types.h linux/version.h netdb.h asm/types.h \
515 sys/cdefs.h sys/param.h limits.h signal.h \
516 sys/socket.h netinet/in.h time.h sys/time.h])
517
518 dnl Utility macro to avoid retyping includes all the time
519 m4_define([QUAGGA_INCLUDES],
520 [#ifdef SUNOS_5
521 #define _XPG4_2
522 #define __EXTENSIONS__
523 #endif
524 #include <stdio.h>
525 #if STDC_HEADERS
526 # include <stdlib.h>
527 # include <stddef.h>
528 #else
529 # if HAVE_STDLIB_H
530 # include <stdlib.h>
531 # endif
532 #endif
533 #if HAVE_SYS_TYPES_H
534 # include <sys/types.h>
535 #endif
536 /* sys/conf.h depends on param.h on FBSD at least */
537 #if HAVE_SYS_PARAM_H
538 # include <sys/param.h>
539 #endif
540 /* Required for MAXSIG */
541 #if HAVE_SIGNAL_H
542 # include <signal.h>
543 #endif
544 #if HAVE_SYS_SOCKET_H
545 # include <sys/socket.h>
546 #endif
547 #ifdef __APPLE__
548 # define __APPLE_USE_RFC_3542
549 #endif
550 #if HAVE_NETINET_IN_H
551 # include <netinet/in.h>
552 #endif
553 #ifdef TIME_WITH_SYS_TIME
554 # include <sys/time.h>
555 # include <time.h>
556 #else
557 # ifdef HAVE_SYS_TIME_H
558 # include <sys/time.h>
559 # else
560 # include <time.h>
561 # endif
562 #endif /* TIME_WITH_SYS_TIME */
563 ])dnl
564
565 dnl HAVE_NET_IF_H must be discovered by the time the longer AC_CHECK_HEADERS
566 dnl round below execution begins, otherwise it doesn't properly detect
567 dnl HAVE_NETINET6_IN6_VAR_H, HAVE_NET_IF_VAR_H and HAVE_STRUCT_IN6_ALIASREQ
568 dnl on FreeBSD (BZ#408).
569
570 AC_CHECK_HEADERS([net/if.h], [], [], QUAGGA_INCLUDES)
571
572 m4_define([QUAGGA_INCLUDES],
573 QUAGGA_INCLUDES
574 [#if HAVE_NET_IF_H
575 # include <net/if.h>
576 #endif
577 ])dnl
578
579 dnl Same applies for HAVE_NET_IF_VAR_H, which HAVE_NETINET6_ND6_H and
580 dnl HAVE_NETINET_IN_VAR_H depend upon. But if_var.h depends on if.h, hence
581 dnl an additional round for it.
582
583 AC_CHECK_HEADERS([net/if_var.h], [], [], QUAGGA_INCLUDES)
584
585 m4_define([QUAGGA_INCLUDES],
586 QUAGGA_INCLUDES
587 [#if HAVE_NET_IF_VAR_H
588 # include <net/if_var.h>
589 #endif
590 ])dnl
591
592 AC_CHECK_HEADERS([sys/un.h netinet/in_systm.h netinet/in_var.h \
593 net/if_dl.h net/netopt.h net/route.h \
594 inet/nd.h arpa/inet.h netinet/ip_icmp.h \
595 fcntl.h stddef.h sys/ioctl.h syslog.h wchar.h wctype.h \
596 sys/sysctl.h sys/sockio.h kvm.h sys/conf.h],
597 [], [], QUAGGA_INCLUDES)
598
599 AC_CHECK_HEADERS([ucontext.h], [], [],
600 [#ifndef __USE_GNU
601 #define __USE_GNU
602 #endif /* __USE_GNU */
603 QUAGGA_INCLUDES
604 ])
605
606 m4_define([UCONTEXT_INCLUDES],
607 [#include <ucontext.h>])dnl
608
609 AC_CHECK_MEMBERS([ucontext_t.uc_mcontext.uc_regs],
610 [], [], [UCONTEXT_INCLUDES])
611 AC_CHECK_MEMBERS([ucontext_t.uc_mcontext.regs],
612 [AC_CHECK_MEMBERS([ucontext_t.uc_mcontext.regs.nip],
613 [], [], [UCONTEXT_INCLUDES])],
614 [], [UCONTEXT_INCLUDES])
615 AC_CHECK_MEMBERS([ucontext_t.uc_mcontext.gregs],
616 [], [], [UCONTEXT_INCLUDES])
617
618 m4_define([QUAGGA_INCLUDES],
619 QUAGGA_INCLUDES
620 [#if HAVE_SYS_UN_H
621 # include <sys/un.h>
622 #endif
623 #if HAVE_NETINET_IN_SYSTM_H
624 # include <netinet/in_systm.h>
625 #endif
626 #if HAVE_NETINET_IN_VAR_H
627 # include <netinet/in_var.h>
628 #endif
629 #if HAVE_NET_IF_DL_H
630 # include <net/if_dl.h>
631 #endif
632 #if HAVE_NET_NETOPT_H
633 # include <net/netopt.h>
634 #endif
635 #if HAVE_NET_ROUTE_H
636 # include <net/route.h>
637 #endif
638 #if HAVE_INET_ND_H
639 # include <inet/nd.h>
640 #endif
641 #if HAVE_ARPA_INET_H
642 # include <arpa/inet.h>
643 #endif
644 /* Required for IDRP */
645 #if HAVE_NETINET_IP_ICMP_H
646 # include <netinet/ip_icmp.h>
647 #endif
648 ])dnl
649
650 dnl V6 headers are checked below, after we check for v6
651
652 dnl Some systems (Solaris 2.x) require libnsl (Network Services Library)
653 case "$host" in
654 [*-sunos5.[6-7]*] | [*-solaris2.[6-7]*])
655 opsys=sol2-6
656 AC_DEFINE(SUNOS_56, 1, SunOS 5.6 to 5.7)
657 AC_DEFINE(SUNOS_5, 1, SunOS 5)
658 AC_CHECK_LIB(xnet, main)
659 CURSES=-lcurses
660 SOLARIS="solaris"
661 ;;
662 [*-sunos5.[8-9]] \
663 | [*-sunos5.1[0-9]] \
664 | [*-sunos5.1[0-9].[0-9]] \
665 | [*-solaris2.[8-9]] \
666 | [*-solaris2.1[0-9]] \
667 | [*-solaris2.1[0-9].[0-9]])
668 opsys=sol8
669 AC_DEFINE(SUNOS_59, 1, [SunOS 5.8 up])
670 AC_DEFINE(SUNOS_5, 1, [SunOS 5])
671 AC_CHECK_LIB(socket, main)
672 AC_CHECK_LIB(nsl, main)
673 AC_CHECK_LIB(umem, main)
674 AC_CHECK_FUNCS([printstack],
675 [AC_DEFINE([HAVE_PRINTSTACK],1,[Solaris printstack])
676 AC_DEFINE([HAVE_STACK_TRACE],1,[Stack symbols decode functionality])
677 ])
678 CURSES=-lcurses
679 SOLARIS="solaris"
680 ;;
681 *-sunos5* | *-solaris2*)
682 AC_DEFINE(SUNOS_5,,SunOS 5, Unknown SunOS)
683 AC_CHECK_LIB(socket, main)
684 AC_CHECK_LIB(nsl, main)
685 CURSES=-lcurses
686 SOLARIS="solaris"
687 ;;
688 *-linux*)
689 opsys=gnu-linux
690 AC_DEFINE(GNU_LINUX,,GNU Linux)
691 ;;
692 *-openbsd*)
693 opsys=openbsd
694 AC_DEFINE(OPEN_BSD,,OpenBSD)
695 ;;
696 esac
697
698 AC_SYS_LARGEFILE
699
700 dnl ---------------------
701 dnl Integrated VTY option
702 dnl ---------------------
703 case "${enable_vtysh}" in
704 "no") VTYSH="";;
705 *) VTYSH="vtysh";
706 AC_DEFINE(VTYSH,,VTY shell)
707 dnl Vtysh uses libreadline, which looks for termcap functions at
708 dnl configure time. We follow readlines search order.
709 dnl The required procedures are in libtermcap on NetBSD, in
710 dnl [TODO] on Linux, and in [TODO] on Solaris.
711 AC_CHECK_LIB(termcap, tputs, LIBREADLINE="$LIBREADLINE -ltermcap",
712 [AC_CHECK_LIB(tinfo, tputs, LIBREADLINE="$LIBREADLINE -ltinfo",
713 [AC_CHECK_LIB(curses, tputs, LIBREADLINE="$LIBREADLINE -lcurses",
714 [AC_CHECK_LIB(ncurses, tputs,
715 LIBREADLINE="$LIBREADLINE -lncurses")]
716 )]
717 )]
718 )
719 AC_CHECK_LIB(readline, main, LIBREADLINE="$LIBREADLINE -lreadline",,
720 "$LIBREADLINE")
721 if test $ac_cv_lib_readline_main = no; then
722 AC_MSG_ERROR([vtysh needs libreadline but was not found and usable on your system.])
723 fi
724 AC_CHECK_HEADER(readline/history.h)
725 if test $ac_cv_header_readline_history_h = no;then
726 AC_MSG_ERROR([readline is too old to have readline/history.h, please update to the latest readline library.])
727 fi
728 AC_CHECK_LIB(readline, rl_completion_matches,
729 LIBREADLINE="$LIBREADLINE",, "$LIBREADLINE")
730 if test $ac_cv_lib_readline_rl_completion_matches = no; then
731 AC_DEFINE(rl_completion_matches,completion_matches,Old readline)
732 fi
733 ;;
734 esac
735 AC_SUBST(LIBREADLINE)
736 AM_CONDITIONAL(VTYSH, test "x$VTYSH" = "xvtysh")
737
738 dnl ----------
739 dnl PAM module
740 dnl
741 dnl Quagga detects the PAM library it is built against by checking for a
742 dnl functional pam_misc.h (Linux-PAM) or openpam.h (OpenPAM) header. pam_misc.h
743 dnl is known to #include pam_appl.h, the standard header of a PAM library, and
744 dnl openpam.h doesn't do that, although depends on the header too. Hence a
745 dnl little assistance to AC_CHECK_HEADER is necessary for the proper detection
746 dnl of OpenPAM.
747 dnl ----------
748 if test "$with_libpam" = "yes"; then
749 AC_CHECK_HEADER([security/pam_misc.h],
750 [AC_DEFINE(HAVE_PAM_MISC_H,,Have pam_misc.h)
751 AC_DEFINE(PAM_CONV_FUNC,misc_conv,Have misc_conv)
752 pam_conv_func="misc_conv"
753 ],
754 [], QUAGGA_INCLUDES)
755 AC_CHECK_HEADER([security/openpam.h],
756 [AC_DEFINE(HAVE_OPENPAM_H,,Have openpam.h)
757 AC_DEFINE(PAM_CONV_FUNC,openpam_ttyconv,Have openpam_ttyconv)
758 pam_conv_func="openpam_ttyconv"
759 ],
760 [], QUAGGA_INCLUDES[#include <security/pam_appl.h>])
761 if test -z "$ac_cv_header_security_pam_misc_h$ac_cv_header_security_openpam_h" ; then
762 AC_MSG_WARN([*** pam support will not be built ***])
763 with_libpam="no"
764 fi
765 fi
766
767 if test "$with_libpam" = "yes"; then
768 dnl took this test from proftpds configure.in and suited to our needs
769 dnl -------------------------------------------------------------------------
770 dnl
771 dnl This next check looks funky due to a linker problem with some versions
772 dnl of the PAM library. Prior to 0.72 release, the Linux PAM shared library
773 dnl omitted requiring libdl linking information. PAM-0.72 or better ships
774 dnl with RedHat 6.2 and Debian 2.2 or better.
775 AC_CHECK_LIB(pam, pam_start,
776 [AC_CHECK_LIB(pam, $pam_conv_func,
777 [AC_DEFINE(USE_PAM,,Use PAM for authentication)
778 LIBPAM="-lpam"],
779 [AC_DEFINE(USE_PAM,,Use PAM for authentication)
780 LIBPAM="-lpam -lpam_misc"]
781 )
782 ],
783
784 [AC_CHECK_LIB(pam, pam_end,
785 [AC_CHECK_LIB(pam, $pam_conv_func,
786 [AC_DEFINE(USE_PAM,,Use PAM for authentication)
787 LIBPAM="-lpam -ldl"],
788 [AC_DEFINE(USE_PAM,,Use PAM for authentication)
789 LIBPAM="-lpam -ldl -lpam_misc"]
790 )
791 ],AC_MSG_WARN([*** pam support will not be built ***]),
792 [-ldl])
793 ]
794 )
795 fi
796 AC_SUBST(LIBPAM)
797
798 dnl -------------------------------
799 dnl Endian-ness check
800 dnl -------------------------------
801 AC_WORDS_BIGENDIAN
802
803 dnl -------------------------------
804 dnl check the size in byte of the C
805 dnl -------------------------------
806 dnl AC_CHECK_SIZEOF(char)
807 dnl AC_CHECK_SIZEOF(int)
808 dnl AC_CHECK_SIZEOF(short)
809 dnl AC_CHECK_SIZEOF(long)
810
811 dnl ----------------------------
812 dnl check existance of functions
813 dnl ----------------------------
814 AC_FUNC_CHOWN
815 AC_FUNC_FNMATCH
816 AC_FUNC_FORK
817 AC_FUNC_MEMCMP
818 AC_FUNC_MKTIME
819 AC_FUNC_STRFTIME
820 AC_FUNC_STAT
821 AC_FUNC_SELECT_ARGTYPES
822 AC_FUNC_STRFTIME
823 dnl Avoid AC_FUNC_STRNLEN because it pulls in AC_SYSTEM_EXTENSIONS which
824 dnl can lead to strange side effects. So we just check for strnlen
825 dnl directly, see below.
826 dnl AC_FUNC_STRNLENdnl
827 AC_FUNC_VPRINTF
828
829 dnl -------------------------------
830 dnl bgpd needs pow() and hence libm
831 dnl -------------------------------
832 TMPLIBS="$LIBS"
833 AC_CHECK_HEADER([math.h],
834 [AC_CHECK_LIB([m], [pow],
835 [LIBM="-lm"
836 LIBS="$LIBS $LIBM"
837 AC_DEFINE(HAVE_LIBM,, Have libm)
838 AC_CHECK_FUNCS(pow,[],[LIBM=""])
839 ])
840 ])
841 if test x"$LIBM" = x ; then
842 AC_MSG_WARN([Unable to find working pow function - bgpd may not link])
843 fi
844 LIBS="$TMPLIBS"
845 AC_SUBST(LIBM)
846
847 dnl ---------------
848 dnl other functions
849 dnl ---------------
850 AC_CHECK_FUNCS([dup2 ftruncate getcwd gethostbyname getpagesize gettimeofday \
851 inet_ntoa inet_aton strnlen \
852 memchr memmove memset select socket \
853 strcasecmp strchr strcspn strdup strerror \
854 strncasecmp strndup strrchr strspn strstr \
855 strtol strtoul strlcat strlcpy \
856 daemon snprintf vsnprintf \
857 if_nametoindex if_indextoname getifaddrs \
858 uname fcntl getgrouplist])
859
860 dnl ------------------------------------
861 dnl Determine routing get and set method
862 dnl ------------------------------------
863 AC_MSG_CHECKING(zebra between kernel interface method)
864 if test x"$opsys" = x"gnu-linux"; then
865 AC_MSG_RESULT(netlink)
866 RT_METHOD=rt_netlink.o
867 AC_DEFINE(HAVE_NETLINK,,netlink)
868 netlink=yes
869 AC_CHECK_DECLS([IFLA_INFO_SLAVE_KIND], [], [], [#include <linux/if_link.h>])
870 else
871 AC_MSG_RESULT(Route socket)
872 KERNEL_METHOD="kernel_socket.o"
873 RT_METHOD="rt_socket.o"
874 fi
875 AC_SUBST(RT_METHOD)
876 AC_SUBST(KERNEL_METHOD)
877 AM_CONDITIONAL([HAVE_NETLINK], [test "x$netlink" = "xyes"])
878
879 dnl --------------------------
880 dnl Determine IS-IS I/O method
881 dnl --------------------------
882 AC_DEFINE(ISIS_METHOD_PFPACKET, 1, [ constant value for isis method pfpacket ])
883 AC_DEFINE(ISIS_METHOD_DLPI, 2, [ constant value for isis method dlpi ])
884 AC_DEFINE(ISIS_METHOD_BPF, 3, [ constant value for isis method bpf ])
885 AC_CHECK_HEADER(net/bpf.h)
886 AC_CHECK_HEADER(sys/dlpi.h)
887 AC_MSG_CHECKING(zebra IS-IS I/O method)
888 if test x"$opsys" = x"gnu-linux"; then
889 AC_MSG_RESULT(pfpacket)
890 ISIS_METHOD_MACRO="ISIS_METHOD_PFPACKET"
891 elif test x"$opsys" = x"sol2-6" -o x"$opsys" = x"sol8"; then
892 AC_MSG_RESULT(DLPI)
893 ISIS_METHOD_MACRO="ISIS_METHOD_DLPI"
894 else
895 if test $ac_cv_header_net_bpf_h = no; then
896 if test $ac_cv_header_sys_dlpi_h = no; then
897 AC_MSG_RESULT(none)
898 AC_MSG_WARN([*** IS-IS support will not be built ***])
899 ISISD=""
900 else
901 AC_MSG_RESULT(DLPI)
902 fi
903 ISIS_METHOD_MACRO="ISIS_METHOD_DLPI"
904 else
905 AC_MSG_RESULT(BPF)
906 ISIS_METHOD_MACRO="ISIS_METHOD_BPF"
907 fi
908 fi
909 AC_DEFINE_UNQUOTED(ISIS_METHOD, $ISIS_METHOD_MACRO, [ selected method for isis, == one of the constants ])
910
911 dnl ------------------------------------
912 dnl check for broken CMSG_FIRSTHDR macro
913 dnl ------------------------------------
914 AC_MSG_CHECKING(for broken CMSG_FIRSTHDR)
915 AC_RUN_IFELSE([AC_LANG_SOURCE([[
916 #ifdef SUNOS_5
917 #define _XPG4_2
918 #define __EXTENSIONS__
919 #endif
920 #ifdef HAVE_STDLIB_H
921 # include <stdlib.h>
922 #endif
923 #ifdef HAVE_SYS_TYPES_H
924 #include <sys/types.h>
925 #endif
926 #ifdef HAVE_SYS_SOCKET_H
927 #include <sys/socket.h>
928 #endif
929
930 main()
931 {
932 struct msghdr msg;
933 char buf[4];
934
935 msg.msg_control = buf;
936 msg.msg_controllen = 0;
937
938 if (CMSG_FIRSTHDR(&msg) != NULL)
939 exit(0);
940 exit (1);
941 }]])],[AC_MSG_RESULT(yes - using workaround) AC_DEFINE(HAVE_BROKEN_CMSG_FIRSTHDR,,Broken CMSG_FIRSTHDR)],
942 [AC_MSG_RESULT(no)],[AC_MSG_RESULT(no)])
943
944 dnl ------------------------------
945 dnl check kernel route read method
946 dnl ------------------------------
947 AC_CACHE_CHECK([route read method], [quagga_cv_rtread_method],
948 [if test "x$netlink" = xyes; then
949 quagga_cv_rtread_method="netlink"
950 else
951 for quagga_cv_rtread_method in /dev/ip /dev/null;
952 do
953 test x`ls $quagga_cv_rtread_method 2>/dev/null` = x"$quagga_cv_rtread_method" && break
954 done
955 case $quagga_cv_rtread_method in
956 "/dev/ip")
957 case "$host" in
958 *-freebsd*) quagga_cv_rtread_method="sysctl";;
959 *) quagga_cv_rtread_method="getmsg";;
960 esac;;
961 *)
962 quagga_cv_rtread_method="sysctl";;
963 esac
964 fi])
965 RTREAD_METHOD=rtread_${quagga_cv_rtread_method}.o
966 AC_SUBST(RTREAD_METHOD)
967
968 dnl -----------------------------
969 dnl check interface lookup method
970 dnl -----------------------------
971 IOCTL_METHOD=ioctl.o
972 AC_MSG_CHECKING(interface looking up method)
973 if test "$netlink" = yes; then
974 AC_MSG_RESULT(netlink)
975 IF_METHOD=if_netlink.o
976 elif test "$opsys" = "sol2-6";then
977 AC_MSG_RESULT(Solaris GIF)
978 IF_METHOD=if_ioctl.o
979 elif test "$opsys" = "sol8";then
980 AC_MSG_RESULT(Solaris GLIF)
981 IF_METHOD=if_ioctl_solaris.o
982 IOCTL_METHOD=ioctl_solaris.o
983 elif test "$opsys" = "openbsd";then
984 AC_MSG_RESULT(openbsd)
985 IF_METHOD=if_ioctl.o
986 elif grep NET_RT_IFLIST /usr/include/sys/socket.h >/dev/null 2>&1; then
987 AC_MSG_RESULT(sysctl)
988 IF_METHOD=if_sysctl.o
989 AC_DEFINE(HAVE_NET_RT_IFLIST,,NET_RT_IFLIST)
990 else
991 AC_MSG_RESULT(ioctl)
992 IF_METHOD=if_ioctl.o
993 fi
994 AC_SUBST(IF_METHOD)
995 AC_SUBST(IOCTL_METHOD)
996
997 dnl ---------------------------------------------------------------
998 dnl figure out how to specify an interface in multicast sockets API
999 dnl ---------------------------------------------------------------
1000 AC_CHECK_MEMBERS([struct ip_mreqn.imr_ifindex], [], [], QUAGGA_INCLUDES)
1001
1002 AC_CHECK_HEADERS([linux/mroute.h], [], [],
1003 [
1004 #if HAVE_NETINET_IN_H
1005 #include<netinet/in.h>
1006 #endif])
1007 AC_MSG_CHECKING([for BSD struct ip_mreq hack])
1008 AC_TRY_COMPILE([#ifdef HAVE_SYS_PARAM_H
1009 #include <sys/param.h>
1010 #endif],[#if (defined(__FreeBSD__) && ((__FreeBSD_version >= 500022 && __FreeBSD_version < 700000) || (__FreeBSD_version < 500000 && __FreeBSD_version >= 440000))) || (defined(__NetBSD__) && defined(__NetBSD_Version__) && __NetBSD_Version__ >= 106010000) || defined(__OpenBSD__) || defined(__APPLE__) || defined(__DragonFly__) || defined(__sun)
1011 return (0);
1012 #else
1013 #error No support for BSD struct ip_mreq hack detected
1014 #endif],[AC_MSG_RESULT(yes)
1015 AC_DEFINE(HAVE_BSD_STRUCT_IP_MREQ_HACK,,[Can pass ifindex in struct ip_mreq])],
1016 AC_MSG_RESULT(no))
1017
1018 AC_MSG_CHECKING([for RFC3678 protocol-independed API])
1019 AC_TRY_COMPILE([
1020 #include <sys/types.h>
1021 #include <netinet/in.h>
1022 ], [struct group_req gr; int sock; setsockopt(sock, IPPROTO_IP, MCAST_JOIN_GROUP, (void*)&gr, sizeof(gr));
1023 ], [AC_MSG_RESULT(yes)
1024 AC_DEFINE(HAVE_RFC3678,1,[Have RFC3678 protocol-independed API])],
1025 AC_MSG_RESULT(no))
1026
1027 dnl ---------------------------------------------------------------
1028 dnl figure out how to check link-state
1029 dnl ---------------------------------------------------------------
1030 AC_CHECK_HEADER([net/if.h],
1031 [AC_CHECK_HEADER( [net/if_media.h],
1032 [m4_define([LINK_DETECT_INCLUDES],
1033 QUAGGA_INCLUDES
1034 [#include <net/if_media.h>
1035 ])
1036 AC_CHECK_MEMBERS( [struct ifmediareq.ifm_status],
1037 AC_DEFINE(HAVE_BSD_LINK_DETECT,,[BSD link-detect]),
1038 [], LINK_DETECT_INCLUDES)],
1039 [],
1040 QUAGGA_INCLUDES)],
1041 [], QUAGGA_INCLUDES )
1042
1043 dnl ---------------------------------------------------------------
1044 dnl Additional, newer way to check link-state using ifi_link_state.
1045 dnl Not available in all BSD's when ifmediareq available
1046 dnl ---------------------------------------------------------------
1047 AC_CHECK_HEADER([net/if.h],
1048 AC_CHECK_MEMBERS([struct if_data.ifi_link_state],
1049 AC_DEFINE(HAVE_BSD_IFI_LINK_STATE,,[BSD ifi_link_state available]),
1050 [], QUAGGA_INCLUDES),
1051 ,)
1052
1053 dnl ------------------------
1054 dnl TCP_MD5SIG socket option
1055 dnl ------------------------
1056
1057 AC_CHECK_HEADER([netinet/tcp.h],
1058 [m4_define([MD5_INCLUDES],
1059 QUAGGA_INCLUDES
1060 [#include <netinet/tcp.h>
1061 ])
1062 AC_CHECK_DECLS([TCP_MD5SIG], [], [], MD5_INCLUDES)],
1063 [],
1064 QUAGGA_INCLUDES)
1065 if test $ac_cv_have_decl_TCP_MD5SIG = no; then
1066 AC_CHECK_HEADER([linux/tcp.h],
1067 [m4_define([MD5_INCLUDES],
1068 QUAGGA_INCLUDES
1069 [#include <linux/tcp.h>
1070 ])
1071 AC_CHECK_DECLS([TCP_MD5SIG], [], [], MD5_INCLUDES)])
1072 fi
1073
1074 dnl -----------------------------
1075 dnl check ipforward detect method
1076 dnl -----------------------------
1077 AC_CACHE_CHECK([ipforward method], [quagga_cv_ipforward_method],
1078 [if test x$cross_compiling = xyes; then
1079 if test x"$opsys" = x"gnu-linux"; then
1080 quagga_cv_ipforward_method=/proc/net/snmp
1081 else
1082 quagga_cv_ipforward_method=/dev/ip
1083 fi
1084 else
1085 for quagga_cv_ipforward_method in /proc/net/snmp /dev/ip /dev/null;
1086 do
1087 test x`ls $quagga_cv_ipforward_method 2>/dev/null` = x"$quagga_cv_ipforward_method" && break
1088 done
1089 fi
1090 case $quagga_cv_ipforward_method in
1091 "/proc/net/snmp") quagga_cv_ipforward_method="proc";;
1092 "/dev/ip")
1093 case "$host" in
1094 *-freebsd*) quagga_cv_ipforward_method="sysctl";;
1095 *) quagga_cv_ipforward_method="solaris";;
1096 esac;;
1097 *) quagga_cv_ipforward_method="sysctl";;
1098 esac])
1099 IPFORWARD=ipforward_${quagga_cv_ipforward_method}.o
1100 AC_SUBST(IPFORWARD)
1101
1102 AC_CHECK_FUNCS(getaddrinfo, [have_getaddrinfo=yes], [have_getaddrinfo=no])
1103
1104 dnl ----------
1105 dnl IPv6 check
1106 dnl ----------
1107 AC_MSG_CHECKING(whether does this OS have IPv6 stack)
1108 dnl ---------
1109 dnl KAME IPv6
1110 dnl ---------
1111 if grep WIDE /usr/include/netinet6/in6.h >/dev/null 2>&1; then
1112 AC_DEFINE(KAME,1,KAME IPv6)
1113 AC_MSG_RESULT(KAME)
1114 dnl ------------------------------------
1115 dnl Solaris 9, 10 and potentially higher
1116 dnl ------------------------------------
1117 elif test x"$opsys" = x"sol8"; then
1118 AC_DEFINE(SOLARIS_IPV6, 1, Solaris IPv6)
1119 AC_MSG_RESULT(Solaris IPv6)
1120 dnl ----------
1121 dnl Linux IPv6
1122 dnl ----------
1123 elif test x"$opsys" = x"gnu-linux"; then
1124 AC_DEFINE(LINUX_IPV6,1,Linux IPv6 stack)
1125 dnl Linux has a compilation problem with mixing
1126 dnl netinet/in.h and linux/in6.h they are not
1127 dnl compatible. There has been discussion on
1128 dnl how to fix it but no real progress on implementation
1129 dnl when they fix it, remove this
1130 AC_DEFINE(IPV6_MINHOPCOUNT, 73, Linux ipv6 Min Hop Count)
1131 AC_MSG_RESULT(Linux IPv6)
1132 else
1133 AC_MSG_ERROR([Failed to detect IPv6 stack])
1134 fi
1135
1136 dnl this is unconditial, for compatibility
1137 AC_DEFINE(HAVE_IPV6,1,IPv6)
1138
1139 dnl ------------------
1140 dnl IPv6 header checks
1141 dnl ------------------
1142 AC_CHECK_HEADERS([netinet6/in6.h netinet/in6_var.h netinet/icmp6.h \
1143 netinet6/in6_var.h netinet6/nd6.h], [], [],
1144 QUAGGA_INCLUDES)
1145
1146 m4_define([QUAGGA_INCLUDES],dnl
1147 QUAGGA_INCLUDES
1148 [#if HAVE_NETINET6_IN6_H
1149 #include <netinet6/in6.h>
1150 #endif
1151 #if HAVE_NETINET_IN6_VAR_H
1152 #include <netinet/in6_var.h>
1153 #endif
1154 #if HAVE_NETINET_ICMP6_H
1155 # include <netinet/icmp6.h>
1156 #endif
1157 #if HAVE_NETINET6_IN6_VAR_H
1158 # include <netinet6/in6_var.h>
1159 #endif
1160 #if HAVE_NETINET6_ND6_H
1161 # include <netinet6/nd6.h>
1162 #endif
1163 ])dnl
1164
1165 dnl disable doc check
1166 if test "${enable_doc}" = "no";then
1167 DOC=""
1168 else
1169 DOC="doc"
1170 fi
1171
1172 dnl --------------------
1173 dnl Daemon disable check
1174 dnl --------------------
1175 if test "${enable_zebra}" = "no";then
1176 ZEBRA=""
1177 else
1178 ZEBRA="zebra"
1179 fi
1180 AM_CONDITIONAL(ZEBRA, test "x$ZEBRA" = "xzebra")
1181
1182 if test "${enable_bgpd}" = "no";then
1183 BGPD=""
1184 else
1185 BGPD="bgpd"
1186 fi
1187 AM_CONDITIONAL(BGPD, test "x$BGPD" = "xbgpd")
1188
1189 if test "${enable_ripd}" = "no";then
1190 RIPD=""
1191 else
1192 RIPD="ripd"
1193 fi
1194 AM_CONDITIONAL(RIPD, test "x$RIPD" = "xripd")
1195
1196 if test "${enable_ospfd}" = "no";then
1197 OSPFD=""
1198 else
1199 OSPFD="ospfd"
1200 fi
1201 AM_CONDITIONAL(OSPFD, test "x$OSPFD" = "xospfd")
1202
1203 if test "${enable_watchquagga}" = "no";then
1204 WATCHQUAGGA=""
1205 else
1206 WATCHQUAGGA="watchquagga"
1207 fi
1208 AM_CONDITIONAL(WATCHQUAGGA, test "x$WATCHQUAGGA" = "xwatchquagga")
1209
1210 OSPFCLIENT=""
1211 if test "${enable_opaque_lsa}" != "no"; then
1212 if test "${enable_ospfapi}" != "no";then
1213 AC_DEFINE(SUPPORT_OSPF_API,,OSPFAPI)
1214
1215 if test "${enable_ospfclient}" != "no";then
1216 OSPFCLIENT="ospfclient"
1217 fi
1218 fi
1219
1220 fi
1221 AM_CONDITIONAL(OSPFCLIENT, test "x$OSPFCLIENT" = "xospfclient")
1222
1223 case "${enable_ripngd}" in
1224 "no" ) RIPNGD="";;
1225 * ) RIPNGD="ripngd";;
1226 esac
1227 AM_CONDITIONAL(RIPNGD, test "x$RIPNGD" = "xripngd")
1228
1229 case "${enable_ospf6d}" in
1230 "no" ) OSPF6D="";;
1231 * ) OSPF6D="ospf6d";;
1232 esac
1233 AM_CONDITIONAL(OSPF6D, test "x$OSPF6D" = "xospf6d")
1234
1235 case "${enable_isisd}" in
1236 "no" ) ISISD="";;
1237 * ) ISISD="isisd";;
1238 esac
1239 AM_CONDITIONAL(ISISD, test "x$ISISD" = "xisisd")
1240
1241 case "${enable_pimd}" in
1242 "no" ) PIMD="";;
1243 * ) PIMD="pimd";;
1244 esac
1245 AM_CONDITIONAL(PIMD, test "x$PIMD" = "xpimd")
1246
1247 if test "${enable_bgp_announce}" = "no";then
1248 AC_DEFINE(DISABLE_BGP_ANNOUNCE,1,Disable BGP installation to zebra)
1249 else
1250 AC_DEFINE(DISABLE_BGP_ANNOUNCE,0,Disable BGP installation to zebra)
1251 fi
1252
1253 AC_SUBST(DOC)
1254 AC_SUBST(ZEBRA)
1255 AC_SUBST(BGPD)
1256 AC_SUBST(RIPD)
1257 AC_SUBST(RIPNGD)
1258 AC_SUBST(OSPFD)
1259 AC_SUBST(OSPF6D)
1260 AC_SUBST(WATCHQUAGGA)
1261 AC_SUBST(ISISD)
1262 AC_SUBST(PIMD)
1263 AC_SUBST(SOLARIS)
1264 AC_SUBST(VTYSH)
1265 AC_SUBST(CURSES)
1266 AC_SUBST(OSPFCLIENT)
1267 AC_SUBST(OSPFAPI)
1268 AC_CHECK_LIB(c, inet_ntop, [AC_DEFINE(HAVE_INET_NTOP,,inet_ntop)])
1269 AC_CHECK_LIB(c, inet_pton, [AC_DEFINE(HAVE_INET_PTON,,inet_pton)])
1270 AC_CHECK_LIB(crypt, crypt)
1271 AC_CHECK_LIB(resolv, res_init)
1272
1273 dnl ---------------------------
1274 dnl check system has PCRE regexp
1275 dnl ---------------------------
1276 if test "x$enable_pcreposix" = "xyes"; then
1277 AC_CHECK_LIB(pcreposix, pcreposix_regexec, ,[enable_pcreposix=no
1278 AC_MSG_WARN([*** falling back to other regex library ***]) ])
1279 fi
1280
1281 if test "x$enable_pcreposix" != "xyes"; then
1282 dnl ---------------------------
1283 dnl check system has GNU regexp
1284 dnl ---------------------------
1285 AC_MSG_CHECKING(whether system has GNU regex)
1286 AC_CHECK_LIB(c, regexec,
1287 [AC_DEFINE(HAVE_GNU_REGEX,,GNU regexp library)
1288 LIB_REGEX=""],
1289 [LIB_REGEX="regex.o"])
1290 fi
1291 AC_SUBST(HAVE_LIBPCREPOSIX)
1292 AC_SUBST(LIB_REGEX)
1293
1294 dnl ------------------
1295 dnl check Net-SNMP library
1296 dnl ------------------
1297 if test "${enable_snmp}" != ""; then
1298 AC_PATH_TOOL([NETSNMP_CONFIG], [net-snmp-config], [no])
1299 if test x"$NETSNMP_CONFIG" = x"no"; then
1300 AC_MSG_ERROR([--enable-snmp given but unable to find net-snmp-config])
1301 fi
1302 LIBS="$LIBS `${NETSNMP_CONFIG} --agent-libs`"
1303 CFLAGS="`${NETSNMP_CONFIG} --base-cflags` $CFLAGS"
1304 AC_MSG_CHECKING([whether we can link to Net-SNMP])
1305 AC_LINK_IFELSE([AC_LANG_PROGRAM([
1306 int main(void);
1307 ],
1308 [
1309 {
1310 return 0;
1311 }
1312 ])],[AC_MSG_RESULT(yes)],[
1313 AC_MSG_RESULT(no)
1314 AC_MSG_ERROR([--enable-snmp given but not usable])])
1315 AC_DEFINE(HAVE_SNMP,,SNMP)
1316 case "${enable_snmp}" in
1317 yes)
1318 SNMP_METHOD=agentx
1319 ;;
1320 smux|agentx)
1321 SNMP_METHOD="${enable_snmp}"
1322 ;;
1323 *)
1324 AC_MSG_ERROR([--enable-snmp given with an unknown method (${enable_snmp}). Use smux or agentx])
1325 ;;
1326 esac
1327 AH_TEMPLATE([SNMP_SMUX], [Use SNMP SMUX to interface with snmpd])
1328 AH_TEMPLATE([SNMP_AGENTX], [Use SNMP AgentX to interface with snmpd])
1329 AC_DEFINE_UNQUOTED(AS_TR_CPP(SNMP_${SNMP_METHOD}),,SNMP method to interface with snmpd)
1330 fi
1331
1332 dnl ---------------------------
1333 dnl sockaddr and netinet checks
1334 dnl ---------------------------
1335 AC_CHECK_TYPES([struct sockaddr, struct sockaddr_in,
1336 struct sockaddr_in6, struct sockaddr_un, struct sockaddr_dl,
1337 socklen_t, struct vifctl, struct mfcctl, struct sioc_sg_req,
1338 vifi_t, struct sioc_vif_req, struct igmpmsg,
1339 struct ifaliasreq, struct if6_aliasreq, struct in6_aliasreq,
1340 struct nd_opt_adv_interval, struct rt_addrinfo,
1341 struct nd_opt_homeagent_info, struct nd_opt_adv_interval],
1342 [], [], QUAGGA_INCLUDES)
1343
1344 AC_CHECK_MEMBERS([struct sockaddr.sa_len,
1345 struct sockaddr_in.sin_len, struct sockaddr_un.sun_len,
1346 struct sockaddr_in6.sin6_scope_id,
1347 struct sockaddr_dl.sdl_len,
1348 struct if6_aliasreq.ifra_lifetime,
1349 struct nd_opt_adv_interval.nd_opt_ai_type],
1350 [], [], QUAGGA_INCLUDES)
1351
1352 dnl ---------------------------
1353 dnl IRDP/pktinfo/icmphdr checks
1354 dnl ---------------------------
1355 AC_CHECK_TYPES([struct in_pktinfo],
1356 [AC_CHECK_TYPES([struct icmphdr],
1357 [if test "${enable_irdp}" != "no"; then
1358 AC_DEFINE(HAVE_IRDP,, IRDP)
1359 fi],
1360 [if test "${enable_irdp}" = "yes"; then
1361 AC_MSG_ERROR(['IRDP requires in_pktinfo at the moment!'])
1362 fi], [QUAGGA_INCLUDES])],
1363 [if test "${enable_irdp}" = "yes"; then
1364 AC_MSG_ERROR(['IRDP requires in_pktinfo at the moment!'])
1365 fi], [QUAGGA_INCLUDES])
1366
1367 dnl -----------------------
1368 dnl checking for IP_PKTINFO
1369 dnl -----------------------
1370 AC_MSG_CHECKING(for IP_PKTINFO)
1371 AC_TRY_COMPILE([#include <netdb.h>], [
1372 int opt = IP_PKTINFO;
1373 ], [
1374 AC_MSG_RESULT(yes)
1375 AC_DEFINE(HAVE_IP_PKTINFO, 1, [Have IP_PKTINFO])
1376 ], [
1377 AC_MSG_RESULT(no)
1378 ])
1379
1380 dnl ---------------------------
1381 dnl checking for IP_RECVDSTADDR
1382 dnl ---------------------------
1383 AC_MSG_CHECKING(for IP_RECVDSTADDR)
1384 AC_TRY_COMPILE([#include <netinet/in.h>], [
1385 int opt = IP_RECVDSTADDR;
1386 ], [
1387 AC_MSG_RESULT(yes)
1388 AC_DEFINE(HAVE_IP_RECVDSTADDR, 1, [Have IP_RECVDSTADDR])
1389 ], [
1390 AC_MSG_RESULT(no)
1391 ])
1392
1393 dnl ----------------------
1394 dnl checking for IP_RECVIF
1395 dnl ----------------------
1396 AC_MSG_CHECKING(for IP_RECVIF)
1397 AC_TRY_COMPILE([#include <netinet/in.h>], [
1398 int opt = IP_RECVIF;
1399 ], [
1400 AC_MSG_RESULT(yes)
1401 AC_DEFINE(HAVE_IP_RECVIF, 1, [Have IP_RECVIF])
1402 ], [
1403 AC_MSG_RESULT(no)
1404 ])
1405
1406 dnl --------------------------------------
1407 dnl checking for getrusage struct and call
1408 dnl --------------------------------------
1409 if test "${enable_rusage}" != "no"; then
1410 AC_MSG_CHECKING(whether getrusage is available)
1411 AC_TRY_COMPILE([#include <sys/resource.h>],[struct rusage ac_x; getrusage (RUSAGE_SELF, &ac_x);],
1412 [AC_MSG_RESULT(yes)
1413 AC_DEFINE(HAVE_RUSAGE,,rusage)],
1414 AC_MSG_RESULT(no))
1415 fi
1416
1417 dnl --------------------------------------
1418 dnl checking for clock_time monotonic struct and call
1419 dnl --------------------------------------
1420 AC_CHECK_DECL(CLOCK_MONOTONIC,
1421 [AC_CHECK_LIB(rt, clock_gettime, [LIBS="$LIBS -lrt"])
1422 AC_DEFINE(HAVE_CLOCK_MONOTONIC,, Have monotonic clock)
1423 ], [AC_MSG_RESULT(no)], [QUAGGA_INCLUDES])
1424
1425 dnl -------------------
1426 dnl capabilities checks
1427 dnl -------------------
1428 if test "${enable_capabilities}" != "no"; then
1429 AC_MSG_CHECKING(whether prctl PR_SET_KEEPCAPS is available)
1430 AC_TRY_COMPILE([#include <sys/prctl.h>],[prctl(PR_SET_KEEPCAPS, 1, 0, 0, 0);],
1431 [AC_MSG_RESULT(yes)
1432 AC_DEFINE(HAVE_PR_SET_KEEPCAPS,,prctl)
1433 quagga_ac_keepcaps="yes"],
1434 AC_MSG_RESULT(no)
1435 )
1436 if test x"${quagga_ac_keepcaps}" = x"yes"; then
1437 AC_CHECK_HEADERS(sys/capability.h)
1438 fi
1439 if test x"${ac_cv_header_sys_capability_h}" = x"yes"; then
1440 AC_CHECK_LIB(cap, cap_init,
1441 [AC_DEFINE(HAVE_LCAPS,1,Capabilities)
1442 LIBCAP="-lcap"
1443 quagga_ac_lcaps="yes"]
1444 )
1445 else
1446 AC_CHECK_HEADERS(priv.h,
1447 [AC_MSG_CHECKING(Solaris style privileges are available)
1448 AC_TRY_COMPILE([#include <priv.h>],[getpflags(PRIV_AWARE);],
1449 [AC_MSG_RESULT(yes)
1450 AC_DEFINE(HAVE_SOLARIS_CAPABILITIES,1,getpflags)
1451 quagga_ac_scaps="yes"],
1452 AC_MSG_RESULT(no)
1453 )
1454 ]
1455 )
1456 fi
1457 if test x"${quagga_ac_scaps}" = x"yes" \
1458 -o x"${quagga_ac_lcaps}" = x"yes"; then
1459 AC_DEFINE(HAVE_CAPABILITIES,1,capabilities)
1460 fi
1461 fi
1462 AC_SUBST(LIBCAP)
1463
1464 dnl ---------------------------
1465 dnl check for glibc 'backtrace'
1466 dnl ---------------------------
1467 if test x"${enable_backtrace}" != x"no" ; then
1468 backtrace_ok=no
1469 AC_CHECK_HEADER([execinfo.h], [
1470 AC_SEARCH_LIBS([backtrace], [execinfo], [
1471 AC_DEFINE(HAVE_GLIBC_BACKTRACE,,[Glibc backtrace])
1472 AC_DEFINE(HAVE_STACK_TRACE,,[Stack symbol decoding])
1473 backtrace_ok=yes
1474 ],, [-lm])
1475 ])
1476
1477 if test x"${enable_backtrace}" = x"yes" -a x"${backtrace_ok}" = x"no"; then
1478 dnl user explicitly requested backtrace but we failed to find support
1479 AC_MSG_FAILURE([failed to find backtrace support])
1480 fi
1481 fi
1482
1483 dnl -----------------------------------------
1484 dnl check for malloc mallinfo struct and call
1485 dnl this must try and link using LIBS, in
1486 dnl order to check no alternative allocator
1487 dnl has been specified, which might not provide
1488 dnl mallinfo, e.g. such as Umem on Solaris.
1489 dnl -----------------------------------------
1490 AC_CHECK_HEADER([malloc.h],
1491 [AC_MSG_CHECKING(whether mallinfo is available)
1492 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <malloc.h>]],
1493 [[struct mallinfo ac_x; ac_x = mallinfo ();]])],
1494 [AC_MSG_RESULT(yes)
1495 AC_DEFINE(HAVE_MALLINFO,,mallinfo)],
1496 AC_MSG_RESULT(no)
1497 )
1498 ], [], QUAGGA_INCLUDES)
1499
1500 dnl ----------
1501 dnl configure date
1502 dnl ----------
1503 CONFDATE=`date '+%Y%m%d'`
1504 AC_SUBST(CONFDATE)
1505
1506 dnl -------
1507 dnl DejaGNU
1508 dnl -------
1509 if test x"$DEJAGNU" = x
1510 then
1511 DEJAGNU="\$(top_srcdir)/tests/global-conf.exp"
1512 fi
1513 RUNTESTDEFAULTFLAGS="-x --tool \$\$tool"
1514
1515 AC_SUBST(DEJAGNU)
1516 AC_SUBST(RUNTESTDEFAULTFLAGS)
1517
1518 dnl ------------------------------
1519 dnl set paths for state directory
1520 dnl ------------------------------
1521 AC_MSG_CHECKING(directory to use for state file)
1522 if test "${prefix}" = "NONE"; then
1523 quagga_statedir_prefix="";
1524 else
1525 quagga_statedir_prefix=${prefix}
1526 fi
1527 if test "${localstatedir}" = '${prefix}/var'; then
1528 for QUAGGA_STATE_DIR in ${quagga_statedir_prefix}/var/run dnl
1529 ${quagga_statedir_prefix}/var/adm dnl
1530 ${quagga_statedir_prefix}/etc dnl
1531 /var/run dnl
1532 /var/adm dnl
1533 /etc dnl
1534 /dev/null;
1535 do
1536 test -d $QUAGGA_STATE_DIR && break
1537 done
1538 quagga_statedir=$QUAGGA_STATE_DIR
1539 else
1540 quagga_statedir=${localstatedir}
1541 fi
1542 if test $quagga_statedir = "/dev/null"; then
1543 AC_MSG_ERROR('STATE DIRECTORY NOT FOUND! FIX OR SPECIFY --localstatedir!')
1544 fi
1545 AC_MSG_RESULT(${quagga_statedir})
1546 AC_SUBST(quagga_statedir)
1547
1548 AC_DEFINE_UNQUOTED(PATH_ZEBRA_PID, "$quagga_statedir/zebra.pid",zebra PID)
1549 AC_DEFINE_UNQUOTED(PATH_RIPD_PID, "$quagga_statedir/ripd.pid",ripd PID)
1550 AC_DEFINE_UNQUOTED(PATH_RIPNGD_PID, "$quagga_statedir/ripngd.pid",ripngd PID)
1551 AC_DEFINE_UNQUOTED(PATH_BGPD_PID, "$quagga_statedir/bgpd.pid",bgpd PID)
1552 AC_DEFINE_UNQUOTED(PATH_OSPFD_PID, "$quagga_statedir/ospfd.pid",ospfd PID)
1553 AC_DEFINE_UNQUOTED(PATH_OSPF6D_PID, "$quagga_statedir/ospf6d.pid",ospf6d PID)
1554 AC_DEFINE_UNQUOTED(PATH_ISISD_PID, "$quagga_statedir/isisd.pid",isisd PID)
1555 AC_DEFINE_UNQUOTED(PATH_PIMD_PID, "$quagga_statedir/pimd.pid",pimd PID)
1556 AC_DEFINE_UNQUOTED(PATH_WATCHQUAGGA_PID, "$quagga_statedir/watchquagga.pid",watchquagga PID)
1557 AC_DEFINE_UNQUOTED(ZEBRA_SERV_PATH, "$quagga_statedir/zserv.api",zebra api socket)
1558 AC_DEFINE_UNQUOTED(ZEBRA_VTYSH_PATH, "$quagga_statedir/zebra.vty",zebra vty socket)
1559 AC_DEFINE_UNQUOTED(RIP_VTYSH_PATH, "$quagga_statedir/ripd.vty",rip vty socket)
1560 AC_DEFINE_UNQUOTED(RIPNG_VTYSH_PATH, "$quagga_statedir/ripngd.vty",ripng vty socket)
1561 AC_DEFINE_UNQUOTED(BGP_VTYSH_PATH, "$quagga_statedir/bgpd.vty",bgpd vty socket)
1562 AC_DEFINE_UNQUOTED(OSPF_VTYSH_PATH, "$quagga_statedir/ospfd.vty",ospfd vty socket)
1563 AC_DEFINE_UNQUOTED(OSPF6_VTYSH_PATH, "$quagga_statedir/ospf6d.vty",ospf6d vty socket)
1564 AC_DEFINE_UNQUOTED(ISIS_VTYSH_PATH, "$quagga_statedir/isisd.vty",isisd vty socket)
1565 AC_DEFINE_UNQUOTED(PIM_VTYSH_PATH, "$quagga_statedir/pimd.vty",pimd vty socket)
1566 AC_DEFINE_UNQUOTED(DAEMON_VTY_DIR, "$quagga_statedir",daemon vty directory)
1567
1568 dnl -------------------------------
1569 dnl Quagga sources should always be
1570 dnl current wrt interfaces. Dont
1571 dnl allow deprecated interfaces to
1572 dnl be exposed.
1573 dnl -------------------------------
1574 AC_DEFINE(QUAGGA_NO_DEPRECATED_INTERFACES, 1, Hide deprecated interfaces)
1575
1576 dnl ---------------------------
1577 dnl Check htonl works correctly
1578 dnl ---------------------------
1579 AC_MSG_CHECKING(for working htonl)
1580 AC_CACHE_VAL(ac_cv_htonl_works,
1581 [AC_LINK_IFELSE([AC_LANG_PROGRAM([QUAGGA_INCLUDES],[htonl (0);])],
1582 [ac_cv_htonl_works=yes], [ac_cv_htonl_works=no])
1583 ]
1584 )
1585 AC_MSG_RESULT($ac_cv_htonl_works)
1586
1587 AC_CONFIG_FILES([Makefile lib/Makefile zebra/Makefile ripd/Makefile
1588 ripngd/Makefile bgpd/Makefile ospfd/Makefile watchquagga/Makefile
1589 ospf6d/Makefile isisd/Makefile vtysh/Makefile
1590 doc/Makefile ospfclient/Makefile tests/Makefile m4/Makefile
1591 pimd/Makefile
1592 tests/bgpd.tests/Makefile
1593 tests/libzebra.tests/Makefile
1594 redhat/Makefile
1595 tools/Makefile
1596 cumulus/Makefile
1597 pkgsrc/Makefile
1598 redhat/quagga.spec
1599 lib/version.h
1600 doc/defines.texi
1601 isisd/topology/Makefile
1602 pkgsrc/bgpd.sh pkgsrc/ospf6d.sh pkgsrc/ospfd.sh
1603 pkgsrc/ripd.sh pkgsrc/ripngd.sh pkgsrc/zebra.sh])
1604 AC_CONFIG_FILES([solaris/Makefile])
1605
1606 AC_CONFIG_FILES([vtysh/extract.pl],[chmod +x vtysh/extract.pl])
1607 ## Hack, but working solution to avoid rebuilding of quagga.info.
1608 ## It's already in CVS until texinfo 4.7 is more common.
1609 AC_OUTPUT
1610
1611 echo "
1612 Quagga configuration
1613 --------------------
1614 quagga version : ${PACKAGE_VERSION}
1615 host operating system : ${host_os}
1616 source code location : ${srcdir}
1617 compiler : ${CC}
1618 compiler flags : ${CFLAGS}
1619 make : ${MAKE-make}
1620 linker flags : ${LDFLAGS} ${LIBS} ${LIBCAP} ${LIBREADLINE} ${LIBM}
1621 state file directory : ${quagga_statedir}
1622 config file directory : `eval echo \`echo ${sysconfdir}\``
1623 example directory : `eval echo \`echo ${exampledir}\``
1624 user to run as : ${enable_user}
1625 group to run as : ${enable_group}
1626 group for vty sockets : ${enable_vty_group}
1627 config file mask : ${enable_configfile_mask}
1628 log file mask : ${enable_logfile_mask}
1629
1630 The above user and group must have read/write access to the state file
1631 directory and to the config files in the config file directory."
1632
1633 if test x"$quagga_cv_gnu_make" = x"no"; then echo "
1634 Warning: The ${MAKE-make} programme detected, either in your path or
1635 via the MAKE variable, is not GNU Make. GNU make may be installed as
1636 gmake on some systems. and is required to complete a build of Quagga
1637 " > /dev/stderr
1638 fi