X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=config%2Fmeson.build;h=28a57f56fc0fbde56246653fe170052fdf7b407b;hb=refs%2Fheads%2Fmempool_20200116b;hp=e1ebdad261f2f0c64282c80cce0ebf7d9b07ede8;hpb=268fa581b1ffbd3077279c18f5a86992b747a9c0;p=dpdk.git diff --git a/config/meson.build b/config/meson.build index e1ebdad261..28a57f56fc 100644 --- a/config/meson.build +++ b/config/meson.build @@ -18,6 +18,21 @@ endforeach # depending on the configuration options pver = meson.project_version().split('.') major_version = '@0@.@1@'.format(pver.get(0), pver.get(1)) +abi_version = run_command(find_program('cat', 'more'), + abi_version_file).stdout().strip() + +# Regular libraries have the abi_version as the filename extension +# and have the soname be all but the final part of the abi_version. +# Experimental libraries have soname with '0.major' +# and the filename suffix as 0.majorminor versions, +# e.g. v20.1 => librte_stable.so.20.1, librte_experimental.so.0.201 +# sonames => librte_stable.so.20, librte_experimental.so.0.20 +# e.g. v20.0.1 => librte_stable.so.20.0.1, librte_experimental.so.0.2001 +# sonames => librte_stable.so.20.0, librte_experimental.so.0.200 +abi_va = abi_version.split('.') +stable_so_version = abi_va.length() == 2 ? abi_va[0] : abi_va[0] + '.' + abi_va[1] +experimental_abi_version = '0.' + ''.join(abi_va) +experimental_so_version = '0.' + ''.join(stable_so_version.split('.')) # extract all version information into the build configuration dpdk_conf.set('RTE_VER_YEAR', pver.get(0).to_int()) @@ -37,7 +52,7 @@ endif pmd_subdir_opt = get_option('drivers_install_subdir') if pmd_subdir_opt.contains('') - pmd_subdir_opt = major_version.join(pmd_subdir_opt.split('')) + pmd_subdir_opt = abi_version.join(pmd_subdir_opt.split('')) endif driver_install_path = join_paths(get_option('libdir'), pmd_subdir_opt) eal_pmd_path = join_paths(get_option('prefix'), driver_install_path) @@ -100,7 +115,7 @@ add_project_link_arguments('-pthread', language: 'c') dpdk_extra_ldflags += '-pthread' # on some OS, maths functions are in a separate library -if cc.find_library('libm', required : false).found() +if cc.find_library('m', required : false).found() # some libs depend on maths lib add_project_link_arguments('-lm', language: 'c') dpdk_extra_ldflags += '-lm' @@ -225,3 +240,16 @@ add_project_arguments('-D_GNU_SOURCE', language: 'c') if is_freebsd add_project_arguments('-D__BSD_VISIBLE', language: 'c') endif + +if get_option('b_lto') + if cc.has_argument('-ffat-lto-objects') + add_project_arguments('-ffat-lto-objects', language: 'c') + else + error('compiler does not support fat LTO objects - please turn LTO off') + endif + # workaround for gcc bug 81440 + if cc.get_id() == 'gcc' and cc.version().version_compare('<8.0') + add_project_arguments('-Wno-lto-type-mismatch', language: 'c') + add_project_link_arguments('-Wno-lto-type-mismatch', language: 'c') + endif +endif