]> git.proxmox.com Git - mirror_frr.git/blobdiff - configure.ac
mpls: add null driver
[mirror_frr.git] / configure.ac
index eb1f1de6c1852f10442c3b860ff77ea1fa999496..e15f384c218bbcc6fc7385b886da31b5bd777f4b 100755 (executable)
@@ -309,6 +309,8 @@ AC_ARG_ENABLE(systemd,
   AS_HELP_STRING([--enable-systemd], [enable Systemd support]))
 AC_ARG_ENABLE(poll,
   AS_HELP_STRING([--enable-poll], [enable usage of Poll instead of select]))
+AC_ARG_ENABLE(mpls,
+  AS_HELP_STRING([--enable-mpls], [enable MPLS support - requires compatible kernel]))
 AC_ARG_ENABLE(werror,
   AS_HELP_STRING([--enable-werror], [enable -Werror (recommended for developers only)]))
 AC_ARG_ENABLE(cumulus,
@@ -360,6 +362,29 @@ if test "${enable_poll}" = "yes" ; then
   AC_DEFINE(HAVE_POLL,,Compile systemd support in)
 fi
 
+dnl ----------
+dnl MPLS check
+dnl ----------
+MPLS_METHOD=""
+AC_MSG_CHECKING(whether this OS has MPLS stack)
+if test "x${enable_mpls}" = "xyes"; then
+  case "$host" in
+    *-linux*)
+        AC_DEFINE(HAVE_MPLS,,Enable MPLS)
+        MPLS_METHOD="zebra_mpls_netlink.o"
+        AC_MSG_RESULT(Linux MPLS)
+    ;;
+    *)
+        AC_MSG_RESULT(Unsupported kernel)
+        MPLS_METHOD="zebra_mpls_null.o"
+    ;;
+  esac
+else
+  AC_MSG_RESULT(disabled)
+  MPLS_METHOD="zebra_mpls_null.o"
+fi
+AC_SUBST(MPLS_METHOD)
+
 if test "${enable_cumulus}" = "yes" ; then
   AC_DEFINE(HAVE_CUMULUS,,Compile Special Cumulus Code in)
 fi