build: set toolchain info during meson configure
authorPavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Tue, 3 Apr 2018 11:24:52 +0000 (16:54 +0530)
committerBruce Richardson <bruce.richardson@intel.com>
Tue, 17 Apr 2018 14:09:43 +0000 (16:09 +0200)
Meson reports the toolchain using cc.get_id and we can set RTE_TOOLCHAIN,
RTE_TOOLCHAIN_X in dpdk_conf so that it can be used by both x86 and arm.

Suggested-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
config/arm/meson.build
config/meson.build

index c1ab6ed..e9c9eb1 100644 (file)
@@ -83,15 +83,6 @@ impl_0x69 = ['Intel', flags_generic, machine_args_generic]
 impl_dpaa = ['NXP DPAA', flags_dpaa, machine_args_generic]
 impl_dpaa2 = ['NXP DPAA2', flags_dpaa2, machine_args_generic]
 
-
-if cc.get_define('__clang__') != ''
-       dpdk_conf.set_quoted('RTE_TOOLCHAIN', 'clang')
-       dpdk_conf.set('RTE_TOOLCHAIN_CLANG', 1)
-else
-       dpdk_conf.set_quoted('RTE_TOOLCHAIN', 'gcc')
-       dpdk_conf.set('RTE_TOOLCHAIN_GCC', 1)
-endif
-
 dpdk_conf.set('RTE_FORCE_INTRINSICS', 1)
 
 if cc.sizeof('void *') != 8
index 77af5d8..5815b56 100644 (file)
@@ -11,6 +11,10 @@ dpdk_conf.set('RTE_MACHINE', machine)
 machine_args = []
 machine_args += '-march=' + machine
 
+toolchain = cc.get_id()
+dpdk_conf.set_quoted('RTE_TOOLCHAIN', toolchain)
+dpdk_conf.set('RTE_TOOLCHAIN_' + toolchain.to_upper(), 1)
+
 # use pthreads
 add_project_link_arguments('-pthread', language: 'c')
 dpdk_extra_ldflags += '-pthread'