]> git.proxmox.com Git - mirror_frr.git/blobdiff - configure.ac
2005-04-16 Paul Jakma <paul@dishone.st>
[mirror_frr.git] / configure.ac
index ff424e8b7a0cb3ea6b17a864201dddb85723b8c6..08b5214f98378822e4766836356ba6bb891d7c81 100755 (executable)
@@ -5,14 +5,26 @@
 ##  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.87 2005/01/12 17:27:27 ajs Exp $
+## $Id: configure.ac,v 1.103 2005/04/16 15:38:23 paul Exp $
 AC_PREREQ(2.53)
 
-AC_INIT(Quagga, 0.98.0, [http://bugzilla.quagga.net])
+AC_INIT(Quagga, 0.99.0, [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],
@@ -33,11 +45,6 @@ dnl XXX add --pkgsrcrcdir to autoconf standard directory list somehow
 AC_SUBST(pkgsrcdir)
 AC_SUBST(pkgsrcrcdir)
 
-dnl -----------------------------------
-dnl Get hostname and other information.
-dnl -----------------------------------
-AC_CANONICAL_HOST
-
 dnl ------------
 dnl Check CFLAGS
 dnl ------------
@@ -49,10 +56,25 @@ elif test -n "$CFLAGS" ; then
   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
@@ -60,20 +82,34 @@ dnl AC_PROG_CC will have set minimal default
 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)
@@ -151,6 +187,8 @@ AC_ARG_ENABLE(rtadv,
 [  --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,
@@ -204,19 +242,28 @@ if test "${enable_irdp}" = "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])
@@ -225,6 +272,11 @@ elif test x"${enable_vty_group}" != x""; then
     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)
@@ -274,20 +326,25 @@ AC_TYPE_SIGNAL
 
 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*)
@@ -296,7 +353,7 @@ case "$host" in
       AC_CHECK_LIB(nsl, main)
       CURSES=-lcurses
   ;;
-  *-linux-*)
+  *-linux*)
       opsys=gnu-linux
       AC_DEFINE(GNU_LINUX,,GNU Linux)
   ;;
@@ -425,7 +482,7 @@ dnl check existance of functions
 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"
@@ -459,7 +516,7 @@ elif test x"$opsys" = x"sol2-6";then
   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"
@@ -498,7 +555,7 @@ dnl ------------------------------------
 dnl check for broken CMSG_FIRSTHDR macro
 dnl ------------------------------------
 AC_MSG_CHECKING(for broken CMSG_FIRSTHDR)
-AC_TRY_RUN([
+AC_RUN_IFELSE([AC_LANG_SOURCE([[
 #ifdef SUNOS_5
 #define _XPG4_2
 #define __EXTENSIONS__
@@ -518,8 +575,8 @@ main()
   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(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
@@ -560,7 +617,7 @@ if test "$netlink" = yes; then
 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
@@ -687,7 +744,7 @@ 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)
@@ -919,7 +976,7 @@ dnl  AC_CHECK_LIB(snmp, asn_parse_int, HAVE_SNMP=yes)
                   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
@@ -928,19 +985,19 @@ dnl  AC_CHECK_LIB(snmp, asn_parse_int, HAVE_SNMP=yes)
                   ;;
       /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
@@ -954,6 +1011,8 @@ 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 ----------------------------
@@ -1073,6 +1132,36 @@ AC_TRY_COMPILE([#include <netinet/in.h>
  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 --------------------------------------
@@ -1155,6 +1244,7 @@ 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!')
@@ -1178,6 +1268,14 @@ AC_DEFINE_UNQUOTED(OSPF6_VTYSH_PATH, "$quagga_statedir/ospf6d.vty",ospf6d vty so
 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
 dnl ---------------------------
@@ -1205,8 +1303,11 @@ AC_CONFIG_FILES([Makefile lib/Makefile zebra/Makefile ripd/Makefile
          redhat/quagga.spec 
          lib/version.h
          doc/defines.texi
+         isisd/topology/Makefile
          pkgsrc/bgpd.sh pkgsrc/ospf6d.sh pkgsrc/ospfd.sh
          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.
@@ -1221,6 +1322,7 @@ host operationg system  : ${host_os}
 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}\``