📄 configure.ac
字号:
#### Configure template file for Zebra.## autoconf will generate configure script.#### Copyright (c) 1996, 97, 98, 99, 2000 Kunihiro Ishiguro <kunihiro@zebra.org>##AC_PREREQ(2.53)AC_INIT(lib/zebra.h)AM_INIT_AUTOMAKE(zebra, 0.94)AM_CONFIG_HEADER(config.h)dnl -----------------------------------dnl Get hostname and other information.dnl -----------------------------------AC_CANONICAL_HOSTdnl ------------dnl Check CFLAGSdnl ------------AC_ARG_WITH(cflags,[ --with-cflags Set CFLAGS for use in compilation.])if test "x$with_cflags" != "x" ; then CFLAGS="$with_cflags" ; cflags_specified=yes ;elif test -n "$CFLAGS" ; then cflags_specified=yes ;fidnl --------dnl Check CCdnl --------AC_PROG_CCdnl -----------------------------------------dnl If CLFAGS doesn\'t exist set default valuednl -----------------------------------------if test "x$cflags_specified" = "x" ; then CFLAGS="$CFLAGS -Wall"fidnl --------------dnl Check programsdnl --------------AC_PROG_CPPAC_PROG_INSTALLAC_PROG_MAKE_SETAC_CHECK_TOOL(AR, ar)AC_CHECK_TOOL(RANLIB, ranlib, :)dnl ---------dnl AIX checkdnl ---------AC_AIXdnl ----------------------dnl Packages configurationdnl ----------------------AC_ARG_ENABLE(vtysh,[ --enable-vtysh, Make integrated VTY version of zebra])AC_ARG_ENABLE(ipv6,[ --disable-ipv6 turn off IPv6 related features and daemons])AC_ARG_ENABLE(zebra,[ --disable-zebra do not build zebra daemon])AC_ARG_ENABLE(bgpd,[ --disable-bgpd do not build bgpd])AC_ARG_ENABLE(ripd,[ --disable-ripd do not build ripd])AC_ARG_ENABLE(ripngd,[ --disable-ripngd do not build ripngd])AC_ARG_ENABLE(ospfd,[ --disable-ospfd do not build ospfd])AC_ARG_ENABLE(ospf6d,[ --disable-ospf6d do not build ospf6d])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_ENABLE(snmp,[ --enable-snmp enable SNMP support])AC_ARG_WITH(libpam,[ --with-libpam use libpam for PAM support in vtysh])AC_ARG_ENABLE(tcpsock,[ --enable-tcp-zebra enable TCP/IP socket connection between zebra and protocol daemon])dnl Temporary option until OSPF NSSA implementation completeAC_ARG_ENABLE(nssa,[ --enable-nssa enable OSPF NSSA option])AC_ARG_ENABLE(opaque-lsa,[ --enable-opaque-lsa enable OSPF Opaque-LSA support (RFC2370)])AC_ARG_ENABLE(ospf-te,[ --enable-ospf-te enable Traffic Engineering Extension to OSPF])AC_ARG_ENABLE(multipath,[ --enable-multipath=ARG enable multipath function, ARG must be digit])dnl AC_ARG_ENABLE(rtadv,dnl [ --enable-rtadv enable IPV6 router advertisment option])if test "${enable_broken_aliases}" = "yes"; then if test "${enable_netlink}" = "yes" then echo "Sorry, you can't use netlink with broken aliases" exit 1 fi AC_DEFINE(HAVE_BROKEN_ALIASES,,Broken Alias) enable_netlink=nofiif test "${enable_tcp_zebra}" = "yes"; then AC_DEFINE(HAVE_TCP_ZEBRA,,Use TCP for zebra communication)fiif test "${enable_nssa}" = "yes"; then AC_DEFINE(HAVE_NSSA,,OSPF NSSA)fiif test "${enable_opaque_lsa}" = "yes"; then AC_DEFINE(HAVE_OPAQUE_LSA,,OSPF Opaque LSA)fiif test "${enable_ospf_te}" = "yes"; then AC_DEFINE(HAVE_OPAQUE_LSA,,OSPF Opaque LSA) AC_DEFINE(HAVE_OSPF_TE,,OSPF TE)fidnl if test "${enable_rtadv}" = "yes"; thendnl AC_DEFINE(HAVE_RTADV)dnl fichangequote(, )dnlMULTIPATH_NUM=1case "${enable_multipath}" in [0-9]|[1-9][0-9]) MULTIPATH_NUM="${enable_multipath}" ;; "") ;; *) echo "Please specify digit to --enable-multipath ARG." exit 1 ;;esacchangequote([, ])dnlAC_SUBST(MULTIPATH_NUM)dnl -------------------dnl Check header files.dnl -------------------AC_STDC_HEADERSAC_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 net/if_dl.h net/if_var.h linux/version.h kvm.h netdb.h netinet/in.h net/netopt.h netinet/in_var.h netinet/in6_var.h netinet/in6.h inet/nd.h asm/types.h netinet/icmp6.h netinet6/nd6.h libutil.h)dnl check some typesAC_C_CONSTdnl AC_TYPE_PID_TAC_TYPE_SIGNALdnl Some systems (Solaris 2.x) require libnsl (Network Services Library)case "$host" in *-sunos5.6* | *-solaris2.6*) opsys=sol2-6 AC_DEFINE(SUNOS_5,,SunOS 5) AC_CHECK_LIB(xnet, main) CURSES=-lcurses ;; *-sunos5* | *-solaris2*) AC_DEFINE(SUNOS_5,,SunOS 5) AC_CHECK_LIB(socket, main) AC_CHECK_LIB(nsl, main) CURSES=-lcurses ;; *-linux-*) opsys=gnu-linux AC_DEFINE(GNU_LINUX,,GNU Linux) ;; *-nec-sysv4*) 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) ;; *-bsdi*) opsys=bsdi OTHER_METHOD="mtu_kvm.o" AC_CHECK_LIB(kvm, main) ;;esacdnl ---------------------dnl Integrated VTY optiondnl ---------------------case "${enable_vtysh}" in "yes") VTYSH="vtysh"; AC_DEFINE(VTYSH,,VTY shell) AC_CHECK_LIB(tinfo, tputs, , AC_CHECK_LIB(ncurses, tputs)) AC_CHECK_LIB(readline, main) if test $ac_cv_lib_readline_main = no; then AC_MSG_ERROR([vtysh needs libreadline but was not found on your system.]) fi AC_CHECK_HEADER(readline/history.h) if test $ac_cv_header_readline_history_h = no;then AC_MSG_ERROR([readline is too old to have readline/history.h, please update to the latest readline library.]) fi ;; "no" ) VTYSH="";; * ) ;;esacdnl ----------dnl PAM modulednl ----------if test "$with_libpam" = "yes"; thendnl took this test from proftpd's configure.in and suited to our needsdnl -------------------------------------------------------------------------dnldnl This next check looks funky due to a linker problem with some versionsdnl of the PAM library. Prior to 0.72 release, the Linux PAM shared librarydnl omitted requiring libdl linking information. PAM-0.72 or better shipsdnl with RedHat 6.2 and Debian 2.2 or better.AC_CHECK_LIB(pam, pam_start, [AC_CHECK_LIB(pam, misc_conv, [AC_DEFINE(USE_PAM,,Use PAM for authentication) LIBPAM="-lpam"], [AC_DEFINE(USE_PAM,,Use PAM for authentication) LIBPAM="-lpam -lpam_misc"] ) ], [AC_CHECK_LIB(pam, pam_end, [AC_CHECK_LIB(pam, misc_conv, [AC_DEFINE(USE_PAM) LIBPAM="-lpam -ldl"], [AC_DEFINE(USE_PAM) LIBPAM="-lpam -ldl -lpam_misc"] ) ],AC_MSG_WARN([*** pam support will not be built ***]), [-ldl]) ])fiAC_SUBST(LIBPAM)dnl -------------------------------dnl Endian-ness checkdnl -------------------------------AC_WORDS_BIGENDIANdnl -------------------------------dnl check the size in byte of the Cdnl -------------------------------dnl AC_CHECK_SIZEOF(char)dnl AC_CHECK_SIZEOF(int)dnl AC_CHECK_SIZEOF(short)dnl AC_CHECK_SIZEOF(long)dnl ----------------------------dnl check existance of functionsdnl ----------------------------AC_CHECK_FUNCS(bcopy bzero strerror inet_aton daemon snprintf vsnprintf strlcat strlcpy if_nametoindex if_indextoname getifaddrs)AC_CHECK_FUNCS(setproctitle, ,[AC_CHECK_LIB(util, setproctitle, [LIBS="$LIBS -lutil"; AC_DEFINE(HAVE_SETPROCTITLE)])])dnl ------------------------------------dnl Determine routing get and set methoddnl ------------------------------------AC_MSG_CHECKING(zebra between kernel interface method)if test x"$opsys" = x"gnu-linux"; then if test "${enable_netlink}" = "yes";then AC_MSG_RESULT(netlink) RT_METHOD=rt_netlink.o AC_DEFINE(HAVE_NETLINK,,netlink) netlink=yes elif test "${enable_netlink}" = "no"; then AC_MSG_RESULT(ioctl) RT_METHOD=rt_ioctl.o netlink=no else AC_MSG_RESULT(netlink) RT_METHOD=rt_netlink.o AC_DEFINE(HAVE_NETLINK,,netlink) netlink=yes fielse if test "$opsys" = "sol2-6";then AC_MSG_RESULT(solaris) KERNEL_METHOD="kernel_socket.o" RT_METHOD="rt_socket.o" else AC_TRY_RUN([#include <errno.h>#include <sys/types.h>#include <sys/socket.h>main (){ int ac_sock; ac_sock = socket (AF_ROUTE, SOCK_RAW, 0); if (ac_sock < 0 && errno == EINVAL) exit (1); exit (0);}], [KERNEL_METHOD=kernel_socket.o RT_METHOD=rt_socket.o AC_MSG_RESULT(socket)], [RT_METHOD=rt_ioctl.o AC_MSG_RESULT(ioctl)], [KERNEL_METHOD=kernel_socket.o RT_METHOD=rt_socket.o AC_MSG_RESULT(socket)]) fifiAC_SUBST(RT_METHOD)AC_SUBST(KERNEL_METHOD)AC_SUBST(OTHER_METHOD)dnl ------------------------------dnl check kernel route read methoddnl ------------------------------AC_CACHE_CHECK(route read method check, zebra_rtread,[if test "$netlink" = yes; then RTREAD_METHOD="rtread_netlink.o" zebra_rtread="netlink"elsefor zebra_rtread in /proc/net/route /dev/ip /dev/null;do test x`ls $zebra_rtread 2>/dev/null` = x"$zebra_rtread" && breakdonecase $zebra_rtread in "/proc/net/route") RTREAD_METHOD="rtread_proc.o" zebra_rtread="proc";; "/dev/ip") RTREAD_METHOD="rtread_getmsg.o" zebra_rtread="getmsg";; *) RTREAD_METHOD="rtread_sysctl.o" zebra_rtread="sysctl";;esacfi])AC_SUBST(RTREAD_METHOD)dnl -----------------------------dnl check interface lookup methoddnl -----------------------------AC_MSG_CHECKING(interface looking up method)if test "$netlink" = yes; then AC_MSG_RESULT(netlink) IF_METHOD=if_netlink.oelse if test "$opsys" = "sol2-6";then AC_MSG_RESULT(solaris) IF_METHOD=if_ioctl.o elif test "$opsys" = "openbsd";then AC_MSG_RESULT(openbsd) IF_METHOD=if_ioctl.o elif grep NET_RT_IFLIST /usr/include/sys/socket.h >/dev/null 2>&1; then AC_MSG_RESULT(sysctl) IF_METHOD=if_sysctl.o AC_DEFINE(HAVE_NET_RT_IFLIST,,NET_RT_IFLIST) else AC_MSG_RESULT(ioctl) IF_METHOD=if_ioctl.o fifiAC_SUBST(IF_METHOD)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.ofiif test -r /proc/net/if_inet6; then AC_DEFINE(HAVE_PROC_NET_IF_INET6,,/proc/net/if_inet6) IF_PROC=if_proc.ofiAC_SUBST(IF_PROC)dnl -----------------------------dnl check ipforward detect methoddnl -----------------------------AC_CACHE_CHECK(ipforward method check, zebra_ipforward_path,[for zebra_ipforward_path in /proc/net/snmp /dev/ip /dev/null;do test x`ls $zebra_ipforward_path 2>/dev/null` = x"$zebra_ipforward_path" && breakdonecase $zebra_ipforward_path in "/proc/net/snmp") IPFORWARD=ipforward_proc.o zebra_ipforward_path="proc";; "/dev/ip") case "$host" in *-linux-*) IPFORWARD=ipforward_proc.o zebra_ipforward_path="proc";; *-nec-sysv4*) IPFORWARD=ipforward_ews.o zebra_ipforward_path="ews";; *) IPFORWARD=ipforward_solaris.o zebra_ipforward_path="solaris";; esac;; *) IPFORWARD=ipforward_sysctl.o zebra_ipforward_path="sysctl";;esac])AC_SUBST(IPFORWARD)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -