## Copyright (c) 1996, 97, 98, 99, 2000 Kunihiro Ishiguro <kunihiro@zebra.org>
## Portions Copyright (c) 2003 Paul Jakma <paul@dishone.st>
##
-## $Id: configure.ac,v 1.72 2004/10/22 23:53:19 paul Exp $
+## $Id: configure.ac,v 1.109 2005/06/30 13:52:20 hasso Exp $
AC_PREREQ(2.53)
-AC_INIT(Quagga, 0.97.2, [http://bugzilla.quagga.net])
+AC_INIT(Quagga, 0.99.1, [http://bugzilla.quagga.net])
AC_CONFIG_SRCDIR(lib/zebra.h)
+
+dnl -----------------------------------
+dnl Get hostname and other information.
+dnl -----------------------------------
+AC_CANONICAL_BUILD()
+AC_CANONICAL_HOST()
+AC_CANONICAL_TARGET()
+
AM_INIT_AUTOMAKE(1.6)
AM_CONFIG_HEADER(config.h)
+dnl we need gawk for memtypes.awk
+AC_CHECK_PROG([GAWK],[gawk],[gawk],[/bin/false])
+AC_ARG_VAR([GAWK],[GNU AWK])
+
dnl default is to match previous behavior
exampledir=${sysconfdir}
AC_ARG_ENABLE([exampledir],
AC_SUBST(pkgsrcdir)
AC_SUBST(pkgsrcrcdir)
-dnl -----------------------------------
-dnl Get hostname and other information.
-dnl -----------------------------------
-AC_CANONICAL_HOST
-
dnl ------------
dnl Check CFLAGS
dnl ------------
cflags_specified=yes ;
fi
-dnl --------
-dnl Check CC
-dnl --------
+dnl --------------------
+dnl Check CC and friends
+dnl --------------------
AC_PROG_CC
+AC_PROG_CPP
+AC_PROG_EGREP
+
+dnl ------------------------------------------------------------------
+dnl Intel compiler check. Although Intel tries really hard to make icc
+dnl look like gcc, there are some differences. It's very verbose with
+dnl -Wall and it doesn't support the individual -W options.
+dnl ------------------------------------------------------------------
+AC_MSG_CHECKING([whether we are using the Intel compiler])
+AC_EGREP_CPP([^__INTEL_COMPILER], [__INTEL_COMPILER],
+ ICC="no"
+ AC_MSG_RESULT([no]),
+ ICC="yes"
+ AC_MSG_RESULT([yes])
+)
dnl ---------------------------------------------
dnl If CLFAGS doesn\'t exist set default value
dnl already, eg "-O2 -g" for gcc, "-g" for others
dnl (Wall is gcc specific... have to make sure
dnl gcc is being used before setting it)
+dnl Intel icc 8.0 also sets __GNUC__, but
+dnl doesn't support all these fancy -W options.
dnl ---------------------------------------------
dnl
if test "x$cflags_specified" = "x" ; then
- if test "x${GCC}" = "xyes"; then
+ if test "x${GCC}" = "xyes" && test "x${ICC}" = "xno"; then
CFLAGS="-Os -g -Wall -Wsign-compare -Wpointer-arith"
CFLAGS="${CFLAGS} -Wbad-function-cast -Wwrite-strings"
fi
# TODO: conditionally addd -Wpacked if handled
fi
+dnl ---------------------------------------------------------------------
+dnl Intel compiler warnings we ignore:
+dnl 279: controlling expression is constant.
+dnl 869: parameter "xxx" was never referenced - to avoid massive warnings
+dnl about "self", "vty", "argc" and "argv" never referenced in DEFUN
+dnl macro.
+dnl 981: operands are evaluated in unspecified order.
+dnl ---------------------------------------------------------------------
+
+if test "$ICC" = "yes"; then
+ CFLAGS="-Os -g -Wall -wd 279,869,981"
+fi
+
dnl --------------
dnl Check programs
dnl --------------
-AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_MAKE_SET
AC_CHECK_TOOL(AR, ar)
[ --disable-ospfd do not build ospfd])
AC_ARG_ENABLE(ospf6d,
[ --disable-ospf6d do not build ospf6d])
+AC_ARG_ENABLE(watchquagga,
+[ --disable-watchquagga do not build watchquagga])
AC_ARG_ENABLE(isisd,
[ --enable-isisd build isisd])
AC_ARG_ENABLE(bgp-announce,
[ --disable-rtadv disable IPV6 router advertisement feature])
AC_ARG_ENABLE(irdp,
[ --enable-irdp enable IRDP server support in zebra])
+AC_ARG_ENABLE(isis_topology,
+[ --enable-isis-topology enable IS-IS topology generator])
AC_ARG_ENABLE(capabilities,
[ --disable-capabilities disable using POSIX capabilities])
AC_ARG_ENABLE(gcc_ultra_verbose,
[ --enable-gcc-ultra-verbose enable ultra verbose GCC warnings])
+AC_ARG_ENABLE(gcc-rdynamic,
+[ --enable-gcc-rdynamic enable gcc linking with -rdynamic for better backtraces])
+AC_ARG_ENABLE(time-check,
+[ --disable-time-check disable slow thread warning messages])
if test x"${enable_gcc_ultra_verbose}" = x"yes" ; then
CFLAGS="${CFLAGS} -W -Wcast-qual -Wstrict-prototypes"
CFLAGS="${CFLAGS} -Wpacked -Wpadded"
fi
+if test x"${enable_gcc_rdynamic}" = x"yes" ; then
+ LDFLAGS="${LDFLAGS} -rdynamic"
+fi
+
+if test x"${enable_time_check}" != x"no" ; then
+ if test x"${enable_time_check}" = x"yes" -o x"${enable_time_check}" = x ; then
+ AC_DEFINE(CONSUMED_TIME_CHECK,5000000,Consumed Time Check)
+ else
+ AC_DEFINE_UNQUOTED(CONSUMED_TIME_CHECK,$enable_time_check,Consumed Time Check)
+ fi
+fi
+
if test "${enable_broken_aliases}" = "yes"; then
if test "${enable_netlink}" = "yes"
then
AC_DEFINE(HAVE_IRDP,, IRDP )
fi
+if test "${enable_isisd}" = "yes" && test "${enable_isis_topology}" = yes; then
+ AC_DEFINE(TOPOLOGY_GENERATE,,Enable IS-IS topology generator code)
+ ISIS_TOPOLOGY_INCLUDES="-I./topology"
+ ISIS_TOPOLOGY_DIR="topology"
+ ISIS_TOPOLOGY_LIB="./topology/libtopology.a"
+fi
+
+AC_SUBST(ISIS_TOPOLOGY_INCLUDES)
+AC_SUBST(ISIS_TOPOLOGY_DIR)
+AC_SUBST(ISIS_TOPOLOGY_LIB)
+
if test "${enable_user}" = "yes" || test x"${enable_user}" = x""; then
enable_user="quagga"
elif test "${enable_user}" = "no"; then
enable_user="root"
fi
-AC_DEFINE_UNQUOTED(QUAGGA_USER, "${enable_user}", Quagga User)
if test "${enable_group}" = "yes" || test x"${enable_group}" = x""; then
enable_group="quagga"
elif test "${enable_group}" = "no"; then
enable_group="root"
fi
-AC_DEFINE_UNQUOTED(QUAGGA_GROUP, "${enable_group}", Quagga Group)
if test x"${enable_vty_group}" = x"yes" ; then
AC_MSG_ERROR([--enable-vty-group requires a group as argument, not yes])
AC_DEFINE_UNQUOTED(VTY_GROUP, "${enable_vty_group}", VTY Sockets Group)
fi
fi
+AC_SUBST([enable_user])
+AC_SUBST([enable_group])
+AC_SUBST([enable_vty_group])
+AC_DEFINE_UNQUOTED(QUAGGA_USER, "${enable_user}", Quagga User)
+AC_DEFINE_UNQUOTED(QUAGGA_GROUP, "${enable_group}", Quagga Group)
enable_configfile_mask=${enable_configfile_mask:-0600}
AC_DEFINE_UNQUOTED(CONFIGFILE_MASK, ${enable_configfile_mask}, Mask for config files)
AC_CHECK_HEADERS([string.h stropts.h sys/conf.h sys/ksym.h sys/time.h \
sys/times.h sys/select.h sys/sysctl.h sys/sockio.h \
sys/types.h linux/version.h kvm.h netdb.h asm/types.h \
- libutil.h limits.h])
+ sys/param.h libutil.h limits.h])
AC_CHECK_HEADERS([sys/socket.h netinet/in_systm.h netinet/in.h \
net/if_dl.h net/netopt.h inet/nd.h net/route.h \
dnl Some systems (Solaris 2.x) require libnsl (Network Services Library)
case "$host" in
- [*-sunos5.[6-8]*] | [*-solaris2.[6-8]*])
+ [*-sunos5.[6-7]*] | [*-solaris2.[6-7]*])
opsys=sol2-6
- AC_DEFINE(SUNOS_56, 1, SunOS 5.6 to 5.8)
+ AC_DEFINE(SUNOS_56, 1, SunOS 5.6 to 5.7)
AC_DEFINE(SUNOS_5, 1, SunOS 5)
AC_CHECK_LIB(xnet, main)
CURSES=-lcurses
;;
- [*-sunos5.[8-9]] | [*-sunos5.1[0-9]] \
- | [*-solaris2.[8-9]] | [*-solaris2.1[0-9]])
- opsys=sol9
- AC_DEFINE(SUNOS_59,,SunOS 5.9 up)
+ [*-sunos5.[8-9]] \
+ | [*-sunos5.1[0-9]] \
+ | [*-sunos5.1[0-9].[0-9]] \
+ | [*-solaris2.[8-9]] \
+ | [*-solaris2.1[0-9]] \
+ | [*-solaris2.1[0-9].[0-9]])
+ opsys=sol8
+ AC_DEFINE(SUNOS_59,,SunOS 5.8 up)
AC_DEFINE(SUNOS_5, 1, SunOS 5)
AC_CHECK_LIB(socket, main)
AC_CHECK_LIB(nsl, main)
+ AC_CHECK_LIB(umem, main)
CURSES=-lcurses
;;
*-sunos5* | *-solaris2*)
AC_CHECK_LIB(nsl, main)
CURSES=-lcurses
;;
- *-linux-*)
+ *-linux*)
opsys=gnu-linux
AC_DEFINE(GNU_LINUX,,GNU Linux)
;;
AC_CHECK_LIB(nsl, gethostbyname)
AC_CHECK_LIB(socket, socket)
;;
- *-freebsd3.2)
- AC_DEFINE(FREEBSD_32,,FreeBSD 3.2)
- ;;
*-openbsd*)
opsys=openbsd
AC_DEFINE(OPEN_BSD,,OpenBSD)
dnl ----------------------------
AC_CHECK_FUNCS(memset memcpy strerror inet_aton daemon snprintf vsnprintf \
strlcat strlcpy if_nametoindex if_indextoname getifaddrs \
- fcntl)
+ fcntl strnlen)
AC_CHECK_FUNCS(setproctitle, ,
[AC_CHECK_LIB(util, setproctitle,
[LIBS="$LIBS -lutil"
AC_MSG_RESULT(Route socket)
KERNEL_METHOD="kernel_socket.o"
RT_METHOD="rt_socket.o"
-elif test x"$opsys" = x"sol9";then
+elif test x"$opsys" = x"sol8";then
AC_MSG_RESULT(Route socket)
KERNEL_METHOD="kernel_socket.o"
RT_METHOD="rt_socket.o"
AC_SUBST(KERNEL_METHOD)
AC_SUBST(OTHER_METHOD)
+dnl ------------------------------------
+dnl check for broken CMSG_FIRSTHDR macro
+dnl ------------------------------------
+AC_MSG_CHECKING(for broken CMSG_FIRSTHDR)
+AC_RUN_IFELSE([AC_LANG_SOURCE([[
+#ifdef SUNOS_5
+#define _XPG4_2
+#define __EXTENSIONS__
+#endif
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+
+main()
+{
+ struct msghdr msg;
+ char buf[4];
+
+ msg.msg_control = buf;
+ msg.msg_controllen = 0;
+
+ if (CMSG_FIRSTHDR(&msg) != NULL)
+ exit(0);
+ exit (1);
+}]])],[AC_MSG_RESULT(yes - using workaround) AC_DEFINE(HAVE_BROKEN_CMSG_FIRSTHDR,,Broken CMSG_FIRSTHDR)],
+[AC_MSG_RESULT(no)],[AC_MSG_RESULT(no)])
+
dnl ------------------------------
dnl check kernel route read method
dnl ------------------------------
elif test "$opsys" = "sol2-6";then
AC_MSG_RESULT(Solaris GIF)
IF_METHOD=if_ioctl.o
-elif test "$opsys" = "sol9";then
+elif test "$opsys" = "sol8";then
AC_MSG_RESULT(Solaris GLIF)
IF_METHOD=if_ioctl_solaris.o
IOCTL_METHOD=ioctl_solaris.o
AC_SUBST(IF_METHOD)
AC_SUBST(IOCTL_METHOD)
+dnl ---------------------------------------------------------------
+dnl figure out how to specify an interface in multicast sockets API
+dnl ---------------------------------------------------------------
+AC_CHECK_MEMBERS([struct ip_mreqn.imr_ifindex],,,[#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif])
+
+AC_MSG_CHECKING([for BSD struct ip_mreq hack])
+AC_TRY_COMPILE([#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif],[#if (defined(__FreeBSD__) && (__FreeBSD_version >= 500022 || (__FreeBSD_version < 500000 && __FreeBSD_version >= 440000))) || (defined(__NetBSD__) && defined(__NetBSD_Version__) && __NetBSD_Version__ >= 106010000)
+ return (0);
+#else
+ #error No support for BSD struct ip_mreq hack detected
+#endif],[AC_MSG_RESULT(yes)
+AC_DEFINE(HAVE_BSD_STRUCT_IP_MREQ_HACK,,[Can pass ifindex in struct ip_mreq])],
+AC_MSG_RESULT(no))
+
dnl -----------------------
dnl check proc file system.
dnl -----------------------
dnl ------------------------------------
dnl Solaris 9, 10 and potentially higher
dnl ------------------------------------
- elif test x"$opsys" = x"sol9"; then
+ elif test x"$opsys" = x"sol8"; then
zebra_cv_ipv6=yes;
AC_DEFINE(HAVE_IPV6, 1, IPv6)
AC_DEFINE(SOLARIS_IPV6, 1, Solaris IPv6)
fi
fi
+ if test "$zebra_cv_linux_ipv6" = "yes";then
+ AC_MSG_CHECKING(whether libc has IPv6 support)
+ AC_TRY_LINK([#include <netinet/in.h>
+ ],[ int a; a = (int) in6addr_any.s6_addr[0]; if (a != 12345) return a; ],
+ [AC_MSG_RESULT(yes)
+ zebra_cv_ipv6=yes
+ zebra_cv_linux_ipv6=yes],
+ [AC_MSG_RESULT(no)
+ zebra_cv_ipv6=no
+ zebra_cv_linux_ipv6=no])
+ fi
+
if test "$zebra_cv_linux_ipv6" = "yes";then
AC_MSG_CHECKING(for GNU libc >= 2.1)
AC_DEFINE(HAVE_IPV6,1,Linux IPv6)
OSPFD="ospfd"
fi
+if test "${enable_watchquagga}" = "no";then
+ WATCHQUAGGA=""
+else
+ WATCHQUAGGA="watchquagga"
+fi
+
OSPFCLIENT=""
if test "${enable_opaque_lsa}" = "yes"; then
if test "${enable_ospfapi}" != "no";then
AC_SUBST(RIPNGD)
AC_SUBST(OSPFD)
AC_SUBST(OSPF6D)
+AC_SUBST(WATCHQUAGGA)
AC_SUBST(ISISD)
AC_SUBST(VTYSH)
AC_SUBST(INCLUDES)
AC_DEFINE(HAVE_SNMP,,SNMP)
AC_DEFINE(HAVE_NETSNMP,,SNMP)
AC_DEFINE(UCD_COMPATIBLE,,SNMP)
- CFLAGS="${CFLAGS} -I/usr/include/net-snmp -I/usr/include/net-snmp/library"
+ SNMP_INCLUDES="${SNMP_INCLUDES} -I/usr/include/net-snmp -I/usr/include/net-snmp/library"
if test "${HAVE_NETSNMP}" = "yes"; then
LIBS="${LIBS} -lnetsnmp"
else
;;
/usr/include/ucd-snmp/*)
AC_DEFINE(HAVE_SNMP,,SNMP)
- CFLAGS="${CFLAGS} -I/usr/include/ucd-snmp"
+ SNMP_INCLUDES="${SNMP_INCLUDES} -I/usr/include/ucd-snmp"
LIBS="${LIBS} -lsnmp"
;;
/usr/local/include/ucd-snmp/*)
AC_DEFINE(HAVE_SNMP,,SNMP)
- CFLAGS="${CFLAGS} -I/usr/local/include/ucd-snmp"
+ SNMP_INCLUDES="${SNMP_INCLUDES} -I/usr/local/include/ucd-snmp"
LIBS="${LIBS} -L/usr/local/lib -lsnmp"
;;
/usr/local/include/net-snmp/*)
AC_DEFINE(HAVE_SNMP,,SNMP)
AC_DEFINE(HAVE_NET_SNMP,,SNMP)
AC_DEFINE(UCD_COMPATIBLE,,SNMP)
- CFLAGS="${CFLAGS} -I/usr/local/include/net-snmp"
+ SNMP_INCLUDES="${SNMP_INCLUDES} -I/usr/local/include/net-snmp"
LIBS="${LIBS} -L/usr/local/lib -lnetsnmp"
;;
esac
fi
fi
+if test "${enable_snmp}" = "yes" -a "${HAVE_SNMP}" != "yes"; then
+ AC_MSG_ERROR([--enable-snmp given, but cannot find support for SNMP])
+fi
+
+AC_SUBST(SNMP_INCLUDES)
+
dnl ----------------------------
dnl check sa_len of sockaddr
dnl ----------------------------
AC_DEFINE(HAVE_INPKTINFO,,in_pktinfo)],
AC_MSG_RESULT(no))
+dnl ----------------------------------
+dnl check struct nd_opt_homeagent_info
+dnl ----------------------------------
+AC_MSG_CHECKING(whether struct nd_opt_homeagent_info exist)
+AC_EGREP_HEADER(nd_opt_homeagent_info,
+netinet/icmp6.h,
+[AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_ND_OPT_HOMEAGENT_INFO,,nd_opt_homeagent_info)],
+ AC_MSG_RESULT(no))
+
+dnl --------------------------------
+dnl check struct nd_opt_adv_interval
+dnl --------------------------------
+AC_MSG_CHECKING(whether struct nd_opt_adv_interval exist)
+AC_EGREP_HEADER(nd_opt_adv_interval,
+netinet/icmp6.h,
+[AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_ND_OPT_ADV_INTERVAL,,nd_opt_adv_interval)],
+ AC_MSG_RESULT(no))
+
+dnl ------------------------------------
+dnl check fields in nd_opt_adv_interval
+dnl ------------------------------------
+AC_MSG_CHECKING(whether nd_opt_ai_type field exist)
+AC_EGREP_HEADER(nd_opt_ai_type,
+netinet/icmp6.h,
+[AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_ND_OPT_ADV_INTERVAL_AI_FIELDS,,nd_opt_ai_type)],
+ AC_MSG_RESULT(no))
+
dnl --------------------------------------
dnl checking for getrusage struct and call
dnl --------------------------------------
fi
AC_SUBST(LIBCAP)
+dnl -------------------
+dnl test for ucontext.h
+dnl -------------------
+AC_CHECK_HEADERS(ucontext.h)
+
dnl ---------------------------
dnl check for glibc 'backtrace'
dnl ---------------------------
quagga_statedir=${localstatedir}
AC_MSG_CHECKING(directory to use for state file)
AC_MSG_RESULT(${quagga_statedir})
+ AC_SUBST(quagga_statedir)
fi
if test $quagga_statedir = "/dev/null"; then
AC_MSG_ERROR('STATE DIRECTORY NOT FOUND! FIX OR SPECIFY --localstatedir!')
AC_DEFINE_UNQUOTED(PATH_OSPFD_PID, "$quagga_statedir/ospfd.pid",ospfd PID)
AC_DEFINE_UNQUOTED(PATH_OSPF6D_PID, "$quagga_statedir/ospf6d.pid",ospf6d PID)
AC_DEFINE_UNQUOTED(PATH_ISISD_PID, "$quagga_statedir/isisd.pid",isisd PID)
+AC_DEFINE_UNQUOTED(PATH_WATCHQUAGGA_PID, "$quagga_statedir/watchquagga.pid",watchquagga PID)
AC_DEFINE_UNQUOTED(ZEBRA_SERV_PATH, "$quagga_statedir/zserv.api",zebra api socket)
AC_DEFINE_UNQUOTED(ZEBRA_VTYSH_PATH, "$quagga_statedir/zebra.vty",zebra vty socket)
AC_DEFINE_UNQUOTED(RIP_VTYSH_PATH, "$quagga_statedir/ripd.vty",rip vty socket)
AC_DEFINE_UNQUOTED(OSPF_VTYSH_PATH, "$quagga_statedir/ospfd.vty",ospfd vty socket)
AC_DEFINE_UNQUOTED(OSPF6_VTYSH_PATH, "$quagga_statedir/ospf6d.vty",ospf6d vty socket)
AC_DEFINE_UNQUOTED(ISIS_VTYSH_PATH, "$quagga_statedir/isisd.vty",isisd vty socket)
+AC_DEFINE_UNQUOTED(DAEMON_VTY_DIR, "$quagga_statedir",daemon vty directory)
+
+dnl -------------------------------
+dnl Quagga sources should always be
+dnl current wrt interfaces. Dont
+dnl allow deprecated interfaces to
+dnl be exposed.
+dnl -------------------------------
+AC_DEFINE(QUAGGA_NO_DEPRECATED_INTERFACES, 1, Hide deprecated interfaces)
dnl ---------------------------
dnl Check htonl works correctly
ac_cv_htonl_works=no)])
AC_MSG_RESULT($ac_cv_htonl_works)
-AC_OUTPUT(Makefile lib/Makefile zebra/Makefile ripd/Makefile
- ripngd/Makefile bgpd/Makefile ospfd/Makefile
+AC_CONFIG_FILES([Makefile lib/Makefile zebra/Makefile ripd/Makefile
+ ripngd/Makefile bgpd/Makefile ospfd/Makefile watchquagga/Makefile
ospf6d/Makefile isisd/Makefile vtysh/Makefile doc/Makefile
- ospfclient/Makefile
- vtysh/extract.pl
- m4/Makefile
+ ospfclient/Makefile tests/Makefile m4/Makefile redhat/Makefile
pkgsrc/Makefile
- redhat/Makefile redhat/quagga.spec
+ redhat/quagga.spec
lib/version.h
- tests/Makefile
+ doc/defines.texi
+ isisd/topology/Makefile
pkgsrc/bgpd.sh pkgsrc/ospf6d.sh pkgsrc/ospfd.sh
- pkgsrc/ripd.sh pkgsrc/ripngd.sh pkgsrc/zebra.sh
- ,
- [chmod +x vtysh/extract.pl])
+ pkgsrc/ripd.sh pkgsrc/ripngd.sh pkgsrc/zebra.sh])
+AC_CONFIG_FILES([solaris/Makefile])
+
+AC_CONFIG_FILES([vtysh/extract.pl],[chmod +x vtysh/extract.pl])
+## Hack, but working solution to avoid rebuilding of quagga.info.
+## It's already in CVS until texinfo 4.7 is more common.
+AC_CONFIG_COMMANDS([info-time],[touch doc/quagga.info])
+AC_OUTPUT
echo "
Quagga configuration
source code location : ${srcdir}
compiler : ${CC}
compiler flags : ${CFLAGS}
+includes : ${INCLUDES} ${SNMP_INCLUDES}
linker flags : ${LDFLAGS} ${LIBS}
state file directory : ${quagga_statedir}
config file directory : `eval echo \`echo ${sysconfdir}\``