blob: 8e0324dc0904533e079a15bac056e7a40c677d33 [file] [log] [blame]
paul7ea487b2003-03-17 02:05:07 +00001##
paule8f29842003-08-12 13:08:31 +00002## Configure template file for Quagga.
paul7ea487b2003-03-17 02:05:07 +00003## autoconf will generate configure script.
4##
5## Copyright (c) 1996, 97, 98, 99, 2000 Kunihiro Ishiguro <kunihiro@zebra.org>
paule8f29842003-08-12 13:08:31 +00006## Portions Copyright (c) 2003 Paul Jakma <paul@dishone.st>
paul7ea487b2003-03-17 02:05:07 +00007##
paul26275b02005-04-11 07:10:47 +00008## $Id: configure.ac,v 1.101 2005/04/11 07:10:47 paul Exp $
paule8f29842003-08-12 13:08:31 +00009AC_PREREQ(2.53)
paul7ea487b2003-03-17 02:05:07 +000010
paulf83d18d2005-01-24 10:24:31 +000011AC_INIT(Quagga, 0.99.0, [http://bugzilla.quagga.net])
paulfa1253d2003-09-24 05:09:26 +000012AC_CONFIG_SRCDIR(lib/zebra.h)
gdt81b81822004-04-07 22:48:47 +000013AM_INIT_AUTOMAKE(1.6)
paul7ea487b2003-03-17 02:05:07 +000014AM_CONFIG_HEADER(config.h)
15
gdtd6b72f72003-12-03 17:24:27 +000016dnl default is to match previous behavior
gdtc4f0efe2003-12-04 15:39:25 +000017exampledir=${sysconfdir}
gdtd6b72f72003-12-03 17:24:27 +000018AC_ARG_ENABLE([exampledir],
19 AC_HELP_STRING([--enable-exampledir],
20 [specify alternate directory for examples]),
21 exampledir="$enableval",)
gdtc4f0efe2003-12-04 15:39:25 +000022dnl XXX add --exampledir to autoconf standard directory list somehow
gdtd6b72f72003-12-03 17:24:27 +000023AC_SUBST(exampledir)
24
gdtcbd04082004-08-31 18:16:36 +000025dnl default is to match previous behavior
26pkgsrcrcdir=""
27pkgsrcdir=""
28AC_ARG_ENABLE([pkgsrcrcdir],
29 AC_HELP_STRING([--enable-pkgsrcrcdir],
30 [specify directory for rc.d scripts]),
31 pkgsrcrcdir="$enableval"; pkgsrcdir="pkgsrc",)
32dnl XXX add --pkgsrcrcdir to autoconf standard directory list somehow
33AC_SUBST(pkgsrcdir)
34AC_SUBST(pkgsrcrcdir)
35
paul7ea487b2003-03-17 02:05:07 +000036dnl -----------------------------------
37dnl Get hostname and other information.
38dnl -----------------------------------
paul26275b02005-04-11 07:10:47 +000039AC_CANONICAL_BUILD()
40AC_CANONICAL_HOST()
41AC_CANONICAL_TARGET()
paul7ea487b2003-03-17 02:05:07 +000042
43dnl ------------
44dnl Check CFLAGS
45dnl ------------
46AC_ARG_WITH(cflags,
47[ --with-cflags Set CFLAGS for use in compilation.])
48if test "x$with_cflags" != "x" ; then
49 CFLAGS="$with_cflags" ; cflags_specified=yes ;
50elif test -n "$CFLAGS" ; then
51 cflags_specified=yes ;
52fi
53
hasso1969e4b2005-03-27 13:07:23 +000054dnl --------------------
55dnl Check CC and friends
56dnl --------------------
paul7ea487b2003-03-17 02:05:07 +000057AC_PROG_CC
hasso1969e4b2005-03-27 13:07:23 +000058AC_PROG_CPP
59AC_PROG_EGREP
60
61dnl ------------------------------------------------------------------
62dnl Intel compiler check. Although Intel tries really hard to make icc
63dnl look like gcc, there are some differences. It's very verbose with
64dnl -Wall and it doesn't support the individual -W options.
65dnl ------------------------------------------------------------------
66AC_MSG_CHECKING([whether we are using the Intel compiler])
67AC_EGREP_CPP([^__INTEL_COMPILER], [__INTEL_COMPILER],
68 ICC="no"
69 AC_MSG_RESULT([no]),
70 ICC="yes"
71 AC_MSG_RESULT([yes])
72)
paul7ea487b2003-03-17 02:05:07 +000073
paula49c0ff2004-09-30 06:08:58 +000074dnl ---------------------------------------------
paul7ea487b2003-03-17 02:05:07 +000075dnl If CLFAGS doesn\'t exist set default value
paula49c0ff2004-09-30 06:08:58 +000076dnl AC_PROG_CC will have set minimal default
77dnl already, eg "-O2 -g" for gcc, "-g" for others
paul27eebb32004-07-22 18:16:59 +000078dnl (Wall is gcc specific... have to make sure
79dnl gcc is being used before setting it)
hasso1969e4b2005-03-27 13:07:23 +000080dnl Intel icc 8.0 also sets __GNUC__, but
81dnl doesn't support all these fancy -W options.
paula49c0ff2004-09-30 06:08:58 +000082dnl ---------------------------------------------
paul27eebb32004-07-22 18:16:59 +000083dnl
paul7ea487b2003-03-17 02:05:07 +000084if test "x$cflags_specified" = "x" ; then
hasso1969e4b2005-03-27 13:07:23 +000085 if test "x${GCC}" = "xyes" && test "x${ICC}" = "xno"; then
gdt7fd63b32004-10-07 13:53:29 +000086 CFLAGS="-Os -g -Wall -Wsign-compare -Wpointer-arith"
hasso7347a2a2004-10-05 14:15:17 +000087 CFLAGS="${CFLAGS} -Wbad-function-cast -Wwrite-strings"
paula49c0ff2004-09-30 06:08:58 +000088 fi
gdt7fd63b32004-10-07 13:53:29 +000089 # TODO: conditionally addd -Wpacked if handled
paul7ea487b2003-03-17 02:05:07 +000090fi
91
hasso1969e4b2005-03-27 13:07:23 +000092dnl ---------------------------------------------------------------------
93dnl Intel compiler warnings we ignore:
94dnl 279: controlling expression is constant.
95dnl 869: parameter "xxx" was never referenced - to avoid massive warnings
96dnl about "self", "vty", "argc" and "argv" never referenced in DEFUN
97dnl macro.
98dnl 981: operands are evaluated in unspecified order.
99dnl ---------------------------------------------------------------------
100
101if test "$ICC" = "yes"; then
102 CFLAGS="-Os -g -Wall -wd 279,869,981"
103fi
104
paul7ea487b2003-03-17 02:05:07 +0000105dnl --------------
106dnl Check programs
107dnl --------------
paul7ea487b2003-03-17 02:05:07 +0000108AC_PROG_INSTALL
109AC_PROG_MAKE_SET
110AC_CHECK_TOOL(AR, ar)
111AC_CHECK_TOOL(RANLIB, ranlib, :)
112
113dnl ---------
114dnl AIX check
115dnl ---------
116AC_AIX
117
gdt87efd642004-06-30 17:36:11 +0000118dnl -------
119dnl libtool
120dnl -------
paul0fc42942004-08-19 04:41:21 +0000121AC_PROG_LIBTOOL
gdt87efd642004-06-30 17:36:11 +0000122
paul7ea487b2003-03-17 02:05:07 +0000123dnl ----------------------
124dnl Packages configuration
125dnl ----------------------
126AC_ARG_ENABLE(vtysh,
gdtfc9d0742004-06-30 14:25:12 +0000127[ --enable-vtysh include integrated vty shell for Quagga])
paul7ea487b2003-03-17 02:05:07 +0000128AC_ARG_ENABLE(ipv6,
129[ --disable-ipv6 turn off IPv6 related features and daemons])
130AC_ARG_ENABLE(zebra,
131[ --disable-zebra do not build zebra daemon])
132AC_ARG_ENABLE(bgpd,
133[ --disable-bgpd do not build bgpd])
134AC_ARG_ENABLE(ripd,
135[ --disable-ripd do not build ripd])
136AC_ARG_ENABLE(ripngd,
137[ --disable-ripngd do not build ripngd])
138AC_ARG_ENABLE(ospfd,
139[ --disable-ospfd do not build ospfd])
paul7ea487b2003-03-17 02:05:07 +0000140AC_ARG_ENABLE(ospf6d,
141[ --disable-ospf6d do not build ospf6d])
ajsd0199432004-12-22 14:03:52 +0000142AC_ARG_ENABLE(watchquagga,
143[ --disable-watchquagga do not build watchquagga])
jardin9e867fe2003-12-23 08:56:18 +0000144AC_ARG_ENABLE(isisd,
hassoae399ab2004-09-13 20:22:18 +0000145[ --enable-isisd build isisd])
paul7ea487b2003-03-17 02:05:07 +0000146AC_ARG_ENABLE(bgp-announce,
147[ --disable-bgp-announce, turn off BGP route announcement])
148AC_ARG_ENABLE(netlink,
149[ --enable-netlink force to use Linux netlink interface])
150AC_ARG_ENABLE(broken-aliases,
151[ --enable-broken-aliases enable aliases as distinct interfaces for Linux 2.2.X])
152AC_ARG_ENABLE(snmp,
153[ --enable-snmp enable SNMP support])
154AC_ARG_WITH(libpam,
155[ --with-libpam use libpam for PAM support in vtysh])
hasso71c0fb52003-05-25 20:18:13 +0000156AC_ARG_ENABLE(tcp-zebra,
paul7ea487b2003-03-17 02:05:07 +0000157[ --enable-tcp-zebra enable TCP/IP socket connection between zebra and protocol daemon])
paul7ea487b2003-03-17 02:05:07 +0000158AC_ARG_ENABLE(opaque-lsa,
paul1ef74ef2003-03-21 15:16:05 +0000159[ --enable-opaque-lsa enable OSPF Opaque-LSA with OSPFAPI support (RFC2370)])
160AC_ARG_ENABLE(ospfapi,
161[ --disable-ospfapi do not build OSPFAPI to access the OSPF LSA Database,
162 (this is the default if --enable-opaque-lsa is not set)])
163AC_ARG_ENABLE(ospfclient,
164[ --disable-ospfclient do not build OSPFAPI client for OSPFAPI,
165 (this is the default if --disable-ospfapi is set)])
paul7ea487b2003-03-17 02:05:07 +0000166AC_ARG_ENABLE(ospf-te,
167[ --enable-ospf-te enable Traffic Engineering Extension to OSPF])
168AC_ARG_ENABLE(multipath,
169[ --enable-multipath=ARG enable multipath function, ARG must be digit])
paule8f29842003-08-12 13:08:31 +0000170AC_ARG_ENABLE(quagga_user,
171[ --enable-user=ARG user to run Quagga suite as (default quagga)])
172AC_ARG_ENABLE(quagga_group,
173[ --enable-group=ARG group to run Quagga suite as (default quagga)])
pauledd7c242003-06-04 13:59:38 +0000174AC_ARG_ENABLE(vty_group,
paul6b6942f2004-10-22 04:55:05 +0000175[ --enable-vty-group=ARG set vty sockets to have specified group as owner])
gdtaa593d52003-12-22 20:15:53 +0000176AC_ARG_ENABLE(configfile_mask,
177[ --enable-configfile-mask=ARG set mask for config files])
178AC_ARG_ENABLE(logfile_mask,
179[ --enable-logfile-mask=ARG set mask for log files])
pauledd7c242003-06-04 13:59:38 +0000180
hasso71c0fb52003-05-25 20:18:13 +0000181AC_ARG_ENABLE(rtadv,
paul6b6942f2004-10-22 04:55:05 +0000182[ --disable-rtadv disable IPV6 router advertisement feature])
hassoca776982004-06-12 14:33:05 +0000183AC_ARG_ENABLE(irdp,
paul6b6942f2004-10-22 04:55:05 +0000184[ --enable-irdp enable IRDP server support in zebra])
hassof695b012005-04-02 19:03:39 +0000185AC_ARG_ENABLE(isis_topology,
186[ --enable-isis-topology enable IS-IS topology generator])
hasso41d3fc92004-04-06 11:59:00 +0000187AC_ARG_ENABLE(capabilities,
188[ --disable-capabilities disable using POSIX capabilities])
paul6b6942f2004-10-22 04:55:05 +0000189AC_ARG_ENABLE(gcc_ultra_verbose,
190[ --enable-gcc-ultra-verbose enable ultra verbose GCC warnings])
ajs3cade262004-12-29 17:50:22 +0000191AC_ARG_ENABLE(gcc-rdynamic,
192[ --enable-gcc-rdynamic enable gcc linking with -rdynamic for better backtraces])
paul6b6942f2004-10-22 04:55:05 +0000193
194if test x"${enable_gcc_ultra_verbose}" = x"yes" ; then
195 CFLAGS="${CFLAGS} -W -Wcast-qual -Wstrict-prototypes"
196 CFLAGS="${CFLAGS} -Wmissing-declarations -Wmissing-noreturn"
197 CFLAGS="${CFLAGS} -Wmissing-format-attribute -Wunreachable-code"
198 CFLAGS="${CFLAGS} -Wpacked -Wpadded"
199fi
paul7ea487b2003-03-17 02:05:07 +0000200
ajs3cade262004-12-29 17:50:22 +0000201if test x"${enable_gcc_rdynamic}" = x"yes" ; then
202 LDFLAGS="${LDFLAGS} -rdynamic"
203fi
204
paul7ea487b2003-03-17 02:05:07 +0000205if test "${enable_broken_aliases}" = "yes"; then
206 if test "${enable_netlink}" = "yes"
207 then
208 echo "Sorry, you can't use netlink with broken aliases"
209 exit 1
210 fi
211 AC_DEFINE(HAVE_BROKEN_ALIASES,,Broken Alias)
212 enable_netlink=no
213fi
214
215if test "${enable_tcp_zebra}" = "yes"; then
216 AC_DEFINE(HAVE_TCP_ZEBRA,,Use TCP for zebra communication)
217fi
218
paul7ea487b2003-03-17 02:05:07 +0000219if test "${enable_opaque_lsa}" = "yes"; then
220 AC_DEFINE(HAVE_OPAQUE_LSA,,OSPF Opaque LSA)
221fi
222
223if test "${enable_ospf_te}" = "yes"; then
224 AC_DEFINE(HAVE_OPAQUE_LSA,,OSPF Opaque LSA)
225 AC_DEFINE(HAVE_OSPF_TE,,OSPF TE)
226fi
227
gdtd2a0ccc2003-12-03 18:13:48 +0000228AC_MSG_CHECKING(if zebra should be configurable to send Route Advertisements)
229if test "${enable_rtadv}" != "no"; then
hasso71c0fb52003-05-25 20:18:13 +0000230 AC_MSG_RESULT(yes)
gdtd2a0ccc2003-12-03 18:13:48 +0000231 AC_DEFINE(HAVE_RTADV,,Enable IPv6 Routing Advertisement support)
paul2487bea2003-05-25 23:51:31 +0000232else
233 AC_MSG_RESULT(no)
hasso71c0fb52003-05-25 20:18:13 +0000234fi
paul7ea487b2003-03-17 02:05:07 +0000235
hassoca776982004-06-12 14:33:05 +0000236if test "${enable_irdp}" = "yes"; then
237 AC_DEFINE(HAVE_IRDP,, IRDP )
238fi
239
hassof695b012005-04-02 19:03:39 +0000240if test "${enable_isisd}" = "yes" && test "${enable_isis_topology}" = yes; then
241 AC_DEFINE(TOPOLOGY_GENERATE,,Enable IS-IS topology generator code)
242 ISIS_TOPOLOGY_INCLUDES="-I./topology"
243 ISIS_TOPOLOGY_DIR="topology"
244 ISIS_TOPOLOGY_LIB="./topology/libtopology.a"
245fi
246
247AC_SUBST(ISIS_TOPOLOGY_INCLUDES)
248AC_SUBST(ISIS_TOPOLOGY_DIR)
249AC_SUBST(ISIS_TOPOLOGY_LIB)
250
paul79cb2162003-06-06 12:19:53 +0000251if test "${enable_user}" = "yes" || test x"${enable_user}" = x""; then
paule8f29842003-08-12 13:08:31 +0000252 enable_user="quagga"
pauledd7c242003-06-04 13:59:38 +0000253elif test "${enable_user}" = "no"; then
254 enable_user="root"
255fi
pauledd7c242003-06-04 13:59:38 +0000256
paul79cb2162003-06-06 12:19:53 +0000257if test "${enable_group}" = "yes" || test x"${enable_group}" = x""; then
paule8f29842003-08-12 13:08:31 +0000258 enable_group="quagga"
pauledd7c242003-06-04 13:59:38 +0000259elif test "${enable_group}" = "no"; then
260 enable_group="root"
261fi
pauledd7c242003-06-04 13:59:38 +0000262
263if test x"${enable_vty_group}" = x"yes" ; then
paul8d4aee52003-06-06 00:30:35 +0000264 AC_MSG_ERROR([--enable-vty-group requires a group as argument, not yes])
paul79cb2162003-06-06 12:19:53 +0000265elif test x"${enable_vty_group}" != x""; then
paul8d4aee52003-06-06 00:30:35 +0000266 if test x"${enable_vty_group}" != x"no"; then
pauledd7c242003-06-04 13:59:38 +0000267 AC_DEFINE_UNQUOTED(VTY_GROUP, "${enable_vty_group}", VTY Sockets Group)
268 fi
269fi
paul26275b02005-04-11 07:10:47 +0000270AC_SUBST([enable_user])
271AC_SUBST([enable_group])
272AC_SUBST([enable_vty_group])
273AC_DEFINE_UNQUOTED(QUAGGA_USER, "${enable_user}", Quagga User)
274AC_DEFINE_UNQUOTED(QUAGGA_GROUP, "${enable_group}", Quagga Group)
pauledd7c242003-06-04 13:59:38 +0000275
gdtaa593d52003-12-22 20:15:53 +0000276enable_configfile_mask=${enable_configfile_mask:-0600}
277AC_DEFINE_UNQUOTED(CONFIGFILE_MASK, ${enable_configfile_mask}, Mask for config files)
278
279enable_logfile_mask=${enable_logfile_mask:-0600}
280AC_DEFINE_UNQUOTED(LOGFILE_MASK, ${enable_logfile_mask}, Mask for log files)
281
paul7ea487b2003-03-17 02:05:07 +0000282changequote(, )dnl
283
284MULTIPATH_NUM=1
285
286case "${enable_multipath}" in
287 [0-9]|[1-9][0-9])
288 MULTIPATH_NUM="${enable_multipath}"
289 ;;
290 "")
291 ;;
292 *)
293 echo "Please specify digit to --enable-multipath ARG."
294 exit 1
295 ;;
296esac
297
298changequote([, ])dnl
299
300AC_SUBST(MULTIPATH_NUM)
301
302dnl -------------------
303dnl Check header files.
304dnl -------------------
pauldc7a2bf2003-10-22 00:07:44 +0000305AC_HEADER_STDC
306AC_CHECK_HEADERS([string.h stropts.h sys/conf.h sys/ksym.h sys/time.h \
307 sys/times.h sys/select.h sys/sysctl.h sys/sockio.h \
308 sys/types.h linux/version.h kvm.h netdb.h asm/types.h \
309 libutil.h limits.h])
310
paul835b7f12003-10-30 21:59:57 +0000311AC_CHECK_HEADERS([sys/socket.h netinet/in_systm.h netinet/in.h \
paulf3bd1a72003-11-02 07:29:11 +0000312 net/if_dl.h net/netopt.h inet/nd.h net/route.h \
paul835b7f12003-10-30 21:59:57 +0000313 net/if.h net/if_var.h netinet/in_var.h])
pauldc7a2bf2003-10-22 00:07:44 +0000314
gdtfa3232e2003-12-03 17:52:30 +0000315dnl V6 headers are checked below, after we check for v6
paul7ea487b2003-03-17 02:05:07 +0000316
317dnl check some types
318AC_C_CONST
319dnl AC_TYPE_PID_T
320AC_TYPE_SIGNAL
321
322dnl Some systems (Solaris 2.x) require libnsl (Network Services Library)
323case "$host" in
paulafd8a122005-03-12 06:36:10 +0000324 [*-sunos5.[6-7]*] | [*-solaris2.[6-7]*])
paul7ea487b2003-03-17 02:05:07 +0000325 opsys=sol2-6
paulafd8a122005-03-12 06:36:10 +0000326 AC_DEFINE(SUNOS_56, 1, SunOS 5.6 to 5.7)
paul19877dd2004-05-11 10:49:35 +0000327 AC_DEFINE(SUNOS_5, 1, SunOS 5)
paul7ea487b2003-03-17 02:05:07 +0000328 AC_CHECK_LIB(xnet, main)
329 CURSES=-lcurses
330 ;;
paul1b73de82005-04-10 16:31:51 +0000331 [*-sunos5.[8-9]] \
332 | [*-sunos5.1[0-9]] \
333 | [*-sunos5.1[0-9].[0-9]] \
334 | [*-solaris2.[8-9]] \
335 | [*-solaris2.1[0-9]] \
336 | [*-solaris2.1[0-9].[0-9]])
paulafd8a122005-03-12 06:36:10 +0000337 opsys=sol8
338 AC_DEFINE(SUNOS_59,,SunOS 5.8 up)
paul19877dd2004-05-11 10:49:35 +0000339 AC_DEFINE(SUNOS_5, 1, SunOS 5)
340 AC_CHECK_LIB(socket, main)
341 AC_CHECK_LIB(nsl, main)
paul1b73de82005-04-10 16:31:51 +0000342 AC_CHECK_LIB(umem, main)
paul19877dd2004-05-11 10:49:35 +0000343 CURSES=-lcurses
344 ;;
paul7ea487b2003-03-17 02:05:07 +0000345 *-sunos5* | *-solaris2*)
paul19877dd2004-05-11 10:49:35 +0000346 AC_DEFINE(SUNOS_5,,SunOS 5, Unknown SunOS)
paul7ea487b2003-03-17 02:05:07 +0000347 AC_CHECK_LIB(socket, main)
348 AC_CHECK_LIB(nsl, main)
349 CURSES=-lcurses
350 ;;
hassoc45eb832005-02-19 13:58:06 +0000351 *-linux*)
paul7ea487b2003-03-17 02:05:07 +0000352 opsys=gnu-linux
353 AC_DEFINE(GNU_LINUX,,GNU Linux)
354 ;;
355 *-nec-sysv4*)
356 AC_CHECK_LIB(nsl, gethostbyname)
357 AC_CHECK_LIB(socket, socket)
358 ;;
359 *-freebsd3.2)
360 AC_DEFINE(FREEBSD_32,,FreeBSD 3.2)
361 ;;
362 *-openbsd*)
363 opsys=openbsd
364 AC_DEFINE(OPEN_BSD,,OpenBSD)
365 ;;
366 *-bsdi*)
367 opsys=bsdi
368 OTHER_METHOD="mtu_kvm.o"
369 AC_CHECK_LIB(kvm, main)
370 ;;
paul49e3b3c2003-10-23 20:39:50 +0000371 *-irix6.5)
pauldc7a2bf2003-10-22 00:07:44 +0000372 opsys=irix
373 AC_DEFINE(IRIX_65,,IRIX 6.5)
374 ;;
paul7ea487b2003-03-17 02:05:07 +0000375esac
376
377dnl ---------------------
378dnl Integrated VTY option
379dnl ---------------------
380case "${enable_vtysh}" in
381 "yes") VTYSH="vtysh";
382 AC_DEFINE(VTYSH,,VTY shell)
gdtfc9d0742004-06-30 14:25:12 +0000383 AC_PATH_PROG(PERL, perl)
384dnl Vtysh uses libreadline, which looks for termcap functions at
385dnl configure time. We follow readline's search order.
386dnl The required procedures are in libtermcap on NetBSD, in
387dnl [TODO] on Linux, and in [TODO] on Solaris.
388 AC_CHECK_LIB(termcap, tputs, ,
389 AC_CHECK_LIB(tinfo, tputs, ,
390 AC_CHECK_LIB(curses, tputs, ,
391 AC_CHECK_LIB(ncurses, tputs))))
paul7ea487b2003-03-17 02:05:07 +0000392 AC_CHECK_LIB(readline, main)
393 if test $ac_cv_lib_readline_main = no; then
gdtfc9d0742004-06-30 14:25:12 +0000394 AC_MSG_ERROR([vtysh needs libreadline but was not found and usable on your system.])
paul7ea487b2003-03-17 02:05:07 +0000395 fi
396 AC_CHECK_HEADER(readline/history.h)
397 if test $ac_cv_header_readline_history_h = no;then
398 AC_MSG_ERROR([readline is too old to have readline/history.h, please update to the latest readline library.])
399 fi
paul3d3de8c2003-05-23 10:33:49 +0000400 AC_CHECK_LIB(readline, rl_completion_matches)
401 if test $ac_cv_lib_readline_rl_completion_matches = no; then
402 AC_DEFINE(rl_completion_matches,completion_matches,Old readline)
403 fi
404 ;;
paul7ea487b2003-03-17 02:05:07 +0000405 "no" ) VTYSH="";;
406 * ) ;;
407esac
408
409dnl ----------
410dnl PAM module
411dnl ----------
412if test "$with_libpam" = "yes"; then
paul24cd4352003-05-06 12:16:27 +0000413 AC_CHECK_HEADER(security/pam_misc.h)
414 if test "$ac_cv_header_security_pam_misc_h" = yes; then
415 AC_DEFINE(HAVE_PAM_MISC_H,,Have pam_misc.h)
416 AC_DEFINE(PAM_CONV_FUNC,misc_conv,Have misc_conv)
417 pam_conv_func="misc_conv"
paul24cd4352003-05-06 12:16:27 +0000418 fi
paul24cd4352003-05-06 12:16:27 +0000419 AC_CHECK_HEADER(security/openpam.h)
420 if test "$ac_cv_header_security_openpam_h" = yes; then
421 AC_DEFINE(HAVE_OPENPAM_H,,Have openpam.h)
422 AC_DEFINE(PAM_CONV_FUNC,openpam_ttyconv,Have openpam_ttyconv)
423 pam_conv_func="openpam_ttyconv"
paul24cd4352003-05-06 12:16:27 +0000424 fi
425 if test -z "$ac_cv_header_security_pam_misc_h$ac_cv_header_security_openpam_h" ; then
426 AC_MSG_WARN([*** pam support will not be built ***])
427 with_libpam="no"
428 fi
429fi
430
431if test "$with_libpam" = "yes"; then
paul7ea487b2003-03-17 02:05:07 +0000432dnl took this test from proftpd's configure.in and suited to our needs
433dnl -------------------------------------------------------------------------
434dnl
435dnl This next check looks funky due to a linker problem with some versions
436dnl of the PAM library. Prior to 0.72 release, the Linux PAM shared library
437dnl omitted requiring libdl linking information. PAM-0.72 or better ships
438dnl with RedHat 6.2 and Debian 2.2 or better.
439AC_CHECK_LIB(pam, pam_start,
paul24cd4352003-05-06 12:16:27 +0000440 [AC_CHECK_LIB(pam, $pam_conv_func,
paul7ea487b2003-03-17 02:05:07 +0000441 [AC_DEFINE(USE_PAM,,Use PAM for authentication)
442 LIBPAM="-lpam"],
443 [AC_DEFINE(USE_PAM,,Use PAM for authentication)
444 LIBPAM="-lpam -lpam_misc"]
445 )
446 ],
447
448 [AC_CHECK_LIB(pam, pam_end,
paul24cd4352003-05-06 12:16:27 +0000449 [AC_CHECK_LIB(pam, $pam_conv_func,
paula159ed92003-06-04 11:01:45 +0000450 [AC_DEFINE(USE_PAM,,Use PAM for authentication)
paul7ea487b2003-03-17 02:05:07 +0000451 LIBPAM="-lpam -ldl"],
paula159ed92003-06-04 11:01:45 +0000452 [AC_DEFINE(USE_PAM,,Use PAM for authentication)
paul7ea487b2003-03-17 02:05:07 +0000453 LIBPAM="-lpam -ldl -lpam_misc"]
454 )
455 ],AC_MSG_WARN([*** pam support will not be built ***]),
456 [-ldl])
457 ]
458)
459fi
460AC_SUBST(LIBPAM)
461
462dnl -------------------------------
463dnl Endian-ness check
464dnl -------------------------------
465AC_WORDS_BIGENDIAN
466
467dnl -------------------------------
468dnl check the size in byte of the C
469dnl -------------------------------
470dnl AC_CHECK_SIZEOF(char)
471dnl AC_CHECK_SIZEOF(int)
472dnl AC_CHECK_SIZEOF(short)
473dnl AC_CHECK_SIZEOF(long)
474
475dnl ----------------------------
476dnl check existance of functions
477dnl ----------------------------
paul49e3b3c2003-10-23 20:39:50 +0000478AC_CHECK_FUNCS(memset memcpy strerror inet_aton daemon snprintf vsnprintf \
paul04bd4842003-10-24 04:24:39 +0000479 strlcat strlcpy if_nametoindex if_indextoname getifaddrs \
ajs3cb98de2005-04-02 16:01:05 +0000480 fcntl strnlen)
paula159ed92003-06-04 11:01:45 +0000481AC_CHECK_FUNCS(setproctitle, ,
482 [AC_CHECK_LIB(util, setproctitle,
483 [LIBS="$LIBS -lutil"
484 AC_DEFINE(HAVE_SETPROCTITLE,, Have setproctitle)
485 ]
486 )
487 ]
488)
paul7ea487b2003-03-17 02:05:07 +0000489
490dnl ------------------------------------
491dnl Determine routing get and set method
492dnl ------------------------------------
493AC_MSG_CHECKING(zebra between kernel interface method)
494if test x"$opsys" = x"gnu-linux"; then
495 if test "${enable_netlink}" = "yes";then
496 AC_MSG_RESULT(netlink)
497 RT_METHOD=rt_netlink.o
498 AC_DEFINE(HAVE_NETLINK,,netlink)
499 netlink=yes
500 elif test "${enable_netlink}" = "no"; then
501 AC_MSG_RESULT(ioctl)
502 RT_METHOD=rt_ioctl.o
503 netlink=no
504 else
505 AC_MSG_RESULT(netlink)
506 RT_METHOD=rt_netlink.o
507 AC_DEFINE(HAVE_NETLINK,,netlink)
508 netlink=yes
509 fi
paul19877dd2004-05-11 10:49:35 +0000510elif test x"$opsys" = x"sol2-6";then
511 AC_MSG_RESULT(Route socket)
512 KERNEL_METHOD="kernel_socket.o"
513 RT_METHOD="rt_socket.o"
paulafd8a122005-03-12 06:36:10 +0000514elif test x"$opsys" = x"sol8";then
paul19877dd2004-05-11 10:49:35 +0000515 AC_MSG_RESULT(Route socket)
516 KERNEL_METHOD="kernel_socket.o"
517 RT_METHOD="rt_socket.o"
518elif test "$opsys" = "irix" ; then
519 AC_MSG_RESULT(Route socket)
520 KERNEL_METHOD="kernel_socket.o"
521 RT_METHOD="rt_socket.o"
paul7ea487b2003-03-17 02:05:07 +0000522else
paul19877dd2004-05-11 10:49:35 +0000523 AC_TRY_RUN([#include <errno.h>
paul7ea487b2003-03-17 02:05:07 +0000524#include <sys/types.h>
525#include <sys/socket.h>
526
527main ()
528{
529 int ac_sock;
530
531 ac_sock = socket (AF_ROUTE, SOCK_RAW, 0);
532 if (ac_sock < 0 && errno == EINVAL)
533 exit (1);
534 exit (0);
535}],
536 [KERNEL_METHOD=kernel_socket.o
537 RT_METHOD=rt_socket.o
538 AC_MSG_RESULT(socket)],
539 [RT_METHOD=rt_ioctl.o
540 AC_MSG_RESULT(ioctl)],
541 [KERNEL_METHOD=kernel_socket.o
542 RT_METHOD=rt_socket.o
543 AC_MSG_RESULT(socket)])
paul7ea487b2003-03-17 02:05:07 +0000544fi
545AC_SUBST(RT_METHOD)
546AC_SUBST(KERNEL_METHOD)
547AC_SUBST(OTHER_METHOD)
548
ajsb99760a2005-01-04 16:24:43 +0000549dnl ------------------------------------
550dnl check for broken CMSG_FIRSTHDR macro
551dnl ------------------------------------
gdt6c200462005-01-04 17:02:48 +0000552AC_MSG_CHECKING(for broken CMSG_FIRSTHDR)
hasso5b087522005-04-03 23:46:37 +0000553AC_RUN_IFELSE([AC_LANG_SOURCE([[
ajsb99760a2005-01-04 16:24:43 +0000554#ifdef SUNOS_5
555#define _XPG4_2
556#define __EXTENSIONS__
557#endif
558#include <stdlib.h>
559#include <sys/types.h>
560#include <sys/socket.h>
561
562main()
563{
564 struct msghdr msg;
565 char buf[4];
566
567 msg.msg_control = buf;
568 msg.msg_controllen = 0;
569
570 if (CMSG_FIRSTHDR(&msg) != NULL)
571 exit(0);
572 exit (1);
hasso5b087522005-04-03 23:46:37 +0000573}]])],[AC_MSG_RESULT(yes - using workaround) AC_DEFINE(HAVE_BROKEN_CMSG_FIRSTHDR,,Broken CMSG_FIRSTHDR)],
hassod33e8d72005-04-03 13:07:21 +0000574[AC_MSG_RESULT(no)],[AC_MSG_RESULT(no)])
ajsb99760a2005-01-04 16:24:43 +0000575
paul7ea487b2003-03-17 02:05:07 +0000576dnl ------------------------------
577dnl check kernel route read method
578dnl ------------------------------
579AC_CACHE_CHECK(route read method check, zebra_rtread,
580[if test "$netlink" = yes; then
581 RTREAD_METHOD="rtread_netlink.o"
582 zebra_rtread="netlink"
583else
584for zebra_rtread in /proc/net/route /dev/ip /dev/null;
585do
586 test x`ls $zebra_rtread 2>/dev/null` = x"$zebra_rtread" && break
587done
588case $zebra_rtread in
589 "/proc/net/route") RTREAD_METHOD="rtread_proc.o"
590 zebra_rtread="proc";;
paul9c30ab62003-07-08 08:36:17 +0000591 "/dev/ip")
592 case "$host" in
593 *-freebsd*) RTREAD_METHOD=rtread_sysctl.o
594 zebra_rtread="sysctl";;
595 *) RTREAD_METHOD="rtread_getmsg.o"
596 zebra_rtread="getmsg";;
597 esac;;
paul7ea487b2003-03-17 02:05:07 +0000598 *) RTREAD_METHOD="rtread_sysctl.o"
599 zebra_rtread="sysctl";;
600esac
601fi])
602AC_SUBST(RTREAD_METHOD)
603
604dnl -----------------------------
605dnl check interface lookup method
606dnl -----------------------------
paul19877dd2004-05-11 10:49:35 +0000607IOCTL_METHOD=ioctl.o
paul7ea487b2003-03-17 02:05:07 +0000608AC_MSG_CHECKING(interface looking up method)
609if test "$netlink" = yes; then
610 AC_MSG_RESULT(netlink)
611 IF_METHOD=if_netlink.o
paul19877dd2004-05-11 10:49:35 +0000612elif test "$opsys" = "sol2-6";then
613 AC_MSG_RESULT(Solaris GIF)
614 IF_METHOD=if_ioctl.o
paulafd8a122005-03-12 06:36:10 +0000615elif test "$opsys" = "sol8";then
paul19877dd2004-05-11 10:49:35 +0000616 AC_MSG_RESULT(Solaris GLIF)
617 IF_METHOD=if_ioctl_solaris.o
618 IOCTL_METHOD=ioctl_solaris.o
619elif test "$opsys" = "irix" ; then
620 AC_MSG_RESULT(IRIX)
621 IF_METHOD=if_ioctl.o
622elif test "$opsys" = "openbsd";then
623 AC_MSG_RESULT(openbsd)
624 IF_METHOD=if_ioctl.o
625elif grep NET_RT_IFLIST /usr/include/sys/socket.h >/dev/null 2>&1; then
626 AC_MSG_RESULT(sysctl)
paul7ea487b2003-03-17 02:05:07 +0000627 IF_METHOD=if_sysctl.o
628 AC_DEFINE(HAVE_NET_RT_IFLIST,,NET_RT_IFLIST)
paul19877dd2004-05-11 10:49:35 +0000629else
paul7ea487b2003-03-17 02:05:07 +0000630 AC_MSG_RESULT(ioctl)
631 IF_METHOD=if_ioctl.o
paul7ea487b2003-03-17 02:05:07 +0000632fi
633AC_SUBST(IF_METHOD)
paul19877dd2004-05-11 10:49:35 +0000634AC_SUBST(IOCTL_METHOD)
paul7ea487b2003-03-17 02:05:07 +0000635
636dnl -----------------------
637dnl check proc file system.
638dnl -----------------------
639if test -r /proc/net/dev; then
640 AC_DEFINE(HAVE_PROC_NET_DEV,,/proc/net/dev)
641 IF_PROC=if_proc.o
642fi
643
644if test -r /proc/net/if_inet6; then
645 AC_DEFINE(HAVE_PROC_NET_IF_INET6,,/proc/net/if_inet6)
646 IF_PROC=if_proc.o
647fi
648AC_SUBST(IF_PROC)
649
650dnl -----------------------------
651dnl check ipforward detect method
652dnl -----------------------------
653AC_CACHE_CHECK(ipforward method check, zebra_ipforward_path,
654[for zebra_ipforward_path in /proc/net/snmp /dev/ip /dev/null;
655do
656 test x`ls $zebra_ipforward_path 2>/dev/null` = x"$zebra_ipforward_path" && break
657done
658case $zebra_ipforward_path in
659 "/proc/net/snmp") IPFORWARD=ipforward_proc.o
660 zebra_ipforward_path="proc";;
661 "/dev/ip")
662 case "$host" in
663 *-nec-sysv4*) IPFORWARD=ipforward_ews.o
664 zebra_ipforward_path="ews";;
paul9c30ab62003-07-08 08:36:17 +0000665 *-freebsd*) IPFORWARD=ipforward_sysctl.o
666 zebra_ipforward_path="sysctl";;
paul7ea487b2003-03-17 02:05:07 +0000667 *) IPFORWARD=ipforward_solaris.o
668 zebra_ipforward_path="solaris";;
669 esac;;
670 *) IPFORWARD=ipforward_sysctl.o
671 zebra_ipforward_path="sysctl";;
672esac])
673AC_SUBST(IPFORWARD)
674
675AC_CHECK_FUNCS(getaddrinfo, [have_getaddrinfo=yes], [have_getaddrinfo=no])
676
677dnl ----------
678dnl IPv6 check
679dnl ----------
680AC_MSG_CHECKING(whether does this OS have IPv6 stack)
681if test "${enable_ipv6}" = "no"; then
682 AC_MSG_RESULT(disabled)
683else
684dnl ----------
685dnl INRIA IPv6
686dnl ----------
paula159ed92003-06-04 11:01:45 +0000687 if grep IPV6_INRIA_VERSION /usr/include/netinet/in.h >/dev/null 2>&1; then
688 zebra_cv_ipv6=yes
689 AC_DEFINE(HAVE_IPV6,1,INRIA IPv6)
690 AC_DEFINE(INRIA_IPV6,1,INRIA IPv6)
691 RIPNGD="ripngd"
692 OSPF6D="ospf6d"
693 LIB_IPV6=""
694 AC_MSG_RESULT(INRIA IPv6)
paul7ea487b2003-03-17 02:05:07 +0000695dnl ---------
696dnl KAME IPv6
697dnl ---------
paula159ed92003-06-04 11:01:45 +0000698 elif grep WIDE /usr/include/netinet6/in6.h >/dev/null 2>&1; then
699 zebra_cv_ipv6=yes
700 AC_DEFINE(HAVE_IPV6,1,KAME IPv6)
701 AC_DEFINE(KAME,1,KAME IPv6)
702 RIPNGD="ripngd"
703 OSPF6D="ospf6d"
704 if test -d /usr/local/v6/lib -a -f /usr/local/v6/lib/libinet6.a; then
paul7ea487b2003-03-17 02:05:07 +0000705 LIB_IPV6="-L/usr/local/v6/lib -linet6"
paula159ed92003-06-04 11:01:45 +0000706 fi
707 AC_MSG_RESULT(KAME)
hasso71c0fb52003-05-25 20:18:13 +0000708dnl -------------------------
709dnl MUSICA IPv6
710dnl default host check
711dnl It is not used by Kheops
712dnl -------------------------
paula159ed92003-06-04 11:01:45 +0000713 elif grep MUSICA /usr/include6/netinet6/in6.h >/dev/null 2>&1; then
714 zebra_cv_ipv6=yes
715 AC_DEFINE(HAVE_IPV6,1,Musicia IPv6)
716 AC_DEFINE(MUSICA,1,Musica IPv6 stack)
717 AC_DEFINE(KAME,1,KAME IPv6 stack)
718 RIPNGD="ripngd"
719 OSPF6D="ospf6d"
720 if test -d /usr/local/v6/lib -a -f /usr/local/v6/lib/libinet6.a; then
hasso71c0fb52003-05-25 20:18:13 +0000721 LIB_IPV6="-L/usr/local/v6/lib -linet6"
paula159ed92003-06-04 11:01:45 +0000722 fi
723 AC_MSG_RESULT(MUSICA)
paul7ea487b2003-03-17 02:05:07 +0000724dnl ---------
725dnl NRL check
726dnl ---------
paula159ed92003-06-04 11:01:45 +0000727 elif grep NRL /usr/include/netinet6/in6.h >/dev/null 2>&1; then
728 zebra_cv_ipv6=yes
729 AC_DEFINE(HAVE_IPV6,1,NRL IPv6)
730 AC_DEFINE(NRL,1,NRL)
731 RIPNGD="ripngd"
732 OSPF6D="ospf6d"
733 if test x"$opsys" = x"bsdi";then
paul7ea487b2003-03-17 02:05:07 +0000734 AC_DEFINE(BSDI_NRL,,BSDI)
735 AC_MSG_RESULT(BSDI_NRL)
paula159ed92003-06-04 11:01:45 +0000736 else
paul7ea487b2003-03-17 02:05:07 +0000737 AC_MSG_RESULT(NRL)
paula159ed92003-06-04 11:01:45 +0000738 fi
paul19877dd2004-05-11 10:49:35 +0000739dnl ------------------------------------
740dnl Solaris 9, 10 and potentially higher
741dnl ------------------------------------
paulafd8a122005-03-12 06:36:10 +0000742 elif test x"$opsys" = x"sol8"; then
paul19877dd2004-05-11 10:49:35 +0000743 zebra_cv_ipv6=yes;
744 AC_DEFINE(HAVE_IPV6, 1, IPv6)
745 AC_DEFINE(SOLARIS_IPV6, 1, Solaris IPv6)
746 RIPNGD="ripngd"
747 OSPF6D="ospf6d"
748 AC_MSG_RESULT(Solaris IPv6)
paul7ea487b2003-03-17 02:05:07 +0000749dnl ----------
750dnl Linux IPv6
751dnl ----------
paula159ed92003-06-04 11:01:45 +0000752 elif test "${enable_ipv6}" = "yes"; then
753 AC_EGREP_CPP(yes, [
754 #include <linux/version.h>
755 /* 2.1.128 or later */
756 #if LINUX_VERSION_CODE >= 0x020180
757 yes
758 #endif],
759 [zebra_cv_ipv6=yes
760 zebra_cv_linux_ipv6=yes
761 AC_MSG_RESULT(Linux IPv6)])
762 else
763 if test x`ls /proc/net/ipv6_route 2>/dev/null` = x"/proc/net/ipv6_route"
764 then
paul7ea487b2003-03-17 02:05:07 +0000765 zebra_cv_ipv6=yes
766 zebra_cv_linux_ipv6=yes
767 AC_MSG_RESULT(Linux IPv6)
paula159ed92003-06-04 11:01:45 +0000768 fi
769 fi
paul7ea487b2003-03-17 02:05:07 +0000770
paula159ed92003-06-04 11:01:45 +0000771 if test "$zebra_cv_linux_ipv6" = "yes";then
772 AC_MSG_CHECKING(for GNU libc >= 2.1)
773 AC_DEFINE(HAVE_IPV6,1,Linux IPv6)
774 AC_EGREP_CPP(yes, [
paul7ea487b2003-03-17 02:05:07 +0000775#include <features.h>
776#if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1
777 yes
paula159ed92003-06-04 11:01:45 +0000778#endif],
779 [glibc=yes
780 AC_DEFINE(LINUX_IPV6,1,Linux IPv6 stack)
781 AC_MSG_RESULT(yes)],
782 AC_MSG_RESULT(no)
783 )
784 RIPNGD="ripngd"
785 OSPF6D="ospf6d"
786 if test "$glibc" != "yes"; then
paul7ea487b2003-03-17 02:05:07 +0000787 INCLUDES="-I/usr/inet6/include"
788 if test x`ls /usr/inet6/lib/libinet6.a 2>/dev/null` != x;then
789 LIB_IPV6="-L/usr/inet6/lib -linet6"
790 fi
paula159ed92003-06-04 11:01:45 +0000791 fi
792 fi
paul7ea487b2003-03-17 02:05:07 +0000793
794dnl -----------------------
795dnl Set IPv6 related values
796dnl -----------------------
paula159ed92003-06-04 11:01:45 +0000797 LIBS="$LIB_IPV6 $LIBS"
798 AC_SUBST(LIB_IPV6)
paul7ea487b2003-03-17 02:05:07 +0000799
paula159ed92003-06-04 11:01:45 +0000800 if test x"$RIPNGD" = x""; then
801 AC_MSG_RESULT(IPv4 only)
802 fi
paul7ea487b2003-03-17 02:05:07 +0000803fi
804
gdtfa3232e2003-12-03 17:52:30 +0000805dnl ------------------
806dnl IPv6 header checks
807dnl ------------------
808if test "x${zebra_cv_ipv6}" = "xyes"; then
809AC_CHECK_HEADERS([netinet6/in6.h netinet/in6_var.h netinet/icmp6.h \
810 netinet6/in6_var.h netinet6/nd6.h])
811fi
812
paul7ea487b2003-03-17 02:05:07 +0000813dnl --------------------
814dnl Daemon disable check
815dnl --------------------
816if test "${enable_zebra}" = "no";then
817 ZEBRA=""
818else
819 ZEBRA="zebra"
820fi
821
822if test "${enable_bgpd}" = "no";then
823 BGPD=""
824else
825 BGPD="bgpd"
826fi
827
828if test "${enable_ripd}" = "no";then
829 RIPD=""
830else
831 RIPD="ripd"
832fi
833
834if test "${enable_ospfd}" = "no";then
835 OSPFD=""
836else
837 OSPFD="ospfd"
838fi
839
ajsd0199432004-12-22 14:03:52 +0000840if test "${enable_watchquagga}" = "no";then
841 WATCHQUAGGA=""
842else
843 WATCHQUAGGA="watchquagga"
844fi
845
paul1ef74ef2003-03-21 15:16:05 +0000846OSPFCLIENT=""
847if test "${enable_opaque_lsa}" = "yes"; then
848 if test "${enable_ospfapi}" != "no";then
paul9a569842003-03-28 01:45:13 +0000849 AC_DEFINE(SUPPORT_OSPF_API,,OSPFAPI)
paul1ef74ef2003-03-21 15:16:05 +0000850
851 if test "${enable_ospfclient}" != "no";then
852 OSPFCLIENT="ospfclient"
853 fi
854 fi
855
paul7ea487b2003-03-17 02:05:07 +0000856fi
857
858case "${enable_ripngd}" in
859 "yes") RIPNGD="ripngd";;
860 "no" ) RIPNGD="";;
861 * ) ;;
862esac
863
864case "${enable_ospf6d}" in
865 "yes") OSPF6D="ospf6d";;
866 "no" ) OSPF6D="";;
867 * ) ;;
868esac
869
jardin9e867fe2003-12-23 08:56:18 +0000870case "${enable_isisd}" in
871 "yes") ISISD="isisd";;
872 "no" ) ISISD="";;
hassoae399ab2004-09-13 20:22:18 +0000873 * ) ;;
jardin9e867fe2003-12-23 08:56:18 +0000874esac
875
paul7ea487b2003-03-17 02:05:07 +0000876if test "${enable_bgp_announce}" = "no";then
877 AC_DEFINE(DISABLE_BGP_ANNOUNCE,,Disable BGP installation to zebra)
878fi
879
880AC_SUBST(ZEBRA)
881AC_SUBST(BGPD)
882AC_SUBST(RIPD)
883AC_SUBST(RIPNGD)
884AC_SUBST(OSPFD)
885AC_SUBST(OSPF6D)
ajsd0199432004-12-22 14:03:52 +0000886AC_SUBST(WATCHQUAGGA)
jardin9e867fe2003-12-23 08:56:18 +0000887AC_SUBST(ISISD)
paul7ea487b2003-03-17 02:05:07 +0000888AC_SUBST(VTYSH)
889AC_SUBST(INCLUDES)
890AC_SUBST(CURSES)
891AC_SUBST(OSPFCLIENT)
paul1ef74ef2003-03-21 15:16:05 +0000892AC_SUBST(OSPFAPI)
paul7ea487b2003-03-17 02:05:07 +0000893AC_CHECK_LIB(c, inet_ntop, [AC_DEFINE(HAVE_INET_NTOP,,inet_ntop)])
894AC_CHECK_LIB(c, inet_pton, [AC_DEFINE(HAVE_INET_PTON,,inet_pton)])
895AC_CHECK_LIB(crypt, crypt)
896AC_CHECK_LIB(resolv, res_init)
897AC_CHECK_LIB(m, main)
898
899dnl ---------------------------------------------------
900dnl BSD/OS 4.1 define inet_XtoY function as __inet_XtoY
901dnl ---------------------------------------------------
paula159ed92003-06-04 11:01:45 +0000902AC_CHECK_FUNC(__inet_ntop, AC_DEFINE(HAVE_INET_NTOP,,__inet_ntop))
903AC_CHECK_FUNC(__inet_pton, AC_DEFINE(HAVE_INET_PTON,,__inet_pton))
904AC_CHECK_FUNC(__inet_aton, AC_DEFINE(HAVE_INET_ATON,,__inet_aton))
paul7ea487b2003-03-17 02:05:07 +0000905
906dnl ---------------------------
907dnl check system has GNU regexp
908dnl ---------------------------
909dnl AC_MSG_CHECKING(whether system has GNU regex)
910AC_CHECK_LIB(c, regexec,
911[AC_DEFINE(HAVE_GNU_REGEX,,GNU regexp library)
912 LIB_REGEX=""],
913[LIB_REGEX="regex.o"])
914AC_SUBST(LIB_REGEX)
915
916dnl ------------------
917dnl check SNMP library
918dnl ------------------
919if test "${enable_snmp}" = "yes";then
920dnl AC_CHECK_LIB(snmp, asn_parse_int, HAVE_SNMP=yes)
paul7ea487b2003-03-17 02:05:07 +0000921 if test "${HAVE_SNMP}" = ""; then
paul1ef74ef2003-03-21 15:16:05 +0000922 old_libs="${LIBS}"
923 LIBS="-L/usr/lib"
paul7ea487b2003-03-17 02:05:07 +0000924 unset ac_cv_lib_snmp_asn_parse_int
paul1ef74ef2003-03-21 15:16:05 +0000925 AC_CHECK_LIB(crypto, main, NEED_CRYPTO=yes, )
926 if test "${NEED_CRYPTO}" = ""; then
927 AC_CHECK_LIB(netsnmp, asn_parse_int, [HAVE_NETSNMP=yes; HAVE_SNMP=yes ])
928 else
929 AC_CHECK_LIB(netsnmp, asn_parse_int, [HAVE_NETSNMP=yes; HAVE_SNMP=yes; NEED_CRYPTO=yes;LIBS="$LIBS -lcrypto" ],,"-lcrypto")
930 fi
931 LIBS="${old_libs}"
paul7ea487b2003-03-17 02:05:07 +0000932 fi
paul1ef74ef2003-03-21 15:16:05 +0000933 if test "${HAVE_SNMP}" = ""; then
934 old_libs="${LIBS}"
935 LIBS="-L/usr/lib"
936 unset ac_cv_lib_snmp_asn_parse_int
937 AC_CHECK_LIB(snmp, asn_parse_int, HAVE_SNMP=yes, )
938 if test "${HAVE_SNMP}" = ""; then
939 unset ac_cv_lib_snmp_asn_parse_int
940 AC_CHECK_LIB(crypto, main, NEED_CRYPTO=yes, )
941 if test "${NEED_CRYPTO}" = "yes"; then
942 AC_CHECK_LIB(snmp, asn_parse_int, [HAVE_SNMP=yes; NEED_CRYPTO=yes; LIBS="$LIBS -lcrypto" ],,"-lcrypto")
943 fi
944 fi
945 LIBS="${old_libs}"
946 fi
paul7ea487b2003-03-17 02:05:07 +0000947
948 if test "${HAVE_SNMP}" = ""; then
paul1ef74ef2003-03-21 15:16:05 +0000949 old_libs="${LIBS}"
950 LIBS="-L/usr/local/lib"
951 unset ac_cv_lib_snmp_asn_parse_int
952 AC_CHECK_LIB(snmp, asn_parse_int, HAVE_SNMP=yes)
953 if test "${HAVE_SNMP}" = ""; then
954 unset ac_cv_lib_snmp_asn_parse_int
955 AC_CHECK_LIB(crypto, main, NEED_CRYPTO=yes, )
956 if test "${NEED_CRYPTO}" = "yes"; then
957 AC_CHECK_LIB(snmp, asn_parse_int, [HAVE_SNMP=yes; NEED_CRYPTO=yes; LIBS="$LIBS -lcrypto" ],,"-lcrypto")
958 fi
959 fi
960 LIBS="${old_libs}"
paul7ea487b2003-03-17 02:05:07 +0000961 fi
paul1ef74ef2003-03-21 15:16:05 +0000962
paul7ea487b2003-03-17 02:05:07 +0000963 if test "${HAVE_SNMP}" = "yes"; then
964 for ac_snmp in /usr/include/net-snmp/library/asn1.h /usr/include/ucd-snmp/asn1.h /usr/local/include/ucd-snmp/asn1.h /dev/null
965 do
966 test -f "${ac_snmp}" && break
967 done
paul1ef74ef2003-03-21 15:16:05 +0000968
paul7ea487b2003-03-17 02:05:07 +0000969 case ${ac_snmp} in
970 /usr/include/net-snmp/*)
971 AC_DEFINE(HAVE_SNMP,,SNMP)
paul1ef74ef2003-03-21 15:16:05 +0000972 AC_DEFINE(HAVE_NETSNMP,,SNMP)
paul7ea487b2003-03-17 02:05:07 +0000973 AC_DEFINE(UCD_COMPATIBLE,,SNMP)
hasso2d582282005-03-28 15:29:07 +0000974 SNMP_INCLUDES="${SNMP_INCLUDES} -I/usr/include/net-snmp -I/usr/include/net-snmp/library"
paulac7c4bb2003-03-19 04:25:08 +0000975 if test "${HAVE_NETSNMP}" = "yes"; then
paul1ef74ef2003-03-21 15:16:05 +0000976 LIBS="${LIBS} -lnetsnmp"
paulac7c4bb2003-03-19 04:25:08 +0000977 else
paul1ef74ef2003-03-21 15:16:05 +0000978 LIBS="${LIBS} -lsnmp"
paulac7c4bb2003-03-19 04:25:08 +0000979 fi
paul7ea487b2003-03-17 02:05:07 +0000980 ;;
981 /usr/include/ucd-snmp/*)
982 AC_DEFINE(HAVE_SNMP,,SNMP)
hasso2d582282005-03-28 15:29:07 +0000983 SNMP_INCLUDES="${SNMP_INCLUDES} -I/usr/include/ucd-snmp"
paul7ea487b2003-03-17 02:05:07 +0000984 LIBS="${LIBS} -lsnmp"
985 ;;
986 /usr/local/include/ucd-snmp/*)
987 AC_DEFINE(HAVE_SNMP,,SNMP)
hasso2d582282005-03-28 15:29:07 +0000988 SNMP_INCLUDES="${SNMP_INCLUDES} -I/usr/local/include/ucd-snmp"
paul7ea487b2003-03-17 02:05:07 +0000989 LIBS="${LIBS} -L/usr/local/lib -lsnmp"
990 ;;
paulf3bd1a72003-11-02 07:29:11 +0000991 /usr/local/include/net-snmp/*)
992 AC_DEFINE(HAVE_SNMP,,SNMP)
993 AC_DEFINE(HAVE_NET_SNMP,,SNMP)
994 AC_DEFINE(UCD_COMPATIBLE,,SNMP)
hasso2d582282005-03-28 15:29:07 +0000995 SNMP_INCLUDES="${SNMP_INCLUDES} -I/usr/local/include/net-snmp"
paulf3bd1a72003-11-02 07:29:11 +0000996 LIBS="${LIBS} -L/usr/local/lib -lnetsnmp"
997 ;;
paul7ea487b2003-03-17 02:05:07 +0000998 esac
999 if test "${NEED_CRYPTO}" = "yes"; then
1000 LIBS="${LIBS} -lcrypto"
1001 fi
1002 fi
1003fi
1004
ajs6cf9df02005-01-12 16:52:55 +00001005if test "${enable_snmp}" = "yes" -a "${HAVE_SNMP}" != "yes"; then
1006 AC_MSG_ERROR([--enable-snmp given, but cannot find support for SNMP])
1007fi
1008
hasso2d582282005-03-28 15:29:07 +00001009AC_SUBST(SNMP_INCLUDES)
1010
paul7ea487b2003-03-17 02:05:07 +00001011dnl ----------------------------
1012dnl check sa_len of sockaddr
1013dnl ----------------------------
1014AC_MSG_CHECKING(whether struct sockaddr has a sa_len field)
1015AC_TRY_COMPILE([#include <sys/types.h>
1016#include <sys/socket.h>
1017],[static struct sockaddr ac_i;int ac_j = sizeof (ac_i.sa_len);],
1018[AC_MSG_RESULT(yes)
1019 AC_DEFINE(HAVE_SA_LEN,,sa_len)],
1020 AC_MSG_RESULT(no))
1021
1022dnl ----------------------------
1023dnl check sin_len of sockaddr_in
1024dnl ----------------------------
1025AC_MSG_CHECKING(whether struct sockaddr_in has a sin_len field)
1026AC_TRY_COMPILE([#include <sys/types.h>
1027#include <netinet/in.h>
1028],[static struct sockaddr_in ac_i;int ac_j = sizeof (ac_i.sin_len);],
1029[AC_MSG_RESULT(yes)
1030 AC_DEFINE(HAVE_SIN_LEN,,sin_len)],
1031 AC_MSG_RESULT(no))
1032
1033dnl ----------------------------
1034dnl check sun_len of sockaddr_un
1035dnl ----------------------------
1036AC_MSG_CHECKING(whether struct sockaddr_un has a sun_len field)
1037AC_TRY_COMPILE([#include <sys/types.h>
1038#include <sys/un.h>
1039],[static struct sockaddr_un ac_i;int ac_j = sizeof (ac_i.sun_len);],
1040[AC_MSG_RESULT(yes)
1041 AC_DEFINE(HAVE_SUN_LEN,,sun_len)],
1042 AC_MSG_RESULT(no))
1043
1044dnl -----------------------------------
1045dnl check sin6_scope_id of sockaddr_in6
1046dnl -----------------------------------
1047if test "$zebra_cv_ipv6" = yes; then
1048 AC_MSG_CHECKING(whether struct sockaddr_in6 has a sin6_scope_id field)
1049 AC_TRY_COMPILE([#include <sys/types.h>
1050#include <netinet/in.h>
1051],[static struct sockaddr_in6 ac_i;int ac_j = sizeof (ac_i.sin6_scope_id);],
1052[AC_MSG_RESULT(yes)
1053 AC_DEFINE(HAVE_SIN6_SCOPE_ID,,scope id)],
1054 AC_MSG_RESULT(no))
1055fi
1056
1057dnl ----------------------------
1058dnl check socklen_t exist or not
1059dnl ----------------------------
1060AC_MSG_CHECKING(whther socklen_t is defined)
1061AC_TRY_COMPILE([#include <sys/types.h>
1062#include <sys/socket.h>
1063#include <netinet/in.h>
1064],[socklen_t ac_x;],
1065[AC_MSG_RESULT(yes)
1066 AC_DEFINE(HAVE_SOCKLEN_T,,socklen_t)],
1067 AC_MSG_RESULT(no))
1068
1069dnl ------------------------
1070dnl check struct sockaddr_dl
1071dnl ------------------------
1072AC_MSG_CHECKING(whether struct sockaddr_dl exist)
1073AC_EGREP_HEADER(sockaddr_dl,
1074net/if_dl.h,
1075[AC_MSG_RESULT(yes)
1076 AC_DEFINE(HAVE_SOCKADDR_DL,,sockaddr_dl)],
1077 AC_MSG_RESULT(no))
1078
1079dnl --------------------------
1080dnl check structure ifaliasreq
1081dnl --------------------------
1082AC_MSG_CHECKING(whether struct ifaliasreq exist)
1083AC_EGREP_HEADER(ifaliasreq,
1084net/if.h,
1085[AC_MSG_RESULT(yes)
1086 AC_DEFINE(HAVE_IFALIASREQ,,ifaliasreq)],
1087 AC_MSG_RESULT(no))
1088
1089dnl ----------------------------
1090dnl check structure in6_aliasreq
1091dnl ----------------------------
hasso71c0fb52003-05-25 20:18:13 +00001092AC_MSG_CHECKING(whether struct in6_aliasreq exist)
paul7ea487b2003-03-17 02:05:07 +00001093AC_EGREP_HEADER(in6_aliasreq,
1094netinet6/in6_var.h,
1095[AC_MSG_RESULT(yes)
1096 AC_DEFINE(HAVE_IN6_ALIASREQ,,in6_aliasreq)],
1097 AC_MSG_RESULT(no))
1098
hasso71c0fb52003-05-25 20:18:13 +00001099dnl -----------------------------------
1100dnl check ifra_lifetime of in6_aliasreq
1101dnl -----------------------------------
1102AC_MSG_CHECKING(whether in6_aliasreq.ifra_lifetime exist)
1103AC_TRY_COMPILE([#include <sys/types.h>
1104#include <netinet6/in6_var.h>
1105],[static struct if6_aliasreq ac_i;int ac_j = sizeof (ac_i.ifra_lifetime);],
1106[AC_MSG_RESULT(yes)
paula159ed92003-06-04 11:01:45 +00001107 AC_DEFINE(HAVE_IFRA_LIFETIME,,Have in6_aliasreq.ifra_lifetime)],
hasso71c0fb52003-05-25 20:18:13 +00001108 AC_MSG_RESULT(no))
1109
paul7ea487b2003-03-17 02:05:07 +00001110dnl ---------------------------
1111dnl check structure rt_addrinfo
1112dnl ---------------------------
1113AC_MSG_CHECKING(whether struct rt_addrinfo exist)
1114AC_EGREP_HEADER(rt_addrinfo,
1115net/route.h,
1116[AC_MSG_RESULT(yes)
1117 AC_DEFINE(HAVE_RT_ADDRINFO,,rt_addrinfo)],
1118 AC_MSG_RESULT(no))
1119
1120dnl --------------------------
1121dnl check structure in_pktinfo
1122dnl --------------------------
1123AC_MSG_CHECKING(whether struct in_pktinfo exist)
1124AC_TRY_COMPILE([#include <netinet/in.h>
1125],[struct in_pktinfo ac_x;],
1126[AC_MSG_RESULT(yes)
1127 AC_DEFINE(HAVE_INPKTINFO,,in_pktinfo)],
1128 AC_MSG_RESULT(no))
1129
vincent29c4c9b2005-03-25 13:05:47 +00001130dnl ----------------------------------
1131dnl check struct nd_opt_homeagent_info
1132dnl ----------------------------------
1133AC_MSG_CHECKING(whether struct nd_opt_homeagent_info exist)
1134AC_EGREP_HEADER(nd_opt_homeagent_info,
1135netinet/icmp6.h,
1136[AC_MSG_RESULT(yes)
1137 AC_DEFINE(HAVE_ND_OPT_HOMEAGENT_INFO,,nd_opt_homeagent_info)],
1138 AC_MSG_RESULT(no))
1139
1140dnl --------------------------------
1141dnl check struct nd_opt_adv_interval
1142dnl --------------------------------
1143AC_MSG_CHECKING(whether struct nd_opt_adv_interval exist)
1144AC_EGREP_HEADER(nd_opt_adv_interval,
1145netinet/icmp6.h,
1146[AC_MSG_RESULT(yes)
1147 AC_DEFINE(HAVE_ND_OPT_ADV_INTERVAL,,nd_opt_adv_interval)],
1148 AC_MSG_RESULT(no))
1149
1150dnl ------------------------------------
1151dnl check fields in nd_opt_adv_interval
1152dnl ------------------------------------
1153AC_MSG_CHECKING(whether nd_opt_ai_type field exist)
1154AC_EGREP_HEADER(nd_opt_ai_type,
1155netinet/icmp6.h,
1156[AC_MSG_RESULT(yes)
1157 AC_DEFINE(HAVE_ND_OPT_ADV_INTERVAL_AI_FIELDS,,nd_opt_ai_type)],
1158 AC_MSG_RESULT(no))
1159
paul7ea487b2003-03-17 02:05:07 +00001160dnl --------------------------------------
1161dnl checking for getrusage struct and call
1162dnl --------------------------------------
1163AC_MSG_CHECKING(whether getrusage is available)
1164AC_TRY_COMPILE([#include <sys/resource.h>
1165],[struct rusage ac_x; getrusage (RUSAGE_SELF, &ac_x);],
1166[AC_MSG_RESULT(yes)
1167 AC_DEFINE(HAVE_RUSAGE,,rusage)],
1168 AC_MSG_RESULT(no))
1169
pauledd7c242003-06-04 13:59:38 +00001170dnl -------------------
1171dnl capabilities checks
1172dnl -------------------
hasso41d3fc92004-04-06 11:59:00 +00001173if test "${enable_capabilities}" != "no"; then
1174 AC_MSG_CHECKING(whether prctl PR_SET_KEEPCAPS is available)
1175 AC_TRY_COMPILE([#include <sys/prctl.h>],[prctl(PR_SET_KEEPCAPS, 1, 0, 0, 0);],
1176 [AC_MSG_RESULT(yes)
1177 AC_DEFINE(HAVE_PR_SET_KEEPCAPS,,prctl)
1178 quagga_ac_keepcaps="yes"],
1179 AC_MSG_RESULT(no)
pauledd7c242003-06-04 13:59:38 +00001180 )
hasso41d3fc92004-04-06 11:59:00 +00001181 if test x"${quagga_ac_keepcaps}" = x"yes"; then
1182 AC_CHECK_HEADERS(sys/capability.h)
1183 fi
1184 if test x"${ac_cv_header_sys_capability_h}" = x"yes"; then
1185 AC_CHECK_LIB(cap, cap_init,
1186 [AC_DEFINE(HAVE_LCAPS,1,Capabilities)
1187 LIBCAP="-lcap"
1188 ]
1189 )
1190 fi
pauledd7c242003-06-04 13:59:38 +00001191fi
1192AC_SUBST(LIBCAP)
1193
ajs40abf232005-01-12 17:27:27 +00001194dnl -------------------
1195dnl test for ucontext.h
1196dnl -------------------
1197AC_CHECK_HEADERS(ucontext.h)
1198
paulfb2d1502003-06-04 09:40:54 +00001199dnl ---------------------------
1200dnl check for glibc 'backtrace'
1201dnl ---------------------------
1202if test "${glibc}" = "yes"; then
1203 AC_CHECK_HEADER(execinfo.h)
1204fi
1205if test x"${ac_cv_header_execinfo_h}" = x"yes"; then
1206 AC_CHECK_FUNC(backtrace,
1207 [AC_DEFINE(HAVE_GLIBC_BACKTRACE,,Glibc backtrace)]
1208 )
1209fi
1210
paul408ad942003-05-20 00:03:33 +00001211dnl ----------
1212dnl configure date
1213dnl ----------
1214CONFDATE=`date '+%Y%m%d'`
1215AC_SUBST(CONFDATE)
1216
paul7ea487b2003-03-17 02:05:07 +00001217dnl ------------------------------
paula159ed92003-06-04 11:01:45 +00001218dnl set paths for state directory
paul23bd12c2003-04-07 06:11:09 +00001219dnl ------------------------------
1220if test "${prefix}" = "NONE"; then
paule8f29842003-08-12 13:08:31 +00001221 quagga_statedir_prefix="";
paul23bd12c2003-04-07 06:11:09 +00001222else
paule8f29842003-08-12 13:08:31 +00001223 quagga_statedir_prefix=${prefix}
paul23bd12c2003-04-07 06:11:09 +00001224fi
1225if test "${localstatedir}" = '${prefix}/var'; then
paula159ed92003-06-04 11:01:45 +00001226 AC_CACHE_CHECK(state directory,ac_statedir,
paule8f29842003-08-12 13:08:31 +00001227 [for QUAGGA_STATE_DIR in ${quagga_statedir_prefix}/var/run dnl
1228 ${quagga_statedir_prefix}/var/adm dnl
1229 ${quagga_statedir_prefix}/etc dnl
paula159ed92003-06-04 11:01:45 +00001230 /var/run dnl
1231 /var/adm dnl
1232 /etc dnl
1233 /dev/null;
paul23bd12c2003-04-07 06:11:09 +00001234 do
paule8f29842003-08-12 13:08:31 +00001235 test -d $QUAGGA_STATE_DIR && break
paul23bd12c2003-04-07 06:11:09 +00001236 done
paule8f29842003-08-12 13:08:31 +00001237 quagga_statedir=$QUAGGA_STATE_DIR])
paul23bd12c2003-04-07 06:11:09 +00001238else
paule8f29842003-08-12 13:08:31 +00001239 quagga_statedir=${localstatedir}
paula159ed92003-06-04 11:01:45 +00001240 AC_MSG_CHECKING(directory to use for state file)
paule8f29842003-08-12 13:08:31 +00001241 AC_MSG_RESULT(${quagga_statedir})
paul26275b02005-04-11 07:10:47 +00001242 AC_SUBST(quagga_statedir)
paul23bd12c2003-04-07 06:11:09 +00001243fi
paule8f29842003-08-12 13:08:31 +00001244if test $quagga_statedir = "/dev/null"; then
paula159ed92003-06-04 11:01:45 +00001245 AC_MSG_ERROR('STATE DIRECTORY NOT FOUND! FIX OR SPECIFY --localstatedir!')
1246fi
1247
paule8f29842003-08-12 13:08:31 +00001248AC_DEFINE_UNQUOTED(PATH_ZEBRA_PID, "$quagga_statedir/zebra.pid",zebra PID)
1249AC_DEFINE_UNQUOTED(PATH_RIPD_PID, "$quagga_statedir/ripd.pid",ripd PID)
1250AC_DEFINE_UNQUOTED(PATH_RIPNGD_PID, "$quagga_statedir/ripngd.pid",ripngd PID)
1251AC_DEFINE_UNQUOTED(PATH_BGPD_PID, "$quagga_statedir/bgpd.pid",bgpd PID)
1252AC_DEFINE_UNQUOTED(PATH_OSPFD_PID, "$quagga_statedir/ospfd.pid",ospfd PID)
1253AC_DEFINE_UNQUOTED(PATH_OSPF6D_PID, "$quagga_statedir/ospf6d.pid",ospf6d PID)
jardin9e867fe2003-12-23 08:56:18 +00001254AC_DEFINE_UNQUOTED(PATH_ISISD_PID, "$quagga_statedir/isisd.pid",isisd PID)
ajsd0199432004-12-22 14:03:52 +00001255AC_DEFINE_UNQUOTED(PATH_WATCHQUAGGA_PID, "$quagga_statedir/watchquagga.pid",watchquagga PID)
paule8f29842003-08-12 13:08:31 +00001256AC_DEFINE_UNQUOTED(ZEBRA_SERV_PATH, "$quagga_statedir/zserv.api",zebra api socket)
1257AC_DEFINE_UNQUOTED(ZEBRA_VTYSH_PATH, "$quagga_statedir/zebra.vty",zebra vty socket)
1258AC_DEFINE_UNQUOTED(RIP_VTYSH_PATH, "$quagga_statedir/ripd.vty",rip vty socket)
1259AC_DEFINE_UNQUOTED(RIPNG_VTYSH_PATH, "$quagga_statedir/ripngd.vty",ripng vty socket)
1260AC_DEFINE_UNQUOTED(BGP_VTYSH_PATH, "$quagga_statedir/bgpd.vty",bgpd vty socket)
1261AC_DEFINE_UNQUOTED(OSPF_VTYSH_PATH, "$quagga_statedir/ospfd.vty",ospfd vty socket)
1262AC_DEFINE_UNQUOTED(OSPF6_VTYSH_PATH, "$quagga_statedir/ospf6d.vty",ospf6d vty socket)
jardin9e867fe2003-12-23 08:56:18 +00001263AC_DEFINE_UNQUOTED(ISIS_VTYSH_PATH, "$quagga_statedir/isisd.vty",isisd vty socket)
ajs515210b2004-12-22 15:35:12 +00001264AC_DEFINE_UNQUOTED(DAEMON_VTY_DIR, "$quagga_statedir",daemon vty directory)
paul7ea487b2003-03-17 02:05:07 +00001265
paul1eb8ef22005-04-07 07:30:20 +00001266dnl -------------------------------
1267dnl Quagga sources should always be
1268dnl current wrt interfaces. Dont
1269dnl allow deprecated interfaces to
1270dnl be exposed.
1271dnl -------------------------------
1272AC_DEFINE(QUAGGA_NO_DEPRECATED_INTERFACES, 1, Hide deprecated interfaces)
1273
paul7ea487b2003-03-17 02:05:07 +00001274dnl ---------------------------
1275dnl Check htonl works correctly
1276dnl ---------------------------
1277AC_MSG_CHECKING(for working htonl)
1278AC_CACHE_VAL(ac_cv_htonl_works, [
1279AC_TRY_LINK([#ifdef HAVE_SYS_TYPES_H
1280#include <sys/types.h>
1281#endif
1282#ifdef HAVE_NETDB_H
1283#include <netdb.h>
1284#endif
1285#ifdef HAVE_NETINET_IN_H
1286#include <netinet/in.h>
1287#endif],
1288[htonl (0);],
1289ac_cv_htonl_works=yes,
1290ac_cv_htonl_works=no)])
1291AC_MSG_RESULT($ac_cv_htonl_works)
1292
paul14c17fd2004-11-07 22:34:23 +00001293AC_CONFIG_FILES([Makefile lib/Makefile zebra/Makefile ripd/Makefile
ajsd0199432004-12-22 14:03:52 +00001294 ripngd/Makefile bgpd/Makefile ospfd/Makefile watchquagga/Makefile
jardin9e867fe2003-12-23 08:56:18 +00001295 ospf6d/Makefile isisd/Makefile vtysh/Makefile doc/Makefile
paul14c17fd2004-11-07 22:34:23 +00001296 ospfclient/Makefile tests/Makefile m4/Makefile redhat/Makefile
gdt69f1fc22004-08-27 15:57:35 +00001297 pkgsrc/Makefile
paul670bbf12004-11-12 09:05:00 +00001298 redhat/quagga.spec
gdtb7a97f82004-07-23 16:23:56 +00001299 lib/version.h
paul14c17fd2004-11-07 22:34:23 +00001300 doc/defines.texi
hassof695b012005-04-02 19:03:39 +00001301 isisd/topology/Makefile
gdtcbd04082004-08-31 18:16:36 +00001302 pkgsrc/bgpd.sh pkgsrc/ospf6d.sh pkgsrc/ospfd.sh
paulf31293a2004-11-12 09:27:04 +00001303 pkgsrc/ripd.sh pkgsrc/ripngd.sh pkgsrc/zebra.sh])
paul26275b02005-04-11 07:10:47 +00001304AC_CONFIG_FILES([solaris/Makefile])
1305
paul670bbf12004-11-12 09:05:00 +00001306AC_CONFIG_FILES([vtysh/extract.pl],[chmod +x vtysh/extract.pl])
hasso48577192004-11-19 06:41:49 +00001307## Hack, but working solution to avoid rebuilding of quagga.info.
1308## It's already in CVS until texinfo 4.7 is more common.
1309AC_CONFIG_COMMANDS([info-time],[touch doc/quagga.info])
paul14c17fd2004-11-07 22:34:23 +00001310AC_OUTPUT
paul7ea487b2003-03-17 02:05:07 +00001311
1312echo "
hassoc89f6492004-08-26 12:21:28 +00001313Quagga configuration
1314--------------------
1315quagga version : ${PACKAGE_VERSION}
paul7ea487b2003-03-17 02:05:07 +00001316host operationg system : ${host_os}
1317source code location : ${srcdir}
1318compiler : ${CC}
1319compiler flags : ${CFLAGS}
hasso2d582282005-03-28 15:29:07 +00001320includes : ${INCLUDES} ${SNMP_INCLUDES}
hasso71c0fb52003-05-25 20:18:13 +00001321linker flags : ${LDFLAGS} ${LIBS}
paule8f29842003-08-12 13:08:31 +00001322state file directory : ${quagga_statedir}
pauldc7a2bf2003-10-22 00:07:44 +00001323config file directory : `eval echo \`echo ${sysconfdir}\``
gdtd6b72f72003-12-03 17:24:27 +00001324example directory : `eval echo \`echo ${exampledir}\``
paul8d4aee52003-06-06 00:30:35 +00001325user to run as : ${enable_user}
1326group to run as : ${enable_group}
1327group for vty sockets : ${enable_vty_group}
gdtaa593d52003-12-22 20:15:53 +00001328config file mask : ${enable_configfile_mask}
1329log file mask : ${enable_logfile_mask}
pauldc7a2bf2003-10-22 00:07:44 +00001330
1331The above user and group must have read/write access to the state file
1332directory and to the config files in the config file directory.
paul7ea487b2003-03-17 02:05:07 +00001333"