X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=config%2Fmeson.build;h=805d5d51d06ff4e9565adbd75eeb367e341bcb02;hb=cc5097b1e46ddee8df8d2210a67ec675f3807ba2;hp=59e3d5c57310eab512579aedf08bceeb5f5bf5a4;hpb=6cc51b1293ceac4a77d4bf7ac91a8bbd59e1f78c;p=dpdk.git diff --git a/config/meson.build b/config/meson.build index 59e3d5c573..805d5d51d0 100644 --- a/config/meson.build +++ b/config/meson.build @@ -218,6 +218,11 @@ if libbsd.found() dpdk_conf.set('RTE_USE_LIBBSD', 1) endif +jansson_dep = dependency('jansson', required: false, method: 'pkg-config') +if jansson_dep.found() + dpdk_conf.set('RTE_HAS_JANSSON', 1) +endif + # check for pcap pcap_dep = dependency('libpcap', required: false, method: 'pkg-config') pcap_lib = is_windows ? 'wpcap' : 'pcap' @@ -226,7 +231,7 @@ if not pcap_dep.found() pcap_dep = cc.find_library(pcap_lib, required: false) endif if pcap_dep.found() and cc.has_header('pcap.h', dependencies: pcap_dep) - dpdk_conf.set('RTE_PORT_PCAP', 1) + dpdk_conf.set('RTE_HAS_LIBPCAP', 1) dpdk_extra_ldflags += '-l@0@'.format(pcap_lib) endif @@ -324,47 +329,47 @@ endif max_lcores = get_option('max_lcores') if max_lcores == 'detect' - # discovery makes sense only for non-cross builds - if meson.is_cross_build() - error('Discovery of max_lcores is not supported for cross-compilation.') - endif - # overwrite the default value with discovered values - max_lcores = run_command(get_cpu_count_cmd).stdout().to_int() - min_lcores = 2 - # DPDK must be built for at least 2 cores - if max_lcores < min_lcores - message('Found less than @0@ cores, building for @0@ cores'.format(min_lcores)) - max_lcores = min_lcores - else - message('Found @0@ cores'.format(max_lcores)) - endif - dpdk_conf.set('RTE_MAX_LCORE', max_lcores) + # discovery makes sense only for non-cross builds + if meson.is_cross_build() + error('Discovery of max_lcores is not supported for cross-compilation.') + endif + # overwrite the default value with discovered values + max_lcores = run_command(get_cpu_count_cmd).stdout().to_int() + min_lcores = 2 + # DPDK must be built for at least 2 cores + if max_lcores < min_lcores + message('Found less than @0@ cores, building for @0@ cores'.format(min_lcores)) + max_lcores = min_lcores + else + message('Found @0@ cores'.format(max_lcores)) + endif + dpdk_conf.set('RTE_MAX_LCORE', max_lcores) elif max_lcores != 'default' - # overwrite the default value from arch_subdir with user input - dpdk_conf.set('RTE_MAX_LCORE', max_lcores.to_int()) + # overwrite the default value from arch_subdir with user input + dpdk_conf.set('RTE_MAX_LCORE', max_lcores.to_int()) endif max_numa_nodes = get_option('max_numa_nodes') if max_numa_nodes == 'detect' - # discovery makes sense only for non-cross builds - if meson.is_cross_build() - error('Discovery of max_numa_nodes not supported for cross-compilation.') - endif - # overwrite the default value with discovered values - max_numa_nodes = run_command(get_numa_count_cmd).stdout().to_int() - message('Found @0@ numa nodes'.format(max_numa_nodes)) - dpdk_conf.set('RTE_MAX_NUMA_NODES', max_numa_nodes) + # discovery makes sense only for non-cross builds + if meson.is_cross_build() + error('Discovery of max_numa_nodes not supported for cross-compilation.') + endif + # overwrite the default value with discovered values + max_numa_nodes = run_command(get_numa_count_cmd).stdout().to_int() + message('Found @0@ numa nodes'.format(max_numa_nodes)) + dpdk_conf.set('RTE_MAX_NUMA_NODES', max_numa_nodes) elif max_numa_nodes != 'default' - # overwrite the default value from arch_subdir with user input - dpdk_conf.set('RTE_MAX_NUMA_NODES', max_numa_nodes.to_int()) + # overwrite the default value from arch_subdir with user input + dpdk_conf.set('RTE_MAX_NUMA_NODES', max_numa_nodes.to_int()) endif # check that CPU and NUMA counts are set if not dpdk_conf.has('RTE_MAX_LCORE') - error('Number of CPU cores not specified.') + error('Number of CPU cores not specified.') endif if not dpdk_conf.has('RTE_MAX_NUMA_NODES') - error('Number of NUMA nodes not specified.') + error('Number of NUMA nodes not specified.') endif # set the install path for the drivers @@ -428,8 +433,8 @@ if get_option('b_sanitize') == 'address' or get_option('b_sanitize') == 'address dpdk_extra_ldflags += '-lasan' endif - if is_linux and arch_subdir == 'x86' and dpdk_conf.get('RTE_ARCH_64') - dpdk_conf.set10('RTE_MALLOC_ASAN', true) + if is_linux and dpdk_conf.get('RTE_ARCH_64') + dpdk_conf.set10('RTE_MALLOC_ASAN', true) endif endif