build: Rework how MULTIPATH_NUM is delivered to build
Changes made here:
1) MULTIPATH_NUM will never be 0. If user specifies --enable-multipath=0
then this translates to MULTIPATH_NUM being set to 64 inside of the build
system.
2) Move MULTIPATH_NUM from a Makefile construct to a config.h construct.
3) Allowed MULTIPATH_NUM to be a number > 99 but < 1000
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
diff --git a/bgpd/Makefile.am b/bgpd/Makefile.am
index 7da4dd8..d2775f3 100644
--- a/bgpd/Makefile.am
+++ b/bgpd/Makefile.am
@@ -1,7 +1,7 @@
## Process this file with automake to produce Makefile.in.
AM_CPPFLAGS = -I.. -I$(top_srcdir) -I$(top_srcdir)/lib -I$(top_builddir)/lib
-DEFS = @DEFS@ -DSYSCONFDIR=\"$(sysconfdir)/\" -DMULTIPATH_NUM=@MULTIPATH_NUM@
+DEFS = @DEFS@ -DSYSCONFDIR=\"$(sysconfdir)/\"
INSTALL_SDATA=@INSTALL@ -m 600
AM_CFLAGS = $(WERROR)
diff --git a/configure.ac b/configure.ac
index b4d934b..7aaacb9 100755
--- a/configure.ac
+++ b/configure.ac
@@ -379,11 +379,14 @@
enable_logfile_mask=${enable_logfile_mask:-0600}
AC_DEFINE_UNQUOTED(LOGFILE_MASK, ${enable_logfile_mask}, Mask for log files)
-MULTIPATH_NUM=1
+MPATH_NUM=1
case "${enable_multipath}" in
- [[0-9]|[1-9][0-9]])
- MULTIPATH_NUM="${enable_multipath}"
+ 0)
+ MPATH_NUM=64
+ ;;
+ [[1-9]|[1-9][0-9]|[1-9][0-9][0-9]])
+ MPATH_NUM="${enable_multipath}"
;;
"")
;;
@@ -392,7 +395,7 @@
;;
esac
-AC_SUBST(MULTIPATH_NUM)
+AC_DEFINE_UNQUOTED(MULTIPATH_NUM, $MPATH_NUM, Maximum number of paths for a route)
dnl -----------------------------------
dnl Add extra version string to package
diff --git a/zebra/Makefile.am b/zebra/Makefile.am
index 96dc6f0..90ce7b9 100644
--- a/zebra/Makefile.am
+++ b/zebra/Makefile.am
@@ -1,7 +1,7 @@
## Process this file with automake to produce Makefile.in.
AM_CPPFLAGS = -I.. -I$(top_srcdir) -I$(top_srcdir)/lib -I$(top_builddir)/lib
-DEFS = @DEFS@ -DSYSCONFDIR=\"$(sysconfdir)/\" -DMULTIPATH_NUM=@MULTIPATH_NUM@
+DEFS = @DEFS@ -DSYSCONFDIR=\"$(sysconfdir)/\"
INSTALL_SDATA=@INSTALL@ -m 600
LIBCAP = @LIBCAP@