blob: 645f7ea54d3632f7244aad9eca22257946bac5d1 [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##
ajsdfb9a542005-04-11 14:55:55 +00008## $Id: configure.ac,v 1.102 2005/04/11 14:55:55 ajs 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)
ajsdfb9a542005-04-11 14:55:55 +000013
14dnl -----------------------------------
15dnl Get hostname and other information.
16dnl -----------------------------------
17AC_CANONICAL_BUILD()
18AC_CANONICAL_HOST()
19AC_CANONICAL_TARGET()
20
gdt81b81822004-04-07 22:48:47 +000021AM_INIT_AUTOMAKE(1.6)
paul7ea487b2003-03-17 02:05:07 +000022AM_CONFIG_HEADER(config.h)
23
gdtd6b72f72003-12-03 17:24:27 +000024dnl default is to match previous behavior
gdtc4f0efe2003-12-04 15:39:25 +000025exampledir=${sysconfdir}
gdtd6b72f72003-12-03 17:24:27 +000026AC_ARG_ENABLE([exampledir],
27 AC_HELP_STRING([--enable-exampledir],
28 [specify alternate directory for examples]),
29 exampledir="$enableval",)
gdtc4f0efe2003-12-04 15:39:25 +000030dnl XXX add --exampledir to autoconf standard directory list somehow
gdtd6b72f72003-12-03 17:24:27 +000031AC_SUBST(exampledir)
32
gdtcbd04082004-08-31 18:16:36 +000033dnl default is to match previous behavior
34pkgsrcrcdir=""
35pkgsrcdir=""
36AC_ARG_ENABLE([pkgsrcrcdir],
37 AC_HELP_STRING([--enable-pkgsrcrcdir],
38 [specify directory for rc.d scripts]),
39 pkgsrcrcdir="$enableval"; pkgsrcdir="pkgsrc",)
40dnl XXX add --pkgsrcrcdir to autoconf standard directory list somehow
41AC_SUBST(pkgsrcdir)
42AC_SUBST(pkgsrcrcdir)
43
paul7ea487b2003-03-17 02:05:07 +000044dnl ------------
45dnl Check CFLAGS
46dnl ------------
47AC_ARG_WITH(cflags,
48[ --with-cflags Set CFLAGS for use in compilation.])
49if test "x$with_cflags" != "x" ; then
50 CFLAGS="$with_cflags" ; cflags_specified=yes ;
51elif test -n "$CFLAGS" ; then
52 cflags_specified=yes ;
53fi
54
hasso1969e4b2005-03-27 13:07:23 +000055dnl --------------------
56dnl Check CC and friends
57dnl --------------------
paul7ea487b2003-03-17 02:05:07 +000058AC_PROG_CC
hasso1969e4b2005-03-27 13:07:23 +000059AC_PROG_CPP
60AC_PROG_EGREP
61
62dnl ------------------------------------------------------------------
63dnl Intel compiler check. Although Intel tries really hard to make icc
64dnl look like gcc, there are some differences. It's very verbose with
65dnl -Wall and it doesn't support the individual -W options.
66dnl ------------------------------------------------------------------
67AC_MSG_CHECKING([whether we are using the Intel compiler])
68AC_EGREP_CPP([^__INTEL_COMPILER], [__INTEL_COMPILER],
69 ICC="no"
70 AC_MSG_RESULT([no]),
71 ICC="yes"
72 AC_MSG_RESULT([yes])
73)
paul7ea487b2003-03-17 02:05:07 +000074
paula49c0ff2004-09-30 06:08:58 +000075dnl ---------------------------------------------
paul7ea487b2003-03-17 02:05:07 +000076dnl If CLFAGS doesn\'t exist set default value
paula49c0ff2004-09-30 06:08:58 +000077dnl AC_PROG_CC will have set minimal default
78dnl already, eg "-O2 -g" for gcc, "-g" for others
paul27eebb32004-07-22 18:16:59 +000079dnl (Wall is gcc specific... have to make sure
80dnl gcc is being used before setting it)
hasso1969e4b2005-03-27 13:07:23 +000081dnl Intel icc 8.0 also sets __GNUC__, but
82dnl doesn't support all these fancy -W options.
paula49c0ff2004-09-30 06:08:58 +000083dnl ---------------------------------------------
paul27eebb32004-07-22 18:16:59 +000084dnl
paul7ea487b2003-03-17 02:05:07 +000085if test "x$cflags_specified" = "x" ; then
hasso1969e4b2005-03-27 13:07:23 +000086 if test "x${GCC}" = "xyes" && test "x${ICC}" = "xno"; then
gdt7fd63b32004-10-07 13:53:29 +000087 CFLAGS="-Os -g -Wall -Wsign-compare -Wpointer-arith"
hasso7347a2a2004-10-05 14:15:17 +000088 CFLAGS="${CFLAGS} -Wbad-function-cast -Wwrite-strings"
paula49c0ff2004-09-30 06:08:58 +000089 fi
gdt7fd63b32004-10-07 13:53:29 +000090 # TODO: conditionally addd -Wpacked if handled
paul7ea487b2003-03-17 02:05:07 +000091fi
92
hasso1969e4b2005-03-27 13:07:23 +000093dnl ---------------------------------------------------------------------
94dnl Intel compiler warnings we ignore:
95dnl 279: controlling expression is constant.
96dnl 869: parameter "xxx" was never referenced - to avoid massive warnings
97dnl about "self", "vty", "argc" and "argv" never referenced in DEFUN
98dnl macro.
99dnl 981: operands are evaluated in unspecified order.
100dnl ---------------------------------------------------------------------
101
102if test "$ICC" = "yes"; then
103 CFLAGS="-Os -g -Wall -wd 279,869,981"
104fi
105
paul7ea487b2003-03-17 02:05:07 +0000106dnl --------------
107dnl Check programs
108dnl --------------
paul7ea487b2003-03-17 02:05:07 +0000109AC_PROG_INSTALL
110AC_PROG_MAKE_SET
111AC_CHECK_TOOL(AR, ar)
112AC_CHECK_TOOL(RANLIB, ranlib, :)
113
114dnl ---------
115dnl AIX check
116dnl ---------
117AC_AIX
118
gdt87efd642004-06-30 17:36:11 +0000119dnl -------
120dnl libtool
121dnl -------
paul0fc42942004-08-19 04:41:21 +0000122AC_PROG_LIBTOOL
gdt87efd642004-06-30 17:36:11 +0000123
paul7ea487b2003-03-17 02:05:07 +0000124dnl ----------------------
125dnl Packages configuration
126dnl ----------------------
127AC_ARG_ENABLE(vtysh,
gdtfc9d0742004-06-30 14:25:12 +0000128[ --enable-vtysh include integrated vty shell for Quagga])
paul7ea487b2003-03-17 02:05:07 +0000129AC_ARG_ENABLE(ipv6,
130[ --disable-ipv6 turn off IPv6 related features and daemons])
131AC_ARG_ENABLE(zebra,
132[ --disable-zebra do not build zebra daemon])
133AC_ARG_ENABLE(bgpd,
134[ --disable-bgpd do not build bgpd])
135AC_ARG_ENABLE(ripd,
136[ --disable-ripd do not build ripd])
137AC_ARG_ENABLE(ripngd,
138[ --disable-ripngd do not build ripngd])
139AC_ARG_ENABLE(ospfd,
140[ --disable-ospfd do not build ospfd])
paul7ea487b2003-03-17 02:05:07 +0000141AC_ARG_ENABLE(ospf6d,
142[ --disable-ospf6d do not build ospf6d])
ajsd0199432004-12-22 14:03:52 +0000143AC_ARG_ENABLE(watchquagga,
144[ --disable-watchquagga do not build watchquagga])
jardin9e867fe2003-12-23 08:56:18 +0000145AC_ARG_ENABLE(isisd,
hassoae399ab2004-09-13 20:22:18 +0000146[ --enable-isisd build isisd])
paul7ea487b2003-03-17 02:05:07 +0000147AC_ARG_ENABLE(bgp-announce,
148[ --disable-bgp-announce, turn off BGP route announcement])
149AC_ARG_ENABLE(netlink,
150[ --enable-netlink force to use Linux netlink interface])
151AC_ARG_ENABLE(broken-aliases,
152[ --enable-broken-aliases enable aliases as distinct interfaces for Linux 2.2.X])
153AC_ARG_ENABLE(snmp,
154[ --enable-snmp enable SNMP support])
155AC_ARG_WITH(libpam,
156[ --with-libpam use libpam for PAM support in vtysh])
hasso71c0fb52003-05-25 20:18:13 +0000157AC_ARG_ENABLE(tcp-zebra,
paul7ea487b2003-03-17 02:05:07 +0000158[ --enable-tcp-zebra enable TCP/IP socket connection between zebra and protocol daemon])
paul7ea487b2003-03-17 02:05:07 +0000159AC_ARG_ENABLE(opaque-lsa,
paul1ef74ef2003-03-21 15:16:05 +0000160[ --enable-opaque-lsa enable OSPF Opaque-LSA with OSPFAPI support (RFC2370)])
161AC_ARG_ENABLE(ospfapi,
162[ --disable-ospfapi do not build OSPFAPI to access the OSPF LSA Database,
163 (this is the default if --enable-opaque-lsa is not set)])
164AC_ARG_ENABLE(ospfclient,
165[ --disable-ospfclient do not build OSPFAPI client for OSPFAPI,
166 (this is the default if --disable-ospfapi is set)])
paul7ea487b2003-03-17 02:05:07 +0000167AC_ARG_ENABLE(ospf-te,
168[ --enable-ospf-te enable Traffic Engineering Extension to OSPF])
169AC_ARG_ENABLE(multipath,
170[ --enable-multipath=ARG enable multipath function, ARG must be digit])
paule8f29842003-08-12 13:08:31 +0000171AC_ARG_ENABLE(quagga_user,
172[ --enable-user=ARG user to run Quagga suite as (default quagga)])
173AC_ARG_ENABLE(quagga_group,
174[ --enable-group=ARG group to run Quagga suite as (default quagga)])
pauledd7c242003-06-04 13:59:38 +0000175AC_ARG_ENABLE(vty_group,
paul6b6942f2004-10-22 04:55:05 +0000176[ --enable-vty-group=ARG set vty sockets to have specified group as owner])
gdtaa593d52003-12-22 20:15:53 +0000177AC_ARG_ENABLE(configfile_mask,
178[ --enable-configfile-mask=ARG set mask for config files])
179AC_ARG_ENABLE(logfile_mask,
180[ --enable-logfile-mask=ARG set mask for log files])
pauledd7c242003-06-04 13:59:38 +0000181
hasso71c0fb52003-05-25 20:18:13 +0000182AC_ARG_ENABLE(rtadv,
paul6b6942f2004-10-22 04:55:05 +0000183[ --disable-rtadv disable IPV6 router advertisement feature])
hassoca776982004-06-12 14:33:05 +0000184AC_ARG_ENABLE(irdp,
paul6b6942f2004-10-22 04:55:05 +0000185[ --enable-irdp enable IRDP server support in zebra])
hassof695b012005-04-02 19:03:39 +0000186AC_ARG_ENABLE(isis_topology,
187[ --enable-isis-topology enable IS-IS topology generator])
hasso41d3fc92004-04-06 11:59:00 +0000188AC_ARG_ENABLE(capabilities,
189[ --disable-capabilities disable using POSIX capabilities])
paul6b6942f2004-10-22 04:55:05 +0000190AC_ARG_ENABLE(gcc_ultra_verbose,
191[ --enable-gcc-ultra-verbose enable ultra verbose GCC warnings])
ajs3cade262004-12-29 17:50:22 +0000192AC_ARG_ENABLE(gcc-rdynamic,
193[ --enable-gcc-rdynamic enable gcc linking with -rdynamic for better backtraces])
paul6b6942f2004-10-22 04:55:05 +0000194
195if test x"${enable_gcc_ultra_verbose}" = x"yes" ; then
196 CFLAGS="${CFLAGS} -W -Wcast-qual -Wstrict-prototypes"
197 CFLAGS="${CFLAGS} -Wmissing-declarations -Wmissing-noreturn"
198 CFLAGS="${CFLAGS} -Wmissing-format-attribute -Wunreachable-code"
199 CFLAGS="${CFLAGS} -Wpacked -Wpadded"
200fi
paul7ea487b2003-03-17 02:05:07 +0000201
ajs3cade262004-12-29 17:50:22 +0000202if test x"${enable_gcc_rdynamic}" = x"yes" ; then
203 LDFLAGS="${LDFLAGS} -rdynamic"
204fi
205
paul7ea487b2003-03-17 02:05:07 +0000206if test "${enable_broken_aliases}" = "yes"; then
207 if test "${enable_netlink}" = "yes"
208 then
209 echo "Sorry, you can't use netlink with broken aliases"
210 exit 1
211 fi
212 AC_DEFINE(HAVE_BROKEN_ALIASES,,Broken Alias)
213 enable_netlink=no
214fi
215
216if test "${enable_tcp_zebra}" = "yes"; then
217 AC_DEFINE(HAVE_TCP_ZEBRA,,Use TCP for zebra communication)
218fi
219
paul7ea487b2003-03-17 02:05:07 +0000220if test "${enable_opaque_lsa}" = "yes"; then
221 AC_DEFINE(HAVE_OPAQUE_LSA,,OSPF Opaque LSA)
222fi
223
224if test "${enable_ospf_te}" = "yes"; then
225 AC_DEFINE(HAVE_OPAQUE_LSA,,OSPF Opaque LSA)
226 AC_DEFINE(HAVE_OSPF_TE,,OSPF TE)
227fi
228
gdtd2a0ccc2003-12-03 18:13:48 +0000229AC_MSG_CHECKING(if zebra should be configurable to send Route Advertisements)
230if test "${enable_rtadv}" != "no"; then
hasso71c0fb52003-05-25 20:18:13 +0000231 AC_MSG_RESULT(yes)
gdtd2a0ccc2003-12-03 18:13:48 +0000232 AC_DEFINE(HAVE_RTADV,,Enable IPv6 Routing Advertisement support)
paul2487bea2003-05-25 23:51:31 +0000233else
234 AC_MSG_RESULT(no)
hasso71c0fb52003-05-25 20:18:13 +0000235fi
paul7ea487b2003-03-17 02:05:07 +0000236
hassoca776982004-06-12 14:33:05 +0000237if test "${enable_irdp}" = "yes"; then
238 AC_DEFINE(HAVE_IRDP,, IRDP )
239fi
240
hassof695b012005-04-02 19:03:39 +0000241if test "${enable_isisd}" = "yes" && test "${enable_isis_topology}" = yes; then
242 AC_DEFINE(TOPOLOGY_GENERATE,,Enable IS-IS topology generator code)
243 ISIS_TOPOLOGY_INCLUDES="-I./topology"
244 ISIS_TOPOLOGY_DIR="topology"
245 ISIS_TOPOLOGY_LIB="./topology/libtopology.a"
246fi
247
248AC_SUBST(ISIS_TOPOLOGY_INCLUDES)
249AC_SUBST(ISIS_TOPOLOGY_DIR)
250AC_SUBST(ISIS_TOPOLOGY_LIB)
251
paul79cb2162003-06-06 12:19:53 +0000252if test "${enable_user}" = "yes" || test x"${enable_user}" = x""; then
paule8f29842003-08-12 13:08:31 +0000253 enable_user="quagga"
pauledd7c242003-06-04 13:59:38 +0000254elif test "${enable_user}" = "no"; then
255 enable_user="root"
256fi
pauledd7c242003-06-04 13:59:38 +0000257
paul79cb2162003-06-06 12:19:53 +0000258if test "${enable_group}" = "yes" || test x"${enable_group}" = x""; then
paule8f29842003-08-12 13:08:31 +0000259 enable_group="quagga"
pauledd7c242003-06-04 13:59:38 +0000260elif test "${enable_group}" = "no"; then
261 enable_group="root"
262fi
pauledd7c242003-06-04 13:59:38 +0000263
264if test x"${enable_vty_group}" = x"yes" ; then
paul8d4aee52003-06-06 00:30:35 +0000265 AC_MSG_ERROR([--enable-vty-group requires a group as argument, not yes])
paul79cb2162003-06-06 12:19:53 +0000266elif test x"${enable_vty_group}" != x""; then
paul8d4aee52003-06-06 00:30:35 +0000267 if test x"${enable_vty_group}" != x"no"; then
pauledd7c242003-06-04 13:59:38 +0000268 AC_DEFINE_UNQUOTED(VTY_GROUP, "${enable_vty_group}", VTY Sockets Group)
269 fi
270fi
paul26275b02005-04-11 07:10:47 +0000271AC_SUBST([enable_user])
272AC_SUBST([enable_group])
273AC_SUBST([enable_vty_group])
274AC_DEFINE_UNQUOTED(QUAGGA_USER, "${enable_user}", Quagga User)
275AC_DEFINE_UNQUOTED(QUAGGA_GROUP, "${enable_group}", Quagga Group)
pauledd7c242003-06-04 13:59:38 +0000276
gdtaa593d52003-12-22 20:15:53 +0000277enable_configfile_mask=${enable_configfile_mask:-0600}
278AC_DEFINE_UNQUOTED(CONFIGFILE_MASK, ${enable_configfile_mask}, Mask for config files)
279
280enable_logfile_mask=${enable_logfile_mask:-0600}
281AC_DEFINE_UNQUOTED(LOGFILE_MASK, ${enable_logfile_mask}, Mask for log files)
282
paul7ea487b2003-03-17 02:05:07 +0000283changequote(, )dnl
284
285MULTIPATH_NUM=1
286
287case "${enable_multipath}" in
288 [0-9]|[1-9][0-9])
289 MULTIPATH_NUM="${enable_multipath}"
290 ;;
291 "")
292 ;;
293 *)
294 echo "Please specify digit to --enable-multipath ARG."
295 exit 1
296 ;;
297esac
298
299changequote([, ])dnl
300
301AC_SUBST(MULTIPATH_NUM)
302
303dnl -------------------
304dnl Check header files.
305dnl -------------------
pauldc7a2bf2003-10-22 00:07:44 +0000306AC_HEADER_STDC
307AC_CHECK_HEADERS([string.h stropts.h sys/conf.h sys/ksym.h sys/time.h \
308 sys/times.h sys/select.h sys/sysctl.h sys/sockio.h \
309 sys/types.h linux/version.h kvm.h netdb.h asm/types.h \
310 libutil.h limits.h])
311
paul835b7f12003-10-30 21:59:57 +0000312AC_CHECK_HEADERS([sys/socket.h netinet/in_systm.h netinet/in.h \
paulf3bd1a72003-11-02 07:29:11 +0000313 net/if_dl.h net/netopt.h inet/nd.h net/route.h \
paul835b7f12003-10-30 21:59:57 +0000314 net/if.h net/if_var.h netinet/in_var.h])
pauldc7a2bf2003-10-22 00:07:44 +0000315
gdtfa3232e2003-12-03 17:52:30 +0000316dnl V6 headers are checked below, after we check for v6
paul7ea487b2003-03-17 02:05:07 +0000317
318dnl check some types
319AC_C_CONST
320dnl AC_TYPE_PID_T
321AC_TYPE_SIGNAL
322
323dnl Some systems (Solaris 2.x) require libnsl (Network Services Library)
324case "$host" in
paulafd8a122005-03-12 06:36:10 +0000325 [*-sunos5.[6-7]*] | [*-solaris2.[6-7]*])
paul7ea487b2003-03-17 02:05:07 +0000326 opsys=sol2-6
paulafd8a122005-03-12 06:36:10 +0000327 AC_DEFINE(SUNOS_56, 1, SunOS 5.6 to 5.7)
paul19877dd2004-05-11 10:49:35 +0000328 AC_DEFINE(SUNOS_5, 1, SunOS 5)
paul7ea487b2003-03-17 02:05:07 +0000329 AC_CHECK_LIB(xnet, main)
330 CURSES=-lcurses
331 ;;
paul1b73de82005-04-10 16:31:51 +0000332 [*-sunos5.[8-9]] \
333 | [*-sunos5.1[0-9]] \
334 | [*-sunos5.1[0-9].[0-9]] \
335 | [*-solaris2.[8-9]] \
336 | [*-solaris2.1[0-9]] \
337 | [*-solaris2.1[0-9].[0-9]])
paulafd8a122005-03-12 06:36:10 +0000338 opsys=sol8
339 AC_DEFINE(SUNOS_59,,SunOS 5.8 up)
paul19877dd2004-05-11 10:49:35 +0000340 AC_DEFINE(SUNOS_5, 1, SunOS 5)
341 AC_CHECK_LIB(socket, main)
342 AC_CHECK_LIB(nsl, main)
paul1b73de82005-04-10 16:31:51 +0000343 AC_CHECK_LIB(umem, main)
paul19877dd2004-05-11 10:49:35 +0000344 CURSES=-lcurses
345 ;;
paul7ea487b2003-03-17 02:05:07 +0000346 *-sunos5* | *-solaris2*)
paul19877dd2004-05-11 10:49:35 +0000347 AC_DEFINE(SUNOS_5,,SunOS 5, Unknown SunOS)
paul7ea487b2003-03-17 02:05:07 +0000348 AC_CHECK_LIB(socket, main)
349 AC_CHECK_LIB(nsl, main)
350 CURSES=-lcurses
351 ;;
hassoc45eb832005-02-19 13:58:06 +0000352 *-linux*)
paul7ea487b2003-03-17 02:05:07 +0000353 opsys=gnu-linux
354 AC_DEFINE(GNU_LINUX,,GNU Linux)
355 ;;
356 *-nec-sysv4*)
357 AC_CHECK_LIB(nsl, gethostbyname)
358 AC_CHECK_LIB(socket, socket)
359 ;;
360 *-freebsd3.2)
361 AC_DEFINE(FREEBSD_32,,FreeBSD 3.2)
362 ;;
363 *-openbsd*)
364 opsys=openbsd
365 AC_DEFINE(OPEN_BSD,,OpenBSD)
366 ;;
367 *-bsdi*)
368 opsys=bsdi
369 OTHER_METHOD="mtu_kvm.o"
370 AC_CHECK_LIB(kvm, main)
371 ;;
paul49e3b3c2003-10-23 20:39:50 +0000372 *-irix6.5)
pauldc7a2bf2003-10-22 00:07:44 +0000373 opsys=irix
374 AC_DEFINE(IRIX_65,,IRIX 6.5)
375 ;;
paul7ea487b2003-03-17 02:05:07 +0000376esac
377
378dnl ---------------------
379dnl Integrated VTY option
380dnl ---------------------
381case "${enable_vtysh}" in
382 "yes") VTYSH="vtysh";
383 AC_DEFINE(VTYSH,,VTY shell)
gdtfc9d0742004-06-30 14:25:12 +0000384 AC_PATH_PROG(PERL, perl)
385dnl Vtysh uses libreadline, which looks for termcap functions at
386dnl configure time. We follow readline's search order.
387dnl The required procedures are in libtermcap on NetBSD, in
388dnl [TODO] on Linux, and in [TODO] on Solaris.
389 AC_CHECK_LIB(termcap, tputs, ,
390 AC_CHECK_LIB(tinfo, tputs, ,
391 AC_CHECK_LIB(curses, tputs, ,
392 AC_CHECK_LIB(ncurses, tputs))))
paul7ea487b2003-03-17 02:05:07 +0000393 AC_CHECK_LIB(readline, main)
394 if test $ac_cv_lib_readline_main = no; then
gdtfc9d0742004-06-30 14:25:12 +0000395 AC_MSG_ERROR([vtysh needs libreadline but was not found and usable on your system.])
paul7ea487b2003-03-17 02:05:07 +0000396 fi
397 AC_CHECK_HEADER(readline/history.h)
398 if test $ac_cv_header_readline_history_h = no;then
399 AC_MSG_ERROR([readline is too old to have readline/history.h, please update to the latest readline library.])
400 fi
paul3d3de8c2003-05-23 10:33:49 +0000401 AC_CHECK_LIB(readline, rl_completion_matches)
402 if test $ac_cv_lib_readline_rl_completion_matches = no; then
403 AC_DEFINE(rl_completion_matches,completion_matches,Old readline)
404 fi
405 ;;
paul7ea487b2003-03-17 02:05:07 +0000406 "no" ) VTYSH="";;
407 * ) ;;
408esac
409
410dnl ----------
411dnl PAM module
412dnl ----------
413if test "$with_libpam" = "yes"; then
paul24cd4352003-05-06 12:16:27 +0000414 AC_CHECK_HEADER(security/pam_misc.h)
415 if test "$ac_cv_header_security_pam_misc_h" = yes; then
416 AC_DEFINE(HAVE_PAM_MISC_H,,Have pam_misc.h)
417 AC_DEFINE(PAM_CONV_FUNC,misc_conv,Have misc_conv)
418 pam_conv_func="misc_conv"
paul24cd4352003-05-06 12:16:27 +0000419 fi
paul24cd4352003-05-06 12:16:27 +0000420 AC_CHECK_HEADER(security/openpam.h)
421 if test "$ac_cv_header_security_openpam_h" = yes; then
422 AC_DEFINE(HAVE_OPENPAM_H,,Have openpam.h)
423 AC_DEFINE(PAM_CONV_FUNC,openpam_ttyconv,Have openpam_ttyconv)
424 pam_conv_func="openpam_ttyconv"
paul24cd4352003-05-06 12:16:27 +0000425 fi
426 if test -z "$ac_cv_header_security_pam_misc_h$ac_cv_header_security_openpam_h" ; then
427 AC_MSG_WARN([*** pam support will not be built ***])
428 with_libpam="no"
429 fi
430fi
431
432if test "$with_libpam" = "yes"; then
paul7ea487b2003-03-17 02:05:07 +0000433dnl took this test from proftpd's configure.in and suited to our needs
434dnl -------------------------------------------------------------------------
435dnl
436dnl This next check looks funky due to a linker problem with some versions
437dnl of the PAM library. Prior to 0.72 release, the Linux PAM shared library
438dnl omitted requiring libdl linking information. PAM-0.72 or better ships
439dnl with RedHat 6.2 and Debian 2.2 or better.
440AC_CHECK_LIB(pam, pam_start,
paul24cd4352003-05-06 12:16:27 +0000441 [AC_CHECK_LIB(pam, $pam_conv_func,
paul7ea487b2003-03-17 02:05:07 +0000442 [AC_DEFINE(USE_PAM,,Use PAM for authentication)
443 LIBPAM="-lpam"],
444 [AC_DEFINE(USE_PAM,,Use PAM for authentication)
445 LIBPAM="-lpam -lpam_misc"]
446 )
447 ],
448
449 [AC_CHECK_LIB(pam, pam_end,
paul24cd4352003-05-06 12:16:27 +0000450 [AC_CHECK_LIB(pam, $pam_conv_func,
paula159ed92003-06-04 11:01:45 +0000451 [AC_DEFINE(USE_PAM,,Use PAM for authentication)
paul7ea487b2003-03-17 02:05:07 +0000452 LIBPAM="-lpam -ldl"],
paula159ed92003-06-04 11:01:45 +0000453 [AC_DEFINE(USE_PAM,,Use PAM for authentication)
paul7ea487b2003-03-17 02:05:07 +0000454 LIBPAM="-lpam -ldl -lpam_misc"]
455 )
456 ],AC_MSG_WARN([*** pam support will not be built ***]),
457 [-ldl])
458 ]
459)
460fi
461AC_SUBST(LIBPAM)
462
463dnl -------------------------------
464dnl Endian-ness check
465dnl -------------------------------
466AC_WORDS_BIGENDIAN
467
468dnl -------------------------------
469dnl check the size in byte of the C
470dnl -------------------------------
471dnl AC_CHECK_SIZEOF(char)
472dnl AC_CHECK_SIZEOF(int)
473dnl AC_CHECK_SIZEOF(short)
474dnl AC_CHECK_SIZEOF(long)
475
476dnl ----------------------------
477dnl check existance of functions
478dnl ----------------------------
paul49e3b3c2003-10-23 20:39:50 +0000479AC_CHECK_FUNCS(memset memcpy strerror inet_aton daemon snprintf vsnprintf \
paul04bd4842003-10-24 04:24:39 +0000480 strlcat strlcpy if_nametoindex if_indextoname getifaddrs \
ajs3cb98de2005-04-02 16:01:05 +0000481 fcntl strnlen)
paula159ed92003-06-04 11:01:45 +0000482AC_CHECK_FUNCS(setproctitle, ,
483 [AC_CHECK_LIB(util, setproctitle,
484 [LIBS="$LIBS -lutil"
485 AC_DEFINE(HAVE_SETPROCTITLE,, Have setproctitle)
486 ]
487 )
488 ]
489)
paul7ea487b2003-03-17 02:05:07 +0000490
491dnl ------------------------------------
492dnl Determine routing get and set method
493dnl ------------------------------------
494AC_MSG_CHECKING(zebra between kernel interface method)
495if test x"$opsys" = x"gnu-linux"; then
496 if test "${enable_netlink}" = "yes";then
497 AC_MSG_RESULT(netlink)
498 RT_METHOD=rt_netlink.o
499 AC_DEFINE(HAVE_NETLINK,,netlink)
500 netlink=yes
501 elif test "${enable_netlink}" = "no"; then
502 AC_MSG_RESULT(ioctl)
503 RT_METHOD=rt_ioctl.o
504 netlink=no
505 else
506 AC_MSG_RESULT(netlink)
507 RT_METHOD=rt_netlink.o
508 AC_DEFINE(HAVE_NETLINK,,netlink)
509 netlink=yes
510 fi
paul19877dd2004-05-11 10:49:35 +0000511elif test x"$opsys" = x"sol2-6";then
512 AC_MSG_RESULT(Route socket)
513 KERNEL_METHOD="kernel_socket.o"
514 RT_METHOD="rt_socket.o"
paulafd8a122005-03-12 06:36:10 +0000515elif test x"$opsys" = x"sol8";then
paul19877dd2004-05-11 10:49:35 +0000516 AC_MSG_RESULT(Route socket)
517 KERNEL_METHOD="kernel_socket.o"
518 RT_METHOD="rt_socket.o"
519elif test "$opsys" = "irix" ; then
520 AC_MSG_RESULT(Route socket)
521 KERNEL_METHOD="kernel_socket.o"
522 RT_METHOD="rt_socket.o"
paul7ea487b2003-03-17 02:05:07 +0000523else
paul19877dd2004-05-11 10:49:35 +0000524 AC_TRY_RUN([#include <errno.h>
paul7ea487b2003-03-17 02:05:07 +0000525#include <sys/types.h>
526#include <sys/socket.h>
527
528main ()
529{
530 int ac_sock;
531
532 ac_sock = socket (AF_ROUTE, SOCK_RAW, 0);
533 if (ac_sock < 0 && errno == EINVAL)
534 exit (1);
535 exit (0);
536}],
537 [KERNEL_METHOD=kernel_socket.o
538 RT_METHOD=rt_socket.o
539 AC_MSG_RESULT(socket)],
540 [RT_METHOD=rt_ioctl.o
541 AC_MSG_RESULT(ioctl)],
542 [KERNEL_METHOD=kernel_socket.o
543 RT_METHOD=rt_socket.o
544 AC_MSG_RESULT(socket)])
paul7ea487b2003-03-17 02:05:07 +0000545fi
546AC_SUBST(RT_METHOD)
547AC_SUBST(KERNEL_METHOD)
548AC_SUBST(OTHER_METHOD)
549
ajsb99760a2005-01-04 16:24:43 +0000550dnl ------------------------------------
551dnl check for broken CMSG_FIRSTHDR macro
552dnl ------------------------------------
gdt6c200462005-01-04 17:02:48 +0000553AC_MSG_CHECKING(for broken CMSG_FIRSTHDR)
hasso5b087522005-04-03 23:46:37 +0000554AC_RUN_IFELSE([AC_LANG_SOURCE([[
ajsb99760a2005-01-04 16:24:43 +0000555#ifdef SUNOS_5
556#define _XPG4_2
557#define __EXTENSIONS__
558#endif
559#include <stdlib.h>
560#include <sys/types.h>
561#include <sys/socket.h>
562
563main()
564{
565 struct msghdr msg;
566 char buf[4];
567
568 msg.msg_control = buf;
569 msg.msg_controllen = 0;
570
571 if (CMSG_FIRSTHDR(&msg) != NULL)
572 exit(0);
573 exit (1);
hasso5b087522005-04-03 23:46:37 +0000574}]])],[AC_MSG_RESULT(yes - using workaround) AC_DEFINE(HAVE_BROKEN_CMSG_FIRSTHDR,,Broken CMSG_FIRSTHDR)],
hassod33e8d72005-04-03 13:07:21 +0000575[AC_MSG_RESULT(no)],[AC_MSG_RESULT(no)])
ajsb99760a2005-01-04 16:24:43 +0000576
paul7ea487b2003-03-17 02:05:07 +0000577dnl ------------------------------
578dnl check kernel route read method
579dnl ------------------------------
580AC_CACHE_CHECK(route read method check, zebra_rtread,
581[if test "$netlink" = yes; then
582 RTREAD_METHOD="rtread_netlink.o"
583 zebra_rtread="netlink"
584else
585for zebra_rtread in /proc/net/route /dev/ip /dev/null;
586do
587 test x`ls $zebra_rtread 2>/dev/null` = x"$zebra_rtread" && break
588done
589case $zebra_rtread in
590 "/proc/net/route") RTREAD_METHOD="rtread_proc.o"
591 zebra_rtread="proc";;
paul9c30ab62003-07-08 08:36:17 +0000592 "/dev/ip")
593 case "$host" in
594 *-freebsd*) RTREAD_METHOD=rtread_sysctl.o
595 zebra_rtread="sysctl";;
596 *) RTREAD_METHOD="rtread_getmsg.o"
597 zebra_rtread="getmsg";;
598 esac;;
paul7ea487b2003-03-17 02:05:07 +0000599 *) RTREAD_METHOD="rtread_sysctl.o"
600 zebra_rtread="sysctl";;
601esac
602fi])
603AC_SUBST(RTREAD_METHOD)
604
605dnl -----------------------------
606dnl check interface lookup method
607dnl -----------------------------
paul19877dd2004-05-11 10:49:35 +0000608IOCTL_METHOD=ioctl.o
paul7ea487b2003-03-17 02:05:07 +0000609AC_MSG_CHECKING(interface looking up method)
610if test "$netlink" = yes; then
611 AC_MSG_RESULT(netlink)
612 IF_METHOD=if_netlink.o
paul19877dd2004-05-11 10:49:35 +0000613elif test "$opsys" = "sol2-6";then
614 AC_MSG_RESULT(Solaris GIF)
615 IF_METHOD=if_ioctl.o
paulafd8a122005-03-12 06:36:10 +0000616elif test "$opsys" = "sol8";then
paul19877dd2004-05-11 10:49:35 +0000617 AC_MSG_RESULT(Solaris GLIF)
618 IF_METHOD=if_ioctl_solaris.o
619 IOCTL_METHOD=ioctl_solaris.o
620elif test "$opsys" = "irix" ; then
621 AC_MSG_RESULT(IRIX)
622 IF_METHOD=if_ioctl.o
623elif test "$opsys" = "openbsd";then
624 AC_MSG_RESULT(openbsd)
625 IF_METHOD=if_ioctl.o
626elif grep NET_RT_IFLIST /usr/include/sys/socket.h >/dev/null 2>&1; then
627 AC_MSG_RESULT(sysctl)
paul7ea487b2003-03-17 02:05:07 +0000628 IF_METHOD=if_sysctl.o
629 AC_DEFINE(HAVE_NET_RT_IFLIST,,NET_RT_IFLIST)
paul19877dd2004-05-11 10:49:35 +0000630else
paul7ea487b2003-03-17 02:05:07 +0000631 AC_MSG_RESULT(ioctl)
632 IF_METHOD=if_ioctl.o
paul7ea487b2003-03-17 02:05:07 +0000633fi
634AC_SUBST(IF_METHOD)
paul19877dd2004-05-11 10:49:35 +0000635AC_SUBST(IOCTL_METHOD)
paul7ea487b2003-03-17 02:05:07 +0000636
637dnl -----------------------
638dnl check proc file system.
639dnl -----------------------
640if test -r /proc/net/dev; then
641 AC_DEFINE(HAVE_PROC_NET_DEV,,/proc/net/dev)
642 IF_PROC=if_proc.o
643fi
644
645if test -r /proc/net/if_inet6; then
646 AC_DEFINE(HAVE_PROC_NET_IF_INET6,,/proc/net/if_inet6)
647 IF_PROC=if_proc.o
648fi
649AC_SUBST(IF_PROC)
650
651dnl -----------------------------
652dnl check ipforward detect method
653dnl -----------------------------
654AC_CACHE_CHECK(ipforward method check, zebra_ipforward_path,
655[for zebra_ipforward_path in /proc/net/snmp /dev/ip /dev/null;
656do
657 test x`ls $zebra_ipforward_path 2>/dev/null` = x"$zebra_ipforward_path" && break
658done
659case $zebra_ipforward_path in
660 "/proc/net/snmp") IPFORWARD=ipforward_proc.o
661 zebra_ipforward_path="proc";;
662 "/dev/ip")
663 case "$host" in
664 *-nec-sysv4*) IPFORWARD=ipforward_ews.o
665 zebra_ipforward_path="ews";;
paul9c30ab62003-07-08 08:36:17 +0000666 *-freebsd*) IPFORWARD=ipforward_sysctl.o
667 zebra_ipforward_path="sysctl";;
paul7ea487b2003-03-17 02:05:07 +0000668 *) IPFORWARD=ipforward_solaris.o
669 zebra_ipforward_path="solaris";;
670 esac;;
671 *) IPFORWARD=ipforward_sysctl.o
672 zebra_ipforward_path="sysctl";;
673esac])
674AC_SUBST(IPFORWARD)
675
676AC_CHECK_FUNCS(getaddrinfo, [have_getaddrinfo=yes], [have_getaddrinfo=no])
677
678dnl ----------
679dnl IPv6 check
680dnl ----------
681AC_MSG_CHECKING(whether does this OS have IPv6 stack)
682if test "${enable_ipv6}" = "no"; then
683 AC_MSG_RESULT(disabled)
684else
685dnl ----------
686dnl INRIA IPv6
687dnl ----------
paula159ed92003-06-04 11:01:45 +0000688 if grep IPV6_INRIA_VERSION /usr/include/netinet/in.h >/dev/null 2>&1; then
689 zebra_cv_ipv6=yes
690 AC_DEFINE(HAVE_IPV6,1,INRIA IPv6)
691 AC_DEFINE(INRIA_IPV6,1,INRIA IPv6)
692 RIPNGD="ripngd"
693 OSPF6D="ospf6d"
694 LIB_IPV6=""
695 AC_MSG_RESULT(INRIA IPv6)
paul7ea487b2003-03-17 02:05:07 +0000696dnl ---------
697dnl KAME IPv6
698dnl ---------
paula159ed92003-06-04 11:01:45 +0000699 elif grep WIDE /usr/include/netinet6/in6.h >/dev/null 2>&1; then
700 zebra_cv_ipv6=yes
701 AC_DEFINE(HAVE_IPV6,1,KAME IPv6)
702 AC_DEFINE(KAME,1,KAME IPv6)
703 RIPNGD="ripngd"
704 OSPF6D="ospf6d"
705 if test -d /usr/local/v6/lib -a -f /usr/local/v6/lib/libinet6.a; then
paul7ea487b2003-03-17 02:05:07 +0000706 LIB_IPV6="-L/usr/local/v6/lib -linet6"
paula159ed92003-06-04 11:01:45 +0000707 fi
708 AC_MSG_RESULT(KAME)
hasso71c0fb52003-05-25 20:18:13 +0000709dnl -------------------------
710dnl MUSICA IPv6
711dnl default host check
712dnl It is not used by Kheops
713dnl -------------------------
paula159ed92003-06-04 11:01:45 +0000714 elif grep MUSICA /usr/include6/netinet6/in6.h >/dev/null 2>&1; then
715 zebra_cv_ipv6=yes
716 AC_DEFINE(HAVE_IPV6,1,Musicia IPv6)
717 AC_DEFINE(MUSICA,1,Musica IPv6 stack)
718 AC_DEFINE(KAME,1,KAME IPv6 stack)
719 RIPNGD="ripngd"
720 OSPF6D="ospf6d"
721 if test -d /usr/local/v6/lib -a -f /usr/local/v6/lib/libinet6.a; then
hasso71c0fb52003-05-25 20:18:13 +0000722 LIB_IPV6="-L/usr/local/v6/lib -linet6"
paula159ed92003-06-04 11:01:45 +0000723 fi
724 AC_MSG_RESULT(MUSICA)
paul7ea487b2003-03-17 02:05:07 +0000725dnl ---------
726dnl NRL check
727dnl ---------
paula159ed92003-06-04 11:01:45 +0000728 elif grep NRL /usr/include/netinet6/in6.h >/dev/null 2>&1; then
729 zebra_cv_ipv6=yes
730 AC_DEFINE(HAVE_IPV6,1,NRL IPv6)
731 AC_DEFINE(NRL,1,NRL)
732 RIPNGD="ripngd"
733 OSPF6D="ospf6d"
734 if test x"$opsys" = x"bsdi";then
paul7ea487b2003-03-17 02:05:07 +0000735 AC_DEFINE(BSDI_NRL,,BSDI)
736 AC_MSG_RESULT(BSDI_NRL)
paula159ed92003-06-04 11:01:45 +0000737 else
paul7ea487b2003-03-17 02:05:07 +0000738 AC_MSG_RESULT(NRL)
paula159ed92003-06-04 11:01:45 +0000739 fi
paul19877dd2004-05-11 10:49:35 +0000740dnl ------------------------------------
741dnl Solaris 9, 10 and potentially higher
742dnl ------------------------------------
paulafd8a122005-03-12 06:36:10 +0000743 elif test x"$opsys" = x"sol8"; then
paul19877dd2004-05-11 10:49:35 +0000744 zebra_cv_ipv6=yes;
745 AC_DEFINE(HAVE_IPV6, 1, IPv6)
746 AC_DEFINE(SOLARIS_IPV6, 1, Solaris IPv6)
747 RIPNGD="ripngd"
748 OSPF6D="ospf6d"
749 AC_MSG_RESULT(Solaris IPv6)
paul7ea487b2003-03-17 02:05:07 +0000750dnl ----------
751dnl Linux IPv6
752dnl ----------
paula159ed92003-06-04 11:01:45 +0000753 elif test "${enable_ipv6}" = "yes"; then
754 AC_EGREP_CPP(yes, [
755 #include <linux/version.h>
756 /* 2.1.128 or later */
757 #if LINUX_VERSION_CODE >= 0x020180
758 yes
759 #endif],
760 [zebra_cv_ipv6=yes
761 zebra_cv_linux_ipv6=yes
762 AC_MSG_RESULT(Linux IPv6)])
763 else
764 if test x`ls /proc/net/ipv6_route 2>/dev/null` = x"/proc/net/ipv6_route"
765 then
paul7ea487b2003-03-17 02:05:07 +0000766 zebra_cv_ipv6=yes
767 zebra_cv_linux_ipv6=yes
768 AC_MSG_RESULT(Linux IPv6)
paula159ed92003-06-04 11:01:45 +0000769 fi
770 fi
paul7ea487b2003-03-17 02:05:07 +0000771
paula159ed92003-06-04 11:01:45 +0000772 if test "$zebra_cv_linux_ipv6" = "yes";then
773 AC_MSG_CHECKING(for GNU libc >= 2.1)
774 AC_DEFINE(HAVE_IPV6,1,Linux IPv6)
775 AC_EGREP_CPP(yes, [
paul7ea487b2003-03-17 02:05:07 +0000776#include <features.h>
777#if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1
778 yes
paula159ed92003-06-04 11:01:45 +0000779#endif],
780 [glibc=yes
781 AC_DEFINE(LINUX_IPV6,1,Linux IPv6 stack)
782 AC_MSG_RESULT(yes)],
783 AC_MSG_RESULT(no)
784 )
785 RIPNGD="ripngd"
786 OSPF6D="ospf6d"
787 if test "$glibc" != "yes"; then
paul7ea487b2003-03-17 02:05:07 +0000788 INCLUDES="-I/usr/inet6/include"
789 if test x`ls /usr/inet6/lib/libinet6.a 2>/dev/null` != x;then
790 LIB_IPV6="-L/usr/inet6/lib -linet6"
791 fi
paula159ed92003-06-04 11:01:45 +0000792 fi
793 fi
paul7ea487b2003-03-17 02:05:07 +0000794
795dnl -----------------------
796dnl Set IPv6 related values
797dnl -----------------------
paula159ed92003-06-04 11:01:45 +0000798 LIBS="$LIB_IPV6 $LIBS"
799 AC_SUBST(LIB_IPV6)
paul7ea487b2003-03-17 02:05:07 +0000800
paula159ed92003-06-04 11:01:45 +0000801 if test x"$RIPNGD" = x""; then
802 AC_MSG_RESULT(IPv4 only)
803 fi
paul7ea487b2003-03-17 02:05:07 +0000804fi
805
gdtfa3232e2003-12-03 17:52:30 +0000806dnl ------------------
807dnl IPv6 header checks
808dnl ------------------
809if test "x${zebra_cv_ipv6}" = "xyes"; then
810AC_CHECK_HEADERS([netinet6/in6.h netinet/in6_var.h netinet/icmp6.h \
811 netinet6/in6_var.h netinet6/nd6.h])
812fi
813
paul7ea487b2003-03-17 02:05:07 +0000814dnl --------------------
815dnl Daemon disable check
816dnl --------------------
817if test "${enable_zebra}" = "no";then
818 ZEBRA=""
819else
820 ZEBRA="zebra"
821fi
822
823if test "${enable_bgpd}" = "no";then
824 BGPD=""
825else
826 BGPD="bgpd"
827fi
828
829if test "${enable_ripd}" = "no";then
830 RIPD=""
831else
832 RIPD="ripd"
833fi
834
835if test "${enable_ospfd}" = "no";then
836 OSPFD=""
837else
838 OSPFD="ospfd"
839fi
840
ajsd0199432004-12-22 14:03:52 +0000841if test "${enable_watchquagga}" = "no";then
842 WATCHQUAGGA=""
843else
844 WATCHQUAGGA="watchquagga"
845fi
846
paul1ef74ef2003-03-21 15:16:05 +0000847OSPFCLIENT=""
848if test "${enable_opaque_lsa}" = "yes"; then
849 if test "${enable_ospfapi}" != "no";then
paul9a569842003-03-28 01:45:13 +0000850 AC_DEFINE(SUPPORT_OSPF_API,,OSPFAPI)
paul1ef74ef2003-03-21 15:16:05 +0000851
852 if test "${enable_ospfclient}" != "no";then
853 OSPFCLIENT="ospfclient"
854 fi
855 fi
856
paul7ea487b2003-03-17 02:05:07 +0000857fi
858
859case "${enable_ripngd}" in
860 "yes") RIPNGD="ripngd";;
861 "no" ) RIPNGD="";;
862 * ) ;;
863esac
864
865case "${enable_ospf6d}" in
866 "yes") OSPF6D="ospf6d";;
867 "no" ) OSPF6D="";;
868 * ) ;;
869esac
870
jardin9e867fe2003-12-23 08:56:18 +0000871case "${enable_isisd}" in
872 "yes") ISISD="isisd";;
873 "no" ) ISISD="";;
hassoae399ab2004-09-13 20:22:18 +0000874 * ) ;;
jardin9e867fe2003-12-23 08:56:18 +0000875esac
876
paul7ea487b2003-03-17 02:05:07 +0000877if test "${enable_bgp_announce}" = "no";then
878 AC_DEFINE(DISABLE_BGP_ANNOUNCE,,Disable BGP installation to zebra)
879fi
880
881AC_SUBST(ZEBRA)
882AC_SUBST(BGPD)
883AC_SUBST(RIPD)
884AC_SUBST(RIPNGD)
885AC_SUBST(OSPFD)
886AC_SUBST(OSPF6D)
ajsd0199432004-12-22 14:03:52 +0000887AC_SUBST(WATCHQUAGGA)
jardin9e867fe2003-12-23 08:56:18 +0000888AC_SUBST(ISISD)
paul7ea487b2003-03-17 02:05:07 +0000889AC_SUBST(VTYSH)
890AC_SUBST(INCLUDES)
891AC_SUBST(CURSES)
892AC_SUBST(OSPFCLIENT)
paul1ef74ef2003-03-21 15:16:05 +0000893AC_SUBST(OSPFAPI)
paul7ea487b2003-03-17 02:05:07 +0000894AC_CHECK_LIB(c, inet_ntop, [AC_DEFINE(HAVE_INET_NTOP,,inet_ntop)])
895AC_CHECK_LIB(c, inet_pton, [AC_DEFINE(HAVE_INET_PTON,,inet_pton)])
896AC_CHECK_LIB(crypt, crypt)
897AC_CHECK_LIB(resolv, res_init)
898AC_CHECK_LIB(m, main)
899
900dnl ---------------------------------------------------
901dnl BSD/OS 4.1 define inet_XtoY function as __inet_XtoY
902dnl ---------------------------------------------------
paula159ed92003-06-04 11:01:45 +0000903AC_CHECK_FUNC(__inet_ntop, AC_DEFINE(HAVE_INET_NTOP,,__inet_ntop))
904AC_CHECK_FUNC(__inet_pton, AC_DEFINE(HAVE_INET_PTON,,__inet_pton))
905AC_CHECK_FUNC(__inet_aton, AC_DEFINE(HAVE_INET_ATON,,__inet_aton))
paul7ea487b2003-03-17 02:05:07 +0000906
907dnl ---------------------------
908dnl check system has GNU regexp
909dnl ---------------------------
910dnl AC_MSG_CHECKING(whether system has GNU regex)
911AC_CHECK_LIB(c, regexec,
912[AC_DEFINE(HAVE_GNU_REGEX,,GNU regexp library)
913 LIB_REGEX=""],
914[LIB_REGEX="regex.o"])
915AC_SUBST(LIB_REGEX)
916
917dnl ------------------
918dnl check SNMP library
919dnl ------------------
920if test "${enable_snmp}" = "yes";then
921dnl AC_CHECK_LIB(snmp, asn_parse_int, HAVE_SNMP=yes)
paul7ea487b2003-03-17 02:05:07 +0000922 if test "${HAVE_SNMP}" = ""; then
paul1ef74ef2003-03-21 15:16:05 +0000923 old_libs="${LIBS}"
924 LIBS="-L/usr/lib"
paul7ea487b2003-03-17 02:05:07 +0000925 unset ac_cv_lib_snmp_asn_parse_int
paul1ef74ef2003-03-21 15:16:05 +0000926 AC_CHECK_LIB(crypto, main, NEED_CRYPTO=yes, )
927 if test "${NEED_CRYPTO}" = ""; then
928 AC_CHECK_LIB(netsnmp, asn_parse_int, [HAVE_NETSNMP=yes; HAVE_SNMP=yes ])
929 else
930 AC_CHECK_LIB(netsnmp, asn_parse_int, [HAVE_NETSNMP=yes; HAVE_SNMP=yes; NEED_CRYPTO=yes;LIBS="$LIBS -lcrypto" ],,"-lcrypto")
931 fi
932 LIBS="${old_libs}"
paul7ea487b2003-03-17 02:05:07 +0000933 fi
paul1ef74ef2003-03-21 15:16:05 +0000934 if test "${HAVE_SNMP}" = ""; then
935 old_libs="${LIBS}"
936 LIBS="-L/usr/lib"
937 unset ac_cv_lib_snmp_asn_parse_int
938 AC_CHECK_LIB(snmp, asn_parse_int, HAVE_SNMP=yes, )
939 if test "${HAVE_SNMP}" = ""; then
940 unset ac_cv_lib_snmp_asn_parse_int
941 AC_CHECK_LIB(crypto, main, NEED_CRYPTO=yes, )
942 if test "${NEED_CRYPTO}" = "yes"; then
943 AC_CHECK_LIB(snmp, asn_parse_int, [HAVE_SNMP=yes; NEED_CRYPTO=yes; LIBS="$LIBS -lcrypto" ],,"-lcrypto")
944 fi
945 fi
946 LIBS="${old_libs}"
947 fi
paul7ea487b2003-03-17 02:05:07 +0000948
949 if test "${HAVE_SNMP}" = ""; then
paul1ef74ef2003-03-21 15:16:05 +0000950 old_libs="${LIBS}"
951 LIBS="-L/usr/local/lib"
952 unset ac_cv_lib_snmp_asn_parse_int
953 AC_CHECK_LIB(snmp, asn_parse_int, HAVE_SNMP=yes)
954 if test "${HAVE_SNMP}" = ""; then
955 unset ac_cv_lib_snmp_asn_parse_int
956 AC_CHECK_LIB(crypto, main, NEED_CRYPTO=yes, )
957 if test "${NEED_CRYPTO}" = "yes"; then
958 AC_CHECK_LIB(snmp, asn_parse_int, [HAVE_SNMP=yes; NEED_CRYPTO=yes; LIBS="$LIBS -lcrypto" ],,"-lcrypto")
959 fi
960 fi
961 LIBS="${old_libs}"
paul7ea487b2003-03-17 02:05:07 +0000962 fi
paul1ef74ef2003-03-21 15:16:05 +0000963
paul7ea487b2003-03-17 02:05:07 +0000964 if test "${HAVE_SNMP}" = "yes"; then
965 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
966 do
967 test -f "${ac_snmp}" && break
968 done
paul1ef74ef2003-03-21 15:16:05 +0000969
paul7ea487b2003-03-17 02:05:07 +0000970 case ${ac_snmp} in
971 /usr/include/net-snmp/*)
972 AC_DEFINE(HAVE_SNMP,,SNMP)
paul1ef74ef2003-03-21 15:16:05 +0000973 AC_DEFINE(HAVE_NETSNMP,,SNMP)
paul7ea487b2003-03-17 02:05:07 +0000974 AC_DEFINE(UCD_COMPATIBLE,,SNMP)
hasso2d582282005-03-28 15:29:07 +0000975 SNMP_INCLUDES="${SNMP_INCLUDES} -I/usr/include/net-snmp -I/usr/include/net-snmp/library"
paulac7c4bb2003-03-19 04:25:08 +0000976 if test "${HAVE_NETSNMP}" = "yes"; then
paul1ef74ef2003-03-21 15:16:05 +0000977 LIBS="${LIBS} -lnetsnmp"
paulac7c4bb2003-03-19 04:25:08 +0000978 else
paul1ef74ef2003-03-21 15:16:05 +0000979 LIBS="${LIBS} -lsnmp"
paulac7c4bb2003-03-19 04:25:08 +0000980 fi
paul7ea487b2003-03-17 02:05:07 +0000981 ;;
982 /usr/include/ucd-snmp/*)
983 AC_DEFINE(HAVE_SNMP,,SNMP)
hasso2d582282005-03-28 15:29:07 +0000984 SNMP_INCLUDES="${SNMP_INCLUDES} -I/usr/include/ucd-snmp"
paul7ea487b2003-03-17 02:05:07 +0000985 LIBS="${LIBS} -lsnmp"
986 ;;
987 /usr/local/include/ucd-snmp/*)
988 AC_DEFINE(HAVE_SNMP,,SNMP)
hasso2d582282005-03-28 15:29:07 +0000989 SNMP_INCLUDES="${SNMP_INCLUDES} -I/usr/local/include/ucd-snmp"
paul7ea487b2003-03-17 02:05:07 +0000990 LIBS="${LIBS} -L/usr/local/lib -lsnmp"
991 ;;
paulf3bd1a72003-11-02 07:29:11 +0000992 /usr/local/include/net-snmp/*)
993 AC_DEFINE(HAVE_SNMP,,SNMP)
994 AC_DEFINE(HAVE_NET_SNMP,,SNMP)
995 AC_DEFINE(UCD_COMPATIBLE,,SNMP)
hasso2d582282005-03-28 15:29:07 +0000996 SNMP_INCLUDES="${SNMP_INCLUDES} -I/usr/local/include/net-snmp"
paulf3bd1a72003-11-02 07:29:11 +0000997 LIBS="${LIBS} -L/usr/local/lib -lnetsnmp"
998 ;;
paul7ea487b2003-03-17 02:05:07 +0000999 esac
1000 if test "${NEED_CRYPTO}" = "yes"; then
1001 LIBS="${LIBS} -lcrypto"
1002 fi
1003 fi
1004fi
1005
ajs6cf9df02005-01-12 16:52:55 +00001006if test "${enable_snmp}" = "yes" -a "${HAVE_SNMP}" != "yes"; then
1007 AC_MSG_ERROR([--enable-snmp given, but cannot find support for SNMP])
1008fi
1009
hasso2d582282005-03-28 15:29:07 +00001010AC_SUBST(SNMP_INCLUDES)
1011
paul7ea487b2003-03-17 02:05:07 +00001012dnl ----------------------------
1013dnl check sa_len of sockaddr
1014dnl ----------------------------
1015AC_MSG_CHECKING(whether struct sockaddr has a sa_len field)
1016AC_TRY_COMPILE([#include <sys/types.h>
1017#include <sys/socket.h>
1018],[static struct sockaddr ac_i;int ac_j = sizeof (ac_i.sa_len);],
1019[AC_MSG_RESULT(yes)
1020 AC_DEFINE(HAVE_SA_LEN,,sa_len)],
1021 AC_MSG_RESULT(no))
1022
1023dnl ----------------------------
1024dnl check sin_len of sockaddr_in
1025dnl ----------------------------
1026AC_MSG_CHECKING(whether struct sockaddr_in has a sin_len field)
1027AC_TRY_COMPILE([#include <sys/types.h>
1028#include <netinet/in.h>
1029],[static struct sockaddr_in ac_i;int ac_j = sizeof (ac_i.sin_len);],
1030[AC_MSG_RESULT(yes)
1031 AC_DEFINE(HAVE_SIN_LEN,,sin_len)],
1032 AC_MSG_RESULT(no))
1033
1034dnl ----------------------------
1035dnl check sun_len of sockaddr_un
1036dnl ----------------------------
1037AC_MSG_CHECKING(whether struct sockaddr_un has a sun_len field)
1038AC_TRY_COMPILE([#include <sys/types.h>
1039#include <sys/un.h>
1040],[static struct sockaddr_un ac_i;int ac_j = sizeof (ac_i.sun_len);],
1041[AC_MSG_RESULT(yes)
1042 AC_DEFINE(HAVE_SUN_LEN,,sun_len)],
1043 AC_MSG_RESULT(no))
1044
1045dnl -----------------------------------
1046dnl check sin6_scope_id of sockaddr_in6
1047dnl -----------------------------------
1048if test "$zebra_cv_ipv6" = yes; then
1049 AC_MSG_CHECKING(whether struct sockaddr_in6 has a sin6_scope_id field)
1050 AC_TRY_COMPILE([#include <sys/types.h>
1051#include <netinet/in.h>
1052],[static struct sockaddr_in6 ac_i;int ac_j = sizeof (ac_i.sin6_scope_id);],
1053[AC_MSG_RESULT(yes)
1054 AC_DEFINE(HAVE_SIN6_SCOPE_ID,,scope id)],
1055 AC_MSG_RESULT(no))
1056fi
1057
1058dnl ----------------------------
1059dnl check socklen_t exist or not
1060dnl ----------------------------
1061AC_MSG_CHECKING(whther socklen_t is defined)
1062AC_TRY_COMPILE([#include <sys/types.h>
1063#include <sys/socket.h>
1064#include <netinet/in.h>
1065],[socklen_t ac_x;],
1066[AC_MSG_RESULT(yes)
1067 AC_DEFINE(HAVE_SOCKLEN_T,,socklen_t)],
1068 AC_MSG_RESULT(no))
1069
1070dnl ------------------------
1071dnl check struct sockaddr_dl
1072dnl ------------------------
1073AC_MSG_CHECKING(whether struct sockaddr_dl exist)
1074AC_EGREP_HEADER(sockaddr_dl,
1075net/if_dl.h,
1076[AC_MSG_RESULT(yes)
1077 AC_DEFINE(HAVE_SOCKADDR_DL,,sockaddr_dl)],
1078 AC_MSG_RESULT(no))
1079
1080dnl --------------------------
1081dnl check structure ifaliasreq
1082dnl --------------------------
1083AC_MSG_CHECKING(whether struct ifaliasreq exist)
1084AC_EGREP_HEADER(ifaliasreq,
1085net/if.h,
1086[AC_MSG_RESULT(yes)
1087 AC_DEFINE(HAVE_IFALIASREQ,,ifaliasreq)],
1088 AC_MSG_RESULT(no))
1089
1090dnl ----------------------------
1091dnl check structure in6_aliasreq
1092dnl ----------------------------
hasso71c0fb52003-05-25 20:18:13 +00001093AC_MSG_CHECKING(whether struct in6_aliasreq exist)
paul7ea487b2003-03-17 02:05:07 +00001094AC_EGREP_HEADER(in6_aliasreq,
1095netinet6/in6_var.h,
1096[AC_MSG_RESULT(yes)
1097 AC_DEFINE(HAVE_IN6_ALIASREQ,,in6_aliasreq)],
1098 AC_MSG_RESULT(no))
1099
hasso71c0fb52003-05-25 20:18:13 +00001100dnl -----------------------------------
1101dnl check ifra_lifetime of in6_aliasreq
1102dnl -----------------------------------
1103AC_MSG_CHECKING(whether in6_aliasreq.ifra_lifetime exist)
1104AC_TRY_COMPILE([#include <sys/types.h>
1105#include <netinet6/in6_var.h>
1106],[static struct if6_aliasreq ac_i;int ac_j = sizeof (ac_i.ifra_lifetime);],
1107[AC_MSG_RESULT(yes)
paula159ed92003-06-04 11:01:45 +00001108 AC_DEFINE(HAVE_IFRA_LIFETIME,,Have in6_aliasreq.ifra_lifetime)],
hasso71c0fb52003-05-25 20:18:13 +00001109 AC_MSG_RESULT(no))
1110
paul7ea487b2003-03-17 02:05:07 +00001111dnl ---------------------------
1112dnl check structure rt_addrinfo
1113dnl ---------------------------
1114AC_MSG_CHECKING(whether struct rt_addrinfo exist)
1115AC_EGREP_HEADER(rt_addrinfo,
1116net/route.h,
1117[AC_MSG_RESULT(yes)
1118 AC_DEFINE(HAVE_RT_ADDRINFO,,rt_addrinfo)],
1119 AC_MSG_RESULT(no))
1120
1121dnl --------------------------
1122dnl check structure in_pktinfo
1123dnl --------------------------
1124AC_MSG_CHECKING(whether struct in_pktinfo exist)
1125AC_TRY_COMPILE([#include <netinet/in.h>
1126],[struct in_pktinfo ac_x;],
1127[AC_MSG_RESULT(yes)
1128 AC_DEFINE(HAVE_INPKTINFO,,in_pktinfo)],
1129 AC_MSG_RESULT(no))
1130
vincent29c4c9b2005-03-25 13:05:47 +00001131dnl ----------------------------------
1132dnl check struct nd_opt_homeagent_info
1133dnl ----------------------------------
1134AC_MSG_CHECKING(whether struct nd_opt_homeagent_info exist)
1135AC_EGREP_HEADER(nd_opt_homeagent_info,
1136netinet/icmp6.h,
1137[AC_MSG_RESULT(yes)
1138 AC_DEFINE(HAVE_ND_OPT_HOMEAGENT_INFO,,nd_opt_homeagent_info)],
1139 AC_MSG_RESULT(no))
1140
1141dnl --------------------------------
1142dnl check struct nd_opt_adv_interval
1143dnl --------------------------------
1144AC_MSG_CHECKING(whether struct nd_opt_adv_interval exist)
1145AC_EGREP_HEADER(nd_opt_adv_interval,
1146netinet/icmp6.h,
1147[AC_MSG_RESULT(yes)
1148 AC_DEFINE(HAVE_ND_OPT_ADV_INTERVAL,,nd_opt_adv_interval)],
1149 AC_MSG_RESULT(no))
1150
1151dnl ------------------------------------
1152dnl check fields in nd_opt_adv_interval
1153dnl ------------------------------------
1154AC_MSG_CHECKING(whether nd_opt_ai_type field exist)
1155AC_EGREP_HEADER(nd_opt_ai_type,
1156netinet/icmp6.h,
1157[AC_MSG_RESULT(yes)
1158 AC_DEFINE(HAVE_ND_OPT_ADV_INTERVAL_AI_FIELDS,,nd_opt_ai_type)],
1159 AC_MSG_RESULT(no))
1160
paul7ea487b2003-03-17 02:05:07 +00001161dnl --------------------------------------
1162dnl checking for getrusage struct and call
1163dnl --------------------------------------
1164AC_MSG_CHECKING(whether getrusage is available)
1165AC_TRY_COMPILE([#include <sys/resource.h>
1166],[struct rusage ac_x; getrusage (RUSAGE_SELF, &ac_x);],
1167[AC_MSG_RESULT(yes)
1168 AC_DEFINE(HAVE_RUSAGE,,rusage)],
1169 AC_MSG_RESULT(no))
1170
pauledd7c242003-06-04 13:59:38 +00001171dnl -------------------
1172dnl capabilities checks
1173dnl -------------------
hasso41d3fc92004-04-06 11:59:00 +00001174if test "${enable_capabilities}" != "no"; then
1175 AC_MSG_CHECKING(whether prctl PR_SET_KEEPCAPS is available)
1176 AC_TRY_COMPILE([#include <sys/prctl.h>],[prctl(PR_SET_KEEPCAPS, 1, 0, 0, 0);],
1177 [AC_MSG_RESULT(yes)
1178 AC_DEFINE(HAVE_PR_SET_KEEPCAPS,,prctl)
1179 quagga_ac_keepcaps="yes"],
1180 AC_MSG_RESULT(no)
pauledd7c242003-06-04 13:59:38 +00001181 )
hasso41d3fc92004-04-06 11:59:00 +00001182 if test x"${quagga_ac_keepcaps}" = x"yes"; then
1183 AC_CHECK_HEADERS(sys/capability.h)
1184 fi
1185 if test x"${ac_cv_header_sys_capability_h}" = x"yes"; then
1186 AC_CHECK_LIB(cap, cap_init,
1187 [AC_DEFINE(HAVE_LCAPS,1,Capabilities)
1188 LIBCAP="-lcap"
1189 ]
1190 )
1191 fi
pauledd7c242003-06-04 13:59:38 +00001192fi
1193AC_SUBST(LIBCAP)
1194
ajs40abf232005-01-12 17:27:27 +00001195dnl -------------------
1196dnl test for ucontext.h
1197dnl -------------------
1198AC_CHECK_HEADERS(ucontext.h)
1199
paulfb2d1502003-06-04 09:40:54 +00001200dnl ---------------------------
1201dnl check for glibc 'backtrace'
1202dnl ---------------------------
1203if test "${glibc}" = "yes"; then
1204 AC_CHECK_HEADER(execinfo.h)
1205fi
1206if test x"${ac_cv_header_execinfo_h}" = x"yes"; then
1207 AC_CHECK_FUNC(backtrace,
1208 [AC_DEFINE(HAVE_GLIBC_BACKTRACE,,Glibc backtrace)]
1209 )
1210fi
1211
paul408ad942003-05-20 00:03:33 +00001212dnl ----------
1213dnl configure date
1214dnl ----------
1215CONFDATE=`date '+%Y%m%d'`
1216AC_SUBST(CONFDATE)
1217
paul7ea487b2003-03-17 02:05:07 +00001218dnl ------------------------------
paula159ed92003-06-04 11:01:45 +00001219dnl set paths for state directory
paul23bd12c2003-04-07 06:11:09 +00001220dnl ------------------------------
1221if test "${prefix}" = "NONE"; then
paule8f29842003-08-12 13:08:31 +00001222 quagga_statedir_prefix="";
paul23bd12c2003-04-07 06:11:09 +00001223else
paule8f29842003-08-12 13:08:31 +00001224 quagga_statedir_prefix=${prefix}
paul23bd12c2003-04-07 06:11:09 +00001225fi
1226if test "${localstatedir}" = '${prefix}/var'; then
paula159ed92003-06-04 11:01:45 +00001227 AC_CACHE_CHECK(state directory,ac_statedir,
paule8f29842003-08-12 13:08:31 +00001228 [for QUAGGA_STATE_DIR in ${quagga_statedir_prefix}/var/run dnl
1229 ${quagga_statedir_prefix}/var/adm dnl
1230 ${quagga_statedir_prefix}/etc dnl
paula159ed92003-06-04 11:01:45 +00001231 /var/run dnl
1232 /var/adm dnl
1233 /etc dnl
1234 /dev/null;
paul23bd12c2003-04-07 06:11:09 +00001235 do
paule8f29842003-08-12 13:08:31 +00001236 test -d $QUAGGA_STATE_DIR && break
paul23bd12c2003-04-07 06:11:09 +00001237 done
paule8f29842003-08-12 13:08:31 +00001238 quagga_statedir=$QUAGGA_STATE_DIR])
paul23bd12c2003-04-07 06:11:09 +00001239else
paule8f29842003-08-12 13:08:31 +00001240 quagga_statedir=${localstatedir}
paula159ed92003-06-04 11:01:45 +00001241 AC_MSG_CHECKING(directory to use for state file)
paule8f29842003-08-12 13:08:31 +00001242 AC_MSG_RESULT(${quagga_statedir})
paul26275b02005-04-11 07:10:47 +00001243 AC_SUBST(quagga_statedir)
paul23bd12c2003-04-07 06:11:09 +00001244fi
paule8f29842003-08-12 13:08:31 +00001245if test $quagga_statedir = "/dev/null"; then
paula159ed92003-06-04 11:01:45 +00001246 AC_MSG_ERROR('STATE DIRECTORY NOT FOUND! FIX OR SPECIFY --localstatedir!')
1247fi
1248
paule8f29842003-08-12 13:08:31 +00001249AC_DEFINE_UNQUOTED(PATH_ZEBRA_PID, "$quagga_statedir/zebra.pid",zebra PID)
1250AC_DEFINE_UNQUOTED(PATH_RIPD_PID, "$quagga_statedir/ripd.pid",ripd PID)
1251AC_DEFINE_UNQUOTED(PATH_RIPNGD_PID, "$quagga_statedir/ripngd.pid",ripngd PID)
1252AC_DEFINE_UNQUOTED(PATH_BGPD_PID, "$quagga_statedir/bgpd.pid",bgpd PID)
1253AC_DEFINE_UNQUOTED(PATH_OSPFD_PID, "$quagga_statedir/ospfd.pid",ospfd PID)
1254AC_DEFINE_UNQUOTED(PATH_OSPF6D_PID, "$quagga_statedir/ospf6d.pid",ospf6d PID)
jardin9e867fe2003-12-23 08:56:18 +00001255AC_DEFINE_UNQUOTED(PATH_ISISD_PID, "$quagga_statedir/isisd.pid",isisd PID)
ajsd0199432004-12-22 14:03:52 +00001256AC_DEFINE_UNQUOTED(PATH_WATCHQUAGGA_PID, "$quagga_statedir/watchquagga.pid",watchquagga PID)
paule8f29842003-08-12 13:08:31 +00001257AC_DEFINE_UNQUOTED(ZEBRA_SERV_PATH, "$quagga_statedir/zserv.api",zebra api socket)
1258AC_DEFINE_UNQUOTED(ZEBRA_VTYSH_PATH, "$quagga_statedir/zebra.vty",zebra vty socket)
1259AC_DEFINE_UNQUOTED(RIP_VTYSH_PATH, "$quagga_statedir/ripd.vty",rip vty socket)
1260AC_DEFINE_UNQUOTED(RIPNG_VTYSH_PATH, "$quagga_statedir/ripngd.vty",ripng vty socket)
1261AC_DEFINE_UNQUOTED(BGP_VTYSH_PATH, "$quagga_statedir/bgpd.vty",bgpd vty socket)
1262AC_DEFINE_UNQUOTED(OSPF_VTYSH_PATH, "$quagga_statedir/ospfd.vty",ospfd vty socket)
1263AC_DEFINE_UNQUOTED(OSPF6_VTYSH_PATH, "$quagga_statedir/ospf6d.vty",ospf6d vty socket)
jardin9e867fe2003-12-23 08:56:18 +00001264AC_DEFINE_UNQUOTED(ISIS_VTYSH_PATH, "$quagga_statedir/isisd.vty",isisd vty socket)
ajs515210b2004-12-22 15:35:12 +00001265AC_DEFINE_UNQUOTED(DAEMON_VTY_DIR, "$quagga_statedir",daemon vty directory)
paul7ea487b2003-03-17 02:05:07 +00001266
paul1eb8ef22005-04-07 07:30:20 +00001267dnl -------------------------------
1268dnl Quagga sources should always be
1269dnl current wrt interfaces. Dont
1270dnl allow deprecated interfaces to
1271dnl be exposed.
1272dnl -------------------------------
1273AC_DEFINE(QUAGGA_NO_DEPRECATED_INTERFACES, 1, Hide deprecated interfaces)
1274
paul7ea487b2003-03-17 02:05:07 +00001275dnl ---------------------------
1276dnl Check htonl works correctly
1277dnl ---------------------------
1278AC_MSG_CHECKING(for working htonl)
1279AC_CACHE_VAL(ac_cv_htonl_works, [
1280AC_TRY_LINK([#ifdef HAVE_SYS_TYPES_H
1281#include <sys/types.h>
1282#endif
1283#ifdef HAVE_NETDB_H
1284#include <netdb.h>
1285#endif
1286#ifdef HAVE_NETINET_IN_H
1287#include <netinet/in.h>
1288#endif],
1289[htonl (0);],
1290ac_cv_htonl_works=yes,
1291ac_cv_htonl_works=no)])
1292AC_MSG_RESULT($ac_cv_htonl_works)
1293
paul14c17fd2004-11-07 22:34:23 +00001294AC_CONFIG_FILES([Makefile lib/Makefile zebra/Makefile ripd/Makefile
ajsd0199432004-12-22 14:03:52 +00001295 ripngd/Makefile bgpd/Makefile ospfd/Makefile watchquagga/Makefile
jardin9e867fe2003-12-23 08:56:18 +00001296 ospf6d/Makefile isisd/Makefile vtysh/Makefile doc/Makefile
paul14c17fd2004-11-07 22:34:23 +00001297 ospfclient/Makefile tests/Makefile m4/Makefile redhat/Makefile
gdt69f1fc22004-08-27 15:57:35 +00001298 pkgsrc/Makefile
paul670bbf12004-11-12 09:05:00 +00001299 redhat/quagga.spec
gdtb7a97f82004-07-23 16:23:56 +00001300 lib/version.h
paul14c17fd2004-11-07 22:34:23 +00001301 doc/defines.texi
hassof695b012005-04-02 19:03:39 +00001302 isisd/topology/Makefile
gdtcbd04082004-08-31 18:16:36 +00001303 pkgsrc/bgpd.sh pkgsrc/ospf6d.sh pkgsrc/ospfd.sh
paulf31293a2004-11-12 09:27:04 +00001304 pkgsrc/ripd.sh pkgsrc/ripngd.sh pkgsrc/zebra.sh])
paul26275b02005-04-11 07:10:47 +00001305AC_CONFIG_FILES([solaris/Makefile])
1306
paul670bbf12004-11-12 09:05:00 +00001307AC_CONFIG_FILES([vtysh/extract.pl],[chmod +x vtysh/extract.pl])
hasso48577192004-11-19 06:41:49 +00001308## Hack, but working solution to avoid rebuilding of quagga.info.
1309## It's already in CVS until texinfo 4.7 is more common.
1310AC_CONFIG_COMMANDS([info-time],[touch doc/quagga.info])
paul14c17fd2004-11-07 22:34:23 +00001311AC_OUTPUT
paul7ea487b2003-03-17 02:05:07 +00001312
1313echo "
hassoc89f6492004-08-26 12:21:28 +00001314Quagga configuration
1315--------------------
1316quagga version : ${PACKAGE_VERSION}
paul7ea487b2003-03-17 02:05:07 +00001317host operationg system : ${host_os}
1318source code location : ${srcdir}
1319compiler : ${CC}
1320compiler flags : ${CFLAGS}
hasso2d582282005-03-28 15:29:07 +00001321includes : ${INCLUDES} ${SNMP_INCLUDES}
hasso71c0fb52003-05-25 20:18:13 +00001322linker flags : ${LDFLAGS} ${LIBS}
paule8f29842003-08-12 13:08:31 +00001323state file directory : ${quagga_statedir}
pauldc7a2bf2003-10-22 00:07:44 +00001324config file directory : `eval echo \`echo ${sysconfdir}\``
gdtd6b72f72003-12-03 17:24:27 +00001325example directory : `eval echo \`echo ${exampledir}\``
paul8d4aee52003-06-06 00:30:35 +00001326user to run as : ${enable_user}
1327group to run as : ${enable_group}
1328group for vty sockets : ${enable_vty_group}
gdtaa593d52003-12-22 20:15:53 +00001329config file mask : ${enable_configfile_mask}
1330log file mask : ${enable_logfile_mask}
pauldc7a2bf2003-10-22 00:07:44 +00001331
1332The above user and group must have read/write access to the state file
1333directory and to the config files in the config file directory.
paul7ea487b2003-03-17 02:05:07 +00001334"