[PATCH v4 3/4] build: select deprecated libraries

David Marchand david.marchand at redhat.com
Wed Jun 21 19:00:57 CEST 2023


Rework deprecated libraries selection by introducing a new configuration
option.

This breaks existing configurations that were relying on disable_libs=''
for enabling deprecated libraries.
On the other hand, it will make enabling optional libraries more
straightforward by taking the deprecated libraries out of the picture.

Signed-off-by: David Marchand <david.marchand at redhat.com>
---
 .ci/linux-build.sh            | 2 +-
 devtools/test-meson-builds.sh | 8 ++++----
 lib/meson.build               | 9 +++++++--
 meson_options.txt             | 4 +++-
 4 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/.ci/linux-build.sh b/.ci/linux-build.sh
index 9631e342b5..da51f8e55e 100755
--- a/.ci/linux-build.sh
+++ b/.ci/linux-build.sh
@@ -97,7 +97,7 @@ if [ "$MINI" = "true" ]; then
     OPTS="$OPTS -Denable_drivers=net/null"
     OPTS="$OPTS -Ddisable_libs=*"
 else
-    OPTS="$OPTS -Ddisable_libs="
+    OPTS="$OPTS -Denable_deprecated_libs=true"
 fi
 
 if [ "$ASAN" = "true" ]; then
diff --git a/devtools/test-meson-builds.sh b/devtools/test-meson-builds.sh
index 9131088c9d..efeddb36f3 100755
--- a/devtools/test-meson-builds.sh
+++ b/devtools/test-meson-builds.sh
@@ -120,10 +120,10 @@ config () # <dir> <builddir> <meson options>
 		return
 	fi
 	options=
-	# deprecated libs may be disabled by default, so for complete builds ensure
-	# no libs are disabled
-	if ! echo $* | grep -q -- 'disable_libs' ; then
-		options="$options -Ddisable_libs="
+	# deprecated libs are disabled by default, so for complete builds
+	# enable them
+	if ! echo $* | grep -q -- 'enable_deprecated_libs' ; then
+		options="$options -Denable_deprecated_libs=true"
 	fi
 	if echo $* | grep -qw -- '--default-library=shared' ; then
 		options="$options -Dexamples=all"
diff --git a/lib/meson.build b/lib/meson.build
index 363a4fd79f..a6e9e19b42 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -136,13 +136,18 @@ foreach l:libraries
         deps += ['eal']
     endif
 
-    if disabled_libs.contains(l)
+    if dpdk_libs_deprecated.contains(l) and not get_option('enable_deprecated_libs')
+        build = false
+        reason = 'deprecated libraries disabled via build config'
+    elif disabled_libs.contains(l)
         build = false
         reason = 'explicitly disabled via build config'
         if dpdk_libs_deprecated.contains(l)
             reason += ' (deprecated lib)'
         endif
-    else
+    endif
+
+    if build
         if dpdk_libs_deprecated.contains(l)
             warning('Enabling deprecated library, "@0@"'.format(l))
         endif
diff --git a/meson_options.txt b/meson_options.txt
index 82c8297065..f959015e46 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -10,7 +10,7 @@ option('disable_apps', type: 'string', value: '', description:
        'Comma-separated list of apps to explicitly disable.')
 option('disable_drivers', type: 'string', value: '', description:
        'Comma-separated list of drivers to explicitly disable.')
-option('disable_libs', type: 'string', value: 'flow_classify,kni', description:
+option('disable_libs', type: 'string', value: '', description:
        'Comma-separated list of libraries to explicitly disable. [NOTE: not all libs can be disabled]')
 option('drivers_install_subdir', type: 'string', value: 'dpdk/pmds-<VERSION>', description:
        'Subdirectory of libdir where to install PMDs. Defaults to using a versioned subdirectory.')
@@ -18,6 +18,8 @@ option('enable_docs', type: 'boolean', value: false, description:
        'build documentation')
 option('enable_apps', type: 'string', value: '', description:
        'Comma-separated list of apps to build. If unspecified, build all apps.')
+option('enable_deprecated_libs', type: 'boolean', value: false, description:
+       'Add deprecated libraries to the list of optional libraries to build')
 option('enable_drivers', type: 'string', value: '', description:
        'Comma-separated list of drivers to build. If unspecified, build all drivers.')
 option('enable_driver_sdk', type: 'boolean', value: false, description:
-- 
2.40.1



More information about the dev mailing list