[v6,3/8] build: add module definition file for windows

Message ID 20190328022115.4660-4-anand.rawat@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers
Series HelloWorld example for windows |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation fail Compilation issues

Commit Message

Anand Rawat March 28, 2019, 2:21 a.m. UTC
  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 <bruce.richardson@intel.com>
Signed-off-by: Anand Rawat <anand.rawat@intel.com>
Reviewed-by: Pallavi Kadam <pallavi.kadam@intel.com>
Reviewed-by: Ranjit Menon <ranjit.menon@intel.com>
---
 lib/librte_eal/rte_eal_exports.def       |  9 +++++++++
 lib/librte_kvargs/rte_kvargs_exports.def |  7 +++++++
 lib/meson.build                          | 12 ++++++++++--
 3 files changed, 26 insertions(+), 2 deletions(-)
 create mode 100644 lib/librte_eal/rte_eal_exports.def
 create mode 100644 lib/librte_kvargs/rte_kvargs_exports.def
  

Comments

Harini Ramakrishnan March 28, 2019, 7:29 p.m. UTC | #1
Acked-by: Harini Ramakrishnan <harini.ramakrishnan@microsoft.com>

-----Original Message-----
From: dev <dev-bounces@dpdk.org> On Behalf Of Anand Rawat
Sent: Wednesday, March 27, 2019 7:21 PM
To: dev@dpdk.org
Cc: anand.rawat@intel.com; pallavi.kadam@intel.com; ranjit.menon@intel.com; jeffrey.b.shaw@intel.com; bruce.richardson@intel.com; thomas@monjalon.net
Subject: [dpdk-dev] [PATCH v6 3/8] build: add module definition file 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 <bruce.richardson@intel.com>
Signed-off-by: Anand Rawat <anand.rawat@intel.com>
Reviewed-by: Pallavi Kadam <pallavi.kadam@intel.com>
Reviewed-by: Ranjit Menon <ranjit.menon@intel.com>
---
 lib/librte_eal/rte_eal_exports.def       |  9 +++++++++
 lib/librte_kvargs/rte_kvargs_exports.def |  7 +++++++
 lib/meson.build                          | 12 ++++++++++--
 3 files changed, 26 insertions(+), 2 deletions(-)  create mode 100644 lib/librte_eal/rte_eal_exports.def
 create mode 100644 lib/librte_kvargs/rte_kvargs_exports.def

diff --git a/lib/librte_eal/rte_eal_exports.def b/lib/librte_eal/rte_eal_exports.def
new file mode 100644
index 000000000..12a6c79d6
--- /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 000000000..10e839e00
--- /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 a81faf0ed..9cba4662e 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -122,14 +122,22 @@ 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 = '@0@/@1@/rte_@2@_exports.def'.format(
+					meson.current_source_dir(), dir_name, name)
+			implib = dir_name + '.dll.a'
+			if host_machine.system() == 'windows'
+				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.17.1.windows.2
  

Patch

diff --git a/lib/librte_eal/rte_eal_exports.def b/lib/librte_eal/rte_eal_exports.def
new file mode 100644
index 000000000..12a6c79d6
--- /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 000000000..10e839e00
--- /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 a81faf0ed..9cba4662e 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -122,14 +122,22 @@  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 = '@0@/@1@/rte_@2@_exports.def'.format(
+					meson.current_source_dir(), dir_name, name)
+			implib = dir_name + '.dll.a'
+			if host_machine.system() == 'windows'
+				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)