From 82ba4416dd87e9d4dad1142704294a8c99911af9 Mon Sep 17 00:00:00 2001 From: Anand Rawat Date: Mon, 1 Apr 2019 20:54:53 -0700 Subject: [PATCH] build: add module definition files for Windows Updated lib/meson.build to create shared libraries on Windows. Added DEF files to list the exports for the eal and kvargs libraries. Signed-off-by: Bruce Richardson Signed-off-by: Anand Rawat Reviewed-by: Pallavi Kadam Reviewed-by: Ranjit Menon Acked-by: Harini Ramakrishnan --- MAINTAINERS | 1 + lib/librte_eal/rte_eal_exports.def | 9 +++++++++ lib/librte_kvargs/rte_kvargs_exports.def | 7 +++++++ lib/meson.build | 15 ++++++++++++--- 4 files changed, 29 insertions(+), 3 deletions(-) create mode 100644 lib/librte_eal/rte_eal_exports.def create mode 100644 lib/librte_kvargs/rte_kvargs_exports.def diff --git a/MAINTAINERS b/MAINTAINERS index 2d50853e07..2547d5b000 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -290,6 +290,7 @@ M: Anand Rawat M: Ranjit Menon F: kernel/windows/ F: lib/librte_eal/windows/ +F: lib/librte_eal/rte_eal_exports.def Core Libraries diff --git a/lib/librte_eal/rte_eal_exports.def b/lib/librte_eal/rte_eal_exports.def new file mode 100644 index 0000000000..12a6c79d6a --- /dev/null +++ b/lib/librte_eal/rte_eal_exports.def @@ -0,0 +1,9 @@ +EXPORTS + __rte_panic + rte_eal_get_configuration + rte_eal_init + rte_eal_mp_remote_launch + rte_eal_mp_wait_lcore + rte_eal_remote_launch + rte_log + rte_vlog diff --git a/lib/librte_kvargs/rte_kvargs_exports.def b/lib/librte_kvargs/rte_kvargs_exports.def new file mode 100644 index 0000000000..10e839e00e --- /dev/null +++ b/lib/librte_kvargs/rte_kvargs_exports.def @@ -0,0 +1,7 @@ +EXPORTS + rte_kvargs_count + rte_kvargs_free + rte_kvargs_parse + rte_kvargs_process + rte_kvargs_parse_delim + rte_kvargs_strcmp diff --git a/lib/meson.build b/lib/meson.build index 99957ba7d7..a7b5a9194c 100644 --- a/lib/meson.build +++ b/lib/meson.build @@ -1,5 +1,5 @@ # SPDX-License-Identifier: BSD-3-Clause -# Copyright(c) 2017 Intel Corporation +# Copyright(c) 2017-2019 Intel Corporation # process all libraries equally, as far as possible @@ -117,14 +117,23 @@ foreach l:libraries objs += static_lib.extract_all_objects(recursive: false) version_map = '@0@/@1@/rte_@2@_version.map'.format( meson.current_source_dir(), dir_name, name) + exports = [] + implib = dir_name + '.dll.a' + if host_machine.system() == 'windows' + exports = '@0@/@1@/rte_@2@_exports.def'.format( + meson.current_source_dir(), dir_name, name) + lk_args = ['-Wl,/def:' + exports, '-Wl,/implib:lib\\' + implib] + else + lk_args = ['-Wl,--version-script=' + version_map] + endif shared_lib = shared_library(libname, sources, objects: objs, c_args: cflags, dependencies: shared_deps, include_directories: includes, - link_args: '-Wl,--version-script=' + version_map, - link_depends: version_map, + link_args: lk_args, + link_depends: [version_map, exports], version: lib_version, soversion: so_version, install: true) -- 2.20.1