machine = get_option('machine')
dpdk_conf.set('RTE_MACHINE', machine)
add_project_arguments('-march=@0@'.format(machine), language: 'c')
+
+# use pthreads
+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'
+
+# for linux link against dl, for bsd execinfo
+if host_machine.system() == 'linux'
+ link_lib = 'dl'
+else
+ link_lib = 'execinfo'
+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
+numa_dep = cc.find_library('numa', required: false)
+if numa_dep.found() and cc.has_header('numaif.h')
+ dpdk_conf.set10('RTE_HAS_LIBNUMA', true)
+ has_libnuma = 1
+ add_project_link_arguments('-lnuma', language: 'c')
+ dpdk_extra_ldflags += '-lnuma'
+endif
# add -include rte_config to cflags
add_project_arguments('-include', 'rte_config.h', language: 'c')
# values which have defaults which may be overridden
dpdk_conf.set('RTE_MAX_VFIO_GROUPS', 64)
-install_headers('rte_config.h')
+install_headers('rte_config.h', subdir: get_option('include_subdir_arch'))