aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2016-07-02 10:34:55 -0400
committerDave Barach <dave@barachs.net>2016-07-02 10:35:08 -0400
commitdbacf85fed57839b58ad10605a5245ebe6c1a049 (patch)
tree4780bd07178f0cd8d173b92deca822b468b791c9 /plugins
parenta15568029aecb3c1da582c8662702edd502bee72 (diff)
Finish cleanup of .../plugins/{configure.ac, Makefile.am}
To add a new plugin subdirectory, add this to Makefile.am: if ENABLE_new_PLUGIN SUBDIRS += new-plugin endif and add this to configure.ac: PLUGIN(new) Change-Id: I770a6f4f8f964fd7318a912be486accf46514b59 Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'plugins')
-rw-r--r--plugins/Makefile.am20
-rw-r--r--plugins/configure.ac106
-rw-r--r--plugins/sample-plugin/configure.ac1
-rw-r--r--plugins/sixrd-plugin/configure.ac1
-rw-r--r--plugins/snat-plugin/configure.ac2
-rw-r--r--plugins/vcgn-plugin/configure.ac1
6 files changed, 44 insertions, 87 deletions
diff --git a/plugins/Makefile.am b/plugins/Makefile.am
index 83dc70bf..350a00e3 100644
--- a/plugins/Makefile.am
+++ b/plugins/Makefile.am
@@ -13,23 +13,33 @@
AUTOMAKE_OPTIONS = foreign subdir-objects
+# To add a new plugin subdirectory:
+#
+# add a stanza here:
+# if ENABLE_new_PLUGIN
+# SUBDIRS += new-plugin
+# endif
+#
+# Also: add PLUGIN(new) to configure.ac
+
SUBDIRS =
-if ENABLE_SAMPLE_PLUGIN
+
+if ENABLE_sample_PLUGIN
SUBDIRS += sample-plugin
endif
-if ENABLE_SIXRD_PLUGIN
+if ENABLE_sixrd_PLUGIN
SUBDIRS += sixrd-plugin
endif
-if ENABLE_IOAM_PLUGIN
+if ENABLE_ioam_PLUGIN
SUBDIRS += ioam-plugin
endif
-if ENABLE_VCGN_PLUGIN
+if ENABLE_vcgn_PLUGIN
SUBDIRS += vcgn-plugin
endif
-if ENABLE_SNAT_PLUGIN
+if ENABLE_snat_PLUGIN
SUBDIRS += snat-plugin
endif
diff --git a/plugins/configure.ac b/plugins/configure.ac
index 8a5fdbc2..7aff9875 100644
--- a/plugins/configure.ac
+++ b/plugins/configure.ac
@@ -29,87 +29,31 @@ AM_CONDITIONAL(ENABLE_TESTS, test "$enable_tests" = "1")
AM_CONDITIONAL(WITH_DPDK, test "$with_dpdk" = "1")
AC_SUBST(DPDK,["-DDPDK=${with_dpdk}"])
-
-#
-# Please DO NOT, UNDER ANY CIRCUMSTANCES enable or disable
-# plugins by "clever" manipulation of the arguments to AC_ARG_ENABLE
-#
-# Instead, please configure the default set of plugins in
-# .../build-data/platforms/<platform>.mk, by adding --enable-XXX-plugin
-# stanzas to plugins_configure_args_<platform>
-
-# The following per-plugin boilerplate is begging for an additional
-# macro, but the first 10 tries at making one didn't work. Another day.
-
-#
-# Sample plugin
-#
-AC_ARG_ENABLE(sample_plugin,
- AC_HELP_STRING([--enable-sample-plugin], [Build sample plugin]),
- [enable_sample_plugin=1],
- [enable_sample_plugin=0])
-
-if test "x$enable_sample_plugin" = x1; then
- AC_CONFIG_SUBDIRS([sample-plugin])
-fi
-
-AM_CONDITIONAL(ENABLE_SAMPLE_PLUGIN, test "$enable_sample_plugin" = "1")
-
-#
-# SIXRD plugin
-#
-AC_ARG_ENABLE(sixrd_plugin,
- AC_HELP_STRING([--enable-sixrd-plugin], [Build sixrd plugin]),
- [enable_sixrd_plugin=1],
- [enable_sixrd_plugin=0])
-
-if test "x$enable_sixrd_plugin" = x1; then
- AC_CONFIG_SUBDIRS([sixrd-plugin])
-fi
-
-AM_CONDITIONAL(ENABLE_SIXRD_PLUGIN, test "$enable_sixrd_plugin" = "1")
-
-#
-# IOAM plugin
-#
-AC_ARG_ENABLE(ioam_plugin,
- AC_HELP_STRING([--enable-ioam-plugin], [Build ioam plugin]),
- [enable_ioam_plugin=1],
- [enable_ioam_plugin=0])
-
-if test "x$enable_ioam_plugin" = x1; then
- AC_CONFIG_SUBDIRS([ioam-plugin])
-fi
-
-AM_CONDITIONAL(ENABLE_IOAM_PLUGIN, test "$enable_ioam_plugin" = "1")
-
-#
-# VCGN plugin
-#
-AC_ARG_ENABLE(vcgn_plugin,
- AC_HELP_STRING([--enable-vcgn-plugin], [Build vcgn plugin]),
- [enable_vcgn_plugin=1],
- [enable_vcgn_plugin=0])
-
-if test "x$enable_vcgn_plugin" = x1; then
- AC_CONFIG_SUBDIRS([vcgn-plugin])
+AC_DEFUN([PLUGIN],
+[
+ AC_ARG_ENABLE($1_plugin,
+ AC_HELP_STRING([--enable-$1-plugin], [Build $1 plugin]),
+ [enable_the_plugin=1],
+ [enable_the_plugin=0])
+if test "x$enable_the_plugin" = x1; then
+ AC_CONFIG_SUBDIRS($1-plugin)
fi
-
-AM_CONDITIONAL(ENABLE_VCGN_PLUGIN, test "$enable_vcgn_plugin" = "1")
-
-#
-# SNAT plugin
-#
-AC_ARG_ENABLE(snat_plugin,
- AC_HELP_STRING([--enable-snat-plugin], [Build snat plugin]),
- [enable_snat_plugin=1],
- [enable_snat_plugin=0])
-
-if test "x$enable_snat_plugin" = x1; then
- AC_CONFIG_SUBDIRS([snat-plugin])
-fi
-
-AM_CONDITIONAL(ENABLE_SNAT_PLUGIN, test "$enable_snat_plugin" = "1")
-
+AM_CONDITIONAL(ENABLE_$1_PLUGIN, test "$enable_the_plugin" = "1")
+])
+
+# To add a new plugin subdirectory:
+#
+# add PLUGIN(new) below, and
+# add the following to Makefile.am:
+#
+# if ENABLE_new_PLUGIN
+# SUBDIRS += new-plugin
+# endif
+
+PLUGIN(sample)
+PLUGIN(sixrd)
+PLUGIN(ioam)
+PLUGIN(vcgn)
+PLUGIN(snat)
AC_OUTPUT([Makefile])
diff --git a/plugins/sample-plugin/configure.ac b/plugins/sample-plugin/configure.ac
index 7defc83d..a8257305 100644
--- a/plugins/sample-plugin/configure.ac
+++ b/plugins/sample-plugin/configure.ac
@@ -1,6 +1,7 @@
AC_INIT(sample_plugin, 1.0)
LT_INIT
AM_INIT_AUTOMAKE
+AM_SILENT_RULES([yes])
AM_PROG_AS
AC_PROG_CC
diff --git a/plugins/sixrd-plugin/configure.ac b/plugins/sixrd-plugin/configure.ac
index c00a23bb..1652c87f 100644
--- a/plugins/sixrd-plugin/configure.ac
+++ b/plugins/sixrd-plugin/configure.ac
@@ -1,6 +1,7 @@
AC_INIT(sixrd_plugin, 1.0)
LT_INIT
AM_INIT_AUTOMAKE
+AM_SILENT_RULES([yes])
AM_PROG_AS
AC_PROG_CC
diff --git a/plugins/snat-plugin/configure.ac b/plugins/snat-plugin/configure.ac
index e43437d2..e10b18ac 100644
--- a/plugins/snat-plugin/configure.ac
+++ b/plugins/snat-plugin/configure.ac
@@ -1,6 +1,6 @@
-
AC_INIT(snat_plugin, 1.0)
AM_INIT_AUTOMAKE
+AM_SILENT_RULES([yes])
AC_PROG_LIBTOOL
AM_PROG_AS
diff --git a/plugins/vcgn-plugin/configure.ac b/plugins/vcgn-plugin/configure.ac
index ced22669..5bc8bd9d 100644
--- a/plugins/vcgn-plugin/configure.ac
+++ b/plugins/vcgn-plugin/configure.ac
@@ -1,6 +1,7 @@
AC_INIT(vcgn_plugin, 1.0)
LT_INIT
AM_INIT_AUTOMAKE
+AM_SILENT_RULES([yes])
AM_PROG_AS
AC_PROG_CC