build: fix soname info for 19.11 compatibility
[dpdk.git] / config / meson.build
index 364a8d7..01911ec 100644 (file)
@@ -20,9 +20,19 @@ 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()
-# experimental libraries are versioned as 0.majorminor versions, e.g. 0.201
-ever = abi_version.split('.')
-experimental_abi_version = '0.@0@@1@'.format(ever.get(0), ever.get(1))
+
+# 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())