[v8,02/10] meson: required changes for windows

Message ID 20190402035458.14664-3-anand.rawat@intel.com (mailing list archive)
State Accepted, 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 April 2, 2019, 3:54 a.m. UTC
  These are the required meson changes for Windows.
kernel/windows/meson is a stub file added to support
Windows specific source in future releases.

Signed-off-by: Anand Rawat <anand.rawat@intel.com>
Signed-off-by: Pallavi Kadam <pallavi.kadam@intel.com>
Reviewed-by: Jeff Shaw <jeffrey.b.shaw@intel.com>
Reviewed-by: Ranjit Menon <ranjit.menon@intel.com>
---
 config/meson.build                     | 23 ++++++++++++++++-------
 config/x86/meson.build                 | 14 ++++++++------
 kernel/windows/meson.build             |  4 ++++
 lib/librte_eal/meson.build             |  6 +++++-
 lib/librte_eal/windows/eal/meson.build | 10 ++++++++++
 5 files changed, 43 insertions(+), 14 deletions(-)
 create mode 100644 kernel/windows/meson.build
 create mode 100644 lib/librte_eal/windows/eal/meson.build
  

Comments

Thomas Monjalon April 2, 2019, 11:04 p.m. UTC | #1
02/04/2019 05:54, Anand Rawat:
> These are the required meson changes for Windows.
> kernel/windows/meson is a stub file added to support
> Windows specific source in future releases.
> 
> Signed-off-by: Anand Rawat <anand.rawat@intel.com>
> Signed-off-by: Pallavi Kadam <pallavi.kadam@intel.com>
> Reviewed-by: Jeff Shaw <jeffrey.b.shaw@intel.com>
> Reviewed-by: Ranjit Menon <ranjit.menon@intel.com>
> ---
>  config/meson.build                     | 23 ++++++++++++++++-------
>  config/x86/meson.build                 | 14 ++++++++------
>  kernel/windows/meson.build             |  4 ++++

For info, kernel/windows/ is not listed in MAINTAINERS. Will add it.
If there is a different maintainer for the kernel part,
you may create a new section in MAINTAINERS file later.
  
Kadam, Pallavi April 2, 2019, 11:23 p.m. UTC | #2
On 4/2/2019 4:04 PM, Thomas Monjalon wrote:
> 02/04/2019 05:54, Anand Rawat:
>> These are the required meson changes for Windows.
>> kernel/windows/meson is a stub file added to support
>> Windows specific source in future releases.
>>
>> Signed-off-by: Anand Rawat <anand.rawat@intel.com>
>> Signed-off-by: Pallavi Kadam <pallavi.kadam@intel.com>
>> Reviewed-by: Jeff Shaw <jeffrey.b.shaw@intel.com>
>> Reviewed-by: Ranjit Menon <ranjit.menon@intel.com>
>> ---
>>   config/meson.build                     | 23 ++++++++++++++++-------
>>   config/x86/meson.build                 | 14 ++++++++------
>>   kernel/windows/meson.build             |  4 ++++
> For info, kernel/windows/ is not listed in MAINTAINERS. Will add it.
> If there is a different maintainer for the kernel part,
> you may create a new section in MAINTAINERS file later.

Ok. Thanks, Thomas.

We will update the Maintainers list moving forward.

We can discuss more about it in the Bi-weekly meeting.
  

Patch

diff --git a/config/meson.build b/config/meson.build
index 30a7261a5..483139b10 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -1,5 +1,5 @@ 
 # SPDX-License-Identifier: BSD-3-Clause
-# Copyright(c) 2017 Intel Corporation
+# Copyright(c) 2017-2019 Intel Corporation
 
 # set the major version, which might be used by drivers and libraries
 # depending on the configuration options
@@ -80,18 +80,27 @@  dpdk_extra_ldflags += '-Wl,--no-as-needed'
 add_project_link_arguments('-pthread', language: 'c')
 dpdk_extra_ldflags += '-pthread'
 
