blob: e173fcaeab3d7ec9bb66ed01ad6fa59dda099162 [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##
Paul Jakma105b8232006-05-28 08:02:41 +00008## $Id$
paule8f29842003-08-12 13:08:31 +00009AC_PREREQ(2.53)
paul7ea487b2003-03-17 02:05:07 +000010
Paul Jakma08f9fb12006-05-10 19:52:36 +000011AC_INIT(Quagga, 0.99.4, [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 ------------------------------------------------------------------
paul6a4b8832005-11-26 08:28:00 +000071if test "x${GCC}" = "xyes" ; then
72 COMPILER="GCC"
73 AC_MSG_CHECKING([whether we are using the Intel compiler])
74 AC_EGREP_CPP([^__INTEL_COMPILER], [__INTEL_COMPILER],
75 [AC_MSG_RESULT([no])],
76 [COMPILER="ICC"
77 AC_MSG_RESULT([yes])]
78 )
79else
80 AC_MSG_CHECKING([whether we are using SunPro compiler])
81 AC_EGREP_CPP([^__SUNPRO_C.*0x5(7|8|9)], ["__SUNPRO_C" __SUNPRO_C],
82 [AC_MSG_RESULT([no])],
83 [COMPILER="SUNPRO"
84 AC_MSG_RESULT([yes])]
85 )
86fi
paul7ea487b2003-03-17 02:05:07 +000087
paula49c0ff2004-09-30 06:08:58 +000088dnl ---------------------------------------------
paul7ea487b2003-03-17 02:05:07 +000089dnl If CLFAGS doesn\'t exist set default value
paula49c0ff2004-09-30 06:08:58 +000090dnl AC_PROG_CC will have set minimal default
91dnl already, eg "-O2 -g" for gcc, "-g" for others
paul27eebb32004-07-22 18:16:59 +000092dnl (Wall is gcc specific... have to make sure
93dnl gcc is being used before setting it)
94dnl
paul6a4b8832005-11-26 08:28:00 +000095dnl Intel icc 8.0 also sets __GNUC__,
96dnl but doesn't support all these fancy -W options.
hasso1969e4b2005-03-27 13:07:23 +000097dnl Intel compiler warnings we ignore:
98dnl 279: controlling expression is constant.
99dnl 869: parameter "xxx" was never referenced - to avoid massive warnings
100dnl about "self", "vty", "argc" and "argv" never referenced in DEFUN
101dnl macro.
102dnl 981: operands are evaluated in unspecified order.
paul6a4b8832005-11-26 08:28:00 +0000103dnl
104dnl Sun Studio 10 / SunPro 5.7 is also supported,
105dnl so lets set some sane CFLAGS for it.
106dnl ---------------------------------------------
hasso1969e4b2005-03-27 13:07:23 +0000107
paul6a4b8832005-11-26 08:28:00 +0000108AC_MSG_CHECKING([whether to set a default CFLAGS])
109if test "x${cflags_specified}" = "x" ; then
110 case ${COMPILER} in
111 "ICC")
112 CFLAGS="-Os -g -Wall -wd 279,869,981"
113 AC_MSG_RESULT([Intel default])
114 ;;
115 "GCC")
116 CFLAGS="-Os -fno-omit-frame-pointer -g -std=c99 -Wall"
117 CFLAGS="${CFLAGS} -Wsign-compare -Wpointer-arith"
118 CFLAGS="${CFLAGS} -Wbad-function-cast -Wwrite-strings"
119 CFLAGS="${CFLAGS} -Wmissing-prototypes -Wmissing-declarations"
120 CFLAGS="${CFLAGS} -Wchar-subscripts -Wcast-qual"
121 # TODO: conditionally addd -Wpacked if handled
122 AC_MSG_RESULT([gcc default])
123 ;;
124 "SUNPRO")
Paul Jakma105b8232006-05-28 08:02:41 +0000125 CFLAGS="-xO4 -v -g -xspace -xcode=pic32 -xstrconst -xc99"
paul6a4b8832005-11-26 08:28:00 +0000126 AC_MSG_RESULT([SunPro default])
127 ;;
128 *)
129 AC_MSG_RESULT([unknown compiler])
130 ;;
131 esac
132else
133 AC_MSG_RESULT([CFLAGS supplied by user])
hasso1969e4b2005-03-27 13:07:23 +0000134fi
135
paul7ea487b2003-03-17 02:05:07 +0000136dnl --------------
137dnl Check programs
138dnl --------------
paul7ea487b2003-03-17 02:05:07 +0000139AC_PROG_INSTALL
140AC_PROG_MAKE_SET
141AC_CHECK_TOOL(AR, ar)
142AC_CHECK_TOOL(RANLIB, ranlib, :)
143
Paul Jakma105b8232006-05-28 08:02:41 +0000144dnl ---------------------------
145dnl We, perhaps unfortunately,
146dnl depend on GNU Make specific
147dnl constructs.
148dnl Give the user a warning if
149dnl not GNU Make.
150dnl ---------------------------
151AC_CACHE_CHECK([if ${MAKE-make} is GNU make], [quagga_cv_gnu_make],
152 [quagga_cv_gnu_make=no
153 if ${MAKE-make} --version 2>/dev/null | \
154 grep '^GNU Make ' >/dev/null ; then
155 quagga_cv_gnu_make=yes;
156 fi
157 ]
158)
159
paul7ea487b2003-03-17 02:05:07 +0000160dnl ---------
161dnl AIX check
162dnl ---------
163AC_AIX
164
gdt87efd642004-06-30 17:36:11 +0000165dnl -------
166dnl libtool
167dnl -------
paul0fc42942004-08-19 04:41:21 +0000168AC_PROG_LIBTOOL
gdt87efd642004-06-30 17:36:11 +0000169
paul7ea487b2003-03-17 02:05:07 +0000170dnl ----------------------
171dnl Packages configuration
172dnl ----------------------
173AC_ARG_ENABLE(vtysh,
gdtfc9d0742004-06-30 14:25:12 +0000174[ --enable-vtysh include integrated vty shell for Quagga])
paul7ea487b2003-03-17 02:05:07 +0000175AC_ARG_ENABLE(ipv6,
176[ --disable-ipv6 turn off IPv6 related features and daemons])
177AC_ARG_ENABLE(zebra,
178[ --disable-zebra do not build zebra daemon])
179AC_ARG_ENABLE(bgpd,
180[ --disable-bgpd do not build bgpd])
181AC_ARG_ENABLE(ripd,
182[ --disable-ripd do not build ripd])
183AC_ARG_ENABLE(ripngd,
184[ --disable-ripngd do not build ripngd])
185AC_ARG_ENABLE(ospfd,
186[ --disable-ospfd do not build ospfd])
paul7ea487b2003-03-17 02:05:07 +0000187AC_ARG_ENABLE(ospf6d,
188[ --disable-ospf6d do not build ospf6d])
ajsd0199432004-12-22 14:03:52 +0000189AC_ARG_ENABLE(watchquagga,
190[ --disable-watchquagga do not build watchquagga])
jardin9e867fe2003-12-23 08:56:18 +0000191AC_ARG_ENABLE(isisd,
hassoae399ab2004-09-13 20:22:18 +0000192[ --enable-isisd build isisd])
paul7ea487b2003-03-17 02:05:07 +0000193AC_ARG_ENABLE(bgp-announce,
194[ --disable-bgp-announce, turn off BGP route announcement])
195AC_ARG_ENABLE(netlink,
196[ --enable-netlink force to use Linux netlink interface])
197AC_ARG_ENABLE(broken-aliases,
198[ --enable-broken-aliases enable aliases as distinct interfaces for Linux 2.2.X])
199AC_ARG_ENABLE(snmp,
200[ --enable-snmp enable SNMP support])
201AC_ARG_WITH(libpam,
202[ --with-libpam use libpam for PAM support in vtysh])
hasso71c0fb52003-05-25 20:18:13 +0000203AC_ARG_ENABLE(tcp-zebra,
paul7ea487b2003-03-17 02:05:07 +0000204[ --enable-tcp-zebra enable TCP/IP socket connection between zebra and protocol daemon])
paul7ea487b2003-03-17 02:05:07 +0000205AC_ARG_ENABLE(opaque-lsa,
paul1ef74ef2003-03-21 15:16:05 +0000206[ --enable-opaque-lsa enable OSPF Opaque-LSA with OSPFAPI support (RFC2370)])
207AC_ARG_ENABLE(ospfapi,
208[ --disable-ospfapi do not build OSPFAPI to access the OSPF LSA Database,
209 (this is the default if --enable-opaque-lsa is not set)])
210AC_ARG_ENABLE(ospfclient,
211[ --disable-ospfclient do not build OSPFAPI client for OSPFAPI,
212 (this is the default if --disable-ospfapi is set)])
paul7ea487b2003-03-17 02:05:07 +0000213AC_ARG_ENABLE(ospf-te,
214[ --enable-ospf-te enable Traffic Engineering Extension to OSPF])
215AC_ARG_ENABLE(multipath,
216[ --enable-multipath=ARG enable multipath function, ARG must be digit])
paule8f29842003-08-12 13:08:31 +0000217AC_ARG_ENABLE(quagga_user,
218[ --enable-user=ARG user to run Quagga suite as (default quagga)])
219AC_ARG_ENABLE(quagga_group,
220[ --enable-group=ARG group to run Quagga suite as (default quagga)])
pauledd7c242003-06-04 13:59:38 +0000221AC_ARG_ENABLE(vty_group,
paul6b6942f2004-10-22 04:55:05 +0000222[ --enable-vty-group=ARG set vty sockets to have specified group as owner])
gdtaa593d52003-12-22 20:15:53 +0000223AC_ARG_ENABLE(configfile_mask,
224[ --enable-configfile-mask=ARG set mask for config files])
225AC_ARG_ENABLE(logfile_mask,
226[ --enable-logfile-mask=ARG set mask for log files])
pauledd7c242003-06-04 13:59:38 +0000227
hasso71c0fb52003-05-25 20:18:13 +0000228AC_ARG_ENABLE(rtadv,
paul6b6942f2004-10-22 04:55:05 +0000229[ --disable-rtadv disable IPV6 router advertisement feature])
hassoca776982004-06-12 14:33:05 +0000230AC_ARG_ENABLE(irdp,
paul6b6942f2004-10-22 04:55:05 +0000231[ --enable-irdp enable IRDP server support in zebra])
hassof695b012005-04-02 19:03:39 +0000232AC_ARG_ENABLE(isis_topology,
233[ --enable-isis-topology enable IS-IS topology generator])
hasso41d3fc92004-04-06 11:59:00 +0000234AC_ARG_ENABLE(capabilities,
235[ --disable-capabilities disable using POSIX capabilities])
paul6b6942f2004-10-22 04:55:05 +0000236AC_ARG_ENABLE(gcc_ultra_verbose,
237[ --enable-gcc-ultra-verbose enable ultra verbose GCC warnings])
ajs3cade262004-12-29 17:50:22 +0000238AC_ARG_ENABLE(gcc-rdynamic,
239[ --enable-gcc-rdynamic enable gcc linking with -rdynamic for better backtraces])
ajs924b9222005-04-16 17:11:24 +0000240AC_ARG_ENABLE(time-check,
241[ --disable-time-check disable slow thread warning messages])
paul6b6942f2004-10-22 04:55:05 +0000242
243if test x"${enable_gcc_ultra_verbose}" = x"yes" ; then
244 CFLAGS="${CFLAGS} -W -Wcast-qual -Wstrict-prototypes"
245 CFLAGS="${CFLAGS} -Wmissing-declarations -Wmissing-noreturn"
246 CFLAGS="${CFLAGS} -Wmissing-format-attribute -Wunreachable-code"
247 CFLAGS="${CFLAGS} -Wpacked -Wpadded"
248fi
paul7ea487b2003-03-17 02:05:07 +0000249
ajs3cade262004-12-29 17:50:22 +0000250if test x"${enable_gcc_rdynamic}" = x"yes" ; then
251 LDFLAGS="${LDFLAGS} -rdynamic"
252fi
253
ajs924b9222005-04-16 17:11:24 +0000254if test x"${enable_time_check}" != x"no" ; then
255 if test x"${enable_time_check}" = x"yes" -o x"${enable_time_check}" = x ; then
256 AC_DEFINE(CONSUMED_TIME_CHECK,5000000,Consumed Time Check)
257 else
258 AC_DEFINE_UNQUOTED(CONSUMED_TIME_CHECK,$enable_time_check,Consumed Time Check)
259 fi
260fi
261
paul7ea487b2003-03-17 02:05:07 +0000262if test "${enable_broken_aliases}" = "yes"; then
263 if test "${enable_netlink}" = "yes"
264 then
265 echo "Sorry, you can't use netlink with broken aliases"
266 exit 1
267 fi
268 AC_DEFINE(HAVE_BROKEN_ALIASES,,Broken Alias)
269 enable_netlink=no
270fi
271
272if test "${enable_tcp_zebra}" = "yes"; then
273 AC_DEFINE(HAVE_TCP_ZEBRA,,Use TCP for zebra communication)
274fi
275
paul7ea487b2003-03-17 02:05:07 +0000276if test "${enable_opaque_lsa}" = "yes"; then
277 AC_DEFINE(HAVE_OPAQUE_LSA,,OSPF Opaque LSA)
278fi
279
280if test "${enable_ospf_te}" = "yes"; then
281 AC_DEFINE(HAVE_OPAQUE_LSA,,OSPF Opaque LSA)
282 AC_DEFINE(HAVE_OSPF_TE,,OSPF TE)
283fi
284
gdtd2a0ccc2003-12-03 18:13:48 +0000285AC_MSG_CHECKING(if zebra should be configurable to send Route Advertisements)
286if test "${enable_rtadv}" != "no"; then
hasso71c0fb52003-05-25 20:18:13 +0000287 AC_MSG_RESULT(yes)
gdtd2a0ccc2003-12-03 18:13:48 +0000288 AC_DEFINE(HAVE_RTADV,,Enable IPv6 Routing Advertisement support)
paul2487bea2003-05-25 23:51:31 +0000289else
290 AC_MSG_RESULT(no)
hasso71c0fb52003-05-25 20:18:13 +0000291fi
paul7ea487b2003-03-17 02:05:07 +0000292
hassoca776982004-06-12 14:33:05 +0000293if test "${enable_irdp}" = "yes"; then
294 AC_DEFINE(HAVE_IRDP,, IRDP )
295fi
296
hassof695b012005-04-02 19:03:39 +0000297if test "${enable_isisd}" = "yes" && test "${enable_isis_topology}" = yes; then
298 AC_DEFINE(TOPOLOGY_GENERATE,,Enable IS-IS topology generator code)
299 ISIS_TOPOLOGY_INCLUDES="-I./topology"
300 ISIS_TOPOLOGY_DIR="topology"
301 ISIS_TOPOLOGY_LIB="./topology/libtopology.a"
302fi
303
304AC_SUBST(ISIS_TOPOLOGY_INCLUDES)
305AC_SUBST(ISIS_TOPOLOGY_DIR)
306AC_SUBST(ISIS_TOPOLOGY_LIB)
307
paul79cb2162003-06-06 12:19:53 +0000308if test "${enable_user}" = "yes" || test x"${enable_user}" = x""; then
paule8f29842003-08-12 13:08:31 +0000309 enable_user="quagga"
pauledd7c242003-06-04 13:59:38 +0000310elif test "${enable_user}" = "no"; then
311 enable_user="root"
312fi
pauledd7c242003-06-04 13:59:38 +0000313
paul79cb2162003-06-06 12:19:53 +0000314if test "${enable_group}" = "yes" || test x"${enable_group}" = x""; then
paule8f29842003-08-12 13:08:31 +0000315 enable_group="quagga"
pauledd7c242003-06-04 13:59:38 +0000316elif test "${enable_group}" = "no"; then
317 enable_group="root"
318fi
pauledd7c242003-06-04 13:59:38 +0000319
320if test x"${enable_vty_group}" = x"yes" ; then
paul8d4aee52003-06-06 00:30:35 +0000321 AC_MSG_ERROR([--enable-vty-group requires a group as argument, not yes])
paul79cb2162003-06-06 12:19:53 +0000322elif test x"${enable_vty_group}" != x""; then
paul8d4aee52003-06-06 00:30:35 +0000323 if test x"${enable_vty_group}" != x"no"; then
pauledd7c242003-06-04 13:59:38 +0000324 AC_DEFINE_UNQUOTED(VTY_GROUP, "${enable_vty_group}", VTY Sockets Group)
325 fi
326fi
paul26275b02005-04-11 07:10:47 +0000327AC_SUBST([enable_user])
328AC_SUBST([enable_group])
329AC_SUBST([enable_vty_group])
330AC_DEFINE_UNQUOTED(QUAGGA_USER, "${enable_user}", Quagga User)
331AC_DEFINE_UNQUOTED(QUAGGA_GROUP, "${enable_group}", Quagga Group)
pauledd7c242003-06-04 13:59:38 +0000332
gdtaa593d52003-12-22 20:15:53 +0000333enable_configfile_mask=${enable_configfile_mask:-0600}
334AC_DEFINE_UNQUOTED(CONFIGFILE_MASK, ${enable_configfile_mask}, Mask for config files)
335
336enable_logfile_mask=${enable_logfile_mask:-0600}
337AC_DEFINE_UNQUOTED(LOGFILE_MASK, ${enable_logfile_mask}, Mask for log files)
338
paul7ea487b2003-03-17 02:05:07 +0000339changequote(, )dnl
340
341MULTIPATH_NUM=1
342
343case "${enable_multipath}" in
344 [0-9]|[1-9][0-9])
345 MULTIPATH_NUM="${enable_multipath}"
346 ;;
347 "")
348 ;;
349 *)
350 echo "Please specify digit to --enable-multipath ARG."
351 exit 1
352 ;;
353esac
354
355changequote([, ])dnl
356
357AC_SUBST(MULTIPATH_NUM)
358
359dnl -------------------
360dnl Check header files.
361dnl -------------------
pauldc7a2bf2003-10-22 00:07:44 +0000362AC_HEADER_STDC
363AC_CHECK_HEADERS([string.h stropts.h sys/conf.h sys/ksym.h sys/time.h \
364 sys/times.h sys/select.h sys/sysctl.h sys/sockio.h \
365 sys/types.h linux/version.h kvm.h netdb.h asm/types.h \
paul76367ea2005-11-14 14:05:35 +0000366 sys/param.h libutil.h limits.h stdint.h])
pauldc7a2bf2003-10-22 00:07:44 +0000367
paul835b7f12003-10-30 21:59:57 +0000368AC_CHECK_HEADERS([sys/socket.h netinet/in_systm.h netinet/in.h \
paulf3bd1a72003-11-02 07:29:11 +0000369 net/if_dl.h net/netopt.h inet/nd.h net/route.h \
paul835b7f12003-10-30 21:59:57 +0000370 net/if.h net/if_var.h netinet/in_var.h])
pauldc7a2bf2003-10-22 00:07:44 +0000371
gdtfa3232e2003-12-03 17:52:30 +0000372dnl V6 headers are checked below, after we check for v6
paul7ea487b2003-03-17 02:05:07 +0000373
374dnl check some types
375AC_C_CONST
376dnl AC_TYPE_PID_T
377AC_TYPE_SIGNAL
378
379dnl Some systems (Solaris 2.x) require libnsl (Network Services Library)
380case "$host" in
paulafd8a122005-03-12 06:36:10 +0000381 [*-sunos5.[6-7]*] | [*-solaris2.[6-7]*])
paul7ea487b2003-03-17 02:05:07 +0000382 opsys=sol2-6
paulafd8a122005-03-12 06:36:10 +0000383 AC_DEFINE(SUNOS_56, 1, SunOS 5.6 to 5.7)
paul19877dd2004-05-11 10:49:35 +0000384 AC_DEFINE(SUNOS_5, 1, SunOS 5)
paul7ea487b2003-03-17 02:05:07 +0000385 AC_CHECK_LIB(xnet, main)
386 CURSES=-lcurses
387 ;;
paul1b73de82005-04-10 16:31:51 +0000388 [*-sunos5.[8-9]] \
389 | [*-sunos5.1[0-9]] \
390 | [*-sunos5.1[0-9].[0-9]] \
391 | [*-solaris2.[8-9]] \
392 | [*-solaris2.1[0-9]] \
393 | [*-solaris2.1[0-9].[0-9]])
paulafd8a122005-03-12 06:36:10 +0000394 opsys=sol8
395 AC_DEFINE(SUNOS_59,,SunOS 5.8 up)
paul19877dd2004-05-11 10:49:35 +0000396 AC_DEFINE(SUNOS_5, 1, SunOS 5)
397 AC_CHECK_LIB(socket, main)
398 AC_CHECK_LIB(nsl, main)
paul1b73de82005-04-10 16:31:51 +0000399 AC_CHECK_LIB(umem, main)
paul19877dd2004-05-11 10:49:35 +0000400 CURSES=-lcurses
401 ;;
paul7ea487b2003-03-17 02:05:07 +0000402 *-sunos5* | *-solaris2*)
paul19877dd2004-05-11 10:49:35 +0000403 AC_DEFINE(SUNOS_5,,SunOS 5, Unknown SunOS)
paul7ea487b2003-03-17 02:05:07 +0000404 AC_CHECK_LIB(socket, main)
405 AC_CHECK_LIB(nsl, main)
406 CURSES=-lcurses
407 ;;
hassoc45eb832005-02-19 13:58:06 +0000408 *-linux*)
paul7ea487b2003-03-17 02:05:07 +0000409 opsys=gnu-linux
410 AC_DEFINE(GNU_LINUX,,GNU Linux)
411 ;;
412 *-nec-sysv4*)
413 AC_CHECK_LIB(nsl, gethostbyname)
414 AC_CHECK_LIB(socket, socket)
415 ;;
paul7ea487b2003-03-17 02:05:07 +0000416 *-openbsd*)
417 opsys=openbsd
418 AC_DEFINE(OPEN_BSD,,OpenBSD)
419 ;;
420 *-bsdi*)
421 opsys=bsdi
422 OTHER_METHOD="mtu_kvm.o"
423 AC_CHECK_LIB(kvm, main)
424 ;;
paul49e3b3c2003-10-23 20:39:50 +0000425 *-irix6.5)
pauldc7a2bf2003-10-22 00:07:44 +0000426 opsys=irix
427 AC_DEFINE(IRIX_65,,IRIX 6.5)
428 ;;
paul7ea487b2003-03-17 02:05:07 +0000429esac
430
431dnl ---------------------
432dnl Integrated VTY option
433dnl ---------------------
434case "${enable_vtysh}" in
435 "yes") VTYSH="vtysh";
436 AC_DEFINE(VTYSH,,VTY shell)
gdtfc9d0742004-06-30 14:25:12 +0000437 AC_PATH_PROG(PERL, perl)
438dnl Vtysh uses libreadline, which looks for termcap functions at
439dnl configure time. We follow readline's search order.
440dnl The required procedures are in libtermcap on NetBSD, in
441dnl [TODO] on Linux, and in [TODO] on Solaris.
hassoc0689392005-08-25 12:00:58 +0000442 AC_CHECK_LIB(termcap, tputs, LIBREADLINE="$LIBREADLINE -ltermcap",
paula9694592005-08-25 14:50:05 +0000443 [AC_CHECK_LIB(tinfo, tputs, LIBREADLINE="$LIBREADLINE -ltinfo",
444 [AC_CHECK_LIB(curses, tputs, LIBREADLINE="$LIBREADLINE -lcurses",
445 [AC_CHECK_LIB(ncurses, tputs,
446 LIBREADLINE="$LIBREADLINE -lncurses")]
447 )]
448 )]
449 )
450 AC_CHECK_LIB(readline, main, LIBREADLINE="$LIBREADLINE -lreadline",,
451 "$LIBREADLINE")
paul7ea487b2003-03-17 02:05:07 +0000452 if test $ac_cv_lib_readline_main = no; then
gdtfc9d0742004-06-30 14:25:12 +0000453 AC_MSG_ERROR([vtysh needs libreadline but was not found and usable on your system.])
paul7ea487b2003-03-17 02:05:07 +0000454 fi
455 AC_CHECK_HEADER(readline/history.h)
456 if test $ac_cv_header_readline_history_h = no;then
457 AC_MSG_ERROR([readline is too old to have readline/history.h, please update to the latest readline library.])
458 fi
paula9694592005-08-25 14:50:05 +0000459 AC_CHECK_LIB(readline, rl_completion_matches,
460 LIBREADLINE="$LIBREADLINE",, "$LIBREADLINE")
paul3d3de8c2003-05-23 10:33:49 +0000461 if test $ac_cv_lib_readline_rl_completion_matches = no; then
462 AC_DEFINE(rl_completion_matches,completion_matches,Old readline)
463 fi
464 ;;
paul7ea487b2003-03-17 02:05:07 +0000465 "no" ) VTYSH="";;
466 * ) ;;
467esac
hassoc0689392005-08-25 12:00:58 +0000468AC_SUBST(LIBREADLINE)
paul7ea487b2003-03-17 02:05:07 +0000469
470dnl ----------
471dnl PAM module
472dnl ----------
473if test "$with_libpam" = "yes"; then
paul24cd4352003-05-06 12:16:27 +0000474 AC_CHECK_HEADER(security/pam_misc.h)
475 if test "$ac_cv_header_security_pam_misc_h" = yes; then
476 AC_DEFINE(HAVE_PAM_MISC_H,,Have pam_misc.h)
477 AC_DEFINE(PAM_CONV_FUNC,misc_conv,Have misc_conv)
478 pam_conv_func="misc_conv"
paul24cd4352003-05-06 12:16:27 +0000479 fi
paul24cd4352003-05-06 12:16:27 +0000480 AC_CHECK_HEADER(security/openpam.h)
481 if test "$ac_cv_header_security_openpam_h" = yes; then
482 AC_DEFINE(HAVE_OPENPAM_H,,Have openpam.h)
483 AC_DEFINE(PAM_CONV_FUNC,openpam_ttyconv,Have openpam_ttyconv)
484 pam_conv_func="openpam_ttyconv"
paul24cd4352003-05-06 12:16:27 +0000485 fi
486 if test -z "$ac_cv_header_security_pam_misc_h$ac_cv_header_security_openpam_h" ; then
487 AC_MSG_WARN([*** pam support will not be built ***])
488 with_libpam="no"
489 fi
490fi
491
492if test "$with_libpam" = "yes"; then
paul7ea487b2003-03-17 02:05:07 +0000493dnl took this test from proftpd's configure.in and suited to our needs
494dnl -------------------------------------------------------------------------
495dnl
496dnl This next check looks funky due to a linker problem with some versions
497dnl of the PAM library. Prior to 0.72 release, the Linux PAM shared library
498dnl omitted requiring libdl linking information. PAM-0.72 or better ships
499dnl with RedHat 6.2 and Debian 2.2 or better.
500AC_CHECK_LIB(pam, pam_start,
paul24cd4352003-05-06 12:16:27 +0000501 [AC_CHECK_LIB(pam, $pam_conv_func,
paul7ea487b2003-03-17 02:05:07 +0000502 [AC_DEFINE(USE_PAM,,Use PAM for authentication)
503 LIBPAM="-lpam"],
504 [AC_DEFINE(USE_PAM,,Use PAM for authentication)
505 LIBPAM="-lpam -lpam_misc"]
506 )
507 ],
508
509 [AC_CHECK_LIB(pam, pam_end,
paul24cd4352003-05-06 12:16:27 +0000510 [AC_CHECK_LIB(pam, $pam_conv_func,
paula159ed92003-06-04 11:01:45 +0000511 [AC_DEFINE(USE_PAM,,Use PAM for authentication)
paul7ea487b2003-03-17 02:05:07 +0000512 LIBPAM="-lpam -ldl"],
paula159ed92003-06-04 11:01:45 +0000513 [AC_DEFINE(USE_PAM,,Use PAM for authentication)
paul7ea487b2003-03-17 02:05:07 +0000514 LIBPAM="-lpam -ldl -lpam_misc"]
515 )
516 ],AC_MSG_WARN([*** pam support will not be built ***]),
517 [-ldl])
518 ]
519)
520fi
521AC_SUBST(LIBPAM)
522
523dnl -------------------------------
524dnl Endian-ness check
525dnl -------------------------------
526AC_WORDS_BIGENDIAN
527
528dnl -------------------------------
529dnl check the size in byte of the C
530dnl -------------------------------
531dnl AC_CHECK_SIZEOF(char)
532dnl AC_CHECK_SIZEOF(int)
533dnl AC_CHECK_SIZEOF(short)
534dnl AC_CHECK_SIZEOF(long)
535
536dnl ----------------------------
537dnl check existance of functions
538dnl ----------------------------
paul49e3b3c2003-10-23 20:39:50 +0000539AC_CHECK_FUNCS(memset memcpy strerror inet_aton daemon snprintf vsnprintf \
paul04bd4842003-10-24 04:24:39 +0000540 strlcat strlcpy if_nametoindex if_indextoname getifaddrs \
hassoe6a4feb2005-09-19 09:53:21 +0000541 fcntl strnlen strndup)
paula159ed92003-06-04 11:01:45 +0000542AC_CHECK_FUNCS(setproctitle, ,
543 [AC_CHECK_LIB(util, setproctitle,
544 [LIBS="$LIBS -lutil"
545 AC_DEFINE(HAVE_SETPROCTITLE,, Have setproctitle)
546 ]
547 )
548 ]
549)
paul7ea487b2003-03-17 02:05:07 +0000550
551dnl ------------------------------------
552dnl Determine routing get and set method
553dnl ------------------------------------
554AC_MSG_CHECKING(zebra between kernel interface method)
555if test x"$opsys" = x"gnu-linux"; then
556 if test "${enable_netlink}" = "yes";then
557 AC_MSG_RESULT(netlink)
558 RT_METHOD=rt_netlink.o
559 AC_DEFINE(HAVE_NETLINK,,netlink)
560 netlink=yes
561 elif test "${enable_netlink}" = "no"; then
562 AC_MSG_RESULT(ioctl)
563 RT_METHOD=rt_ioctl.o
564 netlink=no
565 else
566 AC_MSG_RESULT(netlink)
567 RT_METHOD=rt_netlink.o
568 AC_DEFINE(HAVE_NETLINK,,netlink)
569 netlink=yes
570 fi
paul19877dd2004-05-11 10:49:35 +0000571elif test x"$opsys" = x"sol2-6";then
572 AC_MSG_RESULT(Route socket)
573 KERNEL_METHOD="kernel_socket.o"
574 RT_METHOD="rt_socket.o"
paulafd8a122005-03-12 06:36:10 +0000575elif test x"$opsys" = x"sol8";then
paul19877dd2004-05-11 10:49:35 +0000576 AC_MSG_RESULT(Route socket)
577 KERNEL_METHOD="kernel_socket.o"
578 RT_METHOD="rt_socket.o"
579elif test "$opsys" = "irix" ; then
580 AC_MSG_RESULT(Route socket)
581 KERNEL_METHOD="kernel_socket.o"
582 RT_METHOD="rt_socket.o"
paul7ea487b2003-03-17 02:05:07 +0000583else
paul19877dd2004-05-11 10:49:35 +0000584 AC_TRY_RUN([#include <errno.h>
paul7ea487b2003-03-17 02:05:07 +0000585#include <sys/types.h>
586#include <sys/socket.h>
587
588main ()
589{
590 int ac_sock;
591
592 ac_sock = socket (AF_ROUTE, SOCK_RAW, 0);
593 if (ac_sock < 0 && errno == EINVAL)
594 exit (1);
595 exit (0);
596}],
597 [KERNEL_METHOD=kernel_socket.o
598 RT_METHOD=rt_socket.o
599 AC_MSG_RESULT(socket)],
600 [RT_METHOD=rt_ioctl.o
601 AC_MSG_RESULT(ioctl)],
602 [KERNEL_METHOD=kernel_socket.o
603 RT_METHOD=rt_socket.o
604 AC_MSG_RESULT(socket)])
paul7ea487b2003-03-17 02:05:07 +0000605fi
606AC_SUBST(RT_METHOD)
607AC_SUBST(KERNEL_METHOD)
608AC_SUBST(OTHER_METHOD)
609
ajsb99760a2005-01-04 16:24:43 +0000610dnl ------------------------------------
611dnl check for broken CMSG_FIRSTHDR macro
612dnl ------------------------------------
gdt6c200462005-01-04 17:02:48 +0000613AC_MSG_CHECKING(for broken CMSG_FIRSTHDR)
hasso5b087522005-04-03 23:46:37 +0000614AC_RUN_IFELSE([AC_LANG_SOURCE([[
ajsb99760a2005-01-04 16:24:43 +0000615#ifdef SUNOS_5
616#define _XPG4_2
617#define __EXTENSIONS__
618#endif
619#include <stdlib.h>
620#include <sys/types.h>
621#include <sys/socket.h>
622
623main()
624{
625 struct msghdr msg;
626 char buf[4];
627
628 msg.msg_control = buf;
629 msg.msg_controllen = 0;
630
631 if (CMSG_FIRSTHDR(&msg) != NULL)
632 exit(0);
633 exit (1);
hasso5b087522005-04-03 23:46:37 +0000634}]])],[AC_MSG_RESULT(yes - using workaround) AC_DEFINE(HAVE_BROKEN_CMSG_FIRSTHDR,,Broken CMSG_FIRSTHDR)],
hassod33e8d72005-04-03 13:07:21 +0000635[AC_MSG_RESULT(no)],[AC_MSG_RESULT(no)])
ajsb99760a2005-01-04 16:24:43 +0000636
paul7ea487b2003-03-17 02:05:07 +0000637dnl ------------------------------
638dnl check kernel route read method
639dnl ------------------------------
640AC_CACHE_CHECK(route read method check, zebra_rtread,
641[if test "$netlink" = yes; then
642 RTREAD_METHOD="rtread_netlink.o"
643 zebra_rtread="netlink"
644else
645for zebra_rtread in /proc/net/route /dev/ip /dev/null;
646do
647 test x`ls $zebra_rtread 2>/dev/null` = x"$zebra_rtread" && break
648done
649case $zebra_rtread in
650 "/proc/net/route") RTREAD_METHOD="rtread_proc.o"
651 zebra_rtread="proc";;
paul9c30ab62003-07-08 08:36:17 +0000652 "/dev/ip")
653 case "$host" in
654 *-freebsd*) RTREAD_METHOD=rtread_sysctl.o
655 zebra_rtread="sysctl";;
656 *) RTREAD_METHOD="rtread_getmsg.o"
657 zebra_rtread="getmsg";;
658 esac;;
paul7ea487b2003-03-17 02:05:07 +0000659 *) RTREAD_METHOD="rtread_sysctl.o"
660 zebra_rtread="sysctl";;
661esac
662fi])
663AC_SUBST(RTREAD_METHOD)
664
665dnl -----------------------------
666dnl check interface lookup method
667dnl -----------------------------
paul19877dd2004-05-11 10:49:35 +0000668IOCTL_METHOD=ioctl.o
paul7ea487b2003-03-17 02:05:07 +0000669AC_MSG_CHECKING(interface looking up method)
670if test "$netlink" = yes; then
671 AC_MSG_RESULT(netlink)
672 IF_METHOD=if_netlink.o
paul19877dd2004-05-11 10:49:35 +0000673elif test "$opsys" = "sol2-6";then
674 AC_MSG_RESULT(Solaris GIF)
675 IF_METHOD=if_ioctl.o
paulafd8a122005-03-12 06:36:10 +0000676elif test "$opsys" = "sol8";then
paul19877dd2004-05-11 10:49:35 +0000677 AC_MSG_RESULT(Solaris GLIF)
678 IF_METHOD=if_ioctl_solaris.o
679 IOCTL_METHOD=ioctl_solaris.o
680elif test "$opsys" = "irix" ; then
681 AC_MSG_RESULT(IRIX)
682 IF_METHOD=if_ioctl.o
683elif test "$opsys" = "openbsd";then
684 AC_MSG_RESULT(openbsd)
685 IF_METHOD=if_ioctl.o
686elif grep NET_RT_IFLIST /usr/include/sys/socket.h >/dev/null 2>&1; then
687 AC_MSG_RESULT(sysctl)
paul7ea487b2003-03-17 02:05:07 +0000688 IF_METHOD=if_sysctl.o
689 AC_DEFINE(HAVE_NET_RT_IFLIST,,NET_RT_IFLIST)
paul19877dd2004-05-11 10:49:35 +0000690else
paul7ea487b2003-03-17 02:05:07 +0000691 AC_MSG_RESULT(ioctl)
692 IF_METHOD=if_ioctl.o
paul7ea487b2003-03-17 02:05:07 +0000693fi
694AC_SUBST(IF_METHOD)
paul19877dd2004-05-11 10:49:35 +0000695AC_SUBST(IOCTL_METHOD)
paul7ea487b2003-03-17 02:05:07 +0000696
paul42c98192005-05-07 02:22:51 +0000697dnl ---------------------------------------------------------------
698dnl figure out how to specify an interface in multicast sockets API
699dnl ---------------------------------------------------------------
700AC_CHECK_MEMBERS([struct ip_mreqn.imr_ifindex],,,[#ifdef HAVE_SYS_TYPES_H
701#include <sys/types.h>
702#endif
703#ifdef HAVE_NETINET_IN_H
704#include <netinet/in.h>
705#endif])
706
707AC_MSG_CHECKING([for BSD struct ip_mreq hack])
708AC_TRY_COMPILE([#ifdef HAVE_SYS_PARAM_H
709#include <sys/param.h>
710#endif],[#if (defined(__FreeBSD__) && (__FreeBSD_version >= 500022 || (__FreeBSD_version < 500000 && __FreeBSD_version >= 440000))) || (defined(__NetBSD__) && defined(__NetBSD_Version__) && __NetBSD_Version__ >= 106010000)
711 return (0);
712#else
713 #error No support for BSD struct ip_mreq hack detected
714#endif],[AC_MSG_RESULT(yes)
715AC_DEFINE(HAVE_BSD_STRUCT_IP_MREQ_HACK,,[Can pass ifindex in struct ip_mreq])],
716AC_MSG_RESULT(no))
717
paul7ea487b2003-03-17 02:05:07 +0000718dnl -----------------------
719dnl check proc file system.
720dnl -----------------------
721if test -r /proc/net/dev; then
722 AC_DEFINE(HAVE_PROC_NET_DEV,,/proc/net/dev)
723 IF_PROC=if_proc.o
724fi
725
726if test -r /proc/net/if_inet6; then
727 AC_DEFINE(HAVE_PROC_NET_IF_INET6,,/proc/net/if_inet6)
728 IF_PROC=if_proc.o
729fi
730AC_SUBST(IF_PROC)
731
732dnl -----------------------------
733dnl check ipforward detect method
734dnl -----------------------------
735AC_CACHE_CHECK(ipforward method check, zebra_ipforward_path,
736[for zebra_ipforward_path in /proc/net/snmp /dev/ip /dev/null;
737do
738 test x`ls $zebra_ipforward_path 2>/dev/null` = x"$zebra_ipforward_path" && break
739done
740case $zebra_ipforward_path in
741 "/proc/net/snmp") IPFORWARD=ipforward_proc.o
742 zebra_ipforward_path="proc";;
743 "/dev/ip")
744 case "$host" in
745 *-nec-sysv4*) IPFORWARD=ipforward_ews.o
746 zebra_ipforward_path="ews";;
paul9c30ab62003-07-08 08:36:17 +0000747 *-freebsd*) IPFORWARD=ipforward_sysctl.o
748 zebra_ipforward_path="sysctl";;
paul7ea487b2003-03-17 02:05:07 +0000749 *) IPFORWARD=ipforward_solaris.o
750 zebra_ipforward_path="solaris";;
751 esac;;
752 *) IPFORWARD=ipforward_sysctl.o
753 zebra_ipforward_path="sysctl";;
754esac])
755AC_SUBST(IPFORWARD)
756
757AC_CHECK_FUNCS(getaddrinfo, [have_getaddrinfo=yes], [have_getaddrinfo=no])
758
759dnl ----------
760dnl IPv6 check
761dnl ----------
762AC_MSG_CHECKING(whether does this OS have IPv6 stack)
763if test "${enable_ipv6}" = "no"; then
764 AC_MSG_RESULT(disabled)
765else
766dnl ----------
767dnl INRIA IPv6
768dnl ----------
paula159ed92003-06-04 11:01:45 +0000769 if grep IPV6_INRIA_VERSION /usr/include/netinet/in.h >/dev/null 2>&1; then
770 zebra_cv_ipv6=yes
771 AC_DEFINE(HAVE_IPV6,1,INRIA IPv6)
772 AC_DEFINE(INRIA_IPV6,1,INRIA IPv6)
773 RIPNGD="ripngd"
774 OSPF6D="ospf6d"
775 LIB_IPV6=""
776 AC_MSG_RESULT(INRIA IPv6)
paul7ea487b2003-03-17 02:05:07 +0000777dnl ---------
778dnl KAME IPv6
779dnl ---------
paula159ed92003-06-04 11:01:45 +0000780 elif grep WIDE /usr/include/netinet6/in6.h >/dev/null 2>&1; then
781 zebra_cv_ipv6=yes
782 AC_DEFINE(HAVE_IPV6,1,KAME IPv6)
783 AC_DEFINE(KAME,1,KAME IPv6)
784 RIPNGD="ripngd"
785 OSPF6D="ospf6d"
786 if test -d /usr/local/v6/lib -a -f /usr/local/v6/lib/libinet6.a; then
paul7ea487b2003-03-17 02:05:07 +0000787 LIB_IPV6="-L/usr/local/v6/lib -linet6"
paula159ed92003-06-04 11:01:45 +0000788 fi
789 AC_MSG_RESULT(KAME)
hasso71c0fb52003-05-25 20:18:13 +0000790dnl -------------------------
791dnl MUSICA IPv6
792dnl default host check
793dnl It is not used by Kheops
794dnl -------------------------
paula159ed92003-06-04 11:01:45 +0000795 elif grep MUSICA /usr/include6/netinet6/in6.h >/dev/null 2>&1; then
796 zebra_cv_ipv6=yes
797 AC_DEFINE(HAVE_IPV6,1,Musicia IPv6)
798 AC_DEFINE(MUSICA,1,Musica IPv6 stack)
799 AC_DEFINE(KAME,1,KAME IPv6 stack)
800 RIPNGD="ripngd"
801 OSPF6D="ospf6d"
802 if test -d /usr/local/v6/lib -a -f /usr/local/v6/lib/libinet6.a; then
hasso71c0fb52003-05-25 20:18:13 +0000803 LIB_IPV6="-L/usr/local/v6/lib -linet6"
paula159ed92003-06-04 11:01:45 +0000804 fi
805 AC_MSG_RESULT(MUSICA)
paul7ea487b2003-03-17 02:05:07 +0000806dnl ---------
807dnl NRL check
808dnl ---------
paula159ed92003-06-04 11:01:45 +0000809 elif grep NRL /usr/include/netinet6/in6.h >/dev/null 2>&1; then
810 zebra_cv_ipv6=yes
811 AC_DEFINE(HAVE_IPV6,1,NRL IPv6)
812 AC_DEFINE(NRL,1,NRL)
813 RIPNGD="ripngd"
814 OSPF6D="ospf6d"
815 if test x"$opsys" = x"bsdi";then
paul7ea487b2003-03-17 02:05:07 +0000816 AC_DEFINE(BSDI_NRL,,BSDI)
817 AC_MSG_RESULT(BSDI_NRL)
paula159ed92003-06-04 11:01:45 +0000818 else
paul7ea487b2003-03-17 02:05:07 +0000819 AC_MSG_RESULT(NRL)
paula159ed92003-06-04 11:01:45 +0000820 fi
paul19877dd2004-05-11 10:49:35 +0000821dnl ------------------------------------
822dnl Solaris 9, 10 and potentially higher
823dnl ------------------------------------
paulafd8a122005-03-12 06:36:10 +0000824 elif test x"$opsys" = x"sol8"; then
paul19877dd2004-05-11 10:49:35 +0000825 zebra_cv_ipv6=yes;
826 AC_DEFINE(HAVE_IPV6, 1, IPv6)
827 AC_DEFINE(SOLARIS_IPV6, 1, Solaris IPv6)
828 RIPNGD="ripngd"
829 OSPF6D="ospf6d"
830 AC_MSG_RESULT(Solaris IPv6)
paul7ea487b2003-03-17 02:05:07 +0000831dnl ----------
832dnl Linux IPv6
833dnl ----------
paula159ed92003-06-04 11:01:45 +0000834 elif test "${enable_ipv6}" = "yes"; then
835 AC_EGREP_CPP(yes, [
836 #include <linux/version.h>
837 /* 2.1.128 or later */
838 #if LINUX_VERSION_CODE >= 0x020180
839 yes
840 #endif],
841 [zebra_cv_ipv6=yes
842 zebra_cv_linux_ipv6=yes
843 AC_MSG_RESULT(Linux IPv6)])
844 else
845 if test x`ls /proc/net/ipv6_route 2>/dev/null` = x"/proc/net/ipv6_route"
846 then
paul7ea487b2003-03-17 02:05:07 +0000847 zebra_cv_ipv6=yes
848 zebra_cv_linux_ipv6=yes
849 AC_MSG_RESULT(Linux IPv6)
paula159ed92003-06-04 11:01:45 +0000850 fi
851 fi
paul7ea487b2003-03-17 02:05:07 +0000852
paula159ed92003-06-04 11:01:45 +0000853 if test "$zebra_cv_linux_ipv6" = "yes";then
hasso850d39f2005-06-30 13:52:20 +0000854 AC_MSG_CHECKING(whether libc has IPv6 support)
855 AC_TRY_LINK([#include <netinet/in.h>
856 ],[ int a; a = (int) in6addr_any.s6_addr[0]; if (a != 12345) return a; ],
857 [AC_MSG_RESULT(yes)
858 zebra_cv_ipv6=yes
859 zebra_cv_linux_ipv6=yes],
860 [AC_MSG_RESULT(no)
861 zebra_cv_ipv6=no
862 zebra_cv_linux_ipv6=no])
863 fi
864
865 if test "$zebra_cv_linux_ipv6" = "yes";then
paula159ed92003-06-04 11:01:45 +0000866 AC_MSG_CHECKING(for GNU libc >= 2.1)
867 AC_DEFINE(HAVE_IPV6,1,Linux IPv6)
868 AC_EGREP_CPP(yes, [
paul7ea487b2003-03-17 02:05:07 +0000869#include <features.h>
870#if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1
871 yes
paula159ed92003-06-04 11:01:45 +0000872#endif],
873 [glibc=yes
874 AC_DEFINE(LINUX_IPV6,1,Linux IPv6 stack)
875 AC_MSG_RESULT(yes)],
876 AC_MSG_RESULT(no)
877 )
878 RIPNGD="ripngd"
879 OSPF6D="ospf6d"
880 if test "$glibc" != "yes"; then
paul7ea487b2003-03-17 02:05:07 +0000881 INCLUDES="-I/usr/inet6/include"
882 if test x`ls /usr/inet6/lib/libinet6.a 2>/dev/null` != x;then
883 LIB_IPV6="-L/usr/inet6/lib -linet6"
884 fi
paula159ed92003-06-04 11:01:45 +0000885 fi
886 fi
paul7ea487b2003-03-17 02:05:07 +0000887
888dnl -----------------------
889dnl Set IPv6 related values
890dnl -----------------------
paula159ed92003-06-04 11:01:45 +0000891 LIBS="$LIB_IPV6 $LIBS"
892 AC_SUBST(LIB_IPV6)
paul7ea487b2003-03-17 02:05:07 +0000893
paula159ed92003-06-04 11:01:45 +0000894 if test x"$RIPNGD" = x""; then
895 AC_MSG_RESULT(IPv4 only)
896 fi
paul7ea487b2003-03-17 02:05:07 +0000897fi
898
gdtfa3232e2003-12-03 17:52:30 +0000899dnl ------------------
900dnl IPv6 header checks
901dnl ------------------
902if test "x${zebra_cv_ipv6}" = "xyes"; then
903AC_CHECK_HEADERS([netinet6/in6.h netinet/in6_var.h netinet/icmp6.h \
904 netinet6/in6_var.h netinet6/nd6.h])
905fi
906
paul7ea487b2003-03-17 02:05:07 +0000907dnl --------------------
908dnl Daemon disable check
909dnl --------------------
910if test "${enable_zebra}" = "no";then
911 ZEBRA=""
912else
913 ZEBRA="zebra"
914fi
915
916if test "${enable_bgpd}" = "no";then
917 BGPD=""
918else
919 BGPD="bgpd"
920fi
921
922if test "${enable_ripd}" = "no";then
923 RIPD=""
924else
925 RIPD="ripd"
926fi
927
928if test "${enable_ospfd}" = "no";then
929 OSPFD=""
930else
931 OSPFD="ospfd"
932fi
933
ajsd0199432004-12-22 14:03:52 +0000934if test "${enable_watchquagga}" = "no";then
935 WATCHQUAGGA=""
936else
937 WATCHQUAGGA="watchquagga"
938fi
939
paul1ef74ef2003-03-21 15:16:05 +0000940OSPFCLIENT=""
941if test "${enable_opaque_lsa}" = "yes"; then
942 if test "${enable_ospfapi}" != "no";then
paul9a569842003-03-28 01:45:13 +0000943 AC_DEFINE(SUPPORT_OSPF_API,,OSPFAPI)
paul1ef74ef2003-03-21 15:16:05 +0000944
945 if test "${enable_ospfclient}" != "no";then
946 OSPFCLIENT="ospfclient"
947 fi
948 fi
949
paul7ea487b2003-03-17 02:05:07 +0000950fi
951
952case "${enable_ripngd}" in
953 "yes") RIPNGD="ripngd";;
954 "no" ) RIPNGD="";;
955 * ) ;;
956esac
957
958case "${enable_ospf6d}" in
959 "yes") OSPF6D="ospf6d";;
960 "no" ) OSPF6D="";;
961 * ) ;;
962esac
963
jardin9e867fe2003-12-23 08:56:18 +0000964case "${enable_isisd}" in
965 "yes") ISISD="isisd";;
966 "no" ) ISISD="";;
hassoae399ab2004-09-13 20:22:18 +0000967 * ) ;;
jardin9e867fe2003-12-23 08:56:18 +0000968esac
969
paul7ea487b2003-03-17 02:05:07 +0000970if test "${enable_bgp_announce}" = "no";then
971 AC_DEFINE(DISABLE_BGP_ANNOUNCE,,Disable BGP installation to zebra)
972fi
973
974AC_SUBST(ZEBRA)
975AC_SUBST(BGPD)
976AC_SUBST(RIPD)
977AC_SUBST(RIPNGD)
978AC_SUBST(OSPFD)
979AC_SUBST(OSPF6D)
ajsd0199432004-12-22 14:03:52 +0000980AC_SUBST(WATCHQUAGGA)
jardin9e867fe2003-12-23 08:56:18 +0000981AC_SUBST(ISISD)
paul7ea487b2003-03-17 02:05:07 +0000982AC_SUBST(VTYSH)
983AC_SUBST(INCLUDES)
984AC_SUBST(CURSES)
985AC_SUBST(OSPFCLIENT)
paul1ef74ef2003-03-21 15:16:05 +0000986AC_SUBST(OSPFAPI)
paul7ea487b2003-03-17 02:05:07 +0000987AC_CHECK_LIB(c, inet_ntop, [AC_DEFINE(HAVE_INET_NTOP,,inet_ntop)])
988AC_CHECK_LIB(c, inet_pton, [AC_DEFINE(HAVE_INET_PTON,,inet_pton)])
989AC_CHECK_LIB(crypt, crypt)
990AC_CHECK_LIB(resolv, res_init)
991AC_CHECK_LIB(m, main)
992
993dnl ---------------------------------------------------
994dnl BSD/OS 4.1 define inet_XtoY function as __inet_XtoY
995dnl ---------------------------------------------------
paula159ed92003-06-04 11:01:45 +0000996AC_CHECK_FUNC(__inet_ntop, AC_DEFINE(HAVE_INET_NTOP,,__inet_ntop))
997AC_CHECK_FUNC(__inet_pton, AC_DEFINE(HAVE_INET_PTON,,__inet_pton))
998AC_CHECK_FUNC(__inet_aton, AC_DEFINE(HAVE_INET_ATON,,__inet_aton))
paul7ea487b2003-03-17 02:05:07 +0000999
1000dnl ---------------------------
1001dnl check system has GNU regexp
1002dnl ---------------------------
1003dnl AC_MSG_CHECKING(whether system has GNU regex)
1004AC_CHECK_LIB(c, regexec,
1005[AC_DEFINE(HAVE_GNU_REGEX,,GNU regexp library)
1006 LIB_REGEX=""],
1007[LIB_REGEX="regex.o"])
1008AC_SUBST(LIB_REGEX)
1009
1010dnl ------------------
paulb1fc9ac2006-01-31 10:09:27 +00001011dnl check Net-SNMP library
paul7ea487b2003-03-17 02:05:07 +00001012dnl ------------------
paulb1fc9ac2006-01-31 10:09:27 +00001013if test "${enable_snmp}" = "yes"; then
1014 LIBS="${LIBS} -lcrypto"
1015 AC_CHECK_LIB(netsnmp, asn_parse_int,
1016 [AC_DEFINE(HAVE_NETSNMP,,Net SNMP)
1017 AC_DEFINE(HAVE_SNMP,,SNMP)
1018 LIBS="${LIBS} -lnetsnmp"],
1019 [AC_MSG_ERROR([--enable-snmp given, but cannot find support for SNMP])])
1020
1021 for ac_snmp in /usr/include \
1022 /usr/local/include \
1023 /dev/null; do
1024 test -f "${ac_snmp}/net-snmp/library/asn1.h" && break
paul7ea487b2003-03-17 02:05:07 +00001025 done
paulb1fc9ac2006-01-31 10:09:27 +00001026
paul7ea487b2003-03-17 02:05:07 +00001027 case ${ac_snmp} in
paulb1fc9ac2006-01-31 10:09:27 +00001028 /dev/null)
1029 AC_MSG_ERROR([--enable-snmp given, but can not find header])
1030 ;;
1031 *)
1032 SNMP_INCLUDES="-I${ac_snmp}/net-snmp"
1033 SNMP_INCLUDES="${SNMP_INCLUDES} -I${ac_snmp}/net-snmp/library"
1034 ;;
paul7ea487b2003-03-17 02:05:07 +00001035 esac
paulb1fc9ac2006-01-31 10:09:27 +00001036
1037 AC_SUBST(SNMP_INCLUDES)
paul7ea487b2003-03-17 02:05:07 +00001038fi
1039
1040dnl ----------------------------
1041dnl check sa_len of sockaddr
1042dnl ----------------------------
1043AC_MSG_CHECKING(whether struct sockaddr has a sa_len field)
1044AC_TRY_COMPILE([#include <sys/types.h>
1045#include <sys/socket.h>
1046],[static struct sockaddr ac_i;int ac_j = sizeof (ac_i.sa_len);],
1047[AC_MSG_RESULT(yes)
1048 AC_DEFINE(HAVE_SA_LEN,,sa_len)],
1049 AC_MSG_RESULT(no))
1050
1051dnl ----------------------------
1052dnl check sin_len of sockaddr_in
1053dnl ----------------------------
1054AC_MSG_CHECKING(whether struct sockaddr_in has a sin_len field)
1055AC_TRY_COMPILE([#include <sys/types.h>
1056#include <netinet/in.h>
1057],[static struct sockaddr_in ac_i;int ac_j = sizeof (ac_i.sin_len);],
1058[AC_MSG_RESULT(yes)
1059 AC_DEFINE(HAVE_SIN_LEN,,sin_len)],
1060 AC_MSG_RESULT(no))
1061
1062dnl ----------------------------
1063dnl check sun_len of sockaddr_un
1064dnl ----------------------------
1065AC_MSG_CHECKING(whether struct sockaddr_un has a sun_len field)
1066AC_TRY_COMPILE([#include <sys/types.h>
1067#include <sys/un.h>
1068],[static struct sockaddr_un ac_i;int ac_j = sizeof (ac_i.sun_len);],
1069[AC_MSG_RESULT(yes)
1070 AC_DEFINE(HAVE_SUN_LEN,,sun_len)],
1071 AC_MSG_RESULT(no))
1072
1073dnl -----------------------------------
1074dnl check sin6_scope_id of sockaddr_in6
1075dnl -----------------------------------
1076if test "$zebra_cv_ipv6" = yes; then
1077 AC_MSG_CHECKING(whether struct sockaddr_in6 has a sin6_scope_id field)
1078 AC_TRY_COMPILE([#include <sys/types.h>
1079#include <netinet/in.h>
1080],[static struct sockaddr_in6 ac_i;int ac_j = sizeof (ac_i.sin6_scope_id);],
1081[AC_MSG_RESULT(yes)
1082 AC_DEFINE(HAVE_SIN6_SCOPE_ID,,scope id)],
1083 AC_MSG_RESULT(no))
1084fi
1085
1086dnl ----------------------------
1087dnl check socklen_t exist or not
1088dnl ----------------------------
1089AC_MSG_CHECKING(whther socklen_t is defined)
1090AC_TRY_COMPILE([#include <sys/types.h>
1091#include <sys/socket.h>
1092#include <netinet/in.h>
1093],[socklen_t ac_x;],
1094[AC_MSG_RESULT(yes)
1095 AC_DEFINE(HAVE_SOCKLEN_T,,socklen_t)],
1096 AC_MSG_RESULT(no))
1097
1098dnl ------------------------
1099dnl check struct sockaddr_dl
1100dnl ------------------------
1101AC_MSG_CHECKING(whether struct sockaddr_dl exist)
1102AC_EGREP_HEADER(sockaddr_dl,
1103net/if_dl.h,
1104[AC_MSG_RESULT(yes)
1105 AC_DEFINE(HAVE_SOCKADDR_DL,,sockaddr_dl)],
1106 AC_MSG_RESULT(no))
1107
1108dnl --------------------------
1109dnl check structure ifaliasreq
1110dnl --------------------------
1111AC_MSG_CHECKING(whether struct ifaliasreq exist)
1112AC_EGREP_HEADER(ifaliasreq,
1113net/if.h,
1114[AC_MSG_RESULT(yes)
1115 AC_DEFINE(HAVE_IFALIASREQ,,ifaliasreq)],
1116 AC_MSG_RESULT(no))
1117
1118dnl ----------------------------
1119dnl check structure in6_aliasreq
1120dnl ----------------------------
hasso71c0fb52003-05-25 20:18:13 +00001121AC_MSG_CHECKING(whether struct in6_aliasreq exist)
paul7ea487b2003-03-17 02:05:07 +00001122AC_EGREP_HEADER(in6_aliasreq,
1123netinet6/in6_var.h,
1124[AC_MSG_RESULT(yes)
1125 AC_DEFINE(HAVE_IN6_ALIASREQ,,in6_aliasreq)],
1126 AC_MSG_RESULT(no))
1127
hasso71c0fb52003-05-25 20:18:13 +00001128dnl -----------------------------------
1129dnl check ifra_lifetime of in6_aliasreq
1130dnl -----------------------------------
1131AC_MSG_CHECKING(whether in6_aliasreq.ifra_lifetime exist)
1132AC_TRY_COMPILE([#include <sys/types.h>
1133#include <netinet6/in6_var.h>
1134],[static struct if6_aliasreq ac_i;int ac_j = sizeof (ac_i.ifra_lifetime);],
1135[AC_MSG_RESULT(yes)
paula159ed92003-06-04 11:01:45 +00001136 AC_DEFINE(HAVE_IFRA_LIFETIME,,Have in6_aliasreq.ifra_lifetime)],
hasso71c0fb52003-05-25 20:18:13 +00001137 AC_MSG_RESULT(no))
1138
paul7ea487b2003-03-17 02:05:07 +00001139dnl ---------------------------
1140dnl check structure rt_addrinfo
1141dnl ---------------------------
1142AC_MSG_CHECKING(whether struct rt_addrinfo exist)
1143AC_EGREP_HEADER(rt_addrinfo,
1144net/route.h,
1145[AC_MSG_RESULT(yes)
1146 AC_DEFINE(HAVE_RT_ADDRINFO,,rt_addrinfo)],
1147 AC_MSG_RESULT(no))
1148
1149dnl --------------------------
1150dnl check structure in_pktinfo
1151dnl --------------------------
1152AC_MSG_CHECKING(whether struct in_pktinfo exist)
1153AC_TRY_COMPILE([#include <netinet/in.h>
1154],[struct in_pktinfo ac_x;],
1155[AC_MSG_RESULT(yes)
1156 AC_DEFINE(HAVE_INPKTINFO,,in_pktinfo)],
1157 AC_MSG_RESULT(no))
1158
vincent29c4c9b2005-03-25 13:05:47 +00001159dnl ----------------------------------
1160dnl check struct nd_opt_homeagent_info
1161dnl ----------------------------------
1162AC_MSG_CHECKING(whether struct nd_opt_homeagent_info exist)
1163AC_EGREP_HEADER(nd_opt_homeagent_info,
1164netinet/icmp6.h,
1165[AC_MSG_RESULT(yes)
1166 AC_DEFINE(HAVE_ND_OPT_HOMEAGENT_INFO,,nd_opt_homeagent_info)],
1167 AC_MSG_RESULT(no))
1168
1169dnl --------------------------------
1170dnl check struct nd_opt_adv_interval
1171dnl --------------------------------
1172AC_MSG_CHECKING(whether struct nd_opt_adv_interval exist)
1173AC_EGREP_HEADER(nd_opt_adv_interval,
1174netinet/icmp6.h,
1175[AC_MSG_RESULT(yes)
1176 AC_DEFINE(HAVE_ND_OPT_ADV_INTERVAL,,nd_opt_adv_interval)],
1177 AC_MSG_RESULT(no))
1178
1179dnl ------------------------------------
1180dnl check fields in nd_opt_adv_interval
1181dnl ------------------------------------
1182AC_MSG_CHECKING(whether nd_opt_ai_type field exist)
1183AC_EGREP_HEADER(nd_opt_ai_type,
1184netinet/icmp6.h,
1185[AC_MSG_RESULT(yes)
1186 AC_DEFINE(HAVE_ND_OPT_ADV_INTERVAL_AI_FIELDS,,nd_opt_ai_type)],
1187 AC_MSG_RESULT(no))
1188
paul7ea487b2003-03-17 02:05:07 +00001189dnl --------------------------------------
1190dnl checking for getrusage struct and call
1191dnl --------------------------------------
1192AC_MSG_CHECKING(whether getrusage is available)
1193AC_TRY_COMPILE([#include <sys/resource.h>
1194],[struct rusage ac_x; getrusage (RUSAGE_SELF, &ac_x);],
1195[AC_MSG_RESULT(yes)
1196 AC_DEFINE(HAVE_RUSAGE,,rusage)],
1197 AC_MSG_RESULT(no))
1198
pauledd7c242003-06-04 13:59:38 +00001199dnl -------------------
1200dnl capabilities checks
1201dnl -------------------
hasso41d3fc92004-04-06 11:59:00 +00001202if test "${enable_capabilities}" != "no"; then
1203 AC_MSG_CHECKING(whether prctl PR_SET_KEEPCAPS is available)
1204 AC_TRY_COMPILE([#include <sys/prctl.h>],[prctl(PR_SET_KEEPCAPS, 1, 0, 0, 0);],
1205 [AC_MSG_RESULT(yes)
1206 AC_DEFINE(HAVE_PR_SET_KEEPCAPS,,prctl)
1207 quagga_ac_keepcaps="yes"],
1208 AC_MSG_RESULT(no)
pauledd7c242003-06-04 13:59:38 +00001209 )
hasso41d3fc92004-04-06 11:59:00 +00001210 if test x"${quagga_ac_keepcaps}" = x"yes"; then
1211 AC_CHECK_HEADERS(sys/capability.h)
1212 fi
1213 if test x"${ac_cv_header_sys_capability_h}" = x"yes"; then
1214 AC_CHECK_LIB(cap, cap_init,
1215 [AC_DEFINE(HAVE_LCAPS,1,Capabilities)
1216 LIBCAP="-lcap"
paulceacedb2005-09-29 14:39:32 +00001217 quagga_ac_lcaps="yes"]
hasso41d3fc92004-04-06 11:59:00 +00001218 )
paulceacedb2005-09-29 14:39:32 +00001219 else
1220 AC_CHECK_HEADERS(priv.h,
1221 [AC_MSG_CHECKING(Solaris style privileges are available)
1222 AC_TRY_COMPILE([#include <priv.h>],[getpflags(PRIV_AWARE);],
1223 [AC_MSG_RESULT(yes)
1224 AC_DEFINE(HAVE_SOLARIS_CAPABILITIES,1,getpflags)
1225 quagga_ac_scaps="yes"],
1226 AC_MSG_RESULT(no)
1227 )
1228 ]
1229 )
1230 fi
1231 if test x"${quagga_ac_scaps}" = x"yes" \
1232 -o x"${quagga_ac_lcaps}" = x"yes"; then
1233 AC_DEFINE(HAVE_CAPABILITIES,1,capabilities)
hasso41d3fc92004-04-06 11:59:00 +00001234 fi
pauledd7c242003-06-04 13:59:38 +00001235fi
1236AC_SUBST(LIBCAP)
1237
ajs40abf232005-01-12 17:27:27 +00001238dnl -------------------
1239dnl test for ucontext.h
1240dnl -------------------
1241AC_CHECK_HEADERS(ucontext.h)
1242
paulfb2d1502003-06-04 09:40:54 +00001243dnl ---------------------------
1244dnl check for glibc 'backtrace'
1245dnl ---------------------------
1246if test "${glibc}" = "yes"; then
1247 AC_CHECK_HEADER(execinfo.h)
1248fi
1249if test x"${ac_cv_header_execinfo_h}" = x"yes"; then
1250 AC_CHECK_FUNC(backtrace,
1251 [AC_DEFINE(HAVE_GLIBC_BACKTRACE,,Glibc backtrace)]
1252 )
1253fi
1254
Paul Jakma41be32b2006-03-30 13:53:59 +00001255dnl -----------------------------------------
1256dnl check for malloc mallinfo struct and call
1257dnl this must try and link using LIBS, in
1258dnl order to check no alternative allocator
1259dnl has been specified, which might not provide
1260dnl mallinfo, e.g. such as Umem on Solaris.
1261dnl -----------------------------------------
1262AC_CHECK_HEADERS(malloc.h,
1263 [AC_MSG_CHECKING(whether mallinfo is available)
1264 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <malloc.h>]],
1265 [[struct mallinfo ac_x; ac_x = mallinfo ();]])],
1266 [AC_MSG_RESULT(yes)
1267 AC_DEFINE(HAVE_MALLINFO,,mallinfo)],
1268 AC_MSG_RESULT(no)
1269 )
1270 ]
1271)
1272
paul408ad942003-05-20 00:03:33 +00001273dnl ----------
1274dnl configure date
1275dnl ----------
1276CONFDATE=`date '+%Y%m%d'`
1277AC_SUBST(CONFDATE)
1278
paul7ea487b2003-03-17 02:05:07 +00001279dnl ------------------------------
paula159ed92003-06-04 11:01:45 +00001280dnl set paths for state directory
paul23bd12c2003-04-07 06:11:09 +00001281dnl ------------------------------
1282if test "${prefix}" = "NONE"; then
paule8f29842003-08-12 13:08:31 +00001283 quagga_statedir_prefix="";
paul23bd12c2003-04-07 06:11:09 +00001284else
paule8f29842003-08-12 13:08:31 +00001285 quagga_statedir_prefix=${prefix}
paul23bd12c2003-04-07 06:11:09 +00001286fi
1287if test "${localstatedir}" = '${prefix}/var'; then
paula159ed92003-06-04 11:01:45 +00001288 AC_CACHE_CHECK(state directory,ac_statedir,
paule8f29842003-08-12 13:08:31 +00001289 [for QUAGGA_STATE_DIR in ${quagga_statedir_prefix}/var/run dnl
1290 ${quagga_statedir_prefix}/var/adm dnl
1291 ${quagga_statedir_prefix}/etc dnl
paula159ed92003-06-04 11:01:45 +00001292 /var/run dnl
1293 /var/adm dnl
1294 /etc dnl
1295 /dev/null;
paul23bd12c2003-04-07 06:11:09 +00001296 do
paule8f29842003-08-12 13:08:31 +00001297 test -d $QUAGGA_STATE_DIR && break
paul23bd12c2003-04-07 06:11:09 +00001298 done
paule8f29842003-08-12 13:08:31 +00001299 quagga_statedir=$QUAGGA_STATE_DIR])
paul23bd12c2003-04-07 06:11:09 +00001300else
paule8f29842003-08-12 13:08:31 +00001301 quagga_statedir=${localstatedir}
paula159ed92003-06-04 11:01:45 +00001302 AC_MSG_CHECKING(directory to use for state file)
paule8f29842003-08-12 13:08:31 +00001303 AC_MSG_RESULT(${quagga_statedir})
paul26275b02005-04-11 07:10:47 +00001304 AC_SUBST(quagga_statedir)
paul23bd12c2003-04-07 06:11:09 +00001305fi
paule8f29842003-08-12 13:08:31 +00001306if test $quagga_statedir = "/dev/null"; then
paula159ed92003-06-04 11:01:45 +00001307 AC_MSG_ERROR('STATE DIRECTORY NOT FOUND! FIX OR SPECIFY --localstatedir!')
1308fi
1309
paule8f29842003-08-12 13:08:31 +00001310AC_DEFINE_UNQUOTED(PATH_ZEBRA_PID, "$quagga_statedir/zebra.pid",zebra PID)
1311AC_DEFINE_UNQUOTED(PATH_RIPD_PID, "$quagga_statedir/ripd.pid",ripd PID)
1312AC_DEFINE_UNQUOTED(PATH_RIPNGD_PID, "$quagga_statedir/ripngd.pid",ripngd PID)
1313AC_DEFINE_UNQUOTED(PATH_BGPD_PID, "$quagga_statedir/bgpd.pid",bgpd PID)
1314AC_DEFINE_UNQUOTED(PATH_OSPFD_PID, "$quagga_statedir/ospfd.pid",ospfd PID)
1315AC_DEFINE_UNQUOTED(PATH_OSPF6D_PID, "$quagga_statedir/ospf6d.pid",ospf6d PID)
jardin9e867fe2003-12-23 08:56:18 +00001316AC_DEFINE_UNQUOTED(PATH_ISISD_PID, "$quagga_statedir/isisd.pid",isisd PID)
ajsd0199432004-12-22 14:03:52 +00001317AC_DEFINE_UNQUOTED(PATH_WATCHQUAGGA_PID, "$quagga_statedir/watchquagga.pid",watchquagga PID)
paule8f29842003-08-12 13:08:31 +00001318AC_DEFINE_UNQUOTED(ZEBRA_SERV_PATH, "$quagga_statedir/zserv.api",zebra api socket)
1319AC_DEFINE_UNQUOTED(ZEBRA_VTYSH_PATH, "$quagga_statedir/zebra.vty",zebra vty socket)
1320AC_DEFINE_UNQUOTED(RIP_VTYSH_PATH, "$quagga_statedir/ripd.vty",rip vty socket)
1321AC_DEFINE_UNQUOTED(RIPNG_VTYSH_PATH, "$quagga_statedir/ripngd.vty",ripng vty socket)
1322AC_DEFINE_UNQUOTED(BGP_VTYSH_PATH, "$quagga_statedir/bgpd.vty",bgpd vty socket)
1323AC_DEFINE_UNQUOTED(OSPF_VTYSH_PATH, "$quagga_statedir/ospfd.vty",ospfd vty socket)
1324AC_DEFINE_UNQUOTED(OSPF6_VTYSH_PATH, "$quagga_statedir/ospf6d.vty",ospf6d vty socket)
jardin9e867fe2003-12-23 08:56:18 +00001325AC_DEFINE_UNQUOTED(ISIS_VTYSH_PATH, "$quagga_statedir/isisd.vty",isisd vty socket)
ajs515210b2004-12-22 15:35:12 +00001326AC_DEFINE_UNQUOTED(DAEMON_VTY_DIR, "$quagga_statedir",daemon vty directory)
paul7ea487b2003-03-17 02:05:07 +00001327
paul1eb8ef22005-04-07 07:30:20 +00001328dnl -------------------------------
1329dnl Quagga sources should always be
1330dnl current wrt interfaces. Dont
1331dnl allow deprecated interfaces to
1332dnl be exposed.
1333dnl -------------------------------
1334AC_DEFINE(QUAGGA_NO_DEPRECATED_INTERFACES, 1, Hide deprecated interfaces)
1335
paul7ea487b2003-03-17 02:05:07 +00001336dnl ---------------------------
1337dnl Check htonl works correctly
1338dnl ---------------------------
1339AC_MSG_CHECKING(for working htonl)
1340AC_CACHE_VAL(ac_cv_htonl_works, [
1341AC_TRY_LINK([#ifdef HAVE_SYS_TYPES_H
1342#include <sys/types.h>
1343#endif
1344#ifdef HAVE_NETDB_H
1345#include <netdb.h>
1346#endif
1347#ifdef HAVE_NETINET_IN_H
1348#include <netinet/in.h>
1349#endif],
1350[htonl (0);],
1351ac_cv_htonl_works=yes,
1352ac_cv_htonl_works=no)])
1353AC_MSG_RESULT($ac_cv_htonl_works)
1354
paul14c17fd2004-11-07 22:34:23 +00001355AC_CONFIG_FILES([Makefile lib/Makefile zebra/Makefile ripd/Makefile
ajsd0199432004-12-22 14:03:52 +00001356 ripngd/Makefile bgpd/Makefile ospfd/Makefile watchquagga/Makefile
jardin9e867fe2003-12-23 08:56:18 +00001357 ospf6d/Makefile isisd/Makefile vtysh/Makefile doc/Makefile
paul14c17fd2004-11-07 22:34:23 +00001358 ospfclient/Makefile tests/Makefile m4/Makefile redhat/Makefile
gdt69f1fc22004-08-27 15:57:35 +00001359 pkgsrc/Makefile
paul670bbf12004-11-12 09:05:00 +00001360 redhat/quagga.spec
gdtb7a97f82004-07-23 16:23:56 +00001361 lib/version.h
paul14c17fd2004-11-07 22:34:23 +00001362 doc/defines.texi
hassof695b012005-04-02 19:03:39 +00001363 isisd/topology/Makefile
gdtcbd04082004-08-31 18:16:36 +00001364 pkgsrc/bgpd.sh pkgsrc/ospf6d.sh pkgsrc/ospfd.sh
paulf31293a2004-11-12 09:27:04 +00001365 pkgsrc/ripd.sh pkgsrc/ripngd.sh pkgsrc/zebra.sh])
paul26275b02005-04-11 07:10:47 +00001366AC_CONFIG_FILES([solaris/Makefile])
1367
paul670bbf12004-11-12 09:05:00 +00001368AC_CONFIG_FILES([vtysh/extract.pl],[chmod +x vtysh/extract.pl])
hasso48577192004-11-19 06:41:49 +00001369## Hack, but working solution to avoid rebuilding of quagga.info.
1370## It's already in CVS until texinfo 4.7 is more common.
paul14c1f182005-05-13 20:11:53 +00001371AC_CONFIG_COMMANDS([info-time],[touch doc/quagga.info])
paul14c17fd2004-11-07 22:34:23 +00001372AC_OUTPUT
paul7ea487b2003-03-17 02:05:07 +00001373
1374echo "
hassoc89f6492004-08-26 12:21:28 +00001375Quagga configuration
1376--------------------
1377quagga version : ${PACKAGE_VERSION}
paul7ea487b2003-03-17 02:05:07 +00001378host operationg system : ${host_os}
1379source code location : ${srcdir}
1380compiler : ${CC}
1381compiler flags : ${CFLAGS}
hasso2d582282005-03-28 15:29:07 +00001382includes : ${INCLUDES} ${SNMP_INCLUDES}
hassoc0689392005-08-25 12:00:58 +00001383linker flags : ${LDFLAGS} ${LIBS} ${LIBCAP} ${LIBREADLINE}
paule8f29842003-08-12 13:08:31 +00001384state file directory : ${quagga_statedir}
pauldc7a2bf2003-10-22 00:07:44 +00001385config file directory : `eval echo \`echo ${sysconfdir}\``
gdtd6b72f72003-12-03 17:24:27 +00001386example directory : `eval echo \`echo ${exampledir}\``
paul8d4aee52003-06-06 00:30:35 +00001387user to run as : ${enable_user}
1388group to run as : ${enable_group}
1389group for vty sockets : ${enable_vty_group}
gdtaa593d52003-12-22 20:15:53 +00001390config file mask : ${enable_configfile_mask}
1391log file mask : ${enable_logfile_mask}
pauldc7a2bf2003-10-22 00:07:44 +00001392
1393The above user and group must have read/write access to the state file
Paul Jakma105b8232006-05-28 08:02:41 +00001394directory and to the config files in the config file directory."
1395
1396if test x"$quagga_cv_gnu_make" = x"no"; then echo "
1397Warning: The ${MAKE-make} programme detected, either in your path or
1398via the MAKE variable, is not GNU Make. GNU make may be installed as
1399gmake on some systems. and is required to complete a build of Quagga
1400" > /dev/stderr
1401fi