common/cnxk: support NIX stats
[dpdk.git] / config / meson.build
index 3cf560b..3268cf6 100644 (file)
@@ -70,21 +70,22 @@ else
        machine = get_option('machine')
 endif
 
-# machine type 'default' is special, it defaults to the per arch agreed common
-# minimal baseline needed for DPDK.
+# machine type 'generic' is special, it selects the per arch agreed common
+# minimal baseline needed for DPDK. Machine type 'default' is also supported
+# with the same meaning for backwards compatibility.
 # That might not be the most optimized, but the most portable version while
 # still being able to support the CPU features required for DPDK.
 # This can be bumped up by the DPDK project, but it can never be an
 # invariant like 'native'
-if machine == 'default'
+if machine == 'default' or machine == 'generic'
        if host_machine.cpu_family().startswith('x86')
-               # matches the old pre-meson build systems default
+               # matches the old pre-meson build systems generic machine
                machine = 'corei7'
        elif host_machine.cpu_family().startswith('arm')
                machine = 'armv7-a'
        elif host_machine.cpu_family().startswith('aarch')
-               # arm64 manages defaults in config/arm/meson.build
-               machine = 'default'
+               # arm64 manages generic config in config/arm/meson.build
+               machine = 'generic'
        elif host_machine.cpu_family().startswith('ppc')
                machine = 'power8'
        endif
@@ -125,11 +126,8 @@ if cc.find_library('m', required : false).found()
        dpdk_extra_ldflags += '-lm'
 endif
 
-# for linux link against dl, for bsd execinfo
 if is_linux
        link_lib = 'dl'
-elif is_freebsd
-       link_lib = 'execinfo'
 else
        link_lib = ''
 endif
@@ -166,6 +164,12 @@ if fdt_dep.found() and cc.has_header('fdt.h')
        dpdk_extra_ldflags += '-lfdt'
 endif
 
+libexecinfo = cc.find_library('libexecinfo', required: false)
+if libexecinfo.found() and cc.has_header('execinfo.h')
+       add_project_link_arguments('-lexecinfo', language: 'c')
+       dpdk_extra_ldflags += '-lexecinfo'
+endif
+
 # check for libbsd
 libbsd = dependency('libbsd', required: false, method: 'pkg-config')
 if libbsd.found()