-# some libs depend on maths lib
-add_project_link_arguments('-lm', language: 'c')
-dpdk_extra_ldflags += '-lm'
+# on some OS, maths functions are in a separate library
+if cc.find_library('libm', required : false).found()
+	# some libs depend on maths lib
+	add_project_link_arguments('-lm', language: 'c')
+	dpdk_extra_ldflags += '-lm'
+endif
 
 # for linux link against dl, for bsd execinfo
 if host_machine.system() == 'linux'
 	link_lib = 'dl'
-else
+elif host_machine.system() == 'freebsd'
 	link_lib = 'execinfo'
+else
+	link_lib = ''
+endif
+
+# if link_lib is empty, do not add it to project properties
+if link_lib != ''
+	add_project_link_arguments('-l' + link_lib, language: 'c')
+	dpdk_extra_ldflags += '-l' + link_lib
 endif
-add_project_link_arguments('-l' + link_lib, language: 'c')
-dpdk_extra_ldflags += '-l' + link_lib
 
 # check for libraries used in multiple places in DPDK
 has_libnuma = 0
diff --git a/config/x86/meson.build b/config/x86/meson.build
index 7504cb9e5..558edfda9 100644
--- a/config/x86/meson.build
+++ b/config/x86/meson.build
@@ -1,15 +1,17 @@ 
 # SPDX-License-Identifier: BSD-3-Clause
-# Copyright(c) 2017 Intel Corporation
+# Copyright(c) 2017-2019 Intel Corporation
 
 # for checking defines we need to use the correct compiler flags
 march_opt = ['-march=@0@'.format(machine)]
 
 # get binutils version for the workaround of Bug 97
-ldver = run_command('ld', '-v').stdout().strip()
-if ldver.contains('2.30')
-	if cc.has_argument('-mno-avx512f')
-		march_opt += '-mno-avx512f'
-		message('Binutils 2.30 detected, disabling AVX512 support as workaround for bug #97')
+if host_machine.system() != 'windows'
+	ldver = run_command('ld', '-v').stdout().strip()
+	if ldver.contains('2.30')
+		if cc.has_argument('-mno-avx512f')
+			march_opt += '-mno-avx512f'
+			message('Binutils 2.30 detected, disabling AVX512 support as workaround for bug #97')
+		endif
 	endif
 endif
 
diff --git a/kernel/windows/meson.build b/kernel/windows/meson.build
new file mode 100644
index 000000000..94c47682d
--- /dev/null
+++ b/kernel/windows/meson.build
@@ -0,0 +1,4 @@ 
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2019 Intel Corporation
+
+# stub file for supporting Windows logic in future release
diff --git a/lib/librte_eal/meson.build b/lib/librte_eal/meson.build
index d48c5e11d..1863622c0 100644
--- a/lib/librte_eal/meson.build
+++ b/lib/librte_eal/meson.build
@@ -1,5 +1,5 @@ 
 # SPDX-License-Identifier: BSD-3-Clause
-# Copyright(c) 2017 Intel Corporation
+# Copyright(c) 2017-2019 Intel Corporation
 
 # Custom EAL processing. EAL is complicated enough that it can't just
 # have a straight list of headers and source files.
@@ -17,6 +17,10 @@  elif host_machine.system() == 'freebsd'
 	dpdk_conf.set('RTE_EXEC_ENV_FREEBSD', 1)
 	subdir('freebsd/eal')
 
+elif host_machine.system() == 'windows'
+	dpdk_conf.set('RTE_EXEC_ENV_WINDOWS', 1)
+	subdir('windows/eal')
+
 else
 	error('unsupported system type "@0@"'.format(host_machine.system()))
 endif
diff --git a/lib/librte_eal/windows/eal/meson.build b/lib/librte_eal/windows/eal/meson.build
new file mode 100644
index 000000000..8b1735623
--- /dev/null
+++ b/lib/librte_eal/windows/eal/meson.build
@@ -0,0 +1,10 @@ 
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2019 Intel Corporation
+
+env_objs = []
+env_headers = []
+env_sources = files('eal.c',
+	'eal_debug.c',
+	'eal_lcore.c',
+	'eal_thread.c',
+)