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

Message ID 20180329140457.93034-2-bruce.richardson@intel.com (mailing list archive)
State Not Applicable, archived
Delegated to: Thomas Monjalon
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation fail Compilation issues

Commit Message

Bruce Richardson March 29, 2018, 2:04 p.m. UTC
  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@intel.com>
---
 examples/ethtool/meson.build | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
  

Comments

Thomas Monjalon July 12, 2018, 7:54 a.m. UTC | #1
29/03/2018 16:04, Bruce Richardson:
> 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@intel.com>

It does not compile because of experimental function:
examples/ethtool/lib/rte_ethtool.c:186:2: error:
‘rte_eth_dev_get_module_info’ is deprecated: Symbol is not yet part of stable ABI
  
Bruce Richardson July 12, 2018, 10:46 a.m. UTC | #2
On Thu, Jul 12, 2018 at 09:54:32AM +0200, Thomas Monjalon wrote:
> 29/03/2018 16:04, Bruce Richardson:
> > 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@intel.com>
> 
> It does not compile because of experimental function:
> examples/ethtool/lib/rte_ethtool.c:186:2: error:
> ‘rte_eth_dev_get_module_info’ is deprecated: Symbol is not yet part of stable ABI
> 
Ok. This set is fairly old, and I think I've found other issues with it
since. I suggest we drop this set for 18.08 consideration.
  

Patch

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