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