build: support ARM with meson
[dpdk.git] / config / arm / meson.build
1 # SPDX-License-Identifier: BSD-3-Clause
2 # Copyright(c) 2017 Intel Corporation.
3 # Copyright(c) 2017 Cavium, Inc
4
5 # for checking defines we need to use the correct compiler flags
6 march_opt = '-march=@0@'.format(machine)
7
8 dpdk_conf.set('RTE_FORCE_INTRINSICS', 1)
9 if cc.sizeof('void *') == 8
10         dpdk_conf.set('RTE_CACHE_LINE_SIZE', 128)
11         dpdk_conf.set('RTE_ARCH_ARM64', 1)
12         dpdk_conf.set('RTE_ARCH_64', 1)
13 else
14         dpdk_conf.set('RTE_CACHE_LINE_SIZE', 64)
15         dpdk_conf.set('RTE_ARCH_ARM', 1)
16         dpdk_conf.set('RTE_ARCH_ARMv7', 1)
17 endif
18
19 if cc.get_define('__ARM_NEON', args: march_opt) != ''
20         dpdk_conf.set('RTE_MACHINE_CPUFLAG_NEON', 1)
21         compile_time_cpuflags += ['RTE_CPUFLAG_NEON']
22 endif
23
24 if cc.get_define('__ARM_FEATURE_CRC32', args: march_opt) != ''
25         dpdk_conf.set('RTE_MACHINE_CPUFLAG_CRC32', 1)
26         compile_time_cpuflags += ['RTE_CPUFLAG_CRC32']
27 endif
28
29 if cc.get_define('__ARM_FEATURE_CRYPTO', args: march_opt) != ''
30         dpdk_conf.set('RTE_MACHINE_CPUFLAG_AES', 1)
31         dpdk_conf.set('RTE_MACHINE_CPUFLAG_PMULL', 1)
32         dpdk_conf.set('RTE_MACHINE_CPUFLAG_SHA1', 1)
33         dpdk_conf.set('RTE_MACHINE_CPUFLAG_SHA2', 1)
34         compile_time_cpuflags += ['RTE_CPUFLAG_AES', 'RTE_CPUFLAG_PMULL',
35         'RTE_CPUFLAG_SHA1', 'RTE_CPUFLAG_SHA2']
36 endif