DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] build: allow using wildcards to disable drivers
@ 2020-01-20 17:37 Bruce Richardson
  2020-01-20 18:59 ` Thomas Monjalon
                   ` (4 more replies)
  0 siblings, 5 replies; 19+ messages in thread
From: Bruce Richardson @ 2020-01-20 17:37 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson

Rather than having to explicitly list each and every driver to disable in a
build, we can use a small python script and the python glob library to
expand out the wildcards. This means that we can configure meson using e.g.

    meson -Ddisable_drivers=crypto/*,event/* build

to do a build omitting all the crypto and event drivers. Explicitly
specified drivers e.g. net/i40e, work as before, and can be mixed with
wildcarded drivers as required.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 buildtools/list-dir-globs.sh | 15 +++++++++++++++
 buildtools/meson.build       |  2 +-
 drivers/meson.build          |  3 ++-
 3 files changed, 18 insertions(+), 2 deletions(-)
 create mode 100755 buildtools/list-dir-globs.sh

diff --git a/buildtools/list-dir-globs.sh b/buildtools/list-dir-globs.sh
new file mode 100755
index 000000000..ed5aac41c
--- /dev/null
+++ b/buildtools/list-dir-globs.sh
@@ -0,0 +1,15 @@
+#! /usr/bin/env python
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2020 Intel Corporation
+
+from __future__ import print_function
+from os import chdir, environ
+from sys import argv
+from glob import iglob # glob iterator
+from os.path import isdir, join
+
+chdir(join(environ['MESON_SOURCE_ROOT'], environ['MESON_SUBDIR']))
+dirs = []
+for path in argv[1].split(','):
+  dirs.extend([entry for entry in iglob(path) if isdir(entry)])
+print(",".join(dirs))
diff --git a/buildtools/meson.build b/buildtools/meson.build
index cd1d05403..830c391f9 100644
--- a/buildtools/meson.build
+++ b/buildtools/meson.build
@@ -4,7 +4,7 @@
 subdir('pmdinfogen')
 
 pmdinfo = find_program('gen-pmdinfo-cfile.sh')
-
+list_dir_globs = find_program('list-dir-globs.sh')
 check_experimental_syms = find_program('check-experimental-syms.sh')
 
 # set up map-to-def script using python, either built-in or external
diff --git a/drivers/meson.build b/drivers/meson.build
index 29708cc2b..292d0f39a 100644
--- a/drivers/meson.build
+++ b/drivers/meson.build
@@ -17,7 +17,8 @@ dpdk_driver_classes = ['common',
 	       'event',   # depends on common, bus, mempool and net.
 	       'baseband'] # depends on common and bus.
 
-disabled_drivers = get_option('disable_drivers').split(',')
+disabled_drivers = run_command(list_dir_globs, get_option('disable_drivers'),
+		).stdout().strip().split(',')
 
 default_cflags = machine_args
 if cc.has_argument('-Wno-format-truncation')
-- 
2.20.1


^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2020-02-06  2:26 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-20 17:37 [dpdk-dev] [PATCH] build: allow using wildcards to disable drivers Bruce Richardson
2020-01-20 18:59 ` Thomas Monjalon
2020-01-21  9:11   ` Robin Jarry
2020-01-21 10:17     ` Bruce Richardson
2020-01-21 10:13   ` Bruce Richardson
2020-01-21 11:12 ` [dpdk-dev] [PATCH v2] " Bruce Richardson
2020-01-21 13:22   ` Robin Jarry
2020-01-21 13:37     ` Bruce Richardson
2020-01-21 13:48       ` Robin Jarry
2020-01-24 10:32 ` [dpdk-dev] [PATCH v3] " Bruce Richardson
2020-01-24 12:28   ` Robin Jarry
2020-01-24 14:57     ` Richardson, Bruce
2020-01-24 15:10 ` [dpdk-dev] [PATCH v4] " Bruce Richardson
2020-01-24 15:34   ` Robin Jarry
2020-01-27 11:26   ` Andrzej Ostruszka
2020-01-27 12:15     ` Bruce Richardson
2020-01-27 12:12   ` Luca Boccassi
2020-01-27 14:28 ` [dpdk-dev] [PATCH v5] " Bruce Richardson
2020-02-06  2:26   ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).