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