blob: aca49e90a8d2013fe0e5d2b47f4db1a0734787c1 [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##
paulceacedb2005-09-29 14:39:32 +00008## $Id: configure.ac,v 1.113 2005/09/29 14:39:32 paul Exp $
paule8f29842003-08-12 13:08:31 +00009AC_PREREQ(2.53)
paul7ea487b2003-03-17 02:05:07 +000010
paul0c2029e2005-04-29 03:20:54 +000011AC_INIT(Quagga, 0.99.1, [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
paul03ecfb62005-04-16 15:38:23 +000024dnl we need gawk for memtypes.awk
25AC_CHECK_PROG([GAWK],[gawk],[gawk],[/bin/false])
26AC_ARG_VAR([GAWK],[GNU AWK])
27
gdtd6b72f72003-12-03 17:24:27 +000028dnl default is to match previous behavior
gdtc4f0efe2003-12-04 15:39:25 +000029exampledir=${sysconfdir}
gdtd6b72f72003-12-03 17:24:27 +000030AC_ARG_ENABLE([exampledir],
31 AC_HELP_STRING([--enable-exampledir],
32 [specify alternate directory for examples]),
33 exampledir="$enableval",)
gdtc4f0efe2003-12-04 15:39:25 +000034dnl XXX add --exampledir to autoconf standard directory list somehow
gdtd6b72f72003-12-03 17:24:27 +000035AC_SUBST(exampledir)
36
gdtcbd04082004-08-31 18:16:36 +000037dnl default is to match previous behavior
38pkgsrcrcdir=""
39pkgsrcdir=""
40AC_ARG_ENABLE([pkgsrcrcdir],
41 AC_HELP_STRING([--enable-pkgsrcrcdir],
42 [specify directory for rc.d scripts]),
43 pkgsrcrcdir="$enableval"; pkgsrcdir="pkgsrc",)
44dnl XXX add --pkgsrcrcdir to autoconf standard directory list somehow
45AC_SUBST(pkgsrcdir)
46AC_SUBST(pkgsrcrcdir)
47
paul7ea487b2003-03-17 02:05:07 +000048dnl ------------
49dnl Check CFLAGS
50dnl ------------
51AC_ARG_WITH(cflags,
52[ --with-cflags Set CFLAGS for use in compilation.])
53if test "x$with_cflags" != "x" ; then
54 CFLAGS="$with_cflags" ; cflags_specified=yes ;
55elif test -n "$CFLAGS" ; then
56 cflags_specified=yes ;
57fi
58
hasso1969e4b2005-03-27 13:07:23 +000059dnl --------------------
60dnl Check CC and friends
61dnl --------------------
paul7ea487b2003-03-17 02:05:07 +000062AC_PROG_CC
hasso1969e4b2005-03-27 13:07:23 +000063AC_PROG_CPP
64AC_PROG_EGREP
65
66dnl ------------------------------------------------------------------
67dnl Intel compiler check. Although Intel tries really hard to make icc
68dnl look like gcc, there are some differences. It's very verbose with
69dnl -Wall and it doesn't support the individual -W options.
70dnl ------------------------------------------------------------------
71AC_MSG_CHECKING([whether we are using the Intel compiler])
72AC_EGREP_CPP([^__INTEL_COMPILER], [__INTEL_COMPILER],
73 ICC="no"
74 AC_MSG_RESULT([no]),
75 ICC="yes"
76 AC_MSG_RESULT([yes])
77)
paul7ea487b2003-03-17 02:05:07 +000078
paula49c0ff2004-09-30 06:08:58 +000079dnl ---------------------------------------------
paul7ea487b2003-03-17 02:05:07 +000080dnl If CLFAGS doesn\'t exist set default value
paula49c0ff2004-09-30 06:08:58 +000081dnl AC_PROG_CC will have set minimal default
82dnl already, eg "-O2 -g" for gcc, "-g" for others
paul27eebb32004-07-22 18:16:59 +000083dnl (Wall is gcc specific... have to make sure
84dnl gcc is being used before setting it)
hasso1969e4b2005-03-27 13:07:23 +000085dnl Intel icc 8.0 also sets __GNUC__, but
86dnl doesn't support all these fancy -W options.
paula49c0ff2004-09-30 06:08:58 +000087dnl ---------------------------------------------
paul27eebb32004-07-22 18:16:59 +000088dnl
paul7ea487b2003-03-17 02:05:07 +000089if test "x$cflags_specified" = "x" ; then
hasso1969e4b2005-03-27 13:07:23 +000090 if test "x${GCC}" = "xyes" && test "x${ICC}" = "xno"; then
paula9694592005-08-25 14:50:05 +000091 CFLAGS="-Os -fno-omit-frame-pointer -g -Wall"
92 CFLAGS="${CFLAGS} -Wsign-compare -Wpointer-arith"
hasso7347a2a2004-10-05 14:15:17 +000093 CFLAGS="${CFLAGS} -Wbad-function-cast -Wwrite-strings"
paulceacedb2005-09-29 14:39:32 +000094 CFLAGS="${CFLAGS} -Wmissing-prototypes -Wmissing-declarations"
95 CFLAGS="${CFLAGS} -Wchar-subscripts -Wcast-qual"
paula49c0ff2004-09-30 06:08:58 +000096 fi
gdt7fd63b32004-10-07 13:53:29 +000097 # TODO: conditionally addd -Wpacked if handled
paul7ea487b2003-03-17 02:05:07 +000098fi
99
hasso1969e4b2005-03-27 13:07:23 +0000100dnl ---------------------------------------------------------------------
101dnl Intel compiler warnings we ignore:
102dnl 279: controlling expression is constant.
103dnl 869: parameter "xxx" was never referenced - to avoid massive warnings
104dnl about "self", "vty", "argc" and "argv" never referenced in DEFUN
105dnl macro.
106dnl 981: operands are evaluated in unspecified order.
107dnl ---------------------------------------------------------------------
108
109if test "$ICC" = "yes"; then
110 CFLAGS="-Os -g -Wall -wd 279,869,981"
111fi
112
paul7ea487b2003-03-17 02:05:07 +0000113dnl --------------
114dnl Check programs
115dnl --------------
paul7ea487b2003-03-17 02:05:07 +0000116AC_PROG_INSTALL
117AC_PROG_MAKE_SET
118AC_CHECK_TOOL(AR, ar)
119AC_CHECK_TOOL(RANLIB, ranlib, :)
120
121dnl ---------
122dnl AIX check
123dnl ---------
124AC_AIX
125
gdt87efd642004-06-30 17:36:11 +0000126dnl -------
127dnl libtool
128dnl -------
paul0fc42942004-08-19 04:41:21 +0000129AC_PROG_LIBTOOL
gdt87efd642004-06-30 17:36:11 +0000130
paul7ea487b2003-03-17 02:05:07 +0000131dnl ----------------------
132dnl Packages configuration
133dnl ----------------------
134AC_ARG_ENABLE(vtysh,
gdtfc9d0742004-06-30 14:25:12 +0000135[ --enable-vtysh include integrated vty shell for Quagga])
paul7ea487b2003-03-17 02:05:07 +0000136AC_ARG_ENABLE(ipv6,
137[ --disable-ipv6 turn off IPv6 related features and daemons])
138AC_ARG_ENABLE(zebra,
139[ --disable-zebra do not build zebra daemon])
140AC_ARG_ENABLE(bgpd,
141[ --disable-bgpd do not build bgpd])
142AC_ARG_ENABLE(ripd,
143[ --disable-ripd do not build ripd])
144AC_ARG_ENABLE(ripngd,
145[ --disable-ripngd do not build ripngd])
146AC_ARG_ENABLE(ospfd,
147[ --disable-ospfd do not build ospfd])
paul7ea487b2003-03-17 02:05:07 +0000148AC_ARG_ENABLE(ospf6d,
149[ --disable-ospf6d do not build ospf6d])
ajsd0199432004-12-22 14:03:52 +0000150AC_ARG_ENABLE(watchquagga,
151[ --disable-watchquagga do not build watchquagga])
jardin9e867fe2003-12-23 08:56:18 +0000152AC_ARG_ENABLE(isisd,
hassoae399ab2004-09-13 20:22:18 +0000153[ --enable-isisd build isisd])
paul7ea487b2003-03-17 02:05:07 +0000154AC_ARG_ENABLE(bgp-announce,
155[ --disable-bgp-announce, turn off BGP route announcement])
156AC_ARG_ENABLE(netlink,
157[ --enable-netlink force to use Linux netlink interface])
158AC_ARG_ENABLE(broken-aliases,
159[ --enable-broken-aliases enable aliases as distinct interfaces for Linux 2.2.X])
160AC_ARG_ENABLE(snmp,
161[ --enable-snmp enable SNMP support])
162AC_ARG_WITH(libpam,
163[ --with-libpam use libpam for PAM support in vtysh])
hasso71c0fb52003-05-25 20:18:13 +0000164AC_ARG_ENABLE(tcp-zebra,
paul7ea487b2003-03-17 02:05:07 +0000165[ --enable-tcp-zebra enable TCP/IP socket connection between zebra and protocol daemon])
paul7ea487b2003-03-17 02:05:07 +0000166AC_ARG_ENABLE(opaque-lsa,
paul1ef74ef2003-03-21 15:16:05 +0000167[ --enable-opaque-lsa enable OSPF Opaque-LSA with OSPFAPI support (RFC2370)])
168AC_ARG_ENABLE(ospfapi,
169[ --disable-ospfapi do not build OSPFAPI to access the OSPF LSA Database,
170 (this is the default if --enable-opaque-lsa is not set)])
171AC_ARG_ENABLE(ospfclient,
172[ --disable-ospfclient do not build OSPFAPI client for OSPFAPI,
173 (this is the default if --disable-ospfapi is set)])
paul7ea487b2003-03-17 02:05:07 +0000174AC_ARG_ENABLE(ospf-te,
175[ --enable-ospf-te enable Traffic Engineering Extension to OSPF])
176AC_ARG_ENABLE(multipath,
177[ --enable-multipath=ARG enable multipath function, ARG must be digit])
paule8f29842003-08-12 13:08:31 +0000178AC_ARG_ENABLE(quagga_user,
179[ --enable-user=ARG user to run Quagga suite as (default quagga)])
180AC_ARG_ENABLE(quagga_group,
181[ --enable-group=ARG group to run Quagga suite as (default quagga)])
pauledd7c242003-06-04 13:59:38 +0000182AC_ARG_ENABLE(vty_group,
paul6b6942f2004-10-22 04:55:05 +0000183[ --enable-vty-group=ARG set vty sockets to have specified group as owner])
gdtaa593d52003-12-22 20:15:53 +0000184AC_ARG_ENABLE(configfile_mask,
185[ --enable-configfile-mask=ARG set mask for config files])
186AC_ARG_ENABLE(logfile_mask,
187[ --enable-logfile-mask=ARG set mask for log files])
pauledd7c242003-06-04 13:59:38 +0000188
hasso71c0fb52003-05-25 20:18:13 +0000189AC_ARG_ENABLE(rtadv,
paul6b6942f2004-10-22 04:55:05 +0000190[ --disable-rtadv disable IPV6 router advertisement feature])
hassoca776982004-06-12 14:33:05 +0000191AC_ARG_ENABLE(irdp,
paul6b6942f2004-10-22 04:55:05 +0000192[ --enable-irdp enable IRDP server support in zebra])
hassof695b012005-04-02 19:03:39 +0000193AC_ARG_ENABLE(isis_topology,
194[ --enable-isis-topology enable IS-IS topology generator])
hasso41d3fc92004-04-06 11:59:00 +0000195AC_ARG_ENABLE(capabilities,
196[ --disable-capabilities disable using POSIX capabilities])
paul6b6942f2004-10-22 04:55:05 +0000197AC_ARG_ENABLE(gcc_ultra_verbose,
198[ --enable-gcc-ultra-verbose enable ultra verbose GCC warnings])
ajs3cade262004-12-29 17:50:22 +0000199AC_ARG_ENABLE(gcc-rdynamic,
200[ --enable-gcc-rdynamic enable gcc linking with -rdynamic for better backtraces])
ajs924b9222005-04-16 17:11:24 +0000201AC_ARG_ENABLE(time-check,
202[ --disable-time-check disable slow thread warning messages])
paul6b6942f2004-10-22 04:55:05 +0000203
204if test x"${enable_gcc_ultra_verbose}" = x"yes" ; then
205 CFLAGS="${CFLAGS} -W -Wcast-qual -Wstrict-prototypes"
206 CFLAGS="${CFLAGS} -Wmissing-declarations -Wmissing-noreturn"
207 CFLAGS="${CFLAGS} -Wmissing-format-attribute -Wunreachable-code"
208 CFLAGS="${CFLAGS} -Wpacked -Wpadded"
209fi
paul7ea487b2003-03-17 02:05:07 +0000210
ajs3cade262004-12-29 17:50:22 +0000211if test x"${enable_gcc_rdynamic}" = x"yes" ; then
212 LDFLAGS="${LDFLAGS} -rdynamic"
213fi
214
ajs924b9222005-04-16 17:11:24 +0000215if test x"${enable_time_check}" != x"no" ; then
216 if test x"${enable_time_check}" = x"yes" -o x"${enable_time_check}" = x ; then
217 AC_DEFINE(CONSUMED_TIME_CHECK,5000000,Consumed Time Check)
218 else
219 AC_DEFINE_UNQUOTED(CONSUMED_TIME_CHECK,$enable_time_check,Consumed Time Check)
220 fi
221fi
222
paul7ea487b2003-03-17 02:05:07 +0000223if test "${enable_broken_aliases}" = "yes"; then
224 if test "${enable_netlink}" = "yes"
225 then
226 echo "Sorry, you can't use netlink with broken aliases"
227 exit 1
228 fi
229 AC_DEFINE(HAVE_BROKEN_ALIASES,,Broken Alias)
230 enable_netlink=no
231fi
232
233if test "${enable_tcp_zebra}" = "yes"; then
234 AC_DEFINE(HAVE_TCP_ZEBRA,,Use TCP for zebra communication)
235fi
236
paul7ea487b2003-03-17 02:05:07 +0000237if test "${enable_opaque_lsa}" = "yes"; then
238 AC_DEFINE(HAVE_OPAQUE_LSA,,OSPF Opaque LSA)
239fi
240
241if test "${enable_ospf_te}" = "yes"; then
242 AC_DEFINE(HAVE_OPAQUE_LSA,,OSPF Opaque LSA)
243 AC_DEFINE(HAVE_OSPF_TE,,OSPF TE)
244fi
245
gdtd2a0ccc2003-12-03 18:13:48 +0000246AC_MSG_CHECKING(if zebra should be configurable to send Route Advertisements)
247if test "${enable_rtadv}" != "no"; then
hasso71c0fb52003-05-25 20:18:13 +0000248 AC_MSG_RESULT(yes)
gdtd2a0ccc2003-12-03 18:13:48 +0000249 AC_DEFINE(HAVE_RTADV,,Enable IPv6 Routing Advertisement support)
paul2487bea2003-05-25 23:51:31 +0000250else
251 AC_MSG_RESULT(no)
hasso71c0fb52003-05-25 20:18:13 +0000252fi
paul7ea487b2003-03-17 02:05:07 +0000253
hassoca776982004-06-12 14:33:05 +0000254if test "${enable_irdp}" = "yes"; then
255 AC_DEFINE(HAVE_IRDP,, IRDP )
256fi
257
hassof695b012005-04-02 19:03:39 +0000258if test "${enable_isisd}" = "yes" && test "${enable_isis_topology}" = yes; then
259 AC_DEFINE(TOPOLOGY_GENERATE,,Enable IS-IS topology generator code)
260 ISIS_TOPOLOGY_INCLUDES="-I./topology"
261 ISIS_TOPOLOGY_DIR="topology"
262 ISIS_TOPOLOGY_LIB="./topology/libtopology.a"
263fi
264
265AC_SUBST(ISIS_TOPOLOGY_INCLUDES)
266AC_SUBST(ISIS_TOPOLOGY_DIR)
267AC_SUBST(ISIS_TOPOLOGY_LIB)
268
paul79cb2162003-06-06 12:19:53 +0000269if test "${enable_user}" = "yes" || test x"${enable_user}" = x""; then
paule8f29842003-08-12 13:08:31 +0000270 enable_user="quagga"
pauledd7c242003-06-04 13:59:38 +0000271elif test "${enable_user}" = "no"; then
272 enable_user="root"
273fi
pauledd7c242003-06-04 13:59:38 +0000274
paul79cb2162003-06-06 12:19:53 +0000275if test "${enable_group}" = "yes" || test x"${enable_group}" = x""; then
paule8f29842003-08-12 13:08:31 +0000276 enable_group="quagga"
pauledd7c242003-06-04 13:59:38 +0000277elif test "${enable_group}" = "no"; then
278 enable_group="root"
279fi
pauledd7c242003-06-04 13:59:38 +0000280
281if test x"${enable_vty_group}" = x"yes" ; then
paul8d4aee52003-06-06 00:30:35 +0000282 AC_MSG_ERROR([--enable-vty-group requires a group as argument, not yes])
paul79cb2162003-06-06 12:19:53 +0000283elif test x"${enable_vty_group}" != x""; then
paul8d4aee52003-06-06 00:30:35 +0000284 if test x"${enable_vty_group}" != x"no"; then
pauledd7c242003-06-04 13:59:38 +0000285 AC_DEFINE_UNQUOTED(VTY_GROUP, "${enable_vty_group}", VTY Sockets Group)
286 fi
287fi
paul26275b02005-04-11 07:10:47 +0000288AC_SUBST([enable_user])
289AC_SUBST([enable_group])
290AC_SUBST([enable_vty_group])
291AC_DEFINE_UNQUOTED(QUAGGA_USER, "${enable_user}", Quagga User)
292AC_DEFINE_UNQUOTED(QUAGGA_GROUP, "${enable_group}", Quagga Group)
pauledd7c242003-06-04 13:59:38 +0000293
gdtaa593d52003-12-22 20:15:53 +0000294enable_configfile_mask=${enable_configfile_mask:-0600}
295AC_DEFINE_UNQUOTED(CONFIGFILE_MASK, ${enable_configfile_mask}, Mask for config files)
296
297enable_logfile_mask=${enable_logfile_mask:-0600}
298AC_DEFINE_UNQUOTED(LOGFILE_MASK, ${enable_logfile_mask}, Mask for log files)
299
paul7ea487b2003-03-17 02:05:07 +0000300changequote(, )dnl
301
302MULTIPATH_NUM=1
303
304case "${enable_multipath}" in
305 [0-9]|[1-9][0-9])
306 MULTIPATH_NUM="${enable_multipath}"
307 ;;
308 "")
309 ;;
310 *)
311 echo "Please specify digit to --enable-multipath ARG."
312 exit 1
313 ;;
314esac
315
316changequote([, ])dnl
317
318AC_SUBST(MULTIPATH_NUM)
319
320dnl -------------------
321dnl Check header files.
322dnl -------------------
pauldc7a2bf2003-10-22 00:07:44 +0000323AC_HEADER_STDC
324AC_CHECK_HEADERS([string.h stropts.h sys/conf.h sys/ksym.h sys/time.h \
325 sys/times.h sys/select.h sys/sysctl.h sys/sockio.h \
326 sys/types.h linux/version.h kvm.h netdb.h asm/types.h \
paul42c98192005-05-07 02:22:51 +0000327 sys/param.h libutil.h limits.h])
pauldc7a2bf2003-10-22 00:07:44 +0000328
paul835b7f12003-10-30 21:59:57 +0000329AC_CHECK_HEADERS([sys/socket.h netinet/in_systm.h netinet/in.h \
paulf3bd1a72003-11-02 07:29:11 +0000330 net/if_dl.h net/netopt.h inet/nd.h net/route.h \
paul835b7f12003-10-30 21:59:57 +0000331 net/if.h net/if_var.h netinet/in_var.h])
pauldc7a2bf2003-10-22 00:07:44 +0000332
gdtfa3232e2003-12-03 17:52:30 +0000333dnl V6 headers are checked below, after we check for v6
paul7ea487b2003-03-17 02:05:07 +0000334
335dnl check some types
336AC_C_CONST
337dnl AC_TYPE_PID_T
338AC_TYPE_SIGNAL
339
340dnl Some systems (Solaris 2.x) require libnsl (Network Services Library)
341case "$host" in
paulafd8a122005-03-12 06:36:10 +0000342 [*-sunos5.[6-7]*] | [*-solaris2.[6-7]*])
paul7ea487b2003-03-17 02:05:07 +0000343 opsys=sol2-6
paulafd8a122005-03-12 06:36:10 +0000344 AC_DEFINE(SUNOS_56, 1, SunOS 5.6 to 5.7)
paul19877dd2004-05-11 10:49:35 +0000345 AC_DEFINE(SUNOS_5, 1, SunOS 5)
paul7ea487b2003-03-17 02:05:07 +0000346 AC_CHECK_LIB(xnet, main)
347 CURSES=-lcurses
348 ;;
paul1b73de82005-04-10 16:31:51 +0000349 [*-sunos5.[8-9]] \
350 | [*-sunos5.1[0-9]] \
351 | [*-sunos5.1[0-9].[0-9]] \
352 | [*-solaris2.[8-9]] \
353 | [*-solaris2.1[0-9]] \
354 | [*-solaris2.1[0-9].[0-9]])
paulafd8a122005-03-12 06:36:10 +0000355 opsys=sol8
356 AC_DEFINE(SUNOS_59,,SunOS 5.8 up)
paul19877dd2004-05-11 10:49:35 +0000357 AC_DEFINE(SUNOS_5, 1, SunOS 5)
358 AC_CHECK_LIB(socket, main)
359 AC_CHECK_LIB(nsl, main)
paul1b73de82005-04-10 16:31:51 +0000360 AC_CHECK_LIB(umem, main)
paul19877dd2004-05-11 10:49:35 +0000361 CURSES=-lcurses
362 ;;
paul7ea487b2003-03-17 02:05:07 +0000363 *-sunos5* | *-solaris2*)
paul19877dd2004-05-11 10:49:35 +0000364 AC_DEFINE(SUNOS_5,,SunOS 5, Unknown SunOS)
paul7ea487b2003-03-17 02:05:07 +0000365 AC_CHECK_LIB(socket, main)
366 AC_CHECK_LIB(nsl, main)
367 CURSES=-lcurses
368 ;;
hassoc45eb832005-02-19 13:58:06 +0000369 *-linux*)
paul7ea487b2003-03-17 02:05:07 +0000370 opsys=gnu-linux
371 AC_DEFINE(GNU_LINUX,,GNU Linux)
372 ;;
373 *-nec-sysv4*)
374 AC_CHECK_LIB(nsl, gethostbyname)
375 AC_CHECK_LIB(socket, socket)
376 ;;
paul7ea487b2003-03-17 02:05:07 +0000377 *-openbsd*)
378 opsys=openbsd
379 AC_DEFINE(OPEN_BSD,,OpenBSD)
380 ;;
381 *-bsdi*)
382 opsys=bsdi
383 OTHER_METHOD="mtu_kvm.o"
384 AC_CHECK_LIB(kvm, main)
385 ;;
paul49e3b3c2003-10-23 20:39:50 +0000386 *-irix6.5)
pauldc7a2bf2003-10-22 00:07:44 +0000387 opsys=irix
388 AC_DEFINE(IRIX_65,,IRIX 6.5)
389 ;;
paul7ea487b2003-03-17 02:05:07 +0000390esac
391
392dnl ---------------------
393dnl Integrated VTY option
394dnl ---------------------
395case "${enable_vtysh}" in
396 "yes") VTYSH="vtysh";
397 AC_DEFINE(VTYSH,,VTY shell)
gdtfc9d0742004-06-30 14:25:12 +0000398 AC_PATH_PROG(PERL, perl)
399dnl Vtysh uses libreadline, which looks for termcap functions at
400dnl configure time. We follow readline's search order.
401dnl The required procedures are in libtermcap on NetBSD, in
402dnl [TODO] on Linux, and in [TODO] on Solaris.
hassoc0689392005-08-25 12:00:58 +0000403 AC_CHECK_LIB(termcap, tputs, LIBREADLINE="$LIBREADLINE -ltermcap",
paula9694592005-08-25 14:50:05 +0000404 [AC_CHECK_LIB(tinfo, tputs, LIBREADLINE="$LIBREADLINE -ltinfo",
405 [AC_CHECK_LIB(curses, tputs, LIBREADLINE="$LIBREADLINE -lcurses",
406 [AC_CHECK_LIB(ncurses, tputs,
407 LIBREADLINE="$LIBREADLINE -lncurses")]
408 )]
409 )]
410 )
411 AC_CHECK_LIB(readline, main, LIBREADLINE="$LIBREADLINE -lreadline",,
412 "$LIBREADLINE")
paul7ea487b2003-03-17 02:05:07 +0000413 if test $ac_cv_lib_readline_main = no; then
gdtfc9d0742004-06-30 14:25:12 +0000414 AC_MSG_ERROR([vtysh needs libreadline but was not found and usable on your system.])
paul7ea487b2003-03-17 02:05:07 +0000415 fi
416 AC_CHECK_HEADER(readline/history.h)
417 if test $ac_cv_header_readline_history_h = no;then
418 AC_MSG_ERROR([readline is too old to have readline/history.h, please update to the latest readline library.])
419 fi
paula9694592005-08-25 14:50:05 +0000420 AC_CHECK_LIB(readline, rl_completion_matches,
421 LIBREADLINE="$LIBREADLINE",, "$LIBREADLINE")
paul3d3de8c2003-05-23 10:33:49 +0000422 if test $ac_cv_lib_readline_rl_completion_matches = no; then
423 AC_DEFINE(rl_completion_matches,completion_matches,Old readline)
424 fi
425 ;;
paul7ea487b2003-03-17 02:05:07 +0000426 "no" ) VTYSH="";;
427 * ) ;;
428esac
hassoc0689392005-08-25 12:00:58 +0000429AC_SUBST(LIBREADLINE)
paul7ea487b2003-03-17 02:05:07 +0000430
431dnl ----------
432dnl PAM module
433dnl ----------
434if test "$with_libpam" = "yes"; then
paul24cd4352003-05-06 12:16:27 +0000435 AC_CHECK_HEADER(security/pam_misc.h)
436 if test "$ac_cv_header_security_pam_misc_h" = yes; then
437 AC_DEFINE(HAVE_PAM_MISC_H,,Have pam_misc.h)
438 AC_DEFINE(PAM_CONV_FUNC,misc_conv,Have misc_conv)
439 pam_conv_func="misc_conv"
paul24cd4352003-05-06 12:16:27 +0000440 fi
paul24cd4352003-05-06 12:16:27 +0000441 AC_CHECK_HEADER(security/openpam.h)
442 if test "$ac_cv_header_security_openpam_h" = yes; then
443 AC_DEFINE(HAVE_OPENPAM_H,,Have openpam.h)
444 AC_DEFINE(PAM_CONV_FUNC,openpam_ttyconv,Have openpam_ttyconv)
445 pam_conv_func="openpam_ttyconv"
paul24cd4352003-05-06 12:16:27 +0000446 fi
447 if test -z "$ac_cv_header_security_pam_misc_h$ac_cv_header_security_openpam_h" ; then
448 AC_MSG_WARN([*** pam support will not be built ***])
449 with_libpam="no"
450 fi
451fi
452
453if test "$with_libpam" = "yes"; then
paul7ea487b2003-03-17 02:05:07 +0000454dnl took this test from proftpd's configure.in and suited to our needs
455dnl -------------------------------------------------------------------------
456dnl
457dnl This next check looks funky due to a linker problem with some versions
458dnl of the PAM library. Prior to 0.72 release, the Linux PAM shared library
459dnl omitted requiring libdl linking information. PAM-0.72 or better ships
460dnl with RedHat 6.2 and Debian 2.2 or better.
461AC_CHECK_LIB(pam, pam_start,
paul24cd4352003-05-06 12:16:27 +0000462 [AC_CHECK_LIB(pam, $pam_conv_func,
paul7ea487b2003-03-17 02:05:07 +0000463 [AC_DEFINE(USE_PAM,,Use PAM for authentication)
464 LIBPAM="-lpam"],
465 [AC_DEFINE(USE_PAM,,Use PAM for authentication)
466 LIBPAM="-lpam -lpam_misc"]
467 )
468 ],
469
470 [AC_CHECK_LIB(pam, pam_end,
paul24cd4352003-05-06 12:16:27 +0000471 [AC_CHECK_LIB(pam, $pam_conv_func,
paula159ed92003-06-04 11:01:45 +0000472 [AC_DEFINE(USE_PAM,,Use PAM for authentication)
paul7ea487b2003-03-17 02:05:07 +0000473 LIBPAM="-lpam -ldl"],
paula159ed92003-06-04 11:01:45 +0000474 [AC_DEFINE(USE_PAM,,Use PAM for authentication)
paul7ea487b2003-03-17 02:05:07 +0000475 LIBPAM="-lpam -ldl -lpam_misc"]
476 )
477 ],AC_MSG_WARN([*** pam support will not be built ***]),
478 [-ldl])
479 ]
480)
481fi
482AC_SUBST(LIBPAM)
483
484dnl -------------------------------
485dnl Endian-ness check
486dnl -------------------------------
487AC_WORDS_BIGENDIAN
488
489dnl -------------------------------
490dnl check the size in byte of the C
491dnl -------------------------------
492dnl AC_CHECK_SIZEOF(char)
493dnl AC_CHECK_SIZEOF(int)
494dnl AC_CHECK_SIZEOF(short)
495dnl AC_CHECK_SIZEOF(long)
496
497dnl ----------------------------
498dnl check existance of functions
499dnl ----------------------------
paul49e3b3c2003-10-23 20:39:50 +0000500AC_CHECK_FUNCS(memset memcpy strerror inet_aton daemon snprintf vsnprintf \
paul04bd4842003-10-24 04:24:39 +0000501 strlcat strlcpy if_nametoindex if_indextoname getifaddrs \
hassoe6a4feb2005-09-19 09:53:21 +0000502 fcntl strnlen strndup)
paula159ed92003-06-04 11:01:45 +0000503AC_CHECK_FUNCS(setproctitle, ,
504 [AC_CHECK_LIB(util, setproctitle,
505 [LIBS="$LIBS -lutil"
506 AC_DEFINE(HAVE_SETPROCTITLE,, Have setproctitle)
507 ]
508 )
509 ]
510)
paul7ea487b2003-03-17 02:05:07 +0000511
512dnl ------------------------------------
513dnl Determine routing get and set method
514dnl ------------------------------------
515AC_MSG_CHECKING(zebra between kernel interface method)
516if test x"$opsys" = x"gnu-linux"; then
517 if test "${enable_netlink}" = "yes";then
518 AC_MSG_RESULT(netlink)
519 RT_METHOD=rt_netlink.o
520 AC_DEFINE(HAVE_NETLINK,,netlink)
521 netlink=yes
522 elif test "${enable_netlink}" = "no"; then
523 AC_MSG_RESULT(ioctl)
524 RT_METHOD=rt_ioctl.o
525 netlink=no
526 else
527 AC_MSG_RESULT(netlink)
528 RT_METHOD=rt_netlink.o
529 AC_DEFINE(HAVE_NETLINK,,netlink)
530 netlink=yes
531 fi
paul19877dd2004-05-11 10:49:35 +0000532elif test x"$opsys" = x"sol2-6";then
533 AC_MSG_RESULT(Route socket)
534 KERNEL_METHOD="kernel_socket.o"
535 RT_METHOD="rt_socket.o"
paulafd8a122005-03-12 06:36:10 +0000536elif test x"$opsys" = x"sol8";then
paul19877dd2004-05-11 10:49:35 +0000537 AC_MSG_RESULT(Route socket)
538 KERNEL_METHOD="kernel_socket.o"
539 RT_METHOD="rt_socket.o"
540elif test "$opsys" = "irix" ; then
541 AC_MSG_RESULT(Route socket)
542 KERNEL_METHOD="kernel_socket.o"
543 RT_METHOD="rt_socket.o"
paul7ea487b2003-03-17 02:05:07 +0000544else
paul19877dd2004-05-11 10:49:35 +0000545 AC_TRY_RUN([#include <errno.h>
paul7ea487b2003-03-17 02:05:07 +0000546#include <sys/types.h>
547#include <sys/socket.h>
548
549main ()
550{
551 int ac_sock;
552
553 ac_sock = socket (AF_ROUTE, SOCK_RAW, 0);
554 if (ac_sock < 0 && errno == EINVAL)
555 exit (1);
556 exit (0);
557}],
558 [KERNEL_METHOD=kernel_socket.o
559 RT_METHOD=rt_socket.o
560 AC_MSG_RESULT(socket)],
561 [RT_METHOD=rt_ioctl.o
562 AC_MSG_RESULT(ioctl)],
563 [KERNEL_METHOD=kernel_socket.o
564 RT_METHOD=rt_socket.o
565 AC_MSG_RESULT(socket)])
paul7ea487b2003-03-17 02:05:07 +0000566fi
567AC_SUBST(RT_METHOD)
568AC_SUBST(KERNEL_METHOD)
569AC_SUBST(OTHER_METHOD)
570
ajsb99760a2005-01-04 16:24:43 +0000571dnl ------------------------------------
572dnl check for broken CMSG_FIRSTHDR macro
573dnl ------------------------------------
gdt6c200462005-01-04 17:02:48 +0000574AC_MSG_CHECKING(for broken CMSG_FIRSTHDR)
hasso5b087522005-04-03 23:46:37 +0000575AC_RUN_IFELSE([AC_LANG_SOURCE([[
ajsb99760a2005-01-04 16:24:43 +0000576#ifdef SUNOS_5
577#define _XPG4_2
578#define __EXTENSIONS__
579#endif
580#include <stdlib.h>
581#include <sys/types.h>
582#include <sys/socket.h>
583
584main()
585{
586 struct msghdr msg;
587 char buf[4];
588
589 msg.msg_control = buf;
590 msg.msg_controllen = 0;
591
592 if (CMSG_FIRSTHDR(&msg) != NULL)
593 exit(0);
594 exit (1);
hasso5b087522005-04-03 23:46:37 +0000595}]])],[AC_MSG_RESULT(yes - using workaround) AC_DEFINE(HAVE_BROKEN_CMSG_FIRSTHDR,,Broken CMSG_FIRSTHDR)],
hassod33e8d72005-04-03 13:07:21 +0000596[AC_MSG_RESULT(no)],[AC_MSG_RESULT(no)])
ajsb99760a2005-01-04 16:24:43 +0000597
paul7ea487b2003-03-17 02:05:07 +0000598dnl ------------------------------
599dnl check kernel route read method
600dnl ------------------------------
601AC_CACHE_CHECK(route read method check, zebra_rtread,
602[if test "$netlink" = yes; then
603 RTREAD_METHOD="rtread_netlink.o"
604 zebra_rtread="netlink"
605else
606for zebra_rtread in /proc/net/route /dev/ip /dev/null;
607do
608 test x`ls $zebra_rtread 2>/dev/null` = x"$zebra_rtread" && break
609done
610case $zebra_rtread in
611 "/proc/net/route") RTREAD_METHOD="rtread_proc.o"
612 zebra_rtread="proc";;
paul9c30ab62003-07-08 08:36:17 +0000613 "/dev/ip")
614 case "$host" in
615 *-freebsd*) RTREAD_METHOD=rtread_sysctl.o
616 zebra_rtread="sysctl";;
617 *) RTREAD_METHOD="rtread_getmsg.o"
618 zebra_rtread="getmsg";;
619 esac;;
paul7ea487b2003-03-17 02:05:07 +0000620 *) RTREAD_METHOD="rtread_sysctl.o"
621 zebra_rtread="sysctl";;
622esac
623fi])
624AC_SUBST(RTREAD_METHOD)
625
626dnl -----------------------------
627dnl check interface lookup method
628dnl -----------------------------
paul19877dd2004-05-11 10:49:35 +0000629IOCTL_METHOD=ioctl.o
paul7ea487b2003-03-17 02:05:07 +0000630AC_MSG_CHECKING(interface looking up method)
631if test "$netlink" = yes; then
632 AC_MSG_RESULT(netlink)
633 IF_METHOD=if_netlink.o
paul19877dd2004-05-11 10:49:35 +0000634elif test "$opsys" = "sol2-6";then
635 AC_MSG_RESULT(Solaris GIF)
636 IF_METHOD=if_ioctl.o
paulafd8a122005-03-12 06:36:10 +0000637elif test "$opsys" = "sol8";then
paul19877dd2004-05-11 10:49:35 +0000638 AC_MSG_RESULT(Solaris GLIF)
639 IF_METHOD=if_ioctl_solaris.o
640 IOCTL_METHOD=ioctl_solaris.o
641elif test "$opsys" = "irix" ; then
642 AC_MSG_RESULT(IRIX)
643 IF_METHOD=if_ioctl.o
644elif test "$opsys" = "openbsd";then
645 AC_MSG_RESULT(openbsd)
646 IF_METHOD=if_ioctl.o
647elif grep NET_RT_IFLIST /usr/include/sys/socket.h >/dev/null 2>&1; then
648 AC_MSG_RESULT(sysctl)
paul7ea487b2003-03-17 02:05:07 +0000649 IF_METHOD=if_sysctl.o
650 AC_DEFINE(HAVE_NET_RT_IFLIST,,NET_RT_IFLIST)
paul19877dd2004-05-11 10:49:35 +0000651else
paul7ea487b2003-03-17 02:05:07 +0000652 AC_MSG_RESULT(ioctl)
653 IF_METHOD=if_ioctl.o
paul7ea487b2003-03-17 02:05:07 +0000654fi
655AC_SUBST(IF_METHOD)
paul19877dd2004-05-11 10:49:35 +0000656AC_SUBST(IOCTL_METHOD)
paul7ea487b2003-03-17 02:05:07 +0000657
paul42c98192005-05-07 02:22:51 +0000658dnl ---------------------------------------------------------------
659dnl figure out how to specify an interface in multicast sockets API
660dnl ---------------------------------------------------------------
661AC_CHECK_MEMBERS([struct ip_mreqn.imr_ifindex],,,[#ifdef HAVE_SYS_TYPES_H
662#include <sys/types.h>
663#endif
664#ifdef HAVE_NETINET_IN_H
665#include <netinet/in.h>
666#endif])
667
668AC_MSG_CHECKING([for BSD struct ip_mreq hack])
669AC_TRY_COMPILE([#ifdef HAVE_SYS_PARAM_H
670#include <sys/param.h>
671#endif],[#if (defined(__FreeBSD__) && (__FreeBSD_version >= 500022 || (__FreeBSD_version < 500000 && __FreeBSD_version >= 440000))) || (defined(__NetBSD__) && defined(__NetBSD_Version__) && __NetBSD_Version__ >= 106010000)
672 return (0);
673#else
674 #error No support for BSD struct ip_mreq hack detected
675#endif],[AC_MSG_RESULT(yes)
676AC_DEFINE(HAVE_BSD_STRUCT_IP_MREQ_HACK,,[Can pass ifindex in struct ip_mreq])],
677AC_MSG_RESULT(no))
678
paul7ea487b2003-03-17 02:05:07 +0000679dnl -----------------------
680dnl check proc file system.
681dnl -----------------------
682if test -r /proc/net/dev; then
683 AC_DEFINE(HAVE_PROC_NET_DEV,,/proc/net/dev)
684 IF_PROC=if_proc.o
685fi
686
687if test -r /proc/net/if_inet6; then
688 AC_DEFINE(HAVE_PROC_NET_IF_INET6,,/proc/net/if_inet6)
689 IF_PROC=if_proc.o
690fi
691AC_SUBST(IF_PROC)
692
693dnl -----------------------------
694dnl check ipforward detect method
695dnl -----------------------------
696AC_CACHE_CHECK(ipforward method check, zebra_ipforward_path,
697[for zebra_ipforward_path in /proc/net/snmp /dev/ip /dev/null;
698do
699 test x`ls $zebra_ipforward_path 2>/dev/null` = x"$zebra_ipforward_path" && break
700done
701case $zebra_ipforward_path in
702 "/proc/net/snmp") IPFORWARD=ipforward_proc.o
703 zebra_ipforward_path="proc";;
704 "/dev/ip")
705 case "$host" in
706 *-nec-sysv4*) IPFORWARD=ipforward_ews.o
707 zebra_ipforward_path="ews";;
paul9c30ab62003-07-08 08:36:17 +0000708 *-freebsd*) IPFORWARD=ipforward_sysctl.o
709 zebra_ipforward_path="sysctl";;
paul7ea487b2003-03-17 02:05:07 +0000710 *) IPFORWARD=ipforward_solaris.o
711 zebra_ipforward_path="solaris";;
712 esac;;
713 *) IPFORWARD=ipforward_sysctl.o
714 zebra_ipforward_path="sysctl";;
715esac])
716AC_SUBST(IPFORWARD)
717
718AC_CHECK_FUNCS(getaddrinfo, [have_getaddrinfo=yes], [have_getaddrinfo=no])
719
720dnl ----------
721dnl IPv6 check
722dnl ----------
723AC_MSG_CHECKING(whether does this OS have IPv6 stack)
724if test "${enable_ipv6}" = "no"; then
725 AC_MSG_RESULT(disabled)
726else
727dnl ----------
728dnl INRIA IPv6
729dnl ----------
paula159ed92003-06-04 11:01:45 +0000730 if grep IPV6_INRIA_VERSION /usr/include/netinet/in.h >/dev/null 2>&1; then
731 zebra_cv_ipv6=yes
732 AC_DEFINE(HAVE_IPV6,1,INRIA IPv6)
733 AC_DEFINE(INRIA_IPV6,1,INRIA IPv6)
734 RIPNGD="ripngd"
735 OSPF6D="ospf6d"
736 LIB_IPV6=""
737 AC_MSG_RESULT(INRIA IPv6)
paul7ea487b2003-03-17 02:05:07 +0000738dnl ---------
739dnl KAME IPv6
740dnl ---------
paula159ed92003-06-04 11:01:45 +0000741 elif grep WIDE /usr/include/netinet6/in6.h >/dev/null 2>&1; then
742 zebra_cv_ipv6=yes
743 AC_DEFINE(HAVE_IPV6,1,KAME IPv6)
744 AC_DEFINE(KAME,1,KAME IPv6)
745 RIPNGD="ripngd"
746 OSPF6D="ospf6d"
747 if test -d /usr/local/v6/lib -a -f /usr/local/v6/lib/libinet6.a; then
paul7ea487b2003-03-17 02:05:07 +0000748 LIB_IPV6="-L/usr/local/v6/lib -linet6"
paula159ed92003-06-04 11:01:45 +0000749 fi
750 AC_MSG_RESULT(KAME)
hasso71c0fb52003-05-25 20:18:13 +0000751dnl -------------------------
752dnl MUSICA IPv6
753dnl default host check
754dnl It is not used by Kheops
755dnl -------------------------
paula159ed92003-06-04 11:01:45 +0000756 elif grep MUSICA /usr/include6/netinet6/in6.h >/dev/null 2>&1; then
757 zebra_cv_ipv6=yes
758 AC_DEFINE(HAVE_IPV6,1,Musicia IPv6)
759 AC_DEFINE(MUSICA,1,Musica IPv6 stack)
760 AC_DEFINE(KAME,1,KAME IPv6 stack)
761 RIPNGD="ripngd"
762 OSPF6D="ospf6d"
763 if test -d /usr/local/v6/lib -a -f /usr/local/v6/lib/libinet6.a; then
hasso71c0fb52003-05-25 20:18:13 +0000764 LIB_IPV6="-L/usr/local/v6/lib -linet6"
paula159ed92003-06-04 11:01:45 +0000765 fi
766 AC_MSG_RESULT(MUSICA)
paul7ea487b2003-03-17 02:05:07 +0000767dnl ---------
768dnl NRL check
769dnl ---------
paula159ed92003-06-04 11:01:45 +0000770 elif grep NRL /usr/include/netinet6/in6.h >/dev/null 2>&1; then
771 zebra_cv_ipv6=yes
772 AC_DEFINE(HAVE_IPV6,1,NRL IPv6)
773 AC_DEFINE(NRL,1,NRL)
774 RIPNGD="ripngd"
775 OSPF6D="ospf6d"
776 if test x"$opsys" = x"bsdi";then
paul7ea487b2003-03-17 02:05:07 +0000777 AC_DEFINE(BSDI_NRL,,BSDI)
778 AC_MSG_RESULT(BSDI_NRL)
paula159ed92003-06-04 11:01:45 +0000779 else
paul7ea487b2003-03-17 02:05:07 +0000780 AC_MSG_RESULT(NRL)
paula159ed92003-06-04 11:01:45 +0000781 fi
paul19877dd2004-05-11 10:49:35 +0000782dnl ------------------------------------
783dnl Solaris 9, 10 and potentially higher
784dnl ------------------------------------
paulafd8a122005-03-12 06:36:10 +0000785 elif test x"$opsys" = x"sol8"; then
paul19877dd2004-05-11 10:49:35 +0000786 zebra_cv_ipv6=yes;
787 AC_DEFINE(HAVE_IPV6, 1, IPv6)
788 AC_DEFINE(SOLARIS_IPV6, 1, Solaris IPv6)
789 RIPNGD="ripngd"
790 OSPF6D="ospf6d"
791 AC_MSG_RESULT(Solaris IPv6)
paul7ea487b2003-03-17 02:05:07 +0000792dnl ----------
793dnl Linux IPv6
794dnl ----------
paula159ed92003-06-04 11:01:45 +0000795 elif test "${enable_ipv6}" = "yes"; then
796 AC_EGREP_CPP(yes, [
797 #include <linux/version.h>
798 /* 2.1.128 or later */
799 #if LINUX_VERSION_CODE >= 0x020180
800 yes
801 #endif],
802 [zebra_cv_ipv6=yes
803 zebra_cv_linux_ipv6=yes
804 AC_MSG_RESULT(Linux IPv6)])
805 else
806 if test x`ls /proc/net/ipv6_route 2>/dev/null` = x"/proc/net/ipv6_route"
807 then
paul7ea487b2003-03-17 02:05:07 +0000808 zebra_cv_ipv6=yes
809 zebra_cv_linux_ipv6=yes
810 AC_MSG_RESULT(Linux IPv6)
paula159ed92003-06-04 11:01:45 +0000811 fi
812 fi
paul7ea487b2003-03-17 02:05:07 +0000813
paula159ed92003-06-04 11:01:45 +0000814 if test "$zebra_cv_linux_ipv6" = "yes";then
hasso850d39f2005-06-30 13:52:20 +0000815 AC_MSG_CHECKING(whether libc has IPv6 support)
816 AC_TRY_LINK([#include <netinet/in.h>
817 ],[ int a; a = (int) in6addr_any.s6_addr[0]; if (a != 12345) return a; ],
818 [AC_MSG_RESULT(yes)
819 zebra_cv_ipv6=yes
820 zebra_cv_linux_ipv6=yes],
821 [AC_MSG_RESULT(no)
822 zebra_cv_ipv6=no
823 zebra_cv_linux_ipv6=no])
824 fi
825
826 if test "$zebra_cv_linux_ipv6" = "yes";then
paula159ed92003-06-04 11:01:45 +0000827 AC_MSG_CHECKING(for GNU libc >= 2.1)
828 AC_DEFINE(HAVE_IPV6,1,Linux IPv6)
829 AC_EGREP_CPP(yes, [
paul7ea487b2003-03-17 02:05:07 +0000830#include <features.h>
831#if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1
832 yes
paula159ed92003-06-04 11:01:45 +0000833#endif],
834 [glibc=yes
835 AC_DEFINE(LINUX_IPV6,1,Linux IPv6 stack)
836 AC_MSG_RESULT(yes)],
837 AC_MSG_RESULT(no)
838 )
839 RIPNGD="ripngd"
840 OSPF6D="ospf6d"
841 if test "$glibc" != "yes"; then
paul7ea487b2003-03-17 02:05:07 +0000842 INCLUDES="-I/usr/inet6/include"
843 if test x`ls /usr/inet6/lib/libinet6.a 2>/dev/null` != x;then
844 LIB_IPV6="-L/usr/inet6/lib -linet6"
845 fi
paula159ed92003-06-04 11:01:45 +0000846 fi
847 fi
paul7ea487b2003-03-17 02:05:07 +0000848
849dnl -----------------------
850dnl Set IPv6 related values
851dnl -----------------------
paula159ed92003-06-04 11:01:45 +0000852 LIBS="$LIB_IPV6 $LIBS"
853 AC_SUBST(LIB_IPV6)
paul7ea487b2003-03-17 02:05:07 +0000854
paula159ed92003-06-04 11:01:45 +0000855 if test x"$RIPNGD" = x""; then
856 AC_MSG_RESULT(IPv4 only)
857 fi
paul7ea487b2003-03-17 02:05:07 +0000858fi
859
gdtfa3232e2003-12-03 17:52:30 +0000860dnl ------------------
861dnl IPv6 header checks
862dnl ------------------
863if test "x${zebra_cv_ipv6}" = "xyes"; then
864AC_CHECK_HEADERS([netinet6/in6.h netinet/in6_var.h netinet/icmp6.h \
865 netinet6/in6_var.h netinet6/nd6.h])
866fi
867
paul7ea487b2003-03-17 02:05:07 +0000868dnl --------------------
869dnl Daemon disable check
870dnl --------------------
871if test "${enable_zebra}" = "no";then
872 ZEBRA=""
873else
874 ZEBRA="zebra"
875fi
876
877if test "${enable_bgpd}" = "no";then
878 BGPD=""
879else
880 BGPD="bgpd"
881fi
882
883if test "${enable_ripd}" = "no";then
884 RIPD=""
885else
886 RIPD="ripd"
887fi
888
889if test "${enable_ospfd}" = "no";then
890 OSPFD=""
891else
892 OSPFD="ospfd"
893fi
894
ajsd0199432004-12-22 14:03:52 +0000895if test "${enable_watchquagga}" = "no";then
896 WATCHQUAGGA=""
897else
898 WATCHQUAGGA="watchquagga"
899fi
900
paul1ef74ef2003-03-21 15:16:05 +0000901OSPFCLIENT=""
902if test "${enable_opaque_lsa}" = "yes"; then
903 if test "${enable_ospfapi}" != "no";then
paul9a569842003-03-28 01:45:13 +0000904 AC_DEFINE(SUPPORT_OSPF_API,,OSPFAPI)
paul1ef74ef2003-03-21 15:16:05 +0000905
906 if test "${enable_ospfclient}" != "no";then
907 OSPFCLIENT="ospfclient"
908 fi
909 fi
910
paul7ea487b2003-03-17 02:05:07 +0000911fi
912
913case "${enable_ripngd}" in
914 "yes") RIPNGD="ripngd";;
915 "no" ) RIPNGD="";;
916 * ) ;;
917esac
918
919case "${enable_ospf6d}" in
920 "yes") OSPF6D="ospf6d";;
921 "no" ) OSPF6D="";;
922 * ) ;;
923esac
924
jardin9e867fe2003-12-23 08:56:18 +0000925case "${enable_isisd}" in
926 "yes") ISISD="isisd";;
927 "no" ) ISISD="";;
hassoae399ab2004-09-13 20:22:18 +0000928 * ) ;;
jardin9e867fe2003-12-23 08:56:18 +0000929esac
930
paul7ea487b2003-03-17 02:05:07 +0000931if test "${enable_bgp_announce}" = "no";then
932 AC_DEFINE(DISABLE_BGP_ANNOUNCE,,Disable BGP installation to zebra)
933fi
934
935AC_SUBST(ZEBRA)
936AC_SUBST(BGPD)
937AC_SUBST(RIPD)
938AC_SUBST(RIPNGD)
939AC_SUBST(OSPFD)
940AC_SUBST(OSPF6D)
ajsd0199432004-12-22 14:03:52 +0000941AC_SUBST(WATCHQUAGGA)
jardin9e867fe2003-12-23 08:56:18 +0000942AC_SUBST(ISISD)
paul7ea487b2003-03-17 02:05:07 +0000943AC_SUBST(VTYSH)
944AC_SUBST(INCLUDES)
945AC_SUBST(CURSES)
946AC_SUBST(OSPFCLIENT)
paul1ef74ef2003-03-21 15:16:05 +0000947AC_SUBST(OSPFAPI)
paul7ea487b2003-03-17 02:05:07 +0000948AC_CHECK_LIB(c, inet_ntop, [AC_DEFINE(HAVE_INET_NTOP,,inet_ntop)])
949AC_CHECK_LIB(c, inet_pton, [AC_DEFINE(HAVE_INET_PTON,,inet_pton)])
950AC_CHECK_LIB(crypt, crypt)
951AC_CHECK_LIB(resolv, res_init)
952AC_CHECK_LIB(m, main)
953
954dnl ---------------------------------------------------
955dnl BSD/OS 4.1 define inet_XtoY function as __inet_XtoY
956dnl ---------------------------------------------------
paula159ed92003-06-04 11:01:45 +0000957AC_CHECK_FUNC(__inet_ntop, AC_DEFINE(HAVE_INET_NTOP,,__inet_ntop))
958AC_CHECK_FUNC(__inet_pton, AC_DEFINE(HAVE_INET_PTON,,__inet_pton))
959AC_CHECK_FUNC(__inet_aton, AC_DEFINE(HAVE_INET_ATON,,__inet_aton))
paul7ea487b2003-03-17 02:05:07 +0000960
961dnl ---------------------------
962dnl check system has GNU regexp
963dnl ---------------------------
964dnl AC_MSG_CHECKING(whether system has GNU regex)
965AC_CHECK_LIB(c, regexec,
966[AC_DEFINE(HAVE_GNU_REGEX,,GNU regexp library)
967 LIB_REGEX=""],
968[LIB_REGEX="regex.o"])
969AC_SUBST(LIB_REGEX)
970
971dnl ------------------
972dnl check SNMP library
973dnl ------------------
974if test "${enable_snmp}" = "yes";then
975dnl AC_CHECK_LIB(snmp, asn_parse_int, HAVE_SNMP=yes)
paul7ea487b2003-03-17 02:05:07 +0000976 if test "${HAVE_SNMP}" = ""; then
paul1ef74ef2003-03-21 15:16:05 +0000977 old_libs="${LIBS}"
978 LIBS="-L/usr/lib"
paul7ea487b2003-03-17 02:05:07 +0000979 unset ac_cv_lib_snmp_asn_parse_int
paul1ef74ef2003-03-21 15:16:05 +0000980 AC_CHECK_LIB(crypto, main, NEED_CRYPTO=yes, )
981 if test "${NEED_CRYPTO}" = ""; then
982 AC_CHECK_LIB(netsnmp, asn_parse_int, [HAVE_NETSNMP=yes; HAVE_SNMP=yes ])
983 else
984 AC_CHECK_LIB(netsnmp, asn_parse_int, [HAVE_NETSNMP=yes; HAVE_SNMP=yes; NEED_CRYPTO=yes;LIBS="$LIBS -lcrypto" ],,"-lcrypto")
985 fi
986 LIBS="${old_libs}"
paul7ea487b2003-03-17 02:05:07 +0000987 fi
paul1ef74ef2003-03-21 15:16:05 +0000988 if test "${HAVE_SNMP}" = ""; then
989 old_libs="${LIBS}"
990 LIBS="-L/usr/lib"
991 unset ac_cv_lib_snmp_asn_parse_int
992 AC_CHECK_LIB(snmp, asn_parse_int, HAVE_SNMP=yes, )
993 if test "${HAVE_SNMP}" = ""; then
994 unset ac_cv_lib_snmp_asn_parse_int
995 AC_CHECK_LIB(crypto, main, NEED_CRYPTO=yes, )
996 if test "${NEED_CRYPTO}" = "yes"; then
997 AC_CHECK_LIB(snmp, asn_parse_int, [HAVE_SNMP=yes; NEED_CRYPTO=yes; LIBS="$LIBS -lcrypto" ],,"-lcrypto")
998 fi
999 fi
1000 LIBS="${old_libs}"
1001 fi
paul7ea487b2003-03-17 02:05:07 +00001002
1003 if test "${HAVE_SNMP}" = ""; then
paul1ef74ef2003-03-21 15:16:05 +00001004 old_libs="${LIBS}"
1005 LIBS="-L/usr/local/lib"
1006 unset ac_cv_lib_snmp_asn_parse_int
1007 AC_CHECK_LIB(snmp, asn_parse_int, HAVE_SNMP=yes)
1008 if test "${HAVE_SNMP}" = ""; then
1009 unset ac_cv_lib_snmp_asn_parse_int
1010 AC_CHECK_LIB(crypto, main, NEED_CRYPTO=yes, )
1011 if test "${NEED_CRYPTO}" = "yes"; then
1012 AC_CHECK_LIB(snmp, asn_parse_int, [HAVE_SNMP=yes; NEED_CRYPTO=yes; LIBS="$LIBS -lcrypto" ],,"-lcrypto")
1013 fi
1014 fi
1015 LIBS="${old_libs}"
paul7ea487b2003-03-17 02:05:07 +00001016 fi
paul1ef74ef2003-03-21 15:16:05 +00001017
paul7ea487b2003-03-17 02:05:07 +00001018 if test "${HAVE_SNMP}" = "yes"; then
1019 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
1020 do
1021 test -f "${ac_snmp}" && break
1022 done
paul1ef74ef2003-03-21 15:16:05 +00001023
paul7ea487b2003-03-17 02:05:07 +00001024 case ${ac_snmp} in
1025 /usr/include/net-snmp/*)
1026 AC_DEFINE(HAVE_SNMP,,SNMP)
paul1ef74ef2003-03-21 15:16:05 +00001027 AC_DEFINE(HAVE_NETSNMP,,SNMP)
paul7ea487b2003-03-17 02:05:07 +00001028 AC_DEFINE(UCD_COMPATIBLE,,SNMP)
hasso2d582282005-03-28 15:29:07 +00001029 SNMP_INCLUDES="${SNMP_INCLUDES} -I/usr/include/net-snmp -I/usr/include/net-snmp/library"
paulac7c4bb2003-03-19 04:25:08 +00001030 if test "${HAVE_NETSNMP}" = "yes"; then
paul1ef74ef2003-03-21 15:16:05 +00001031 LIBS="${LIBS} -lnetsnmp"
paulac7c4bb2003-03-19 04:25:08 +00001032 else
paul1ef74ef2003-03-21 15:16:05 +00001033 LIBS="${LIBS} -lsnmp"
paulac7c4bb2003-03-19 04:25:08 +00001034 fi
paul7ea487b2003-03-17 02:05:07 +00001035 ;;
1036 /usr/include/ucd-snmp/*)
1037 AC_DEFINE(HAVE_SNMP,,SNMP)
hasso2d582282005-03-28 15:29:07 +00001038 SNMP_INCLUDES="${SNMP_INCLUDES} -I/usr/include/ucd-snmp"
paul7ea487b2003-03-17 02:05:07 +00001039 LIBS="${LIBS} -lsnmp"
1040 ;;
1041 /usr/local/include/ucd-snmp/*)
1042 AC_DEFINE(HAVE_SNMP,,SNMP)
hasso2d582282005-03-28 15:29:07 +00001043 SNMP_INCLUDES="${SNMP_INCLUDES} -I/usr/local/include/ucd-snmp"
paul7ea487b2003-03-17 02:05:07 +00001044 LIBS="${LIBS} -L/usr/local/lib -lsnmp"
1045 ;;
paulf3bd1a72003-11-02 07:29:11 +00001046 /usr/local/include/net-snmp/*)
1047 AC_DEFINE(HAVE_SNMP,,SNMP)
1048 AC_DEFINE(HAVE_NET_SNMP,,SNMP)
1049 AC_DEFINE(UCD_COMPATIBLE,,SNMP)
hasso2d582282005-03-28 15:29:07 +00001050 SNMP_INCLUDES="${SNMP_INCLUDES} -I/usr/local/include/net-snmp"
paulf3bd1a72003-11-02 07:29:11 +00001051 LIBS="${LIBS} -L/usr/local/lib -lnetsnmp"
1052 ;;
paul7ea487b2003-03-17 02:05:07 +00001053 esac
1054 if test "${NEED_CRYPTO}" = "yes"; then
1055 LIBS="${LIBS} -lcrypto"
1056 fi
1057 fi
1058fi
1059
ajs6cf9df02005-01-12 16:52:55 +00001060if test "${enable_snmp}" = "yes" -a "${HAVE_SNMP}" != "yes"; then
1061 AC_MSG_ERROR([--enable-snmp given, but cannot find support for SNMP])
1062fi
1063
hasso2d582282005-03-28 15:29:07 +00001064AC_SUBST(SNMP_INCLUDES)
1065
paul7ea487b2003-03-17 02:05:07 +00001066dnl ----------------------------
1067dnl check sa_len of sockaddr
1068dnl ----------------------------
1069AC_MSG_CHECKING(whether struct sockaddr has a sa_len field)
1070AC_TRY_COMPILE([#include <sys/types.h>
1071#include <sys/socket.h>
1072],[static struct sockaddr ac_i;int ac_j = sizeof (ac_i.sa_len);],
1073[AC_MSG_RESULT(yes)
1074 AC_DEFINE(HAVE_SA_LEN,,sa_len)],
1075 AC_MSG_RESULT(no))
1076
1077dnl ----------------------------
1078dnl check sin_len of sockaddr_in
1079dnl ----------------------------
1080AC_MSG_CHECKING(whether struct sockaddr_in has a sin_len field)
1081AC_TRY_COMPILE([#include <sys/types.h>
1082#include <netinet/in.h>
1083],[static struct sockaddr_in ac_i;int ac_j = sizeof (ac_i.sin_len);],
1084[AC_MSG_RESULT(yes)
1085 AC_DEFINE(HAVE_SIN_LEN,,sin_len)],
1086 AC_MSG_RESULT(no))
1087
1088dnl ----------------------------
1089dnl check sun_len of sockaddr_un
1090dnl ----------------------------
1091AC_MSG_CHECKING(whether struct sockaddr_un has a sun_len field)
1092AC_TRY_COMPILE([#include <sys/types.h>
1093#include <sys/un.h>
1094],[static struct sockaddr_un ac_i;int ac_j = sizeof (ac_i.sun_len);],
1095[AC_MSG_RESULT(yes)
1096 AC_DEFINE(HAVE_SUN_LEN,,sun_len)],
1097 AC_MSG_RESULT(no))
1098
1099dnl -----------------------------------
1100dnl check sin6_scope_id of sockaddr_in6
1101dnl -----------------------------------
1102if test "$zebra_cv_ipv6" = yes; then
1103 AC_MSG_CHECKING(whether struct sockaddr_in6 has a sin6_scope_id field)
1104 AC_TRY_COMPILE([#include <sys/types.h>
1105#include <netinet/in.h>
1106],[static struct sockaddr_in6 ac_i;int ac_j = sizeof (ac_i.sin6_scope_id);],
1107[AC_MSG_RESULT(yes)
1108 AC_DEFINE(HAVE_SIN6_SCOPE_ID,,scope id)],
1109 AC_MSG_RESULT(no))
1110fi
1111
1112dnl ----------------------------
1113dnl check socklen_t exist or not
1114dnl ----------------------------
1115AC_MSG_CHECKING(whther socklen_t is defined)
1116AC_TRY_COMPILE([#include <sys/types.h>
1117#include <sys/socket.h>
1118#include <netinet/in.h>
1119],[socklen_t ac_x;],
1120[AC_MSG_RESULT(yes)
1121 AC_DEFINE(HAVE_SOCKLEN_T,,socklen_t)],
1122 AC_MSG_RESULT(no))
1123
1124dnl ------------------------
1125dnl check struct sockaddr_dl
1126dnl ------------------------
1127AC_MSG_CHECKING(whether struct sockaddr_dl exist)
1128AC_EGREP_HEADER(sockaddr_dl,
1129net/if_dl.h,
1130[AC_MSG_RESULT(yes)
1131 AC_DEFINE(HAVE_SOCKADDR_DL,,sockaddr_dl)],
1132 AC_MSG_RESULT(no))
1133
1134dnl --------------------------
1135dnl check structure ifaliasreq
1136dnl --------------------------
1137AC_MSG_CHECKING(whether struct ifaliasreq exist)
1138AC_EGREP_HEADER(ifaliasreq,
1139net/if.h,
1140[AC_MSG_RESULT(yes)
1141 AC_DEFINE(HAVE_IFALIASREQ,,ifaliasreq)],
1142 AC_MSG_RESULT(no))
1143
1144dnl ----------------------------
1145dnl check structure in6_aliasreq
1146dnl ----------------------------
hasso71c0fb52003-05-25 20:18:13 +00001147AC_MSG_CHECKING(whether struct in6_aliasreq exist)
paul7ea487b2003-03-17 02:05:07 +00001148AC_EGREP_HEADER(in6_aliasreq,
1149netinet6/in6_var.h,
1150[AC_MSG_RESULT(yes)
1151 AC_DEFINE(HAVE_IN6_ALIASREQ,,in6_aliasreq)],
1152 AC_MSG_RESULT(no))
1153
hasso71c0fb52003-05-25 20:18:13 +00001154dnl -----------------------------------
1155dnl check ifra_lifetime of in6_aliasreq
1156dnl -----------------------------------
1157AC_MSG_CHECKING(whether in6_aliasreq.ifra_lifetime exist)
1158AC_TRY_COMPILE([#include <sys/types.h>
1159#include <netinet6/in6_var.h>
1160],[static struct if6_aliasreq ac_i;int ac_j = sizeof (ac_i.ifra_lifetime);],
1161[AC_MSG_RESULT(yes)
paula159ed92003-06-04 11:01:45 +00001162 AC_DEFINE(HAVE_IFRA_LIFETIME,,Have in6_aliasreq.ifra_lifetime)],
hasso71c0fb52003-05-25 20:18:13 +00001163 AC_MSG_RESULT(no))
1164
paul7ea487b2003-03-17 02:05:07 +00001165dnl ---------------------------
1166dnl check structure rt_addrinfo
1167dnl ---------------------------
1168AC_MSG_CHECKING(whether struct rt_addrinfo exist)
1169AC_EGREP_HEADER(rt_addrinfo,
1170net/route.h,
1171[AC_MSG_RESULT(yes)
1172 AC_DEFINE(HAVE_RT_ADDRINFO,,rt_addrinfo)],
1173 AC_MSG_RESULT(no))
1174
1175dnl --------------------------
1176dnl check structure in_pktinfo
1177dnl --------------------------
1178AC_MSG_CHECKING(whether struct in_pktinfo exist)
1179AC_TRY_COMPILE([#include <netinet/in.h>
1180],[struct in_pktinfo ac_x;],
1181[AC_MSG_RESULT(yes)
1182 AC_DEFINE(HAVE_INPKTINFO,,in_pktinfo)],
1183 AC_MSG_RESULT(no))
1184
vincent29c4c9b2005-03-25 13:05:47 +00001185dnl ----------------------------------
1186dnl check struct nd_opt_homeagent_info
1187dnl ----------------------------------
1188AC_MSG_CHECKING(whether struct nd_opt_homeagent_info exist)
1189AC_EGREP_HEADER(nd_opt_homeagent_info,
1190netinet/icmp6.h,
1191[AC_MSG_RESULT(yes)
1192 AC_DEFINE(HAVE_ND_OPT_HOMEAGENT_INFO,,nd_opt_homeagent_info)],
1193 AC_MSG_RESULT(no))
1194
1195dnl --------------------------------
1196dnl check struct nd_opt_adv_interval
1197dnl --------------------------------
1198AC_MSG_CHECKING(whether struct nd_opt_adv_interval exist)
1199AC_EGREP_HEADER(nd_opt_adv_interval,
1200netinet/icmp6.h,
1201[AC_MSG_RESULT(yes)
1202 AC_DEFINE(HAVE_ND_OPT_ADV_INTERVAL,,nd_opt_adv_interval)],
1203 AC_MSG_RESULT(no))
1204
1205dnl ------------------------------------
1206dnl check fields in nd_opt_adv_interval
1207dnl ------------------------------------
1208AC_MSG_CHECKING(whether nd_opt_ai_type field exist)
1209AC_EGREP_HEADER(nd_opt_ai_type,
1210netinet/icmp6.h,
1211[AC_MSG_RESULT(yes)
1212 AC_DEFINE(HAVE_ND_OPT_ADV_INTERVAL_AI_FIELDS,,nd_opt_ai_type)],
1213 AC_MSG_RESULT(no))
1214
paul7ea487b2003-03-17 02:05:07 +00001215dnl --------------------------------------
1216dnl checking for getrusage struct and call
1217dnl --------------------------------------
1218AC_MSG_CHECKING(whether getrusage is available)
1219AC_TRY_COMPILE([#include <sys/resource.h>
1220],[struct rusage ac_x; getrusage (RUSAGE_SELF, &ac_x);],
1221[AC_MSG_RESULT(yes)
1222 AC_DEFINE(HAVE_RUSAGE,,rusage)],
1223 AC_MSG_RESULT(no))
1224
pauledd7c242003-06-04 13:59:38 +00001225dnl -------------------
1226dnl capabilities checks
1227dnl -------------------
hasso41d3fc92004-04-06 11:59:00 +00001228if test "${enable_capabilities}" != "no"; then
1229 AC_MSG_CHECKING(whether prctl PR_SET_KEEPCAPS is available)
1230 AC_TRY_COMPILE([#include <sys/prctl.h>],[prctl(PR_SET_KEEPCAPS, 1, 0, 0, 0);],
1231 [AC_MSG_RESULT(yes)
1232 AC_DEFINE(HAVE_PR_SET_KEEPCAPS,,prctl)
1233 quagga_ac_keepcaps="yes"],
1234 AC_MSG_RESULT(no)
pauledd7c242003-06-04 13:59:38 +00001235 )
hasso41d3fc92004-04-06 11:59:00 +00001236 if test x"${quagga_ac_keepcaps}" = x"yes"; then
1237 AC_CHECK_HEADERS(sys/capability.h)
1238 fi
1239 if test x"${ac_cv_header_sys_capability_h}" = x"yes"; then
1240 AC_CHECK_LIB(cap, cap_init,
1241 [AC_DEFINE(HAVE_LCAPS,1,Capabilities)
1242 LIBCAP="-lcap"
paulceacedb2005-09-29 14:39:32 +00001243 quagga_ac_lcaps="yes"]
hasso41d3fc92004-04-06 11:59:00 +00001244 )
paulceacedb2005-09-29 14:39:32 +00001245 else
1246 AC_CHECK_HEADERS(priv.h,
1247 [AC_MSG_CHECKING(Solaris style privileges are available)
1248 AC_TRY_COMPILE([#include <priv.h>],[getpflags(PRIV_AWARE);],
1249 [AC_MSG_RESULT(yes)
1250 AC_DEFINE(HAVE_SOLARIS_CAPABILITIES,1,getpflags)
1251 quagga_ac_scaps="yes"],
1252 AC_MSG_RESULT(no)
1253 )
1254 ]
1255 )
1256 fi
1257 if test x"${quagga_ac_scaps}" = x"yes" \
1258 -o x"${quagga_ac_lcaps}" = x"yes"; then
1259 AC_DEFINE(HAVE_CAPABILITIES,1,capabilities)
hasso41d3fc92004-04-06 11:59:00 +00001260 fi
pauledd7c242003-06-04 13:59:38 +00001261fi
1262AC_SUBST(LIBCAP)
1263
ajs40abf232005-01-12 17:27:27 +00001264dnl -------------------
1265dnl test for ucontext.h
1266dnl -------------------
1267AC_CHECK_HEADERS(ucontext.h)
1268
paulfb2d1502003-06-04 09:40:54 +00001269dnl ---------------------------
1270dnl check for glibc 'backtrace'
1271dnl ---------------------------
1272if test "${glibc}" = "yes"; then
1273 AC_CHECK_HEADER(execinfo.h)
1274fi
1275if test x"${ac_cv_header_execinfo_h}" = x"yes"; then
1276 AC_CHECK_FUNC(backtrace,
1277 [AC_DEFINE(HAVE_GLIBC_BACKTRACE,,Glibc backtrace)]
1278 )
1279fi
1280
paul408ad942003-05-20 00:03:33 +00001281dnl ----------
1282dnl configure date
1283dnl ----------
1284CONFDATE=`date '+%Y%m%d'`
1285AC_SUBST(CONFDATE)
1286
paul7ea487b2003-03-17 02:05:07 +00001287dnl ------------------------------
paula159ed92003-06-04 11:01:45 +00001288dnl set paths for state directory
paul23bd12c2003-04-07 06:11:09 +00001289dnl ------------------------------
1290if test "${prefix}" = "NONE"; then
paule8f29842003-08-12 13:08:31 +00001291 quagga_statedir_prefix="";
paul23bd12c2003-04-07 06:11:09 +00001292else
paule8f29842003-08-12 13:08:31 +00001293 quagga_statedir_prefix=${prefix}
paul23bd12c2003-04-07 06:11:09 +00001294fi
1295if test "${localstatedir}" = '${prefix}/var'; then
paula159ed92003-06-04 11:01:45 +00001296 AC_CACHE_CHECK(state directory,ac_statedir,
paule8f29842003-08-12 13:08:31 +00001297 [for QUAGGA_STATE_DIR in ${quagga_statedir_prefix}/var/run dnl
1298 ${quagga_statedir_prefix}/var/adm dnl
1299 ${quagga_statedir_prefix}/etc dnl
paula159ed92003-06-04 11:01:45 +00001300 /var/run dnl
1301 /var/adm dnl
1302 /etc dnl
1303 /dev/null;
paul23bd12c2003-04-07 06:11:09 +00001304 do
paule8f29842003-08-12 13:08:31 +00001305 test -d $QUAGGA_STATE_DIR && break
paul23bd12c2003-04-07 06:11:09 +00001306 done
paule8f29842003-08-12 13:08:31 +00001307 quagga_statedir=$QUAGGA_STATE_DIR])
paul23bd12c2003-04-07 06:11:09 +00001308else
paule8f29842003-08-12 13:08:31 +00001309 quagga_statedir=${localstatedir}
paula159ed92003-06-04 11:01:45 +00001310 AC_MSG_CHECKING(directory to use for state file)
paule8f29842003-08-12 13:08:31 +00001311 AC_MSG_RESULT(${quagga_statedir})
paul26275b02005-04-11 07:10:47 +00001312 AC_SUBST(quagga_statedir)
paul23bd12c2003-04-07 06:11:09 +00001313fi
paule8f29842003-08-12 13:08:31 +00001314if test $quagga_statedir = "/dev/null"; then
paula159ed92003-06-04 11:01:45 +00001315 AC_MSG_ERROR('STATE DIRECTORY NOT FOUND! FIX OR SPECIFY --localstatedir!')
1316fi
1317
paule8f29842003-08-12 13:08:31 +00001318AC_DEFINE_UNQUOTED(PATH_ZEBRA_PID, "$quagga_statedir/zebra.pid",zebra PID)
1319AC_DEFINE_UNQUOTED(PATH_RIPD_PID, "$quagga_statedir/ripd.pid",ripd PID)
1320AC_DEFINE_UNQUOTED(PATH_RIPNGD_PID, "$quagga_statedir/ripngd.pid",ripngd PID)
1321AC_DEFINE_UNQUOTED(PATH_BGPD_PID, "$quagga_statedir/bgpd.pid",bgpd PID)
1322AC_DEFINE_UNQUOTED(PATH_OSPFD_PID, "$quagga_statedir/ospfd.pid",ospfd PID)
1323AC_DEFINE_UNQUOTED(PATH_OSPF6D_PID, "$quagga_statedir/ospf6d.pid",ospf6d PID)
jardin9e867fe2003-12-23 08:56:18 +00001324AC_DEFINE_UNQUOTED(PATH_ISISD_PID, "$quagga_statedir/isisd.pid",isisd PID)
ajsd0199432004-12-22 14:03:52 +00001325AC_DEFINE_UNQUOTED(PATH_WATCHQUAGGA_PID, "$quagga_statedir/watchquagga.pid",watchquagga PID)
paule8f29842003-08-12 13:08:31 +00001326AC_DEFINE_UNQUOTED(ZEBRA_SERV_PATH, "$quagga_statedir/zserv.api",zebra api socket)
1327AC_DEFINE_UNQUOTED(ZEBRA_VTYSH_PATH, "$quagga_statedir/zebra.vty",zebra vty socket)
1328AC_DEFINE_UNQUOTED(RIP_VTYSH_PATH, "$quagga_statedir/ripd.vty",rip vty socket)
1329AC_DEFINE_UNQUOTED(RIPNG_VTYSH_PATH, "$quagga_statedir/ripngd.vty",ripng vty socket)
1330AC_DEFINE_UNQUOTED(BGP_VTYSH_PATH, "$quagga_statedir/bgpd.vty",bgpd vty socket)
1331AC_DEFINE_UNQUOTED(OSPF_VTYSH_PATH, "$quagga_statedir/ospfd.vty",ospfd vty socket)
1332AC_DEFINE_UNQUOTED(OSPF6_VTYSH_PATH, "$quagga_statedir/ospf6d.vty",ospf6d vty socket)
jardin9e867fe2003-12-23 08:56:18 +00001333AC_DEFINE_UNQUOTED(ISIS_VTYSH_PATH, "$quagga_statedir/isisd.vty",isisd vty socket)
ajs515210b2004-12-22 15:35:12 +00001334AC_DEFINE_UNQUOTED(DAEMON_VTY_DIR, "$quagga_statedir",daemon vty directory)
paul7ea487b2003-03-17 02:05:07 +00001335
paul1eb8ef22005-04-07 07:30:20 +00001336dnl -------------------------------
1337dnl Quagga sources should always be
1338dnl current wrt interfaces. Dont
1339dnl allow deprecated interfaces to
1340dnl be exposed.
1341dnl -------------------------------
1342AC_DEFINE(QUAGGA_NO_DEPRECATED_INTERFACES, 1, Hide deprecated interfaces)
1343
paul7ea487b2003-03-17 02:05:07 +00001344dnl ---------------------------
1345dnl Check htonl works correctly
1346dnl ---------------------------
1347AC_MSG_CHECKING(for working htonl)
1348AC_CACHE_VAL(ac_cv_htonl_works, [
1349AC_TRY_LINK([#ifdef HAVE_SYS_TYPES_H
1350#include <sys/types.h>
1351#endif
1352#ifdef HAVE_NETDB_H
1353#include <netdb.h>
1354#endif
1355#ifdef HAVE_NETINET_IN_H
1356#include <netinet/in.h>
1357#endif],
1358[htonl (0);],
1359ac_cv_htonl_works=yes,
1360ac_cv_htonl_works=no)])
1361AC_MSG_RESULT($ac_cv_htonl_works)
1362
paul14c17fd2004-11-07 22:34:23 +00001363AC_CONFIG_FILES([Makefile lib/Makefile zebra/Makefile ripd/Makefile
ajsd0199432004-12-22 14:03:52 +00001364 ripngd/Makefile bgpd/Makefile ospfd/Makefile watchquagga/Makefile
jardin9e867fe2003-12-23 08:56:18 +00001365 ospf6d/Makefile isisd/Makefile vtysh/Makefile doc/Makefile
paul14c17fd2004-11-07 22:34:23 +00001366 ospfclient/Makefile tests/Makefile m4/Makefile redhat/Makefile
gdt69f1fc22004-08-27 15:57:35 +00001367 pkgsrc/Makefile
paul670bbf12004-11-12 09:05:00 +00001368 redhat/quagga.spec
gdtb7a97f82004-07-23 16:23:56 +00001369 lib/version.h
paul14c17fd2004-11-07 22:34:23 +00001370 doc/defines.texi
hassof695b012005-04-02 19:03:39 +00001371 isisd/topology/Makefile
gdtcbd04082004-08-31 18:16:36 +00001372 pkgsrc/bgpd.sh pkgsrc/ospf6d.sh pkgsrc/ospfd.sh
paulf31293a2004-11-12 09:27:04 +00001373 pkgsrc/ripd.sh pkgsrc/ripngd.sh pkgsrc/zebra.sh])
paul26275b02005-04-11 07:10:47 +00001374AC_CONFIG_FILES([solaris/Makefile])
1375
paul670bbf12004-11-12 09:05:00 +00001376AC_CONFIG_FILES([vtysh/extract.pl],[chmod +x vtysh/extract.pl])
hasso48577192004-11-19 06:41:49 +00001377## Hack, but working solution to avoid rebuilding of quagga.info.
1378## It's already in CVS until texinfo 4.7 is more common.
paul14c1f182005-05-13 20:11:53 +00001379AC_CONFIG_COMMANDS([info-time],[touch doc/quagga.info])
paul14c17fd2004-11-07 22:34:23 +00001380AC_OUTPUT
paul7ea487b2003-03-17 02:05:07 +00001381
1382echo "
hassoc89f6492004-08-26 12:21:28 +00001383Quagga configuration
1384--------------------
1385quagga version : ${PACKAGE_VERSION}
paul7ea487b2003-03-17 02:05:07 +00001386host operationg system : ${host_os}
1387source code location : ${srcdir}
1388compiler : ${CC}
1389compiler flags : ${CFLAGS}
hasso2d582282005-03-28 15:29:07 +00001390includes : ${INCLUDES} ${SNMP_INCLUDES}
hassoc0689392005-08-25 12:00:58 +00001391linker flags : ${LDFLAGS} ${LIBS} ${LIBCAP} ${LIBREADLINE}
paule8f29842003-08-12 13:08:31 +00001392state file directory : ${quagga_statedir}
pauldc7a2bf2003-10-22 00:07:44 +00001393config file directory : `eval echo \`echo ${sysconfdir}\``
gdtd6b72f72003-12-03 17:24:27 +00001394example directory : `eval echo \`echo ${exampledir}\``
paul8d4aee52003-06-06 00:30:35 +00001395user to run as : ${enable_user}
1396group to run as : ${enable_group}
1397group for vty sockets : ${enable_vty_group}
gdtaa593d52003-12-22 20:15:53 +00001398config file mask : ${enable_configfile_mask}
1399log file mask : ${enable_logfile_mask}
pauldc7a2bf2003-10-22 00:07:44 +00001400
1401The above user and group must have read/write access to the state file
1402directory and to the config files in the config file directory.
paul7ea487b2003-03-17 02:05:07 +00001403"