X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=lib%2Fmeson.build;h=0af3efab291eb8ac433da4320ff8482846e5ab30;hb=70ccb6056847a87bba374d703f51705344982eec;hp=8ea3671c049b722637c56482d0dfe70b77f27a23;hpb=7f8f7f4d0a3c0a499626ebb36480044f5d8c243a;p=dpdk.git diff --git a/lib/meson.build b/lib/meson.build index 8ea3671c04..0af3efab29 100644 --- a/lib/meson.build +++ b/lib/meson.build @@ -22,9 +22,11 @@ libraries = [ 'gro', 'gso', 'ip_frag', 'jobstats', 'kni', 'latencystats', 'lpm', 'member', 'power', 'pdump', 'rawdev', - 'rcu', 'reorder', 'sched', 'security', 'stack', 'vhost', + 'rcu', 'rib', 'reorder', 'sched', 'security', 'stack', 'vhost', # ipsec lib depends on net, crypto and security 'ipsec', + #fib lib depends on rib + 'fib', # add pkt framework libs which use other libs from above 'port', 'table', 'pipeline', # flow_classify lib depends on pkt framework table lib @@ -45,8 +47,8 @@ foreach l:libraries build = true reason = '' # set if build == false to explain why name = l - version = 1 allow_experimental_apis = false + use_function_versioning = false sources = [] headers = [] includes = [] @@ -99,13 +101,22 @@ foreach l:libraries if allow_experimental_apis cflags += '-DALLOW_EXPERIMENTAL_API' endif + if use_function_versioning + cflags += '-DRTE_USE_FUNCTION_VERSIONING' + endif + + version_map = '@0@/@1@/rte_@2@_version.map'.format( + meson.current_source_dir(), dir_name, name) - if get_option('per_library_versions') - lib_version = '@0@.1'.format(version) - so_version = '@0@'.format(version) + is_experimental = run_command(is_experimental_cmd, + files(version_map)).returncode() + + if is_experimental != 0 + lib_version = experimental_abi_version + so_version = experimental_so_version else - lib_version = major_version - so_version = major_version + lib_version = abi_version + so_version = stable_so_version endif # first build static lib @@ -120,9 +131,15 @@ foreach l:libraries include_directories: includes, dependencies: static_deps) - # then use pre-build objects to build shared lib - sources = [] - objs += static_lib.extract_all_objects(recursive: false) + if not use_function_versioning + # use pre-build objects to build shared lib + sources = [] + objs += static_lib.extract_all_objects(recursive: false) + else + # for compat we need to rebuild with + # RTE_BUILD_SHARED_LIB defined + cflags += '-DRTE_BUILD_SHARED_LIB' + endif version_map = '@0@/@1@/rte_@2@_version.map'.format( meson.current_source_dir(), dir_name, name) implib = dir_name + '.dll.a' @@ -131,11 +148,21 @@ foreach l:libraries command: [map_to_def_cmd, '@INPUT@', '@OUTPUT@'], input: version_map, output: 'rte_@0@_exports.def'.format(name)) + lk_deps = [version_map, def_file] if is_windows lk_args = ['-Wl,/def:' + def_file.full_path(), '-Wl,/implib:lib\\' + implib] else lk_args = ['-Wl,--version-script=' + version_map] + # on unix systems check the output of the + # experimental syms script, using it as a + # dependency of the .so build + lk_deps += custom_target(name + '.exp_chk', + command: [check_experimental_syms, + version_map, '@INPUT@'], + capture: true, + input: static_lib, + output: name + '.exp_chk') endif shared_lib = shared_library(libname, @@ -145,7 +172,7 @@ foreach l:libraries dependencies: shared_deps, include_directories: includes, link_args: lk_args, - link_depends: [version_map, def_file], + link_depends: lk_deps, version: lib_version, soversion: so_version, install: true)