From 6f54e56d65226dd04b13c671ba86acf01513f90c Mon Sep 17 00:00:00 2001 From: Tomasz Duszynski Date: Wed, 11 Apr 2018 13:45:07 +0200 Subject: [PATCH] net/mvpp2: add to meson build Add support for building MRVL MVPP2 PMD with meson. To avoid cluttering the build environment and to keep all relevant settings local to a cross build we get MUSDK library installation path from a meson option. Signed-off-by: Tomasz Duszynski Acked-by: Bruce Richardson --- drivers/net/meson.build | 2 +- drivers/net/mvpp2/meson.build | 25 +++++++++++++++++++++++++ meson_options.txt | 2 ++ 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 drivers/net/mvpp2/meson.build diff --git a/drivers/net/meson.build b/drivers/net/meson.build index b7cac4a4a1..b7d00a04c8 100644 --- a/drivers/net/meson.build +++ b/drivers/net/meson.build @@ -3,7 +3,7 @@ drivers = ['af_packet', 'axgbe', 'bonding', 'dpaa', 'dpaa2', 'e1000', 'enic', 'fm10k', 'i40e', 'ixgbe', - 'null', 'octeontx', 'pcap', 'ring', + 'mvpp2', 'null', 'octeontx', 'pcap', 'ring', 'sfc', 'thunderx', 'virtio'] std_deps = ['ethdev', 'kvargs'] # 'ethdev' also pulls in mbuf, net, eal etc std_deps += ['bus_pci'] # very many PMDs depend on PCI, so make std diff --git a/drivers/net/mvpp2/meson.build b/drivers/net/mvpp2/meson.build new file mode 100644 index 0000000000..e1398895a8 --- /dev/null +++ b/drivers/net/mvpp2/meson.build @@ -0,0 +1,25 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2018 Marvell International Ltd. +# Copyright(c) 2018 Semihalf. +# All rights reserved. + +path = get_option('lib_musdk_dir') +lib_dir = path + '/lib' +inc_dir = path + '/include' + +lib = cc.find_library('libmusdk', dirs : [lib_dir], required: false) +if not lib.found() + build = false +else + ext_deps += lib + includes += include_directories(inc_dir) + cflags += ['-DMVCONF_TYPES_PUBLIC', '-DMVCONF_DMA_PHYS_ADDR_T_PUBLIC'] +endif + +sources = files( + 'mrvl_ethdev.c', + 'mrvl_flow.c', + 'mrvl_qos.c' +) + +deps += ['cfgfile'] diff --git a/meson_options.txt b/meson_options.txt index 1a674aa50f..c843278587 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -8,6 +8,8 @@ option('include_subdir_arch', type: 'string', value: '', description: 'subdirectory where to install arch-dependent headers') option('kernel_dir', type: 'string', value: '', description: 'path to the kernel for building kernel modules') +option('lib_musdk_dir', type: 'string', value: '', + description: 'path to the MUSDK library installation directory') option('machine', type: 'string', value: 'native', description: 'set the target machine type') option('max_lcores', type: 'string', value: '128', -- 2.20.1