Multiple changes in the plugin build infra 07/1907/6
authorDamjan Marion <damarion@cisco.com>
Thu, 7 Jul 2016 18:27:49 +0000 (20:27 +0200)
committerDave Barach <openvpp@barachs.net>
Fri, 8 Jul 2016 10:43:38 +0000 (10:43 +0000)
- configure.ac - some plugins are enabled by default
- Plugin .so files are placed into corresponding subdirs
- WITH_PLUGIN_TOOLKIT macro is retired - not needed anymore
- plugins/build-data is removed
- plugin makefiles are not building static libs anymore
- plugin makefiles are not installing header files to /usr/include
  anymore

Change-Id: I55681bd9ce34811f7eb1b2b24d9f0ca42df1cf04
Signed-off-by: Damjan Marion <damarion@cisco.com>
18 files changed:
Makefile
build-data/platforms/vpp.mk
build-root/bootstrap.sh
plugins/build-data/packages/ioam-plugin.mk [deleted file]
plugins/build-data/packages/sample-plugin.mk [deleted file]
plugins/build-data/packages/sixrd-plugin.mk [deleted file]
plugins/build-data/packages/vcgn-plugin.mk [deleted file]
plugins/configure.ac
plugins/ioam-plugin/Makefile.am
plugins/ioam-plugin/configure.ac
plugins/sample-plugin/Makefile.am
plugins/sample-plugin/configure.ac
plugins/sixrd-plugin/Makefile.am
plugins/sixrd-plugin/configure.ac
plugins/snat-plugin/Makefile.am
plugins/snat-plugin/configure.ac
plugins/vcgn-plugin/Makefile.am
plugins/vcgn-plugin/configure.ac

index 49a7386..a1c6307 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -110,7 +110,7 @@ ifeq ($(OS_ID),ubuntu)
        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
@@ -178,12 +178,12 @@ define run
        @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
 
index 45f74d3..fb1867c 100644 (file)
@@ -38,9 +38,7 @@ vnet_configure_args_vpp = --with-dpdk
 # 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
index 2419b6a..f83734f 100755 (executable)
@@ -12,7 +12,7 @@ ADD_TO_PATH="$build_root/tools/ccache-bin:$build_root/tools/bin"
 
 # 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
diff --git a/plugins/build-data/packages/ioam-plugin.mk b/plugins/build-data/packages/ioam-plugin.mk
deleted file mode 100644 (file)
index 1ebe818..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-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
diff --git a/plugins/build-data/packages/sample-plugin.mk b/plugins/build-data/packages/sample-plugin.mk
deleted file mode 100644 (file)
index 047a26f..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-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
diff --git a/plugins/build-data/packages/sixrd-plugin.mk b/plugins/build-data/packages/sixrd-plugin.mk
deleted file mode 100644 (file)
index 186d9b8..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-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
diff --git a/plugins/build-data/packages/vcgn-plugin.mk b/plugins/build-data/packages/vcgn-plugin.mk
deleted file mode 100644 (file)
index cd865c1..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-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
index 7aff987..f10d180 100644 (file)
@@ -11,25 +11,29 @@ AC_ARG_ENABLE(tests,
               [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]),
@@ -42,7 +46,7 @@ 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:
 #
@@ -50,10 +54,12 @@ AM_CONDITIONAL(ENABLE_$1_PLUGIN, test "$enable_the_plugin" = "1")
 # 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])
index e62525f..47ff116 100644 (file)
@@ -13,7 +13,8 @@
 
 AUTOMAKE_OPTIONS = foreign subdir-objects
 
-AM_CFLAGS = -Wall -I@TOOLKIT_INCLUDE@
+AM_CFLAGS = -Wall
+AM_LDFLAGS = -module -shared -avoid-version
 
 ########################################
 # iOAM Proof of Transit
@@ -26,8 +27,6 @@ ioam_pot_plugin_la_SOURCES =                  \
        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
 
@@ -38,7 +37,7 @@ SUFFIXES = .api.h .api
        $(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                       \
@@ -49,14 +48,14 @@ ioam_pot_test_plugin_la_SOURCES =           \
        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))
index 8c82857..27fda73 100644 (file)
@@ -1,17 +1,8 @@
 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])
index 30b1719..0b21379 100644 (file)
 
 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
 
@@ -29,18 +34,14 @@ SUFFIXES = .api.h .api
        $(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))
index a825730..4364273 100644 (file)
@@ -2,17 +2,8 @@ AC_INIT(sample_plugin, 1.0)
 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])
index c2fae79..71c8da4 100644 (file)
 
 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))
index 1652c87..3aa4c42 100644 (file)
@@ -2,17 +2,8 @@ AC_INIT(sixrd_plugin, 1.0)
 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])
index 11b0839..0fe694c 100644 (file)
@@ -3,9 +3,9 @@
 # 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
 
@@ -34,22 +37,15 @@ SUFFIXES = .api.h .api
        $(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))
index e10b18a..9af139e 100644 (file)
@@ -1,11 +1,10 @@
 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]),
@@ -15,13 +14,4 @@ AC_ARG_WITH(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])
index f9705d0..927f35b 100644 (file)
@@ -13,7 +13,8 @@
 
 AUTOMAKE_OPTIONS = foreign subdir-objects
 
-AM_CFLAGS = -Wall -I@TOOLKIT_INCLUDE@
+AM_CFLAGS = -Wall
+AM_LDFLAGS = -module -shared -avoid-version
 
 ########################################
 # Virtual Carrier Grade NAT
@@ -87,13 +88,10 @@ nobase_include_HEADERS =                    \
        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))
index 5bc8bd9..f9c365a 100644 (file)
@@ -2,17 +2,8 @@ AC_INIT(vcgn_plugin, 1.0)
 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])