diff options
author | 2016-06-27 09:25:13 -0400 | |
---|---|---|
committer | 2016-06-27 06:54:32 -0700 | |
commit | aa6920e0a80d8271be1dda59f613a1d2b0e1d3e6 (patch) | |
tree | 473efa376151e0b7bce525b97f627e6c67ac6efb /vpp/Makefile.am | |
parent | 20c90f765dd0350892421e1dea544752108f4ce9 (diff) |
More janitorial work
Install vpp api header files in /usr/include/vpp-api, instead of
/usr/include/api. Someone will eventually complain if we continue with
the status quo.
Generate /usr/bin/vpp_plugin_configure, to correctly configure
standalone plugin compilation against header files installed from the
dev package.
If a plugin's CFLAGS don't precisely match the installed vpp engine
binary, subtle misbehavior can and will occur. Example: the ip4/ip6
main_t structure size / member offsets depend on DPDK=[0|1]. Screw
that one up, and your brand-new configurable ip feature will
mysteriously fail to appear, even though the plugin loads perfectly.
Change-Id: I20c97fe1042808a79935863209d995c31953b98c
Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'vpp/Makefile.am')
-rw-r--r-- | vpp/Makefile.am | 50 |
1 files changed, 38 insertions, 12 deletions
diff --git a/vpp/Makefile.am b/vpp/Makefile.am index 4c28fb79..5577c075 100644 --- a/vpp/Makefile.am +++ b/vpp/Makefile.am @@ -30,25 +30,25 @@ vpp_SOURCES = \ stats/stats.c vpp_SOURCES += \ - api/api.c \ - api/custom_dump.c + vpp-api/api.c \ + vpp-api/custom_dump.c # comment out to disable stats upload to gmond vpp_SOURCES += \ - api/gmon.c + vpp-api/gmon.c nobase_include_HEADERS = \ - api/vpe_all_api_h.h \ - api/vpe_msg_enum.h \ - api/vpe.api.h + vpp-api/vpe_all_api_h.h \ + vpp-api/vpe_msg_enum.h \ + vpp-api/vpe.api.h # install the API definition, so we can produce java bindings, etc. -apidir = $(prefix)/api -api_DATA = api/vpe.api +apidir = $(prefix)/vpp-api +api_DATA = vpp-api/vpe.api -BUILT_SOURCES += api/vpe.api.h app/version.h +BUILT_SOURCES += vpp-api/vpe.api.h app/version.h app/version.o: app/version.h @@ -62,6 +62,32 @@ app/version.h: @echo "#define VPP_BUILD_TOPDIR \"$$(git rev-parse --show-toplevel)\"" >> $@ @echo "#define VPP_BUILD_VER \"$$(../../scripts/version)\"" >> $@ +# Generate a plugin configuration script. Misconfiguring a +# plugin can cause very subtle problems. + +bin_SCRIPTS = vpp_plugin_configure + +BUILT_SOURCES += vpp_plugin_configure + +.PHONY: vpp_plugin_configure + +vpp_plugin_configure: + @echo "PLUGIN CONFIGURE " $@ + @echo "#!/bin/bash" > $@ + @echo " " >> $@ + @echo "set +eu" >> $@ + @echo " " >> $@ + @echo "if [ -f ./configure ] ; then" >> $@ + @echo " CFLAGS='$(CFLAGS) $(AM_CFLAGS) -I/usr/include/vpp-dpdk' ./configure --with-plugin-toolkit" >> $@ + @echo "else" >> $@ + @echo " if [ -f ../configure ] ; then" >> $@ + @echo " CFLAGS='$(CFLAGS) $(AM_CFLAGS) -I/usr/include/vpp-dpdk' ../configure --with-plugin-toolkit" >> $@ + @echo " else" >> $@ + @echo " echo Couldnt find ./configure or ../configure " >> $@ + @echo " exit 1" >> $@ + @echo " fi" >> $@ + @echo "fi" >> $@ + vpp_LDADD = -lvlibapi -lvlibmemory -lvlib_unix -lvlib vpp_LDADD += -lvnet @@ -97,13 +123,13 @@ SUFFIXES = .api.h .api noinst_PROGRAMS += test_client -test_client_SOURCES = api/test_client.c +test_client_SOURCES = vpp-api/test_client.c test_client_LDADD = -lvlibmemoryclient -lvlibapi -lsvm -lvppinfra \ -lpthread -lm -lrt noinst_PROGRAMS += test_client test_ha -test_ha_SOURCES = api/test_ha.c +test_ha_SOURCES = vpp-api/test_ha.c test_ha_LDADD = -lvlibmemoryclient -lvlibapi -lsvmdb -lsvm -lvppinfra \ -lpthread -lm -lrt @@ -111,6 +137,6 @@ test_ha_LDADD = -lvlibmemoryclient -lvlibapi -lsvmdb -lsvm -lvppinfra \ noinst_PROGRAMS += summary_stats_client -summary_stats_client_SOURCES = api/summary_stats_client.c +summary_stats_client_SOURCES = vpp-api/summary_stats_client.c summary_stats_client_LDADD = -lvlibmemoryclient -lvlibapi -lsvm -lvppinfra \ -lpthread -lm -lrt |