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