[dpdk-dev] [PATCH 1/2] examples/ethtool: add to meson build

Bruce Richardson bruce.richardson at intel.com
Thu Mar 29 16:04:56 CEST 2018


Add the ethtool example to the meson build. This example is more
complicated than the previously added ones as it has files in two
subdirectories. An ethtool "wrapper lib" in one, used by the actual
example "ethtool app" in the other.

Rather than using recursive operation, like is done with the makefiles,
we instead can just special-case the building of the library from the
single .c file, and then use that as a dependency when building the app
proper.

Signed-off-by: Bruce Richardson <bruce.richardson at intel.com>
---
 examples/ethtool/meson.build | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/examples/ethtool/meson.build b/examples/ethtool/meson.build
index c370d7476..0ec2a2391 100644
--- a/examples/ethtool/meson.build
+++ b/examples/ethtool/meson.build
@@ -6,5 +6,14 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
-# Example app currently unsupported by meson build
-build = false
+# build the ethtool wrapper as a lib, which app uses as a dependency
+ethtool_inc = include_directories('lib')
+ethtool_lib = static_library('rte_ethtool', 'lib/rte_ethtool.c',
+		include_directories: ethtool_inc,
+		dependencies: [static_rte_ethdev, static_rte_pmd_ixgbe])
+ethtool_dep = declare_dependency(link_with: ethtool_lib,
+	include_directories: ethtool_inc)
+
+# sample app files are in the ethtool-app subdir
+sources = files('ethtool-app/ethapp.c', 'ethtool-app/main.c')
+ext_deps += ethtool_dep
-- 
2.14.3



More information about the dev mailing list