X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=lib%2Fmeson.build;h=24adbe44c9a6c740062daefedc3410e203899d07;hb=4d75f3fcdedd86327c5d515e8fe5ece1ef16394d;hp=95fcd01896d22252c89a230f6850396fe3952e61;hpb=7d611e35b0771a6d55ad3f3eec87ea83d32dd7af;p=dpdk.git diff --git a/lib/meson.build b/lib/meson.build index 95fcd01896..24adbe44c9 100644 --- a/lib/meson.build +++ b/lib/meson.build @@ -3,51 +3,99 @@ # process all libraries equally, as far as possible -# "core" libs first, then others alphebetically as far as possible +# "core" libs first, then others alphabetically as far as possible # NOTE: for speed of meson runs, the dependencies in the subdirectories # sometimes skip deps that would be implied by others, e.g. if mempool is # given as a dep, no need to mention ring. This is especially true for the # core libs which are widely reused, so their deps are kept to a minimum. libraries = [ - 'kvargs', # eal depends on kvargs - 'telemetry', # basic info querying - 'eal', # everything depends on eal - 'ring', - 'rcu', # rcu depends on ring - 'mempool', 'mbuf', 'net', 'meter', 'ethdev', 'pci', # core - 'cmdline', - 'metrics', # bitrate/latency stats depends on this - 'hash', # efd depends on this - 'timer', # eventdev depends on this - 'acl', 'bbdev', 'bitratestats', 'cfgfile', - 'compressdev', 'cryptodev', - 'distributor', 'efd', 'eventdev', - 'gro', 'gso', 'ip_frag', 'jobstats', - 'kni', 'latencystats', 'lpm', 'member', - 'power', 'pdump', 'rawdev', 'regexdev', - '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 - 'flow_classify', 'bpf', 'graph', 'node'] - -if is_windows - libraries = [ - 'kvargs', - 'telemetry', - 'eal', - 'ring', - 'rcu', - 'mempool', 'mbuf', 'net', 'meter', 'ethdev', 'pci', - 'cmdline', - 'hash', - 'cfgfile', - ] # only supported libraries for windows -endif + 'kvargs', # eal depends on kvargs + 'telemetry', # basic info querying + 'eal', # everything depends on eal + 'ring', + 'rcu', # rcu depends on ring + 'mempool', + 'mbuf', + 'net', + 'meter', + 'ethdev', + 'pci', # core + 'cmdline', + 'metrics', # bitrate/latency stats depends on this + 'hash', # efd depends on this + 'timer', # eventdev depends on this + 'acl', + 'bbdev', + 'bitratestats', + 'bpf', + 'cfgfile', + 'compressdev', + 'cryptodev', + 'distributor', + 'efd', + 'eventdev', + 'gpudev', + 'gro', + 'gso', + 'ip_frag', + 'jobstats', + 'kni', + 'latencystats', + 'lpm', + 'member', + 'pcapng', + 'power', + 'rawdev', + 'regexdev', + 'dmadev', + 'rib', + 'reorder', + 'sched', + 'security', + 'stack', + 'vhost', + 'ipsec', # ipsec lib depends on net, crypto and security + 'fib', #fib lib depends on rib + 'port', # pkt framework libs which use other libs from above + 'pdump', # pdump lib depends on bpf + 'table', + 'pipeline', + 'flow_classify', # flow_classify lib depends on pkt framework table lib + 'graph', + 'node', +] + +optional_libs = [ + 'bitratestats', + 'cfgfile', + 'flow_classify', + 'gpudev', + 'gro', + 'gso', + 'kni', + 'jobstats', + 'latencystats', + 'metrics', + 'node', + 'pdump', + 'pipeline', + 'port', + 'power', + 'table', + 'vhost', +] + +disabled_libs = [] +opt_disabled_libs = run_command(list_dir_globs, get_option('disable_libs'), + check: true).stdout().split() +foreach l:opt_disabled_libs + if not optional_libs.contains(l) + warning('Cannot disable mandatory library "@0@"'.format(l)) + continue + endif + disabled_libs += l +endforeach + default_cflags = machine_args default_cflags += ['-DALLOW_EXPERIMENTAL_API'] @@ -82,26 +130,39 @@ foreach l:libraries deps += ['eal'] endif - dir_name = 'librte_' + l - subdir(dir_name) - - if not build - dpdk_libs_disabled += name - set_variable(name.underscorify() + '_disable_reason', reason) - continue + if disabled_libs.contains(l) + build = false + reason = 'explicitly disabled via build config' + else + subdir(l) + endif + if name != l + warning('Library name, "@0@", and directory name, "@1@", do not match'.format(name, l)) endif shared_deps = ext_deps static_deps = ext_deps foreach d:deps + if not build + break + endif if not is_variable('shared_rte_' + d) - error('Missing internal dependency "@0@" for @1@ [@2@]' - .format(d, name, 'lib/' + dir_name)) + build = false + reason = 'missing internal dependency, "@0@"'.format(d) + message('Disabling @1@ [@2@]: missing internal dependency "@0@"' + .format(d, name, 'lib/' + l)) + else + shared_deps += [get_variable('shared_rte_' + d)] + static_deps += [get_variable('static_rte_' + d)] endif - shared_deps += [get_variable('shared_rte_' + d)] - static_deps += [get_variable('static_rte_' + d)] endforeach + if not build + dpdk_libs_disabled += name + set_variable(name.underscorify() + '_disable_reason', reason) + continue + endif + enabled_libs += name dpdk_conf.set('RTE_LIB_' + name.to_upper(), 1) install_headers(headers) @@ -110,17 +171,19 @@ foreach l:libraries install_headers(driver_sdk_headers) endif dpdk_chkinc_headers += headers + dpdk_chkinc_headers += driver_sdk_headers libname = 'rte_' + name - includes += include_directories(dir_name) + includes += include_directories(l) - if is_windows and use_function_versioning + if developer_mode and is_windows and use_function_versioning message('@0@: Function versioning is not supported by Windows.'.format(name)) endif if use_function_versioning cflags += '-DRTE_USE_FUNCTION_VERSIONING' endif + cflags += '-DRTE_LOG_DEFAULT_LOGTYPE=lib.' + l # first build static lib static_lib = static_library(libname, @@ -144,8 +207,8 @@ foreach l:libraries cflags += '-DRTE_BUILD_SHARED_LIB' endif version_map = '@0@/@1@/version.map'.format( - meson.current_source_dir(), dir_name) - implib = dir_name + '.dll.a' + meson.current_source_dir(), l) + implib = 'librte_' + l + '.dll.a' def_file = custom_target(libname + '_def', command: [map_to_win_cmd, '@INPUT@', '@OUTPUT@'], @@ -171,7 +234,7 @@ foreach l:libraries endif lk_deps = [version_map, def_file, mingw_map] - if not is_windows + if developer_mode and not is_windows # on unix systems check the output of the # check-symbols.sh script, using it as a # dependency of the .so build @@ -204,6 +267,6 @@ foreach l:libraries set_variable('shared_rte_' + name, shared_dep) set_variable('static_rte_' + name, static_dep) if developer_mode - message('lib/@0@: Defining dependency "@1@"'.format(dir_name, name)) + message('lib/@0@: Defining dependency "@1@"'.format(l, name)) endif endforeach