## Copyright (c) 1996, 97, 98, 99, 2000 Kunihiro Ishiguro <kunihiro@zebra.org>
## Portions Copyright (c) 2003 Paul Jakma <paul@dishone.st>
##
-## $Id$
AC_PREREQ(2.53)
-AC_INIT(Quagga, 0.99.7, [http://bugzilla.quagga.net])
+AC_INIT(Quagga, 0.99.19, [https://bugzilla.quagga.net])
AC_CONFIG_SRCDIR(lib/zebra.h)
+AC_CONFIG_MACRO_DIR([m4])
dnl -----------------------------------
dnl Get hostname and other information.
AM_INIT_AUTOMAKE(1.6)
AM_CONFIG_HEADER(config.h)
-dnl GNU awk is required for lib/memtype.h made by memtypes.awk.
-dnl BSD awk complains: awk: gensub doesn't support backreferences (subst "\1")
-AC_CHECK_PROG([GAWK],[gawk],[gawk],[/bin/false])
+AC_CHECK_PROG([GAWK],[gawk],[gawk],[not-in-PATH])
+if test "x$GAWK" = "xnot-in-PATH" ; then
+ AC_MSG_ERROR([GNU awk is required for lib/memtype.h made by memtypes.awk.
+BSD awk complains: awk: gensub doesn't support backreferences (subst "\1") ])
+fi
AC_ARG_VAR([GAWK],[GNU AWK])
dnl default is to match previous behavior
dnl --------------------
dnl Check CC and friends
dnl --------------------
+AC_LANG([C])
AC_PROG_CC
AC_PROG_CPP
-
+AM_PROG_CC_C_O
AC_PROG_EGREP
dnl autoconf 2.59 appears not to support AC_PROG_SED
dnl -----------------
dnl System extensions
dnl -----------------
-AC_AIX
AC_GNU_SOURCE
dnl -------
[ --enable-vtysh include integrated vty shell for Quagga])
AC_ARG_ENABLE(ipv6,
[ --disable-ipv6 turn off IPv6 related features and daemons])
+AC_ARG_ENABLE(doc,
+[ --disable-doc do not build docs])
AC_ARG_ENABLE(zebra,
[ --disable-zebra do not build zebra daemon])
AC_ARG_ENABLE(bgpd,
[ --disable-watchquagga do not build watchquagga])
AC_ARG_ENABLE(isisd,
[ --enable-isisd build isisd])
+AC_ARG_ENABLE(solaris,
+[ --enable-solaris build solaris])
AC_ARG_ENABLE(bgp-announce,
[ --disable-bgp-announce, turn off BGP route announcement])
AC_ARG_ENABLE(netlink,
[ --enable-netlink force to use Linux netlink interface])
AC_ARG_ENABLE(broken-aliases,
[ --enable-broken-aliases enable aliases as distinct interfaces for Linux 2.2.X])
+AC_ARG_WITH(crypto,
+[ --without-crypto do not use libcrypto in SNMP])
AC_ARG_ENABLE(snmp,
[ --enable-snmp enable SNMP support])
AC_ARG_WITH(libpam,
AC_ARG_ENABLE(tcp-zebra,
[ --enable-tcp-zebra enable TCP/IP socket connection between zebra and protocol daemon])
AC_ARG_ENABLE(opaque-lsa,
-[ --enable-opaque-lsa enable OSPF Opaque-LSA with OSPFAPI support (RFC2370)])
+ AC_HELP_STRING([--disable-opaque-lsa],[do not build OSPF Opaque-LSA with OSPFAPI support (RFC2370)]))
AC_ARG_ENABLE(ospfapi,
-[ --disable-ospfapi do not build OSPFAPI to access the OSPF LSA Database,
- (this is the default if --enable-opaque-lsa is not set)])
+[ --disable-ospfapi do not build OSPFAPI to access the OSPF LSA Database])
AC_ARG_ENABLE(ospfclient,
[ --disable-ospfclient do not build OSPFAPI client for OSPFAPI,
(this is the default if --disable-ospfapi is set)])
AC_ARG_ENABLE(ospf-te,
-[ --enable-ospf-te enable Traffic Engineering Extension to OSPF])
+ AC_HELP_STRING([--disable-ospf-te],[disable Traffic Engineering Extension to OSPF]))
AC_ARG_ENABLE(multipath,
[ --enable-multipath=ARG enable multipath function, ARG must be digit])
-AC_ARG_ENABLE(quagga_user,
-[ --enable-user=ARG user to run Quagga suite as (default quagga)])
-AC_ARG_ENABLE(quagga_group,
-[ --enable-group=ARG group to run Quagga suite as (default quagga)])
+AC_ARG_ENABLE(user,
+ AC_HELP_STRING([--enable-user=user], [user to run Quagga suite as (default quagga)]))
+AC_ARG_ENABLE(group,
+ AC_HELP_STRING([--enable-group=group], [group to run Quagga suite as (default quagga)]))
AC_ARG_ENABLE(vty_group,
[ --enable-vty-group=ARG set vty sockets to have specified group as owner])
AC_ARG_ENABLE(configfile_mask,
[ --disable-capabilities disable using POSIX capabilities])
AC_ARG_ENABLE(gcc_ultra_verbose,
[ --enable-gcc-ultra-verbose enable ultra verbose GCC warnings])
+AC_ARG_ENABLE(linux24_tcp_md5,
+[ --enable-linux24-tcp-md5 enable support for old, Linux-2.4 RFC2385 patch])
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])
+AC_ARG_ENABLE(pcreposix,
+[ --enable-pcreposix enable using PCRE Posix libs for regex functions])
if test x"${enable_gcc_ultra_verbose}" = x"yes" ; then
CFLAGS="${CFLAGS} -W -Wcast-qual -Wstrict-prototypes"
AC_DEFINE(HAVE_TCP_ZEBRA,,Use TCP for zebra communication)
fi
-if test "${enable_opaque_lsa}" = "yes"; then
+if test "${enable_opaque_lsa}" != "no"; then
AC_DEFINE(HAVE_OPAQUE_LSA,,OSPF Opaque LSA)
fi
-if test "${enable_ospf_te}" = "yes"; then
+if test "${enable_ospf_te}" != "no"; then
AC_DEFINE(HAVE_OPAQUE_LSA,,OSPF Opaque LSA)
AC_DEFINE(HAVE_OSPF_TE,,OSPF TE)
fi
+if test "${enable_linux24_tcp_md5}" = "yes"; then
+ AC_DEFINE(HAVE_TCP_MD5_LINUX24,,Old Linux 2.4 TCP MD5 Signature Patch)
+fi
+
AC_MSG_CHECKING(if zebra should be configurable to send Route Advertisements)
if test "${enable_rtadv}" != "no"; then
AC_MSG_RESULT(yes)
dnl -------------------------
AC_CHECK_HEADERS([stropts.h sys/ksym.h sys/times.h sys/select.h \
sys/types.h linux/version.h netdb.h asm/types.h \
- sys/param.h limits.h signal.h libutil.h \
- sys/socket.h netinet/in.h])
+ sys/param.h limits.h signal.h \
+ sys/socket.h netinet/in.h time.h sys/time.h])
dnl Utility macro to avoid retyping includes all the time
m4_define([QUAGGA_INCLUDES],
#if HAVE_NETINET_IN_H
# include <netinet/in.h>
#endif
+#ifdef TIME_WITH_SYS_TIME
+# include <sys/time.h>
+# include <time.h>
+#else
+# ifdef HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
+#endif /* TIME_WITH_SYS_TIME */
+])dnl
+
+dnl HAVE_NET_IF_H must be discovered by the time the longer AC_CHECK_HEADERS
+dnl round below execution begins, otherwise it doesn't properly detect
+dnl HAVE_NETINET6_IN6_VAR_H, HAVE_NET_IF_VAR_H and HAVE_STRUCT_IN6_ALIASREQ
+dnl on FreeBSD (BZ#408).
+
+AC_CHECK_HEADERS([net/if.h], [], [], QUAGGA_INCLUDES)
+
+m4_define([QUAGGA_INCLUDES],
+QUAGGA_INCLUDES
+[#if HAVE_NET_IF_H
+# include <net/if.h>
+#endif
+])dnl
+
+dnl Same applies for HAVE_NET_IF_VAR_H, which HAVE_NETINET6_ND6_H and
+dnl HAVE_NETINET_IN_VAR_H depend upon. But if_var.h depends on if.h, hence
+dnl an additional round for it.
+
+AC_CHECK_HEADERS([net/if_var.h], [], [], QUAGGA_INCLUDES)
+
+m4_define([QUAGGA_INCLUDES],
+QUAGGA_INCLUDES
+[#if HAVE_NET_IF_VAR_H
+# include <net/if_var.h>
+#endif
])dnl
-AC_CHECK_HEADERS([sys/un.h net/if.h netinet/in_systm.h netinet/in_var.h \
- net/if_dl.h net/if_var.h net/netopt.h net/route.h \
+AC_CHECK_HEADERS([sys/un.h netinet/in_systm.h netinet/in_var.h \
+ net/if_dl.h net/netopt.h net/route.h \
inet/nd.h arpa/inet.h netinet/ip_icmp.h \
fcntl.h stddef.h sys/ioctl.h syslog.h wchar.h wctype.h \
sys/sysctl.h sys/sockio.h kvm.h sys/conf.h],
m4_define([QUAGGA_INCLUDES],
QUAGGA_INCLUDES
-[#if HAVE_NET_IF_H
-# include <net/if.h>
-#endif
-#if HAVE_SYS_UN_H
+[#if HAVE_SYS_UN_H
# include <sys/un.h>
#endif
#if HAVE_NETINET_IN_SYSTM_H
#if HAVE_NET_IF_DL_H
# include <net/if_dl.h>
#endif
-#if HAVE_NET_IF_VAR_H
-# include <net/if_var.h>
-#endif
#if HAVE_NET_NETOPT_H
# include <net/netopt.h>
#endif
;;
esac
+AC_SYS_LARGEFILE
+
dnl ---------------------
dnl Integrated VTY option
dnl ---------------------
dnl ----------
dnl PAM module
+dnl
+dnl Quagga detects the PAM library it is built against by checking for a
+dnl functional pam_misc.h (Linux-PAM) or openpam.h (OpenPAM) header. pam_misc.h
+dnl is known to #include pam_appl.h, the standard header of a PAM library, and
+dnl openpam.h doesn't do that, although depends on the header too. Hence a
+dnl little assistance to AC_CHECK_HEADER is necessary for the proper detection
+dnl of OpenPAM.
dnl ----------
if test "$with_libpam" = "yes"; then
AC_CHECK_HEADER([security/pam_misc.h],
AC_DEFINE(PAM_CONV_FUNC,openpam_ttyconv,Have openpam_ttyconv)
pam_conv_func="openpam_ttyconv"
],
- [], QUAGGA_INCLUDES)
+ [], QUAGGA_INCLUDES[#include <security/pam_appl.h>])
if test -z "$ac_cv_header_security_pam_misc_h$ac_cv_header_security_openpam_h" ; then
AC_MSG_WARN([*** pam support will not be built ***])
with_libpam="no"
AC_SUBST(KERNEL_METHOD)
AC_SUBST(OTHER_METHOD)
+dnl --------------------------
+dnl Determine IS-IS I/O method
+dnl --------------------------
+AC_DEFINE(ISIS_METHOD_PFPACKET, 1, [ constant value for isis method pfpacket ])
+AC_DEFINE(ISIS_METHOD_DLPI, 2, [ constant value for isis method dlpi ])
+AC_DEFINE(ISIS_METHOD_BPF, 3, [ constant value for isis method bpf ])
+AC_CHECK_HEADER(net/bpf.h)
+AC_CHECK_HEADER(sys/dlpi.h)
+AC_MSG_CHECKING(zebra IS-IS I/O method)
+if test x"$opsys" = x"gnu-linux"; then
+ AC_MSG_RESULT(pfpacket)
+ ISIS_METHOD_MACRO="ISIS_METHOD_PFPACKET"
+elif test x"$opsys" = x"sol2-6" -o x"$opsys" = x"sol8"; then
+ AC_MSG_RESULT(DLPI)
+ ISIS_METHOD_MACRO="ISIS_METHOD_DLPI"
+else
+ if test $ac_cv_header_net_bpf_h = no; then
+ if test $ac_cv_header_sys_dlpi_h = no; then
+ AC_MSG_RESULT(none)
+ AC_MSG_WARN([*** IS-IS support will not be built ***])
+ ISISD=""
+ else
+ AC_MSG_RESULT(DLPI)
+ fi
+ ISIS_METHOD_MACRO="ISIS_METHOD_DLPI"
+ else
+ AC_MSG_RESULT(BPF)
+ ISIS_METHOD_MACRO="ISIS_METHOD_BPF"
+ fi
+fi
+AC_DEFINE_UNQUOTED(ISIS_METHOD, $ISIS_METHOD_MACRO, [ selected method for isis, == one of the constants ])
+
dnl ------------------------------------
dnl check for broken CMSG_FIRSTHDR macro
dnl ------------------------------------
dnl ------------------------------
dnl check kernel route read method
dnl ------------------------------
-AC_CACHE_CHECK(route read method check, zebra_rtread,
-[if test "$netlink" = yes; then
- RTREAD_METHOD="rtread_netlink.o"
- zebra_rtread="netlink"
+AC_CACHE_CHECK([route read method], [quagga_cv_rtread_method],
+[if test "x$netlink" = xyes; then
+ quagga_cv_rtread_method="netlink"
else
-for zebra_rtread in /proc/net/route /dev/ip /dev/null;
+for quagga_cv_rtread_method in /proc/net/route /dev/ip /dev/null;
do
- test x`ls $zebra_rtread 2>/dev/null` = x"$zebra_rtread" && break
+ test x`ls $quagga_cv_rtread_method 2>/dev/null` = x"$quagga_cv_rtread_method" && break
done
-case $zebra_rtread in
- "/proc/net/route") RTREAD_METHOD="rtread_proc.o"
- zebra_rtread="proc";;
+case $quagga_cv_rtread_method in
+ "/proc/net/route") quagga_cv_rtread_method="proc";;
"/dev/ip")
case "$host" in
- *-freebsd*) RTREAD_METHOD=rtread_sysctl.o
- zebra_rtread="sysctl";;
- *) RTREAD_METHOD="rtread_getmsg.o"
- zebra_rtread="getmsg";;
+ *-freebsd*) quagga_cv_rtread_method="sysctl";;
+ *) quagga_cv_rtread_method="getmsg";;
esac;;
- *) RTREAD_METHOD="rtread_sysctl.o"
- zebra_rtread="sysctl";;
+ *)
+ quagga_cv_rtread_method="sysctl";;
esac
fi])
+RTREAD_METHOD=rtread_${quagga_cv_rtread_method}.o
AC_SUBST(RTREAD_METHOD)
dnl -----------------------------
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)
+#endif],[#if (defined(__FreeBSD__) && ((__FreeBSD_version >= 500022 && __FreeBSD_version < 700000) || (__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
AC_DEFINE(HAVE_BSD_STRUCT_IP_MREQ_HACK,,[Can pass ifindex in struct ip_mreq])],
AC_MSG_RESULT(no))
+dnl ---------------------------------------------------------------
+dnl figure out how to check link-state
+dnl ---------------------------------------------------------------
+AC_CHECK_HEADER([net/if.h],
+ [AC_CHECK_HEADER( [net/if_media.h],
+ [m4_define([LINK_DETECT_INCLUDES],
+ QUAGGA_INCLUDES
+ [#include <net/if_media.h>
+ ])
+ AC_CHECK_MEMBERS( [struct ifmediareq.ifm_status],
+ AC_DEFINE(HAVE_BSD_LINK_DETECT,,[BSD link-detect]),
+ [], LINK_DETECT_INCLUDES)],
+ [],
+ QUAGGA_INCLUDES)],
+ [], QUAGGA_INCLUDES )
+
+dnl ------------------------
+dnl TCP_MD5SIG socket option
+dnl ------------------------
+
+AC_CHECK_HEADER([netinet/tcp.h],
+ [m4_define([MD5_INCLUDES],
+ QUAGGA_INCLUDES
+ [#include <netinet/tcp.h>
+ ])
+ AC_CHECK_DECLS([TCP_MD5SIG], [], [], MD5_INCLUDES)],
+ [],
+ QUAGGA_INCLUDES)
+if test $ac_cv_have_decl_TCP_MD5SIG = no; then
+ AC_CHECK_HEADER([linux/tcp.h],
+ [m4_define([MD5_INCLUDES],
+ QUAGGA_INCLUDES
+ [#include <linux/tcp.h>
+ ])
+ AC_CHECK_DECLS([TCP_MD5SIG], [], [], MD5_INCLUDES)])
+fi
+
dnl -----------------------
dnl check proc file system.
dnl -----------------------
-if test -r /proc/net/dev; then
- AC_DEFINE(HAVE_PROC_NET_DEV,,/proc/net/dev)
- IF_PROC=if_proc.o
-fi
-
-if test -r /proc/net/if_inet6; then
- AC_DEFINE(HAVE_PROC_NET_IF_INET6,,/proc/net/if_inet6)
- IF_PROC=if_proc.o
+if test "$netlink" != yes; then
+ if test -r /proc/net/dev; then
+ AC_DEFINE(HAVE_PROC_NET_DEV,,/proc/net/dev)
+ IF_PROC=if_proc.o
+ fi
+ if test -r /proc/net/if_inet6; then
+ AC_DEFINE(HAVE_PROC_NET_IF_INET6,,/proc/net/if_inet6)
+ IF_PROC=if_proc.o
+ fi
fi
AC_SUBST(IF_PROC)
dnl -----------------------------
dnl check ipforward detect method
dnl -----------------------------
-AC_CACHE_CHECK(ipforward method check, zebra_ipforward_path,
-[for zebra_ipforward_path in /proc/net/snmp /dev/ip /dev/null;
+AC_CACHE_CHECK([ipforward method], [quagga_cv_ipforward_method],
+[for quagga_cv_ipforward_method in /proc/net/snmp /dev/ip /dev/null;
do
- test x`ls $zebra_ipforward_path 2>/dev/null` = x"$zebra_ipforward_path" && break
+ test x`ls $quagga_cv_ipforward_method 2>/dev/null` = x"$quagga_cv_ipforward_method" && break
done
-case $zebra_ipforward_path in
- "/proc/net/snmp") IPFORWARD=ipforward_proc.o
- zebra_ipforward_path="proc";;
+case $quagga_cv_ipforward_method in
+ "/proc/net/snmp") quagga_cv_ipforward_method="proc";;
"/dev/ip")
case "$host" in
- *-nec-sysv4*) IPFORWARD=ipforward_ews.o
- zebra_ipforward_path="ews";;
- *-freebsd*) IPFORWARD=ipforward_sysctl.o
- zebra_ipforward_path="sysctl";;
- *) IPFORWARD=ipforward_solaris.o
- zebra_ipforward_path="solaris";;
+ *-nec-sysv4*) quagga_cv_ipforward_method="ews";;
+ *-freebsd*) quagga_cv_ipforward_method="sysctl";;
+ *) quagga_cv_ipforward_method="solaris";;
esac;;
- *) IPFORWARD=ipforward_sysctl.o
- zebra_ipforward_path="sysctl";;
+ *) quagga_cv_ipforward_method="sysctl";;
esac])
+IPFORWARD=ipforward_${quagga_cv_ipforward_method}.o
AC_SUBST(IPFORWARD)
AC_CHECK_FUNCS(getaddrinfo, [have_getaddrinfo=yes], [have_getaddrinfo=no])
#endif
])dnl
+dnl disable doc check
+if test "${enable_doc}" = "no";then
+ DOC=""
+else
+ DOC="doc"
+fi
+
dnl --------------------
dnl Daemon disable check
dnl --------------------
fi
OSPFCLIENT=""
-if test "${enable_opaque_lsa}" = "yes"; then
+if test "${enable_opaque_lsa}" != "no"; then
if test "${enable_ospfapi}" != "no";then
AC_DEFINE(SUPPORT_OSPF_API,,OSPFAPI)
* ) ;;
esac
+# XXX Perhaps auto-enable on Solaris, but that's messy for cross builds.
+case "${enable_solaris}" in
+ "yes") SOLARIS="solaris";;
+ "no" ) SOLARIS="";;
+ * ) ;;
+esac
+
if test "${enable_bgp_announce}" = "no";then
- AC_DEFINE(DISABLE_BGP_ANNOUNCE,,Disable BGP installation to zebra)
+ AC_DEFINE(DISABLE_BGP_ANNOUNCE,1,Disable BGP installation to zebra)
+else
+ AC_DEFINE(DISABLE_BGP_ANNOUNCE,0,Disable BGP installation to zebra)
fi
+AC_SUBST(DOC)
AC_SUBST(ZEBRA)
AC_SUBST(BGPD)
AC_SUBST(RIPD)
AC_SUBST(OSPF6D)
AC_SUBST(WATCHQUAGGA)
AC_SUBST(ISISD)
+AC_SUBST(SOLARIS)
AC_SUBST(VTYSH)
AC_SUBST(INCLUDES)
AC_SUBST(CURSES)
AC_CHECK_FUNC(__inet_pton, AC_DEFINE(HAVE_INET_PTON,,__inet_pton))
AC_CHECK_FUNC(__inet_aton, AC_DEFINE(HAVE_INET_ATON,,__inet_aton))
+dnl ---------------------------
+dnl check system has PCRE regexp
+dnl ---------------------------
+if test "x$enable_pcreposix" = "xyes"; then
+ AC_CHECK_LIB(pcreposix, pcreposix_regexec, ,[enable_pcreposix=no
+ AC_MSG_WARN([*** falling back to other regex library ***]) ])
+fi
+
+if test "x$enable_pcreposix" != "xyes"; then
dnl ---------------------------
dnl check system has GNU regexp
dnl ---------------------------
-dnl AC_MSG_CHECKING(whether system has GNU regex)
+AC_MSG_CHECKING(whether system has GNU regex)
AC_CHECK_LIB(c, regexec,
[AC_DEFINE(HAVE_GNU_REGEX,,GNU regexp library)
LIB_REGEX=""],
[LIB_REGEX="regex.o"])
+fi
+AC_SUBST(HAVE_LIBPCREPOSIX)
AC_SUBST(LIB_REGEX)
dnl ------------------
dnl check Net-SNMP library
dnl ------------------
if test "${enable_snmp}" = "yes"; then
- LIBS="${LIBS} -lcrypto"
+ if test "$with_crypto" != "no"; then
+ LIBS="${LIBS} -lcrypto";
+ fi
AC_CHECK_LIB(netsnmp, asn_parse_int,
[AC_DEFINE(HAVE_NETSNMP,,Net SNMP)
AC_DEFINE(HAVE_SNMP,,SNMP)
LIBS="${LIBS} -lnetsnmp"],
[AC_MSG_ERROR([--enable-snmp given, but cannot find support for SNMP])])
-
- for ac_snmp in /usr/include \
- /usr/local/include \
- /dev/null; do
- test -f "${ac_snmp}/net-snmp/library/asn1.h" && break
- done
-
- case ${ac_snmp} in
- /dev/null)
- AC_MSG_ERROR([--enable-snmp given, but can not find header])
- ;;
- *)
- SNMP_INCLUDES="-I${ac_snmp}/net-snmp"
- SNMP_INCLUDES="${SNMP_INCLUDES} -I${ac_snmp}/net-snmp/library"
- ;;
- esac
-
+
+ AC_CHECK_HEADER([net-snmp/net-snmp-config.h],
+ [],
+ [AC_MSG_ERROR([--enable-snmp given, but cannot find net-snmp-config.h])],
+ QUAGGA_INCLUDES)
AC_SUBST(SNMP_INCLUDES)
fi
AC_DEFINE(HAVE_RUSAGE,,rusage)],
AC_MSG_RESULT(no))
+dnl --------------------------------------
+dnl checking for clock_time monotonic struct and call
+dnl --------------------------------------
+AC_CHECK_DECL(CLOCK_MONOTONIC,
+ [AC_CHECK_LIB(rt, clock_gettime, [LIBS="$LIBS -lrt"])
+ AC_DEFINE(HAVE_CLOCK_MONOTONIC,, Have monotonic clock)
+], [AC_MSG_RESULT(no)], [QUAGGA_INCLUDES])
+
dnl -------------------
dnl capabilities checks
dnl -------------------
CONFDATE=`date '+%Y%m%d'`
AC_SUBST(CONFDATE)
+dnl Conditionally enable PIE support for GNU toolchains.
+AC_ARG_ENABLE(pie, AS_HELP_STRING([--disable-pie], [Do not build tools as a Position Independent Executables]))
+if test "$enable_pie" != "no"; then
+ AC_CACHE_CHECK([whether $CC accepts PIE flags], [ap_cv_cc_pie], [
+ save_CFLAGS=$CFLAGS
+ save_LDFLAGS=$LDFLAGS
+ CFLAGS="$CFLAGS -fPIE"
+ LDFLAGS="$LDFLAGS -pie"
+ AC_LINK_IFELSE([AC_LANG_SOURCE([[static int foo[30000]; int main () { return 0; }]])],
+ [ap_cv_cc_pie=yes], [ap_cv_cc_pie=no]
+ )
+ CFLAGS=$save_CFLAGS
+ LDFLAGS=$save_LDFLAGS
+ ])
+ if test "$ap_cv_cc_pie" = "yes"; then
+ PICFLAGS="-fPIE"
+ PILDFLAGS="-pie"
+ fi
+fi
+
+AC_SUBST(PICFLAGS)
+AC_SUBST(PILDFLAGS)
+
dnl ------------------------------
dnl set paths for state directory
dnl ------------------------------
+AC_MSG_CHECKING(directory to use for state file)
if test "${prefix}" = "NONE"; then
quagga_statedir_prefix="";
else
quagga_statedir_prefix=${prefix}
fi
if test "${localstatedir}" = '${prefix}/var'; then
- AC_CACHE_CHECK(state directory,ac_statedir,
- [for QUAGGA_STATE_DIR in ${quagga_statedir_prefix}/var/run dnl
+ for QUAGGA_STATE_DIR in ${quagga_statedir_prefix}/var/run dnl
${quagga_statedir_prefix}/var/adm dnl
${quagga_statedir_prefix}/etc dnl
/var/run dnl
do
test -d $QUAGGA_STATE_DIR && break
done
- quagga_statedir=$QUAGGA_STATE_DIR])
+ quagga_statedir=$QUAGGA_STATE_DIR
else
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!')
fi
+AC_MSG_RESULT(${quagga_statedir})
+AC_SUBST(quagga_statedir)
AC_DEFINE_UNQUOTED(PATH_ZEBRA_PID, "$quagga_statedir/zebra.pid",zebra PID)
AC_DEFINE_UNQUOTED(PATH_RIPD_PID, "$quagga_statedir/ripd.pid",ripd PID)
Quagga configuration
--------------------
quagga version : ${PACKAGE_VERSION}
-host operationg system : ${host_os}
+host operating system : ${host_os}
source code location : ${srcdir}
compiler : ${CC}
compiler flags : ${CFLAGS}