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