drivers: process shared link dependencies as for libs
authorBruce Richardson <bruce.richardson@intel.com>
Tue, 8 Oct 2019 14:36:28 +0000 (15:36 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Sat, 9 Nov 2019 20:17:44 +0000 (21:17 +0100)
For the public APIs of DPDK libraries we run checks for correct use of
experimental tags, and also do dynamic generation of the version file to
its window's equivalent. Although must drivers don't export APIs, some do,
so these checks are relevant and should be copied from lib/meson.build to
drivers/meson.build.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
drivers/meson.build

index 156d2dc..823e3ef 100644 (file)
@@ -145,14 +145,37 @@ foreach class:dpdk_driver_classes
                        version_map = '@0@/@1@/@2@_version.map'.format(
                                        meson.current_source_dir(),
                                        drv_path, lib_name)
+                       implib = dir_name + '.dll.a'
+
+                       def_file = custom_target(lib_name + '_def',
+                               command: [map_to_def_cmd, '@INPUT@', '@OUTPUT@'],
+                               input: version_map,
+                               output: '@0@_exports.def'.format(lib_name))
+                       lk_deps = [version_map, def_file]
+                       if is_windows
+                               lk_args = ['-Wl,/def:' + def_file.full_path(),
+                                       '-Wl,/implib:lib\\' + implib]
+                       else
+                               lk_args = ['-Wl,--version-script=' + version_map]
+                               # on unix systems check the output of the
+                               # experimental syms script, using it as a
+                               # dependency of the .so build
+                               lk_deps += custom_target(lib_name + '.exp_chk',
+                                       command: [check_experimental_syms,
+                                               version_map, '@INPUT@'],
+                                       capture: true,
+                                       input: static_lib,
+                                       output: lib_name + '.exp_chk')
+                       endif
+
                        shared_lib = shared_library(lib_name,
                                sources,
                                objects: objs,
                                include_directories: includes,
                                dependencies: shared_deps,
                                c_args: cflags,
-                               link_args: '-Wl,--version-script=' + version_map,
-                               link_depends: version_map,
+                               link_args: lk_args,
+                               link_depends: lk_deps,
                                version: lib_version,
                                soversion: so_version,
                                install: true,