fi ; \
exit 0
endif
- @echo "SOURCE_PATH = $(WS_ROOT) $(WS_ROOT)/plugins"> $(BR)/build-config.mk
+ @echo "SOURCE_PATH = $(WS_ROOT)" > $(BR)/build-config.mk
@echo "#!/bin/bash\n" > $(BR)/path_setup
@echo 'export PATH=$(BR)/tools/ccache-bin:$$PATH' >> $(BR)/path_setup
@echo 'export PATH=$(BR)/tools/bin:$$PATH' >> $(BR)/path_setup
@echo "WARNING: STARTUP_CONF not defined or file doesn't exist."
@echo " Running with minimal startup config: $(MINIMAL_STARTUP_CONF)\n"
@cd $(STARTUP_DIR) && \
- sudo $(2) $(1)/vpp/bin/vpp $(MINIMAL_STARTUP_CONF) plugin_path $(1)/plugins/lib64
+ sudo $(2) $(1)/vpp/bin/vpp $(MINIMAL_STARTUP_CONF) plugin_path $(1)/plugins/lib64/vpp_plugins
endef
else
define run
@cd $(STARTUP_DIR) && \
- sudo $(2) $(1)/vpp/bin/vpp $(shell cat $(STARTUP_CONF) | sed -e 's/#.*//') plugin_path $(1)/plugins/lib64
+ sudo $(2) $(1)/vpp/bin/vpp $(shell cat $(STARTUP_CONF) | sed -e 's/#.*//') plugin_path $(1)/plugins/lib64/vpp_plugins
endef
endif
# Set these parameters carefully. The vlib_buffer_t is 128 bytes, i.e.
vlib_configure_args_vpp = --with-pre-data=128
-# Enable plugins here, and no place else, via multiple --enable-XXX-plugin
-# stanzas.
-plugins_configure_args_vpp = --with-dpdk --enable-sixrd-plugin
+plugins_configure_args_vpp = --with-dpdk
# DPDK configuration parameters
# vpp_uses_external_dpdk = yes
# Construct build-config.mk
cd $build_root
-echo SOURCE_PATH = $wsroot $wsroot/plugins/ > build-config.mk
+echo SOURCE_PATH = $wsroot > build-config.mk
echo
echo Saving PATH settings in `pwd`/path_setup
echo Source this file later, as needed
+++ /dev/null
-ioam-plugin_configure_depend = \
- vppinfra-install \
- svm-install \
- vlib-api-install \
- vlib-install \
- vnet-install \
- vpp-install \
- vpp-api-test-install
-
-ioam-plugin_CPPFLAGS = $(call installed_includes_fn, \
- vppinfra \
- openssl \
- svm \
- vlib \
- vlib-api \
- vnet \
- vpp \
- vpp-api-test)
-
-ioam-plugin_LDFLAGS = $(call installed_libs_fn, \
- vppinfra \
- openssl \
- svm \
- vlib \
- vlib-api \
- vnet \
- vpp \
- vpp-api-test)
-
-ioam-plugin_post_install = \
- mkdir -p $(PACKAGE_INSTALL_DIR)/$(arch_lib_dir)/vlib_plugins ; \
- cp $(PACKAGE_INSTALL_DIR)/$(arch_lib_dir)/*.so \
- $(PACKAGE_INSTALL_DIR)/$(arch_lib_dir)/vlib_plugins
-
-ioam-plugin_image_include = echo $(arch_lib_dir)/vlib_plugins
-
-ifneq ($($(PLATFORM)_uses_dpdk),no)
-ioam-plugin_configure_args = --with-dpdk
-ifeq ($($(PLATFORM)_uses_external_dpdk),yes)
-ioam-plugin_CPPFLAGS += -I$($(PLATFORM)_dpdk_inc_dir)
-ioam-plugin_LDFLAGS += -L$($(PLATFORM)_dpdk_lib_dir)
-else
-ioam-plugin_configure_depend += dpdk-install
-ioam-plugin_CPPFLAGS += $(call installed_includes_fn, dpdk)
-ioam-plugin_LDFLAGS += $(call installed_libs_fn, dpdk)
-endif
-endif
+++ /dev/null
-sample-plugin_configure_depend = \
- vppinfra-install \
- svm-install \
- vlib-api-install \
- vlib-install \
- vnet-install \
- vpp-install \
- vpp-api-test-install
-
-sample-plugin_CPPFLAGS = $(call installed_includes_fn, \
- vppinfra \
- openssl \
- svm \
- vlib \
- vlib-api \
- vnet \
- vpp \
- vpp-api-test)
-
-sample-plugin_LDFLAGS = $(call installed_libs_fn, \
- vppinfra \
- openssl \
- svm \
- vlib \
- vlib-api \
- vnet \
- vpp \
- vpp-api-test)
-
-sample-plugin_post_install = \
- mkdir -p $(PACKAGE_INSTALL_DIR)/$(arch_lib_dir)/vlib_plugins ; \
- cp $(PACKAGE_INSTALL_DIR)/$(arch_lib_dir)/*.so \
- $(PACKAGE_INSTALL_DIR)/$(arch_lib_dir)/vlib_plugins
-
-sample-plugin_image_include = echo $(arch_lib_dir)/vlib_plugins
-
-ifneq ($($(PLATFORM)_uses_dpdk),no)
-sample-plugin_configure_args = --with-dpdk
-ifeq ($($(PLATFORM)_uses_external_dpdk),yes)
-sample-plugin_CPPFLAGS += -I$($(PLATFORM)_dpdk_inc_dir)
-sample-plugin_LDFLAGS += -L$($(PLATFORM)_dpdk_lib_dir)
-else
-sample-plugin_configure_depend += dpdk-install
-sample-plugin_CPPFLAGS += $(call installed_includes_fn, dpdk)
-sample-plugin_LDFLAGS += $(call installed_libs_fn, dpdk)
-endif
-endif
+++ /dev/null
-sixrd-plugin_configure_depend = \
- vppinfra-install \
- svm-install \
- vlib-api-install \
- vlib-install \
- vnet-install \
- vpp-install \
- vpp-api-test-install
-
-sixrd-plugin_CPPFLAGS = $(call installed_includes_fn, \
- vppinfra \
- openssl \
- svm \
- vlib \
- vlib-api \
- vnet \
- vpp \
- vpp-api-test)
-
-sixrd-plugin_LDFLAGS = $(call installed_libs_fn, \
- vppinfra \
- openssl \
- svm \
- vlib \
- vlib-api \
- vnet \
- vpp \
- vpp-api-test)
-
-sixrd-plugin_post_install = \
- mkdir -p $(PACKAGE_INSTALL_DIR)/$(arch_lib_dir)/vlib_plugins ; \
- cp $(PACKAGE_INSTALL_DIR)/$(arch_lib_dir)/*.so \
- $(PACKAGE_INSTALL_DIR)/$(arch_lib_dir)/vlib_plugins
-
-sixrd-plugin_image_include = echo $(arch_lib_dir)/vlib_plugins
-
-ifneq ($($(PLATFORM)_uses_dpdk),no)
-sixrd-plugin_configure_args = --with-dpdk
-ifeq ($($(PLATFORM)_uses_external_dpdk),yes)
-sixrd-plugin_CPPFLAGS += -I$($(PLATFORM)_dpdk_inc_dir)
-sixrd-plugin_LDFLAGS += -L$($(PLATFORM)_dpdk_lib_dir)
-else
-sixrd-plugin_configure_depend += dpdk-install
-sixrd-plugin_CPPFLAGS += $(call installed_includes_fn, dpdk)
-sixrd-plugin_LDFLAGS += $(call installed_libs_fn, dpdk)
-endif
-endif
+++ /dev/null
-vcgn-plugin_configure_depend = \
- vppinfra-install \
- svm-install \
- vlib-api-install \
- vlib-install \
- vnet-install \
- vpp-install \
- vpp-api-test-install
-
-vcgn-plugin_CPPFLAGS = $(call installed_includes_fn, \
- vppinfra \
- openssl \
- svm \
- vlib \
- vlib-api \
- vnet \
- vpp \
- vpp-api-test)
-
-vcgn-plugin_LDFLAGS = $(call installed_libs_fn, \
- vppinfra \
- openssl \
- svm \
- vlib \
- vlib-api \
- vnet \
- vpp \
- vpp-api-test)
-
-vcgn-plugin_post_install = \
- mkdir -p $(PACKAGE_INSTALL_DIR)/$(arch_lib_dir)/vlib_plugins ; \
- cp $(PACKAGE_INSTALL_DIR)/$(arch_lib_dir)/*.so \
- $(PACKAGE_INSTALL_DIR)/$(arch_lib_dir)/vlib_plugins
-
-vcgn-plugin_image_include = echo $(arch_lib_dir)/vlib_plugins
-
-ifneq ($($(PLATFORM)_uses_dpdk),no)
-vcgn-plugin_configure_args = --with-dpdk
-ifeq ($($(PLATFORM)_uses_external_dpdk),yes)
-vcgn-plugin_CPPFLAGS += -I$($(PLATFORM)_dpdk_inc_dir)
-vcgn-plugin_LDFLAGS += -L$($(PLATFORM)_dpdk_lib_dir)
-else
-vcgn-plugin_configure_depend += dpdk-install
-vcgn-plugin_CPPFLAGS += $(call installed_includes_fn, dpdk)
-vcgn-plugin_LDFLAGS += $(call installed_libs_fn, dpdk)
-endif
-endif
[enable_tests=1],
[enable_tests=0])
-AC_ARG_WITH(plugin-toolkit,
- AC_HELP_STRING([--with-plugin-toolkit],
- [build using the vpp toolkit]),
- [with_plugin_toolkit=${prefix}/include],
- [with_plugin_toolkit=.])
-
AC_ARG_WITH(dpdk,
AC_HELP_STRING([--with-dpdk],[Use the Intel dpdk]),
[with_dpdk=1],
[with_dpdk=0])
-AC_SUBST(TOOLKIT_INCLUDE,[${with_plugin_toolkit}])
-AM_CONDITIONAL(WITH_PLUGIN_TOOLKIT, test "$with_plugin_toolkit" != ".")
AM_CONDITIONAL(ENABLE_TESTS, test "$enable_tests" = "1")
AM_CONDITIONAL(WITH_DPDK, test "$with_dpdk" = "1")
AC_SUBST(DPDK,["-DDPDK=${with_dpdk}"])
-AC_DEFUN([PLUGIN],
+AC_DEFUN([PLUGIN_ENABLED],
+[
+ AC_ARG_ENABLE($1_plugin,
+ AC_HELP_STRING([--disable-$1-plugin], [Do not build $1 plugin]),
+ [enable_the_plugin=0],
+ [enable_the_plugin=1])
+if test "x$enable_the_plugin" = x1; then
+ AC_CONFIG_SUBDIRS($1-plugin)
+fi
+AM_CONDITIONAL(ENABLE_$1_PLUGIN, test "$enable_the_plugin" = "1")
+])
+
+AC_DEFUN([PLUGIN_DISABLED],
[
AC_ARG_ENABLE($1_plugin,
AC_HELP_STRING([--enable-$1-plugin], [Build $1 plugin]),
])
# To add a new plugin subdirectory:
-#
+#
# add PLUGIN(new) below, and
# add the following to Makefile.am:
#
# SUBDIRS += new-plugin
# endif
-PLUGIN(sample)
-PLUGIN(sixrd)
-PLUGIN(ioam)
-PLUGIN(vcgn)
-PLUGIN(snat)
+PLUGIN_ENABLED(sixrd)
+PLUGIN_ENABLED(ioam)
+PLUGIN_ENABLED(snat)
+
+# Disabled plugins, require --enable-XXX-plugin
+PLUGIN_DISABLED(vcgn)
+PLUGIN_DISABLED(sample)
AC_OUTPUT([Makefile])
AUTOMAKE_OPTIONS = foreign subdir-objects
-AM_CFLAGS = -Wall -I@TOOLKIT_INCLUDE@
+AM_CFLAGS = -Wall
+AM_LDFLAGS = -module -shared -avoid-version
########################################
# iOAM Proof of Transit
ioam/lib-pot/math64.h \
ioam/lib-pot/pot_api.c
-ioam_pot_plugin_la_LDFLAGS = -module
-
BUILT_SOURCES = \
ioam/lib-pot/pot.api.h
$(CC) $(CPPFLAGS) -E -P -C -x c $^ \
| vppapigen --input - --output $@ --show-name $@
-nobase_include_HEADERS = \
+noinst_HEADERS = \
ioam/lib-pot/pot_all_api_h.h \
ioam/lib-pot/pot_msg_enum.h \
ioam/lib-pot/pot.api.h \
ioam/lib-pot/pot_test.c \
ioam/lib-pot/pot_plugin.api.h
-ioam_pot_test_plugin_la_LDFLAGS = -module
+vppapitestpluginsdir = ${libdir}/vpp_api_test_plugins
+vpppluginsdir = ${libdir}/vpp_plugins
+
+vppapitestplugins_LTLIBRARIES = ioam_pot_test_plugin.la
+vppplugins_LTLIBRARIES = ioam_pot_plugin.la
-lib_LTLIBRARIES = ioam_pot_plugin.la ioam_pot_test_plugin.la
-if WITH_PLUGIN_TOOLKIT
+# Remove *.la files
install-data-hook:
- mkdir /usr/lib/vpp_plugins || true
- mkdir /usr/lib/vpp_api_test_plugins || true
- cp -L $(prefix)/lib/ioam_pot_plugin.so /usr/lib/vpp_plugins
- cp -L $(prefix)/lib/ioam_pot_test_plugin.so /usr/lib/vpp_api_test_plugins
-endif
+ @(cd $(vpppluginsdir) && $(RM) $(vppplugins_LTLIBRARIES))
+ @(cd $(vppapitestpluginsdir) && $(RM) $(vppapitestplugins_LTLIBRARIES))
AC_INIT(ioam_plugin, 1.0)
LT_INIT
AM_INIT_AUTOMAKE
+AC_PREFIX_DEFAULT([/usr])
-AM_PROG_AS
AC_PROG_CC
-AM_PROG_CC_C_O
-AC_ARG_WITH(plugin-toolkit,
- AC_HELP_STRING([--with-plugin-toolkit],
- [build using the vpp toolkit]),
- [with_plugin_toolkit=${prefix}/include],
- [with_plugin_toolkit=.])
-
-AC_SUBST(TOOLKIT_INCLUDE,[${with_plugin_toolkit}])
-AM_CONDITIONAL(WITH_PLUGIN_TOOLKIT, test "$with_plugin_toolkit" != ".")
AC_OUTPUT([Makefile])
AUTOMAKE_OPTIONS = foreign subdir-objects
-AM_CFLAGS = -Wall -I@TOOLKIT_INCLUDE@
+AM_CFLAGS = -Wall
+AM_LDFLAGS = -module -shared -avoid-version
+
+vppapitestpluginsdir = ${libdir}/vpp_api_test_plugins
+vpppluginsdir = ${libdir}/vpp_plugins
+
+vppapitestplugins_LTLIBRARIES = sample_test_plugin.la
+vppplugins_LTLIBRARIES = sample_plugin.la
-lib_LTLIBRARIES = sample_plugin.la sample_test_plugin.la
sample_plugin_la_SOURCES = sample/sample.c sample/node.c \
- sample/sample_plugin.api.h
-sample_plugin_la_LDFLAGS = -module
+ sample/sample_plugin.api.h
BUILT_SOURCES = sample/sample.api.h
$(CC) $(CPPFLAGS) -E -P -C -x c $^ \
| vppapigen --input - --output $@ --show-name $@
-nobase_include_HEADERS = \
+noinst_HEADERS = \
sample/sample_all_api_h.h \
sample/sample_msg_enum.h \
sample/sample.api.h
sample_test_plugin_la_SOURCES = sample/sample_test.c sample/sample_plugin.api.h
-sample_test_plugin_la_LDFLAGS = -module
-if WITH_PLUGIN_TOOLKIT
+# Remove *.la files
install-data-hook:
- mkdir /usr/lib/vpp_plugins || true
- mkdir /usr/lib/vpp_api_test_plugins || true
- cp -L $(prefix)/lib/sample_plugin.so /usr/lib/vpp_plugins
- cp -L $(prefix)/lib/sample_test_plugin.so /usr/lib/vpp_api_test_plugins
-endif
+ @(cd $(vpppluginsdir) && $(RM) $(vppplugins_LTLIBRARIES))
+ @(cd $(vppapitestpluginsdir) && $(RM) $(vppapitestplugins_LTLIBRARIES))
LT_INIT
AM_INIT_AUTOMAKE
AM_SILENT_RULES([yes])
+AC_PREFIX_DEFAULT([/usr])
-AM_PROG_AS
AC_PROG_CC
-AM_PROG_CC_C_O
-AC_ARG_WITH(plugin-toolkit,
- AC_HELP_STRING([--with-plugin-toolkit],
- [build using the vpp toolkit]),
- [with_plugin_toolkit=${prefix}/include],
- [with_plugin_toolkit=.])
-
-AC_SUBST(TOOLKIT_INCLUDE,[${with_plugin_toolkit}])
-AM_CONDITIONAL(WITH_PLUGIN_TOOLKIT, test "$with_plugin_toolkit" != ".")
AC_OUTPUT([Makefile])
AUTOMAKE_OPTIONS = foreign subdir-objects
-AM_CFLAGS = -Wall -I@TOOLKIT_INCLUDE@
+AM_CFLAGS = -Wall
+AM_LDFLAGS = -module -shared -avoid-version
libsixrd_plugin_la_SOURCES = \
sixrd/sixrd.c \
sixrd/ip4_sixrd.c \
sixrd/ip6_sixrd.c
-nobase_include_HEADERS = \
+noinst_HEADERS = \
sixrd/sixrd.h
-libsixrd_plugin_la_LDFLAGS = -module
-
BUILT_SOURCES =
-lib_LTLIBRARIES = libsixrd_plugin.la
+vpppluginsdir = ${libdir}/vpp_plugins
+
+vppplugins_LTLIBRARIES = libsixrd_plugin.la
+
-if WITH_PLUGIN_TOOLKIT
+# Remove *.la files
install-data-hook:
- mkdir /usr/lib/vpp_plugins || true
- mkdir /usr/lib/vpp_api_test_plugins || true
- cp -L $(prefix)/lib/libsixrd_plugin.so /usr/lib/vpp_plugins
-endif
+ @(cd $(vpppluginsdir) && $(RM) $(vppplugins_LTLIBRARIES))
LT_INIT
AM_INIT_AUTOMAKE
AM_SILENT_RULES([yes])
+AC_PREFIX_DEFAULT([/usr])
-AM_PROG_AS
AC_PROG_CC
-AM_PROG_CC_C_O
-AC_ARG_WITH(plugin-toolkit,
- AC_HELP_STRING([--with-plugin-toolkit],
- [build using the vpp toolkit]),
- [with_plugin_toolkit=${prefix}/include],
- [with_plugin_toolkit=.])
-
-AC_SUBST(TOOLKIT_INCLUDE,[${with_plugin_toolkit}])
-AM_CONDITIONAL(WITH_PLUGIN_TOOLKIT, test "$with_plugin_toolkit" != ".")
AC_OUTPUT([Makefile])
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
-#
+#
# http://www.apache.org/licenses/LICENSE-2.0
-#
+#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
AUTOMAKE_OPTIONS = foreign subdir-objects
-AM_CFLAGS = -Wall -I@TOOLKIT_INCLUDE@ @DPDK@
+AM_CFLAGS = -Wall @DPDK@
+AM_LDFLAGS = -module -shared -avoid-version
-lib_LTLIBRARIES = snat_plugin.la snat_test_plugin.la
+vppapitestpluginsdir = ${libdir}/vpp_api_test_plugins
+vpppluginsdir = ${libdir}/vpp_plugins
+
+vppapitestplugins_LTLIBRARIES = snat_test_plugin.la
+vppplugins_LTLIBRARIES = snat_plugin.la
snat_plugin_la_SOURCES = snat/snat.c \
snat/in2out.c \
snat/out2in.c \
- snat/snat_plugin.api.h
-
-snat_plugin_la_LDFLAGS = -module
+ snat/snat_plugin.api.h
BUILT_SOURCES = snat/snat.api.h
$(CC) $(CPPFLAGS) -E -P -C -x c $^ \
| vppapigen --input - --output $@ --show-name $@
-nobase_include_HEADERS = \
+noinst_HEADERS = \
snat/snat_all_api_h.h \
snat/snat_msg_enum.h \
snat/snat.api.h
snat_test_plugin_la_SOURCES = \
snat/snat_test.c snat/snat_plugin.api.h
-snat_test_plugin_la_LDFLAGS = -module
-if WITH_PLUGIN_TOOLKIT
+# Remove *.la files
install-data-hook:
- mkdir /usr/lib/vpp_plugins || true
- mkdir /usr/lib/vpp_api_test_plugins || true
- cp -L $(prefix)/lib/snat_plugin.so /usr/lib/vpp_plugins
- cp -L $(prefix)/lib/snat_test_plugin.so \
- /usr/lib/vpp_api_test_plugins
- rm -f $(prefix)/lib/snat_plugin.*
- rm -f $(prefix)/lib/snat_test_plugin.*
-endif
+ @(cd $(vpppluginsdir) && $(RM) $(vppplugins_LTLIBRARIES))
+ @(cd $(vppapitestpluginsdir) && $(RM) $(vppapitestplugins_LTLIBRARIES))
AC_INIT(snat_plugin, 1.0)
AM_INIT_AUTOMAKE
AM_SILENT_RULES([yes])
+AC_PREFIX_DEFAULT([/usr])
AC_PROG_LIBTOOL
-AM_PROG_AS
AC_PROG_CC
-AM_PROG_CC_C_O
AC_ARG_WITH(dpdk,
AC_HELP_STRING([--with-dpdk],[Use the Intel dpdk]),
AM_CONDITIONAL(WITH_DPDK, test "$with_dpdk" = "1")
AC_SUBST(DPDK,["-DDPDK=${with_dpdk}"])
-AC_ARG_WITH(plugin-toolkit,
- AC_HELP_STRING([--with-plugin-toolkit],
- [build using the vpp toolkit]),
- [with_plugin_toolkit=${prefix}/include],
- [with_plugin_toolkit=.])
-
-AC_SUBST(TOOLKIT_INCLUDE,[${with_plugin_toolkit}])
-AM_CONDITIONAL(WITH_PLUGIN_TOOLKIT, test "$with_plugin_toolkit" != ".")
-
AC_OUTPUT([Makefile])
AUTOMAKE_OPTIONS = foreign subdir-objects
-AM_CFLAGS = -Wall -I@TOOLKIT_INCLUDE@
+AM_CFLAGS = -Wall
+AM_LDFLAGS = -module -shared -avoid-version
########################################
# Virtual Carrier Grade NAT
vcgn/tcp_header_definitions.h \
vcgn/vcgn_db.h
-libvcgn_plugin_la_LDFLAGS = -module
+vpppluginsdir = ${libdir}/vpp_plugins
-lib_LTLIBRARIES = libvcgn_plugin.la
+vppplugins_LTLIBRARIES = libvcgn_plugin.la
-if WITH_PLUGIN_TOOLKIT
+# Remove *.la files
install-data-hook:
- mkdir /usr/lib/vpp_plugins || true
- mkdir /usr/lib/vpp_api_test_plugins || true
- cp -L $(prefix)/lib/libvcgn_plugin.so /usr/lib/vpp_plugins
-endif
+ @(cd $(vpppluginsdir) && $(RM) $(vppplugins_LTLIBRARIES))
LT_INIT
AM_INIT_AUTOMAKE
AM_SILENT_RULES([yes])
+AC_PREFIX_DEFAULT([/usr])
-AM_PROG_AS
AC_PROG_CC
-AM_PROG_CC_C_O
-AC_ARG_WITH(plugin-toolkit,
- AC_HELP_STRING([--with-plugin-toolkit],
- [build using the vpp toolkit]),
- [with_plugin_toolkit=${prefix}/include],
- [with_plugin_toolkit=.])
-
-AC_SUBST(TOOLKIT_INCLUDE,[${with_plugin_toolkit}])
-AM_CONDITIONAL(WITH_PLUGIN_TOOLKIT, test "$with_plugin_toolkit" != ".")
AC_OUTPUT([Makefile])